math.numerics
Class EulerRichardson

java.lang.Object
  extended by math.numerics.EulerRichardson
All Implemented Interfaces:
ODESolver

public class EulerRichardson
extends java.lang.Object
implements ODESolver

Title: EulerRichardson Description: An Euler-Richardson method ODE solver. The Euler-Richardson method uses the state affineTransform the beginning of the interval to estimate the state affineTransform the midpoint. x(midpoint) = x(n) + v(n)*dt/2 v(midpoint) = v(n) + a(n)*dt/2 t(midpoint) = t(n) + dt/2 The midpoint state is then used to calculate the final state.

Version:
1.0
Author:
Wolfgang Christian

Constructor Summary
EulerRichardson(ODE _ode)
          Constructs the EulerRichardson 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)
          Sets the step size.
 double step()
          Steps (advances) the differential equations by the stepSize.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EulerRichardson

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

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

initialize

public void initialize(double _stepSize)
Initializes the ODE solver. The rate and midstate arrays are allocated. The number of differential equations is determined by invoking getState2().length on the ODE.

Specified by:
initialize in interface ODESolver
Parameters:
_stepSize -

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
Returns:
the step size

setStepSize

public void setStepSize(double _stepSize)
Sets the step size. The step size remains fixed in this algorithm.

Specified by:
setStepSize in interface ODESolver
Parameters:
_stepSize -

getStepSize

public double getStepSize()
Gets the step size. The stepsize is constant in this algorithm.

Specified by:
getStepSize in interface ODESolver
Returns:
the step size