[SciPy-User] Computing derivatives with scipy.integrate.odeint

Camille Chambon camillechambon at yahoo.fr
Thu May 28 04:34:47 EDT 2015


Hello,

I'm trying to understand how scipy.integrate.odeint works.

I wrote the following example:

import numpy as np
from scipy.integrate import odeint
y0 = [2]
def func(y, t):
     return [y[0]]
t = np.arange(0, 4.0, 1.0)
y = odeint(func, y0, t)
print 'y', y

It prints:
y [[  2.        ]
  [  5.43656382]
  [ 14.77811278]
  [ 40.17107594]]

Why don't I get:
y [[  2.        ]
  [  4.]
  [ 8.]
  [ 16.]]

?

My question is probably due to my limited knowledge in basic mathematics.

Thanks for your help.

Camille

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150528/a2a9d32a/attachment.html>


More information about the SciPy-User mailing list