pyoculus.integrators.base_integrator

base_integrator.py

Contains the abstract base class for integrators.

authors:
class pyoculus.integrators.base_integrator.BaseIntegrator(params)

Abstract base class for ODE integrators.

It can be a wrapper of any existing ODE solver, such as scipy.integrate.ode or scipy.integrate.solve_ivp, or a new solver implemented from scratch.

_params

The parameters used in the ODE solver.

Type:

dict

t

The current time.

x

The current coordinates.

set_initial_value(t, x)

Set up the initial value for the ODE solver.

Parameters:
  • t – The start of time.

  • x – The start of coordinates.

abstractmethod integrate(tend)

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

Parameters:

tend – The target end time.

Returns:

The new value of x.

get_solution()

Get the solution at current time.

Returns:

The solution.