Integrals with Python

Fernando Pérez fperez528 at yahoo.com
Tue Jun 25 15:20:04 EDT 2002


Nathan Given wrote:

> Matlab has quad, quadl, and quad8...
> 
> 
> does Numeric have anything like those?

Go look at SciPy (http://scipy.org), it comes with a reasonable set of 
integration routines. But as Jerzy warned you, you first need to understand 
correctly the structure of your integrands. Black box integration is similar 
to russian roulette (just look at some of the disasters the famous 
Mathematica spits out).

But at the level you seem to be working, scipy would definitely be a good 
start. Then you can refine the routines therein if needed. Another option is 
to use C integrators wrapped with weave (part of Scipy). That's what I do 
because it's faster and I have tighter control over exactly what is going on 
under the hood. With weave, the wrapping job is very simple.

Cheers,

f



More information about the Python-list mailing list