utils.integration
Integrator objects provide numerical methods for approximating ODE solutions.
- class utils.integration.Integrator(identifier: str = None, step: int = 1.0, **kwargs)
Base integrator class.
- Parameters:
identifier (str, optional) – Name of the integrator.
step (float, optional) – Step size. Defaults to
DT.
Warning
Users are encouraged to use the
RungeKuttaobject in theirintegrate()implementations (which in turn should be used inforward()), regardless of whether they anticipate using more advanced approximation methods.
- class utils.integration.RungeKutta(identifier: str = 'RK', order: int = 1, **kwargs)
Generic Runge-Kutta integrator.
When called, approximates the next value of an ODE equation, whose keyword arguments are given as kwargs, for an initial value x and a time step step (defaults to the global
DT), using the Runge-Kutta method of order order.- Parameters:
identifier (str, optional) – Name of the integrator.
order (int, optional) – Order of the integrator. RK1 and RK4 are currently supported.
Note
The forward Euler method is Runge-Kutta of order 1.
References
- Tutorial
RungeKuttaimplements the algorithm variants described above.