Class RK4HalfStepAdvance

java.lang.Object
cnuphys.adaptiveSwim.RK4HalfStepAdvance
All Implemented Interfaces:
IAdaptiveAdvance

public class RK4HalfStepAdvance extends Object implements IAdaptiveAdvance
This is a 4th order RungeKutta advancer
Author:
heddle
  • Constructor Details Link icon

    • RK4HalfStepAdvance Link icon

      public RK4HalfStepAdvance(int nDim)
      Create a RK4 half stepper
      Parameters:
      nDim - the dimension of the problem (length of state vector)
  • Method Details Link icon

    • advance Link icon

      public void advance(double s, double[] u, double[] du, double h, IDerivative deriv, double[] uf, double eps, AdaptiveStepResult result)
      Description copied from interface: IAdaptiveAdvance
      Advance the solution by one step of the independent variable.
      Specified by:
      advance in interface IAdaptiveAdvance
      Parameters:
      s - the current value of the independent variable
      u - the current values of the state vector
      du - the current values of the derivative (before advance)
      h - the current step size
      deriv - the function (interface) that can compute the derivatives. That is where the problem specificity resides .
      uf - where the state vector at the next step will be stored (output)
      eps - the overall tolerance (e.g., 1.0e-5) param result container for the new value of the independent variable and the new step size