[SciPy-Dev] ode and odeint callable parameters
Marcel Oliver
m.oliver at jacobs-university.de
Fri Jan 29 10:56:53 EST 2016
Benny Malengier writes:
> This somewhat proves that returning output also on wrong output (not
> satisfying atol/rtol) like ode.integrate does is not a good practice. In the
> above case, with scipy.ode, you should test for r1.successful() after every
> integrate, which you failed to do.
I totally agree. In fact, I used this example to teach students to be
critical about solver output. We tested with a number of solvers -
not just library solvers, mostly simple self-written ones - and all of
failing ones except dop853 fail catastrophically on this example.
So in some sense the dop853 has the worst possible behavior, but on
the other hand I am still amazed how close it is (qualitatively) to
the correct solution. And dop853 does very well for non-stiff
problems. In particular, it is only very mildly dissipative on energy
conserving systems.
> With the odes scikit approach, wrong output just stops the solve routine and
> goes to sol.errors. The dopri warning output is to increase nsteps. If you do
> that, and restart at the last computed solution, the error of dop853 becomes:
> UserWarning: dop853: problem is probably stiff (interrupted)
> So an indication to use another solver.
Interesting, I guess I never increased nsteps that much. I absolutely
agree that an explicit fail is much better.
Best,
Marcel
More information about the SciPy-Dev
mailing list