# scipy.integrate.odeint¶

scipy.integrate.odeint(func, y0, t, args=(), Dfun=None, col_deriv=0, full_output=0, ml=None, mu=None, rtol=None, atol=None, tcrit=None, h0=0.0, hmax=0.0, hmin=0.0, ixpr=0, mxstep=0, mxhnil=0, mxordn=12, mxords=5, printmessg=0)

Integrate a system of ordinary differential equations.

Solve a system of ordinary differential equations using lsoda from the FORTRAN library odepack.

Solves the initial value problem for stiff or non-stiff systems of first order ode-s:

```dy/dt = func(y,t0,...)
```

where y can be a vector.

Parameters:

func : callable(y, t0, ...)

Computes the derivative of y at t0.

y0 : array

Initial condition on y (can be a vector).

t : array

A sequence of time points for which to solve for y. The initial value point should be the first element of this sequence.

args : tuple

Extra arguments to pass to function.

Dfun : callable(y, t0, ...)

col_deriv : boolean

True if Dfun defines derivatives down columns (faster), otherwise Dfun should define derivatives across rows.

full_output : boolean

True if to return a dictionary of optional outputs as the second output

printmessg : boolean

Whether to print the convergence message

Returns:

y : array, shape (len(y0), len(t))

Array containing the value of y for each desired time in t, with the initial value y0 in the first row.

infodict : dict, only returned if full_output == True

key

meaning

‘hu’

vector of step sizes successfully used for each time step.

‘tcur’

vector with the value of t reached for each time step. (will always be at least as large as the input times).

‘tolsf’

vector of tolerance scale factors, greater than 1.0, computed when a request for too much accuracy was detected.

‘tsw’

value of t at the time of the last method switch (given for each time step)

‘nst’

cumulative number of time steps

‘nfe’

cumulative number of function evaluations for each time step

‘nje’

cumulative number of jacobian evaluations for each time step

‘nqu’

a vector of method orders for each successful step.

‘imxer’

index of the component of largest magnitude in the weighted local error vector (e / ewt) on an error return, -1 otherwise.

‘lenrw’

the length of the double work array required.

‘leniw’

the length of integer work array required.

‘mused’

a vector of method indicators for each successful time step: 1: adams (nonstiff), 2: bdf (stiff)

ode
a more object-oriented integrator based on VODE