Class RungeKuttaIntegrator

java.lang.Object
org.hipparchus.ode.AbstractIntegrator
org.hipparchus.ode.nonstiff.RungeKuttaIntegrator
All Implemented Interfaces:
ButcherArrayProvider, ExplicitRungeKuttaIntegrator, ODEIntegrator
Direct Known Subclasses:
ClassicalRungeKuttaIntegrator, EulerIntegrator, GillIntegrator, LutherIntegrator, MidpointIntegrator, ThreeEighthesIntegrator

public abstract class RungeKuttaIntegrator extends AbstractIntegrator implements ExplicitRungeKuttaIntegrator
This class implements the common part of all fixed step Runge-Kutta integrators for Ordinary Differential Equations.

These methods are explicit Runge-Kutta methods, their Butcher arrays are as follows :

    0  |
   c2  | a21
   c3  | a31  a32
   ... |        ...
   cs  | as1  as2  ...  ass-1
       |--------------------------
       |  b1   b2  ...   bs-1  bs
 
See Also:
  • Constructor Details

    • RungeKuttaIntegrator

      protected RungeKuttaIntegrator(String name, double step)
      Simple constructor. Build a Runge-Kutta integrator with the given step. The default step handler does nothing.
      Parameters:
      name - name of the method
      step - integration step
  • Method Details

    • getDefaultStep

      public double getDefaultStep()
      Getter for the default, positive step-size assigned at constructor level.
      Returns:
      step
    • createInterpolator

      protected abstract org.hipparchus.ode.nonstiff.RungeKuttaStateInterpolator createInterpolator(boolean forward, double[][] yDotK, ODEStateAndDerivative globalPreviousState, ODEStateAndDerivative globalCurrentState, EquationsMapper mapper)
      Create an interpolator.
      Parameters:
      forward - integration direction indicator
      yDotK - slopes at the intermediate points
      globalPreviousState - start of the global step
      globalCurrentState - end of the global step
      mapper - equations mapper for the all equations
      Returns:
      external weights for the high order method from Butcher array
    • integrate

      public ODEStateAndDerivative integrate(ExpandableODE equations, ODEState initialState, double finalTime) throws MathIllegalArgumentException, MathIllegalStateException
      Integrate the differential equations up to the given time.

      This method solves an Initial Value Problem (IVP).

      Since this method stores some internal state variables made available in its public interface during integration (ODEIntegrator.getCurrentSignedStepsize()), it is not thread-safe.

      Specified by:
      integrate in interface ODEIntegrator
      Parameters:
      equations - differential equations to integrate
      initialState - initial state (time, primary and secondary state vectors)
      finalTime - target time for the integration (can be set to a value smaller than t0 for backward integration)
      Returns:
      final state, its time will be the same as finalTime if integration reached its target, but may be different if some ODEEventHandler stops it at some point.
      Throws:
      MathIllegalArgumentException - if integration step is too small
      MathIllegalStateException - if the number of functions evaluations is exceeded