Function Reference
— Loadable Function: [x, istate, msg] = lsode (fcn, x_0, t, t_crit)

Solve the set of differential equations The solution is returned in the matrix x, with each row corresponding to an element of the vector t. The first element of t should be t_0 and should correspond to the initial state of the system x_0, so that the first row of the output is x_0.

The first argument, fcn, is a string, or cell array of strings, inline or function handles, that names the function to call to compute the vector of right hand sides for the set of equations. The function must have the form

          xdot = f (x, t)

in which xdot and x are vectors and t is a scalar.

If fcn is a two-element string array, the first element names the function f described above, and the second element names a function to compute the Jacobian of f. The Jacobian function must have the form

          jac = j (x, t)

in which jac is the matrix of partial derivatives

The second and third arguments specify the initial state of the system, x_0, and the initial value of the independent variable t_0.

The fourth argument is optional, and may be used to specify a set of times that the ODE solver should not integrate past. It is useful for avoiding difficulties with singularities and points where there is a discontinuity in the derivative.

After a successful computation, the value of istate will be 2 (consistent with the Fortran version of Lsode).

If the computation is not successful, istate will be something other than 2 and msg will contain additional information.

You can use the function lsode_options to set optional parameters for lsode.

See also: daspk dassl dasrt