[SciPy-user] error after using odeint (excess work done + lsoda)
Anne Archibald
peridot.faceted@gmail....
Sun Jun 28 14:36:01 CDT 2009
2009/6/28 Ala Al-Shaibani <shaibani@ymail.com>:
> I used odeint to solve a coupled ode, and then printed the solution. The
> solution is correct, but I'm wondering as to why I'm receiving the error
> before printing the solution, and the lsoda error after printing the
> solution (although all I do is print the solution).
odeint tries to adjust the number of function evaluations it does to
produce the level of accuracy you requested. But in order to avoid
infinite loops and wasting time on bogus values, it limits the number
of function evaluations. If it is unable to reach the desired accuracy
in the specified number of function evaluations, it returns what it
has with a warning. So this means that your result is probably not
accurate, presumably because the ODE is difficult to evaluate in this
region.
This can happen with some ODEs; if the solution has some kind of
oscillatory behaviour, it can require many function evaluations to
track (even if you don't acutally care about the oscillations). But it
can also happen if your right-hand-side function is returning bogus
values, either because of a bug or because it's being evaluated
outside a region of applicability.
I would recommend double-checking the values your right-hand-side
function returns. You might also want to inspect the shape of the
solution, to see if there's a good reason it needs so many evaluations
to track. If there is, you can turn up the maximum number of
evaluations or turn down the required accuracy to avoid the warnings
and get better answers.
If you really need high accuracy from difficult ODEs, you might also
look into pydstool, which provides some smarter ODE solvers, along
with good tools to diagnose difficult behaviour from ODEs.
Anne
> Would appreciate any help.
>
>
>
> Excess work done on this call (perhaps wrong Dfun type).
>
> Run with full_output = 1 to get quantitative information.
>
> [ 13.9 20.7 79.8 14.6 78.8]
>
> lsoda-- at current t (=r1), mxstep (=i1) steps
>
> taken on this call before reaching tout
>
> In above message, I1 = 500
>
> In above message, R1 = 0.3409980342206E+01
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
More information about the SciPy-user
mailing list