[SciPy-User] possible bug with scipy.integrate.ode

Flavio Coelho fccoelho@gmail....
Fri Nov 4 07:35:01 CDT 2011


Hi,

I am a long time user of scipy.integrate.odeint for solving ODEs. Today I
decided to test the "other solver" in scipy: scipy.integrate.ode I am
getting strange results for model below:

def fun(y,t):
"""
Logistic model
 """
a = .5
k = 1000.0
 return a*(1-y/k)*y

r = ode(fun).set_integrator('vode',method='bdf', with_jacobian=False)
r.set_initial_value(1e-6,0)
res = np.zeros(10000)
i = 0
while r.successful() and r.t < 100:
r.integrate(r.t+.01)
res[i] = r.y
 i += 1


odeint solves this correctly and returns the caracteristic logistic curve
which maxes out at 1000. ode, however, keeps growing beyond 1000.

I may be doing something stupid, since I am not familiar with the usage of
ode. Or there maybe a bug in ode.

I'll just stay away from ode for now, but I thought it might be a good Idea
to report this.


-- 
Flávio Codeço Coelho
================
+55(21) 3799-5567
Professor
Escola de Matemática Aplicada
Fundação Getúlio Vargas
Rio de Janeiro - RJ
Brasil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20111104/d71a9a02/attachment.html 


More information about the SciPy-User mailing list