public class RK45Integrator extends java.lang.Object implements Integrator
A variable-timestep Integrator, which uses the Dormand-Prince 4th and 5th-order Runge-Kutta formulae.
This code is adapted from a GPL Octave implementation by Marc Compere (see http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/ode_v1.11/ode45.m)
See also Dormand & Prince, 1980, J Computational and Applied Mathematics 6(1), 19-26.
TODO: should re-use initial time step estimate from last integration if availableConstructor and Description |
---|
RK45Integrator()
Uses default error tolerance of 1e-6
|
RK45Integrator(float tolerance) |
Modifier and Type | Method and Description |
---|---|
Integrator |
clone() |
float |
getTolerance() |
TimeSeries |
integrate(DynamicalSystem system,
TimeSeries input)
Integrates the given system over the time span defined by the input time series.
|
void |
setTolerance(float tolerance) |
public RK45Integrator(float tolerance)
tolerance
- Error tolerancepublic RK45Integrator()
public float getTolerance()
public void setTolerance(float tolerance)
tolerance
- Error tolerancepublic TimeSeries integrate(DynamicalSystem system, TimeSeries input)
Integrator
integrate
in interface Integrator
system
- The DynamicalSystem to solve.input
- Input vector to the system, defined at the desired start and end times
of integration, and optionally at times in between. The way in which the
integrator interpolates between inputs at different times is decided by the
Integrator implementation.Integrator.integrate(ca.nengo.dynamics.DynamicalSystem, ca.nengo.util.TimeSeries)
public Integrator clone() throws java.lang.CloneNotSupportedException
clone
in interface Integrator
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- is clone operation fails