Class RK45MultiStep

All Implemented Interfaces:
ODEAdaptiveSolver, ODESolver

public class RK45MultiStep extends RK45
Title: RK45MultiStep Description: Perform multiple RK4/5 ODE steps so that a uniform step size is maintained
Version:
1.0
Author:
Wolfgang Christian
  • Field Details

    • maxIterations

      protected int maxIterations
  • Constructor Details

    • RK45MultiStep

      public RK45MultiStep(ODE _ode)
      Constructs the RK45MultiStep ODESolver for a system of ordinary differential equations.
      Parameters:
      _ode - the system of differential equations.
  • Method Details

    • 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.
      Specified by:
      step in interface ODESolver
      Overrides:
      step in class DormandPrince45
      Returns:
      the step size
    • setMaxIterations

      public void setMaxIterations(int n)
      Sets the maximum number of iterations.
      Parameters:
      n - maximum
    • setMaximumNumberOfErrorMessages

      public void setMaximumNumberOfErrorMessages(int n)
      Sets the number of error messages if ODE solver did not converge.
      Parameters:
      n - int
    • initialize

      public void initialize(double stepSize)
      Initializes the ODE solver. Temporary state and rate arrays are allocated by invoking the superclass method.
      Specified by:
      initialize in interface ODESolver
      Overrides:
      initialize in class DormandPrince45
      Parameters:
      stepSize -
    • setStepSize

      public void setStepSize(double stepSize)
      Method setStepSize
      Specified by:
      setStepSize in interface ODESolver
      Overrides:
      setStepSize in class DormandPrince45
      Parameters:
      stepSize -
    • getStepSize

      public double getStepSize()
      Gets the step size. The step size is the fixed step size, not the size of the RK4/5 steps that are combined into a single step.
      Specified by:
      getStepSize in interface ODESolver
      Overrides:
      getStepSize in class DormandPrince45
      Returns:
      the step size
    • getErrorCode

      public int getErrorCode()
      Gets the error code. Error codes: ODEAdaptiveSolver.NO_ERROR ODEAdaptiveSolver.DID_NOT_CONVERGE
      Specified by:
      getErrorCode in interface ODEAdaptiveSolver
      Overrides:
      getErrorCode in class DormandPrince45
      Returns:
      int