[SciPy-User] Not enough intervals in scipy.integrate.quad

Kauffmann, Thierry Thierry.Kauffmann@saint-gobain....
Wed Apr 3 06:31:18 CDT 2013


I have a function that is peaked around k (a given value) -the expression is not very complicated, and the graph is attached to this email. I would like to integrate it from -inf to +inf.

quad is taking 90 evaluations only, and is returning a value of e-66 (with a accuracy of e-66 too).

But if I integrate from 0 to 2*k, the value is 1.6, with an accuracy of e-10. This takes 900 iterations.
The integral from -inf to 0 and from 2*k to +inf are very low.

Indeed, the correct value is close to the one given by the integration between -k and k.

My question is: how can I force quad to integrate with smaller intervals around k ? I have tried to play with the arguments 'limit' and 'epsabs' or 'epsrel', but without any outcome. I could not find any clue either in API or in the various forums.

Can someone help me? My code is attached too.

Thanks for all your work on Scipy.

Best regards,

Thierry Kauffmann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20130403/44bef39d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: real.png
Type: image/png
Size: 26927 bytes
Desc: real.png
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20130403/44bef39d/attachment-0001.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_quad.py
Type: application/octet-stream
Size: 948 bytes
Desc: test_quad.py
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20130403/44bef39d/attachment-0001.obj 

More information about the SciPy-User mailing list