[SciPy-user] Gaussian quadrature error

Dan Murphy chiefmurph@comcast....
Sun Sep 14 20:44:25 CDT 2008


I am trying out the integrate.quadrature function on the function f(x)=e**x
to the left of the y-axis. If the lower bound in not too negative, I get a
reasonable answer, but if the lower bound is too negative, I get 0.0 as the
value of the integral. Here is the code:

 

from scipy import *

 

def f(x):

    return e**x

 

integrate.quadrature(f,-10.0,0.0) # answer is (0.999954600065,
3.14148596026e-010)

 

but

 

integrate.quadrature(f,-1000.0,0.0) # yields (8.35116510531e-090,
8.35116510531e-090)

 

Note that 'val' and 'err' are equal. Is this a bug in quadrature?

 

Thanks.

Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20080914/929ad341/attachment.html 


More information about the SciPy-user mailing list