[SciPy-user] question about ODE output and time steps

Travis Oliphant oliphant.travis@ieee....
Thu Apr 26 12:30:40 CDT 2007


Anne Archibald wrote:
>> [Trevis Crane]
>>
>> I assumed it was fixed since you supply the dt value (or in the case of
>> odeint, an array of t values).  By you statement above, though, I assume
>> these are simply to tell the solver at what times you want y information
>> (much like MATLAB's solvers).
>>
>> What I really want to do, however, requires that I stop the solver at
>> some iteration step that, a priori, is unknown.  I'm simulating a
>> dynamic system and my condition for stopping the solver is when the
>> energy of the system stops changing beyond a specified threshold.  So
>> each iteration of the solver I calculated the energy, and if after so
>> many iterations it stops changing (much), I want the solver to stop.
>>     
>
> I had essentially the same need. I tried various hacks - it turns out
> odeint actually allows you to backtrack within one integrator step -
> but they failed and were a pain to use. I came up with a wrapper for
> ODEPACK's LSODAR, which has a stop-on-contstraint function that does
> exactly the right thing but is otherwise identical to LSODA that
> odeint uses. But PyDSTool did it right, apparently (I haven't used
> it).
>   

So why don't we put what PyDSTool into scipy?  SciPy's odeint is a 
wrapper I did of ODEPACK about 10 years  ago.  It is pretty low-level 
and reflects my needs for ordinary differential equation solving.     It 
does not claim to be the end-all solution.  Pearu wrote some additional 
tools (VSODE) which may be easier for some to use.  It would be great if 
other people who wrote wrappers put them into SciPy.    

It seems that there is a strong tendency to just release your own 
package than to help with another package.  We SciPy developers do try 
to be easy to work with to avoid this kind of forking.

-Travis



More information about the SciPy-user mailing list