[SciPy-user] integrating a system of differential equations

ms devicerandom@gmail....
Wed May 27 11:13:44 CDT 2009


Fabrice Silva ha scritto:
> Le mercredi 27 mai 2009 à 16:30 +0100, ms a écrit :
> You need to write your system of differential equations as a system of
> first-order differential equations. 
> if X=[X_1, ..., X_N] is the vector of unknown signals, the function you
> have to supply is the function that computes the time derivatives of
> these signals.
> 
>         def func_ode(X,t):
>                 dX = np.zeros_like(X)
>                 for n in xrange(len(X)):
>                         dX[n]=...
>                 return dX
> 
> then you call the odeint routine giving an initial condition X0 and a
> time range TimeVec:
>         import scipy.integrate as integrate
>         X = integrate.odeint(func_ode, X0, TimeVec)
> 
>> - As for the Jacobian, I'm lost.
> You do not have to provide the jacobian. The Ode Solver recommends but
> does not require it.

Ok, looks easier than I thought (sorry, but I'm multitasking a lot of
things and I cannot concentrate as much as I should).

thanks,
m.


More information about the SciPy-user mailing list