[SciPy-User] [SciPy-user] scipy: integration

josef.pktd@gmai... josef.pktd@gmai...
Wed Feb 15 10:52:13 CST 2012


On Tue, Feb 14, 2012 at 10:25 AM, suzana8447 <k-assem84@hotmail.com> wrote:
>
> Hello every body,
>
> I am a new user of scipy and I am facing some troubles of performing
> numerical integration.
>
> Suppose that we have a function called f(x,a,b) that we are going to
> integrate it from 0 to c.
>
> Note that a, b and c are some arrays.
>
> For example a=array([1., 0.5,3.]) , b=array([0.,1.,4.)]  c=
> array([..,..,...])
>
> By this way, I would expect that the program returns an array whereby each
> value of the array represents the integral at each term of the arrays a,b
> and c.

AFAIK

None of the integrators for functions are vectorized. So this would
always need a loop.

For lower precision, the integrators using samples have an axis
argument if you build an array for different values of the parameters
a and b.
Only cumtrapz (or using ode) can integrate for different limits simultaneously.
http://docs.scipy.org/doc/scipy/reference/integrate.html#integrating-functions-given-fixed-samples

Which version to use depends on your requirements.

Josef

>
> Thanks in advance.
>
> Best regards.
>
> --
> View this message in context: http://old.nabble.com/scipy%3A-integration-tp33322670p33322670.html
> Sent from the Scipy-User mailing list archive at Nabble.com.
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user


More information about the SciPy-User mailing list