[SciPy-user] ode/programming question

Anne Archibald peridot.faceted@gmail....
Mon Apr 30 16:05:48 CDT 2007


On 30/04/07, Trevis Crane <t_crane@mrl.uiuc.edu> wrote:

> I found reference to a __call__ method, but not the __callable__ method.
> Can you point me to a description of it?

As Robert pointed out, I got this wrong; you do indeed want a __call__
method to make your class callable. Sorry about that!

> In reference to you comment about the ODE not likely calling the
> function in t order -- you're saying that the ODE solver doesn't
> necessarily progress in a monotonic fashion from t = t_0 to t = t_final?
> Hmm.  I hadn't thought of that.

Most serious ODE solvers are adaptive, taking smaller steps when the
function behaves sharply and larger when it is well-predicted by the
model the ODE solver is using. You may find it enlightening to read
chapter 16 of Numerical Recipes in C
(http://www.nrbook.com/b/bookcpdf.php) - don't implement any of those
methods (there are almost certainly better, solider implementations
already built into scipy) but it will tell you more about how ODE
solvers work, when they are likely to run into problems, and what to
do about it.

What is the problem you are working on? It may be possible to avoid
using state, or to use it in a way that won't be a problem.

Anne


More information about the SciPy-user mailing list