[SciPy-User] SciPy ODE integrator

Sebastian Castillo castillohair@gmail....
Tue Oct 26 12:38:23 CDT 2010

David Pine <djpine <at> gmail.com> writes:

> Anne,
> Thanks.  Actually I finally figured this (the VODE option) out but I agree
that scipy's ODE solvers need a
> makeover.  The routines under the hood seem to be quite nice but the interface
to Python is clumsy at best and
> the documentation on how to use it is pretty awful.  I'll take a look at
pydstool.  Thanks.
> David
> On Jul 28, 2010, at 10:45 AM, Anne Archibald wrote:
> > On 26 July 2010 12:46, David Pine <djpine <at> gmail.com> wrote:
> >> Is there a SciPy ODE integrator that does adaptive stepsize integration AND
produces output with the
> adaptive time steps intact?
> > 
> > It is not obvious, but the object-oriented integrator, based on VODE,
> > can be run in this mode. You normally tell it how much to advance on
> > each call and it does as many adaptive steps as it takes to get there,
> > but there is an optional argument you can pass it that will make it
> > take just one step of the underlying integrator. You can then write a
> > python loop to produce the solution you want.
> > 
> > If this seems messy, I have to agree. scipy's ODE integrators are in
> > desperate need of an API redesign (they've had one already, which is
> > why there are two completely different interfaces, but they need
> > another). You could try pydstool, which is designed for the study of
> > dynamical systems and has many more tools for working with ODEs and
> > their solutions.
> > 
> > Anne
> > 
> >> The standard SciPy ODE integrator seems to be scipy.integrate.odeint and
its simpler cousin
> scipy.integrate.ode.  These work just fine but  both take a user-specified
time series and returns the
> solution at those points only.  Often, I prefer to have a more classic
adaptive stepsize integrator that
> returns the solution at time steps determined by the integrator (and the
degree of desired precision
> input by the user).  This is often the most useful kind of solution because it
tends to produce more points
> where the solution is varying rapidly and fewer where it is not varying much.
 A classic Runge-Kugga
> adaptive stepsize ODE solver does this as to many others, but I can't find a
nice implementation in SciPy or
> NumPy.  Please advise.  Thanks.
> >> 
> >> David
> >> _______________________________________________
> >> SciPy-User mailing list
> >> SciPy-User <at> scipy.org
> >> http://mail.scipy.org/mailman/listinfo/scipy-user
> >> 
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User <at> scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user

Hello. I am trying to use scipy.integrate.ode with time steps determined by the
integrator. I can see that you have acomplished this already. I understand that
there is an option in the VODE object, and I have found a "step" method in it,
but I still don't get how to use it. Can you please post some example code of
this? Thank you very much!

More information about the SciPy-User mailing list