org.opensourcephysics.numerics
Class Butcher5

java.lang.Object
  extended by org.opensourcephysics.numerics.AbstractODESolver
      extended by org.opensourcephysics.numerics.Butcher5
All Implemented Interfaces:
ODESolver
Direct Known Subclasses:
Adams5

public class Butcher5
extends AbstractODESolver

Butcher5 implements a fifth order Runge-Kutta ODE solver using an algorithm developed by Butcher.

Version:
1.0
Author:
Wolfgang Christian & F. Esquembre

Field Summary
 
Fields inherited from class org.opensourcephysics.numerics.AbstractODESolver
numEqn, ode, stepSize
 
Constructor Summary
Butcher5(ODE ode)
          Constructs the Butcher5 ODESolver for a system of ordinary differential equations.
 
Method Summary
 void initialize(double stepSize)
          Initializes the ODE solver and allocates the rate and state arrays.
 double step()
          Steps (advances) the differential equations by the stepSize.
 
Methods inherited from class org.opensourcephysics.numerics.AbstractODESolver
getStepSize, setStepSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Butcher5

public Butcher5(ODE ode)
Constructs the Butcher5 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 and allocates the rate and state arrays. The number of differential equations is determined by invoking getState().length on the superclass.

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

step

public double step()
Steps (advances) the differential equations by the stepSize. The ODESolver invokes the ODE's getRate method to compute the rate at various intermediate states. The ODESolver then advances the solution and copies the new state into the ODE's state array at the end of the solution step.

Specified by:
step in interface ODESolver
Specified by:
step in class AbstractODESolver
Returns:
the step size