[SciPy-user] integrating a system of differential equations
Wed May 27 11:34:50 CDT 2009
There are also examples at scipy.org:
On Wed, May 27, 2009 at 11:13 AM, ms <email@example.com> wrote:
> 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).
> SciPy-user mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user