Class Adams4

All Implemented Interfaces:
ODESolver

public class Adams4 extends RK4
Title: Adams4 Description: A fourth order Predictor-Corrector ODE solver.
Version:
1.0
Author:
F. Esquembre
  • Constructor Details

    • Adams4

      public Adams4(ODE ode)
      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 interface ODESolver
      Overrides:
      initialize in class RK4
      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
      Overrides:
      step in class RK4
      Returns:
      the step size