[SciPy-user] odeint, rtol, atol

Arnd Baecker baecker at physik.tu-dresden.de
Wed May 7 02:55:22 EDT 2003


Hi,

there seems to be a mismatch between documentation
and implementation in scipy.integrate.odeint.
According to the doc
"rtol and atol can be either vectors the same length as y or
  scalars."
However, for me the scalar variant does not work
such that both rtol and atol have be to vectors.
Below is an example which shows this
for the one-dimensional case.

Arnd

#
-------------------------------------------------------------------------
from Numeric import *
from scipy.integrate import odeint

y0=1.0

def f(y,t):
    return exp(-0.01*y*t)

atol=1e-6
rtol=1e-6

t=arange(0, 3.0, 0.1)
#y=odeint(f, y0, t)                                     # ok
#y=odeint(f, y0, t,atol=atol*ones(1),rtol=rtol*ones(1)) # ok
y=odeint(f, y0, t,atol=atol,rtol=rtol)                  # error (segfault)
print y
#
-------------------------------------------------------------------------






More information about the SciPy-User mailing list