0

I have a function func(rp,pi) for which I now have the values. I also have the values of rp and pi.

I now need to integrate this function within the limits of 0 to pi

enter image description here

How do I go about using quad from scipy to solve this? The doubt I have is, how does quad know that my integral limits are for pi and not rp?

I tried:

from scipy.integrate import quad

integral = []

for a in func:
    result,error = quad(lambda func:a,0,pi)
    integral.append(result)

integral = np.array(integral)

Here func is the list that has the values of the function. This does give me values, but I am not sure if this is right?

Here is download link to the file with rp,pi,func. The first column is rp, the second column is pi and the third column is func

4

0 回答 0