Package org.opensourcephysics.numerics
Class Fehlberg8
java.lang.Object
org.opensourcephysics.numerics.AbstractODESolver
org.opensourcephysics.numerics.Fehlberg8
- All Implemented Interfaces:
ODESolver
- Direct Known Subclasses:
Adams6
Title: Fehlberg8
Description: An eigth order Runge-Kutta ODE solver.
- Version:
- 1.0
- Author:
- Wolfgang Christian & F. Esquembre
-
Field Summary
Fields inherited from class org.opensourcephysics.numerics.AbstractODESolver
numEqn, ode, stepSize
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
-
Constructor Details
-
Fehlberg8
Constructs the RK4 ODESolver for a system of ordinary differential equations.- Parameters:
ode
- the system of differential equations.
-
-
Method Details
-
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 interfaceODESolver
- Overrides:
initialize
in classAbstractODESolver
- 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 interfaceODESolver
- Specified by:
step
in classAbstractODESolver
- Returns:
- the step size
-