Package org.hipparchus.ode.nonstiff
Class FixedStepRungeKuttaIntegrator
- java.lang.Object
-
- org.hipparchus.ode.AbstractIntegrator
-
- org.hipparchus.ode.nonstiff.FixedStepRungeKuttaIntegrator
-
- All Implemented Interfaces:
ButcherArrayProvider
,ExplicitRungeKuttaIntegrator
,ODEIntegrator
- Direct Known Subclasses:
ClassicalRungeKuttaIntegrator
,EulerIntegrator
,GillIntegrator
,LutherIntegrator
,MidpointIntegrator
,ThreeEighthesIntegrator
public abstract class FixedStepRungeKuttaIntegrator 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FixedStepRungeKuttaIntegrator(String name, double step)
Simple constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract RungeKuttaStateInterpolator
createInterpolator(boolean forward, double[][] yDotK, ODEStateAndDerivative globalPreviousState, ODEStateAndDerivative globalCurrentState, EquationsMapper mapper)
Create an interpolator.double
getDefaultStep()
Getter for the default, positive step-size assigned at constructor level.ODEStateAndDerivative
integrate(ExpandableODE equations, ODEState initialState, double finalTime)
Integrate the differential equations up to the given time.-
Methods inherited from class org.hipparchus.ode.AbstractIntegrator
acceptStep, addEventDetector, addStepEndHandler, addStepHandler, clearEventDetectors, clearStepEndHandlers, clearStepHandlers, computeDerivatives, getCurrentSignedStepsize, getEquations, getEvaluations, getEvaluationsCounter, getEventDetectors, getMaxEvaluations, getName, getStepEndHandlers, getStepHandlers, getStepSize, getStepStart, incrementEvaluations, initIntegration, isLastStep, resetOccurred, sanityChecks, setIsLastStep, setMaxEvaluations, setStateInitialized, setStepSize, setStepStart
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hipparchus.ode.nonstiff.ButcherArrayProvider
getA, getB, getC
-
Methods inherited from interface org.hipparchus.ode.nonstiff.ExplicitRungeKuttaIntegrator
getNumberOfStages, singleStep
-
Methods inherited from interface org.hipparchus.ode.ODEIntegrator
addEventDetector, addStepEndHandler, addStepHandler, clearEventDetectors, clearStepEndHandlers, clearStepHandlers, getCurrentSignedStepsize, getEvaluations, getEventDetectors, getMaxEvaluations, getName, getStepEndHandlers, getStepHandlers, getStepStart, integrate, setMaxEvaluations
-
-
-
-
Constructor Detail
-
FixedStepRungeKuttaIntegrator
protected FixedStepRungeKuttaIntegrator(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 methodstep
- integration step
-
-
Method Detail
-
getDefaultStep
public double getDefaultStep()
Getter for the default, positive step-size assigned at constructor level.- Returns:
- step
-
createInterpolator
protected abstract RungeKuttaStateInterpolator createInterpolator(boolean forward, double[][] yDotK, ODEStateAndDerivative globalPreviousState, ODEStateAndDerivative globalCurrentState, EquationsMapper mapper)
Create an interpolator.- Parameters:
forward
- integration direction indicatoryDotK
- slopes at the intermediate pointsglobalPreviousState
- start of the global stepglobalCurrentState
- end of the global stepmapper
- 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 interfaceODEIntegrator
- Parameters:
equations
- differential equations to integrateinitialState
- initial state (time, primary and secondary state vectors)finalTime
- target time for the integration (can be set to a value smaller thant0
for backward integration)- Returns:
- final state, its time will be the same as
finalTime
if integration reached its target, but may be different if someODEEventHandler
stops it at some point. - Throws:
MathIllegalArgumentException
- if integration step is too smallMathIllegalStateException
- if the number of functions evaluations is exceeded
-
-