[SciPy-user] Bug in scipy.integrate.odeint ?

LB berthe.loic at gmail.com
Thu Nov 1 10:27:38 EDT 2007


Hi,

I find the behaviour of scipy.integrate.odeint very strange :
>>> from numpy import *
>>> from scipy import integrate
>>>
>>> def f(x, t):
...        return cos(x)
...
>>>
>>> X0 = array([0.0])
>>> X0_ini = X0.copy()
>>> t = linspace(0, 20., 200)
>>> X = integrate.odeint(f, X0, t)
>>> X0 == X0_ini
array([False], dtype=bool)
>>> X0 == X[-1]
array([True], dtype=bool)

Why do odeint modify X0 ?
Is there any reason for this ?
For me, it seems really like a bug and could easily lead to bugs if
there's no mention of this in the doc string.

--
LB




More information about the SciPy-User mailing list