pyoculus.integrators.scipyode_integrator

scipyode_integrator.py

Contains wrapper for the scipy.integrate.ode ODE solver class.

authors:
class pyoculus.integrators.scipyode_integrator.ScipyODEIntegrator(**params)

Wrapper for the scipy.integrate.ode ODE solver.

This class serves as a wrapper and is notably useful to use the explicit Runge-Kutta methods implemented in scipy.integrate.ode.

ode

Function for the right-hand side of the ODE.

Type:

callable

args

Additional arguments to pass to the ODE function.

Type:

tuple

type

Type of integrator. Notably: ‘dopri5’ for RK45, ‘dop853’ for RK853. Defaults to ‘dopri5’.

Type:

str

rtol

Relative tolerance for the solver.

Type:

float

nsteps

Maximum number of integration steps.

Type:

int

For more information on the scipy ODE solver, see the scipy documentation.

set_initial_value(t, x)

Sets up the initial value for the ODE solver.

Parameters:
  • t (float) – The start time.

  • x (array_like) – The initial state vector.

integrate(tend)

Integrates the ODE until \(t_\text{end}\).

Parameters:

tend (float) – The target end time.

Returns:

The new state vector at time \(t_\text{end}\).

Return type:

array_like

set_rhs(rhs)

Changes the RHS function to solve.

Parameters:

rhs (callable) – The new RHS function.