[SciPy-user] Coupled ODEs

Colin Gillespie c.gillespie@ncl.ac...
Tue Apr 22 12:00:54 CDT 2008


Hi,

How do I solve coupled ODEs using scipy?

For the ODE

dz/dt = z^2

I have

from scipy import *
def f(t,z):
    return z**2
t = [0,1]
z0 = array([0])

z = integrate.odeint(f, z0, t)
print z

But how do I handle:

dy/dt = y*z
dz/dt = z^2+y

Thanks

Colin



-- 
Dr Colin Gillespie
http://www.mas.ncl.ac.uk/~ncsg3/



More information about the SciPy-user mailing list