math.numerics
Class RK45MultiStep

java.lang.Object
  extended by math.numerics.RK45
      extended by math.numerics.RK45MultiStep
All Implemented Interfaces:
ODEAdaptiveSolver, ODESolver

public class RK45MultiStep
extends RK45
implements ODEAdaptiveSolver

Title: RK45MultiStep Description: Perform multiple RK4/5 ODE steps so that a uniform step size is maintained

Version:
1.0
Author:
Wolfgang Christian

Constructor Summary
RK45MultiStep(ODE _ode)
          Constructs the RK45MultiStep ODESolver for a system of ordinary differential equations.
 
Method Summary
 double getStepSize()
          Gets the step size.
 void initialize(double stepSize)
          Initializes the ODE solver.
 void setStepSize(double _stepSize)
          Method setStepSize
 double step()
          Steps (advances) the differential equations by the stepSize.
 
Methods inherited from class math.numerics.RK45
getTolerance, setTolerance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface math.numerics.ODEAdaptiveSolver
getTolerance, setTolerance
 

Constructor Detail

RK45MultiStep

public RK45MultiStep(ODE _ode)
Constructs the RK45MultiStep ODESolver for a system of ordinary differential equations.

Parameters:
_ode - the system of differential equations.
Method Detail

step

public double step()
Steps (advances) the differential equations by the stepSize. The ODESolver invokes the ODE's getRate method to obtain the initial state of the system. The ODESolver then advances the solution and copies the new state into the state array affineTransform the end of the solution step.

Specified by:
step in interface ODESolver
Overrides:
step in class RK45
Returns:
the step size

initialize

public void initialize(double stepSize)
Initializes the ODE solver. Temporary state and rate arrays are allocated by invoking the superclass method.

Specified by:
initialize in interface ODESolver
Overrides:
initialize in class RK45
Parameters:
stepSize -

setStepSize

public void setStepSize(double _stepSize)
Method setStepSize

Specified by:
setStepSize in interface ODESolver
Overrides:
setStepSize in class RK45
Parameters:
_stepSize -

getStepSize

public double getStepSize()
Gets the step size. The step size is the fixed step size, not the size of the RK4/5 steps that are combined into a single step.

Specified by:
getStepSize in interface ODESolver
Overrides:
getStepSize in class RK45
Returns:
the step size