org.opensourcephysics.numerics
Interface ODESolver

All Known Subinterfaces:
ODEAdaptiveSolver, ODEEventSolver, ODEInterpolationSolver
All Known Implementing Classes:
AbstractODESolver, CashKarp45, DormandPrince45, ODEBisectionEventSolver, ODEMultistepSolver

public interface ODESolver

ODE defines a minimal differential equation solver.


Method Summary
 double getStepSize()
          Gets the step size.
 void initialize(double stepSize)
          Initializes the ODE solver.
 void setStepSize(double stepSize)
          Sets the initial step size.
 double step()
          Steps (advances) the differential equations by the stepSize.
 

Method Detail

initialize

public void initialize(double stepSize)
Initializes the ODE solver. ODE solvers use this method to allocate temporary arrays that may be required to carry out the solution. The number of differential equations is determined by invoking getState().length on the ODE.

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 at the end of the solution step.

Returns:
the step size

setStepSize

public void setStepSize(double stepSize)
Sets the initial step size. The step size may change if the ODE solver implements an adaptive step size algorithm such as RK4/5.

Parameters:
stepSize -

getStepSize

public double getStepSize()
Gets the step size.

Returns:
the step size