[SciPy-user] Caveat About integrate.odeint

Lorenzo Isella lorenzo.isella@gmail....
Thu Oct 25 15:24:24 CDT 2007


Dear Anne,
I think you are right, nevertheless I am puzzled at what is going on 
with integrate.odeint.
If the problem I will post a code snippet on the list.
Cheers

Lorenzo





Do you have a small piece of demo code? This is very surprising, as
FORTRAN should never see the variable names. I can't replicate it in
spite of headache-inducing variable names:

In [17]: T = lambda t, T: T

In [18]: T0 = 1

In [19]: t = [0,1,2]

In [20]: scipy.integrate.odeint(T,T0,t)
Out[20]:
array([[ 1.        ],
       [ 1.50000001],
       [ 3.00000001]])

Anne


> Message: 2
> Date: Thu, 25 Oct 2007 11:40:02 -0400
> From: "Anne Archibald" <peridot.faceted@gmail.com>
> Subject: Re: [SciPy-user] Caveat About integrate.odeint
> To: "SciPy Users List" <scipy-user@scipy.org>
> Message-ID:
> 	<ce557a360710250840l295ba96ds43fdae685e98a10e@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On 25/10/2007, Lorenzo Isella <lorenzo.isella@gmail.com> wrote:
>
>   
>> I do not know if what I am going to write is really useful (maybe it
>> is pretty obvious for everybody on this list).
>> I have been using integrate.odeint for quite a while to solve some
>> population equations.
>> Then I made a trivial change (nothing leading to different physics or
>> in general such as to justify any substantial difference with the
>> previous results), and I woke up in a nightmare: precision errors,
>> routine crashing etc...
>> I think I now what happened: in my code I was using t [time], T(t)
>> [time-dependent temperature], t_0 (initial time) and T_0 (initial
>> temperature).
>> For Python there is no possibility of confusion, but the underlying
>> Fortran made a mess out of this...
>> Something very trivial, but it took me a day and a half to debug this.
>> Hope it was useful.
>>     
>
>
>
>
>   



More information about the SciPy-user mailing list