Package org.hipparchus.ode.nonstiff
Class FixedStepRungeKuttaFieldIntegrator<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.hipparchus.ode.AbstractFieldIntegrator<T>
-
- org.hipparchus.ode.nonstiff.FixedStepRungeKuttaFieldIntegrator<T>
-
- Type Parameters:
T
- the type of the field elements
- All Implemented Interfaces:
FieldODEIntegrator<T>
,FieldButcherArrayProvider<T>
,FieldExplicitRungeKuttaIntegrator<T>
- Direct Known Subclasses:
ClassicalRungeKuttaFieldIntegrator
,EulerFieldIntegrator
,GillFieldIntegrator
,LutherFieldIntegrator
,MidpointFieldIntegrator
,ThreeEighthesFieldIntegrator
public abstract class FixedStepRungeKuttaFieldIntegrator<T extends CalculusFieldElement<T>> extends AbstractFieldIntegrator<T> implements FieldExplicitRungeKuttaIntegrator<T>
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
FixedStepRungeKuttaFieldIntegrator(Field<T> field, String name, T step)
Simple constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract RungeKuttaFieldStateInterpolator<T>
createInterpolator(boolean forward, T[][] yDotK, FieldODEStateAndDerivative<T> globalPreviousState, FieldODEStateAndDerivative<T> globalCurrentState, FieldEquationsMapper<T> mapper)
Create an interpolator.T
getDefaultStep()
Getter for the default, positive step-size assigned at constructor level.int
getNumberOfStages()
Getter for the number of stages corresponding to the Butcher array.protected FieldODEStateAndDerivative<T>
initIntegration(FieldExpandableODE<T> eqn, FieldODEState<T> s0, T t)
Prepare the start of an integration.FieldODEStateAndDerivative<T>
integrate(FieldExpandableODE<T> equations, FieldODEState<T> initialState, T finalTime)
Integrate the differential equations up to the given time.boolean
isUsingFieldCoefficients()
Getter for the flag between real or Field coefficients in the Butcher array.void
setUsingFieldCoefficients(boolean usingFieldCoefficients)
Setter for the flag between real or Field coefficients in the Butcher array.-
Methods inherited from class org.hipparchus.ode.AbstractFieldIntegrator
acceptStep, addEventDetector, addStepEndHandler, addStepHandler, clearEventDetectors, clearStepEndHandlers, clearStepHandlers, computeDerivatives, getCurrentSignedStepsize, getEquations, getEvaluations, getEvaluationsCounter, getEventDetectors, getField, getMaxEvaluations, getName, getStepEndHandlers, getStepHandlers, getStepSize, getStepStart, incrementEvaluations, 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.FieldButcherArrayProvider
getA, getB, getC
-
Methods inherited from interface org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator
getRealA, getRealB, getRealC, singleStep
-
Methods inherited from interface org.hipparchus.ode.FieldODEIntegrator
addEventDetector, addStepEndHandler, addStepHandler, clearEventDetectors, clearStepEndHandlers, clearStepHandlers, getCurrentSignedStepsize, getEvaluations, getEventDetectors, getMaxEvaluations, getName, getStepEndHandlers, getStepHandlers, getStepStart, setMaxEvaluations
-
-
-
-
Constructor Detail
-
FixedStepRungeKuttaFieldIntegrator
protected FixedStepRungeKuttaFieldIntegrator(Field<T> field, String name, T step)
Simple constructor. Build a Runge-Kutta integrator with the given step. The default step handler does nothing.- Parameters:
field
- field to which the time and state vector elements belongname
- name of the methodstep
- integration step
-
-
Method Detail
-
getDefaultStep
public T getDefaultStep()
Getter for the default, positive step-size assigned at constructor level.- Returns:
- step
-
setUsingFieldCoefficients
public void setUsingFieldCoefficients(boolean usingFieldCoefficients)
Setter for the flag between real or Field coefficients in the Butcher array.- Parameters:
usingFieldCoefficients
- new value for flag
-
isUsingFieldCoefficients
public boolean isUsingFieldCoefficients()
Getter for the flag between real or Field coefficients in the Butcher array.- Specified by:
isUsingFieldCoefficients
in interfaceFieldExplicitRungeKuttaIntegrator<T extends CalculusFieldElement<T>>
- Returns:
- flag
-
getNumberOfStages
public int getNumberOfStages()
Getter for the number of stages corresponding to the Butcher array.- Specified by:
getNumberOfStages
in interfaceFieldExplicitRungeKuttaIntegrator<T extends CalculusFieldElement<T>>
- Returns:
- number of stages
-
createInterpolator
protected abstract RungeKuttaFieldStateInterpolator<T> createInterpolator(boolean forward, T[][] yDotK, FieldODEStateAndDerivative<T> globalPreviousState, FieldODEStateAndDerivative<T> globalCurrentState, FieldEquationsMapper<T> 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
-
initIntegration
protected FieldODEStateAndDerivative<T> initIntegration(FieldExpandableODE<T> eqn, FieldODEState<T> s0, T t)
Prepare the start of an integration.- Overrides:
initIntegration
in classAbstractFieldIntegrator<T extends CalculusFieldElement<T>>
- Parameters:
eqn
- equations to integrates0
- initial state vectort
- target time for the integration- Returns:
- initial state with derivatives added
-
integrate
public FieldODEStateAndDerivative<T> integrate(FieldExpandableODE<T> equations, FieldODEState<T> initialState, T 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 (
FieldODEIntegrator.getCurrentSignedStepsize()
), it is not thread-safe.- Specified by:
integrate
in interfaceFieldODEIntegrator<T extends CalculusFieldElement<T>>
- 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 someFieldODEEventHandler
stops it at some point. - Throws:
MathIllegalArgumentException
- if integration step is too smallMathIllegalStateException
- if the number of functions evaluations is exceeded
-
-