[SciPy-User] Help!!!!!! having NEW problems with ODEINT

Warren Weckesser warren.weckesser at enthought.com
Tue Jul 26 09:45:33 EDT 2011


Hi Laura,


On Mon, Jul 25, 2011 at 4:53 PM, Laura Matrajt <matrajt at gmail.com> wrote:
> Laura Matrajt <matrajt <at> gmail.com> writes:
>
>>
>> Kevin Dunn <kgdunn <at> gmail.com> writes:
>>
>> > Hi Laura,
>> >
>> > There's an example in the SciPy documentation on using a Jacobian:
>> > http://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html
>> >
>> > This is for the ``ode`` function, not the ``odeint`` function though.
>> >
>> > I've just posted an example on using ``ode`` with coupled ODEs, no Jacobian
>> > over here:
>> >
>>
> http://scipy-central.org/item/13/0/integrating-an-initial-value-problem-multiple-odes
>> >
>> > Hope that helps,
>> > Kevin
>> >
>>
>> Hi Kevin,
>>  the example was good. I now have implemented my Jacobian. Thank you very
> much!!!!!
>>
>
>
> Hi all:
> sorry to bother you again! I implemented the Jacobian as Anne kindly suggested
> to me with the help of Kevin's pointers to the correct webpage AND I increased
> the maximum number of steps as Warren kindly said.
> I am now getting a new message:
>
> lsoda--  warning..internal t (=r1) and h (=r2) are
>       such that in the machine, t + h = t on the next step
>       (h = step size). solver will continue anyway
>      In above,  R1 =  0.1209062893646E+03   R2 =  0.9059171791494E-18


Something about your system is causing the solver to reduce its
internal step size down to about 1e-17 (and it can't go any smaller
than that).  Do you actually have a discontinuity in your equations?
Is your system singularly perturbed, with shock-like or boundary layer
solutions?  As Anne said: "It's worth thinking about why the
integrator is taking all those steps. It generally happens because
there's some sort of kink or complex behaviour in the solution there;
this can be a genuine feature of the solution, or (more often in my
experience) it can be because your RHS function has some discontinuity
(perhaps due to a bug). So it's worth checking out those segments."

If you can isolate the initial conditions and parameters that lead to
this warning, you could plot the solution that it generates to see
what is going on.

Warren

>
> It is just a warning, and my code continues to run. But I am really worried
> about this being a bug. The problem is that I am coupling a system of ODE's with
> a stochastic process. Mainly, I simulate a day of an epidemic, stop the
> integrator, change some of the initial conditions stochastically (not just
> randomly, I do follow some rules) and I run the ODE again and so on.
>  I have run this millions of times (and I am not exagerating about the millions)
> and it doesn't produce any warnings, but every now and then (~15 times) it does
> it. I don't know if this is a bug or just that not all of my domain will be good
> for the ODE's...
> If anyone has any suggestion of how to think about this problem, I will really
> appreciate it!!!!!!
> thanks to all the people that replied to me previously, you helped me sooo much
> already!
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list