[SciPy-user] Optimization & Parallelization of, integrate.odeint

Rob Clewley rhc28 at cornell.edu
Tue May 8 12:49:16 EDT 2007


Hi,

Frankly, for low-dimensional systems, I find the scipy-wrapped vode
and odeint solvers to be quite fast enough for most uses. It's only if
you're going to start doing things like parameter sensitivity
calculations or large parameter sweeps that you might have to wait a
bit longer for your answers.

Not to be flippant, but the only truly fast way to use python for
solving ODEs is to only use it for managing your system, and actually
*solve* the thing entirely in the same piece of C or Fortran code.  By
which I am trying to say that for ODE problems for which you really
care about performance, the C- or Fortran-based integrators that have
been interfaced to by PyDSTool and SloppyCell are your best bet,
AFAIK. With these you can specify and manipulate your ODE definitions,
parameters etc. in python, and work with the output in python, but the
RHS functions etc. will actually get *automatically* converted into C
code for the integrators. So there's no call-back to Python functions,
which has a lot of inefficient overhead.

Also, I wouldn't have thought that using weave for your RHS functions
will really make a great improvement, as from my understanding
information still has to flow back and forth to odeint via the python
layer for every function call. But I'd be interested to see a
comparative test of that, or to be educated otherwise!

-Rob



More information about the SciPy-User mailing list