[SciPy-user] integrating a system of differential equations
Wed May 27 10:46:05 CDT 2009
Look at the example in the documentation:
That should give you an idea of how to define your system's function,
it returns a vector since you are trying to integrate a system of
The Jacobian is a matrix of partial derivatives of your system
function, call it f, with respect to all of your variables:
J = df_i/dx_j
J = [ df_1/dx_1 df_1/dx_2 ... df_1/dx_n]
[ df_2/dx_1 df_2/dx_2 ... df_2/dx_n]
[ ... ... ]
[ df_n/dx_1 df_n/dx_2 ... df_n/dx_n]
I'm assuming you are integrating something like:
dy/dt = f(x)
On Wed, May 27, 2009 at 11:30 AM, ms <email@example.com> wrote:
> Hi Josh,
> Joshua Stults ha scritto:
>> If you're having stability problems, usually going to an implicit
>> integration scheme will help. Looks like the scipy.integrate.ode
>> class lets you choose an integration scheme based on backward
>> difference formulas, which should be unconditionally stable.
> Oh, good.
>> just need to supply a system function and a Jacobian function.
> This is quite unclear to me. That is:
> - A single function should calculate the whole system? This is what is
> done of course, with each dy(j)/dt saved in a vector at index j for
> every j-th equation; but I am not sure it is doable in the way ode wants
> it -because I really don't understand how ode wants stuff.
> - As for the Jacobian, I'm lost. If it is the matrix described here:
> I don't understand, looks redundant -it seems in my case it will be a
> vector of all my derivatives as a function of t (there are no other
> variables I'm integrating) -but isn't it the output of the above
> function? But it is all really new stuff for me, sorry.
> SciPy-user mailing list
More information about the SciPy-user