[SciPy-Dev] ode and odeint callable parameters

Benny Malengier benny.malengier at gmail.com
Tue Jan 26 06:48:14 EST 2016


2016-01-26 11:43 GMT+01:00 Marcel Oliver <m.oliver at jacobs-university.de>:

>
>  > Some extra tests seem in order. How does method=adams in ode succeed?
> Should
>  > you be able to quickly make an ipython notebook ...
>
> I attach a small code snippet.  In fact, my memory failed me in that
> dop853 indeed complains about insufficient nmax (nsteps in the Python
> API).  What breaks is the accuracy of the solution, but it's still
> remarkably good and can be controlled by nsteps.  It's obvious that
> one should not solve this kind of problem with dop853, but I am still
> amazed that it does not fall flat on its face.
>
> In fact, vode/Adams dies completely (as it should) and vode/BDF gives
> lots of warnings and computes a completely wrong solution (BDF schemes
> are supposed to work here).  lsoda is fine, though.
>

You forgot
, with_jacobian=True
when doing bdf metho via ode. So change into:

r2 = ode(van_der_pol).set_integrator('vode', method='bdf',
with_jacobian=True)

Normally, as vode is for stiff methods, you set ml or mr to indicate how
banded the jacobian is. Here you want full jacobian, so you should indicate
this, see doc.
Result then is as lsoda.

Can I use your code in an example under the scipy license ? I'll see what
odes does.

Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20160126/49fe7e7a/attachment.html>


More information about the SciPy-Dev mailing list