public abstract class AdamsIntegrator extends MultistepIntegrator
Adams-Bashforth
and
Adams-Moulton
integrators.nordsieck, scaled
Constructor and Description |
---|
AdamsIntegrator(String name,
int nSteps,
int order,
double minStep,
double maxStep,
double[] vecAbsoluteTolerance,
double[] vecRelativeTolerance)
Build an Adams integrator with the given order and step control parameters.
|
AdamsIntegrator(String name,
int nSteps,
int order,
double minStep,
double maxStep,
double scalAbsoluteTolerance,
double scalRelativeTolerance)
Build an Adams integrator with the given order and step control parameters.
|
Modifier and Type | Method and Description |
---|---|
protected abstract double |
errorEstimation(double[] previousState,
double predictedTime,
double[] predictedState,
double[] predictedScaled,
RealMatrix predictedNordsieck)
Estimate error.
|
protected abstract org.hipparchus.ode.nonstiff.AdamsStateInterpolator |
finalizeStep(double stepSize,
double[] predictedState,
double[] predictedScaled,
Array2DRowRealMatrix predictedNordsieck,
boolean isForward,
ODEStateAndDerivative globalPreviousState,
ODEStateAndDerivative globalCurrentState,
EquationsMapper equationsMapper)
Finalize the step.
|
protected Array2DRowRealMatrix |
initializeHighOrderDerivatives(double h,
double[] t,
double[][] y,
double[][] yDot)
Initialize the high order scaled derivatives at step start.
|
ODEStateAndDerivative |
integrate(ExpandableODE equations,
ODEState initialState,
double finalTime)
Integrate the differential equations up to the given time.
|
Array2DRowRealMatrix |
updateHighOrderDerivativesPhase1(Array2DRowRealMatrix highOrder)
Update the high order scaled derivatives for Adams integrators (phase 1).
|
void |
updateHighOrderDerivativesPhase2(double[] start,
double[] end,
Array2DRowRealMatrix highOrder)
Update the high order scaled derivatives Adams integrators (phase 2).
|
computeStepGrowShrinkFactor, getMaxGrowth, getMinReduction, getNSteps, getSafety, getStarterIntegrator, rescale, setMaxGrowth, setMinReduction, setSafety, setStarterIntegrator, start
getMaxStep, getMinStep, getStepSizeHelper, initializeStep, resetInternalState, sanityChecks, setInitialStepSize, setStepSizeControl, setStepSizeControl
acceptStep, addEventHandler, addEventHandler, addStepHandler, clearEventHandlers, clearStepHandlers, computeDerivatives, getCurrentSignedStepsize, getEquations, getEvaluations, getEvaluationsCounter, getEventHandlers, getEventHandlersConfigurations, getMaxEvaluations, getName, getStepHandlers, getStepSize, getStepStart, initIntegration, isLastStep, resetOccurred, setIsLastStep, setMaxEvaluations, setStateInitialized, setStepSize, setStepStart
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
integrate
public AdamsIntegrator(String name, int nSteps, int order, double minStep, double maxStep, double scalAbsoluteTolerance, double scalRelativeTolerance) throws MathIllegalArgumentException
name
- name of the methodnSteps
- number of steps of the method excluding the one being computedorder
- order of the methodminStep
- minimal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than thismaxStep
- maximal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than thisscalAbsoluteTolerance
- allowed absolute errorscalRelativeTolerance
- allowed relative errorMathIllegalArgumentException
- if order is 1 or lesspublic AdamsIntegrator(String name, int nSteps, int order, double minStep, double maxStep, double[] vecAbsoluteTolerance, double[] vecRelativeTolerance) throws IllegalArgumentException
name
- name of the methodnSteps
- number of steps of the method excluding the one being computedorder
- order of the methodminStep
- minimal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than thismaxStep
- maximal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than thisvecAbsoluteTolerance
- allowed absolute errorvecRelativeTolerance
- allowed relative errorIllegalArgumentException
- if order is 1 or lesspublic ODEStateAndDerivative integrate(ExpandableODE equations, ODEState initialState, double finalTime) throws MathIllegalArgumentException, MathIllegalStateException
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.
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 than t0
for backward integration)finalTime
if
integration reached its target, but may be different if some ODEEventHandler
stops it at some point.MathIllegalArgumentException
- if integration step is too smallMathIllegalStateException
- if the number of functions evaluations is exceededprotected Array2DRowRealMatrix initializeHighOrderDerivatives(double h, double[] t, double[][] y, double[][] yDot)
initializeHighOrderDerivatives
in class MultistepIntegrator
h
- step size to use for scalingt
- first steps timesy
- first steps statesyDot
- first steps derivativespublic Array2DRowRealMatrix updateHighOrderDerivativesPhase1(Array2DRowRealMatrix highOrder)
The complete update of high order derivatives has a form similar to:
rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rnthis method computes the P-1 A P rn part.
highOrder
- high order scaled derivatives
(h2/2 y'', ... hk/k! y(k))updateHighOrderDerivativesPhase2(double[], double[], Array2DRowRealMatrix)
public void updateHighOrderDerivativesPhase2(double[] start, double[] end, Array2DRowRealMatrix highOrder)
The complete update of high order derivatives has a form similar to:
rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rnthis method computes the (s1(n) - s1(n+1)) P-1 u part.
Phase 1 of the update must already have been performed.
start
- first order scaled derivatives at step startend
- first order scaled derivatives at step endhighOrder
- high order scaled derivatives, will be modified
(h2/2 y'', ... hk/k! y(k))updateHighOrderDerivativesPhase1(Array2DRowRealMatrix)
protected abstract double errorEstimation(double[] previousState, double predictedTime, double[] predictedState, double[] predictedScaled, RealMatrix predictedNordsieck)
previousState
- state vector at step startpredictedTime
- time at step endpredictedState
- predicted state vector at step endpredictedScaled
- predicted value of the scaled derivatives at step endpredictedNordsieck
- predicted value of the Nordsieck vector at step endprotected abstract org.hipparchus.ode.nonstiff.AdamsStateInterpolator finalizeStep(double stepSize, double[] predictedState, double[] predictedScaled, Array2DRowRealMatrix predictedNordsieck, boolean isForward, ODEStateAndDerivative globalPreviousState, ODEStateAndDerivative globalCurrentState, EquationsMapper equationsMapper)
stepSize
- step size used in the scaled and Nordsieck arrayspredictedState
- predicted state at end of steppredictedScaled
- predicted first scaled derivativepredictedNordsieck
- predicted Nordsieck vectorisForward
- integration direction indicatorglobalPreviousState
- start of the global stepglobalCurrentState
- end of the global stepequationsMapper
- mapper for ODE equations primary and secondary componentsCopyright © 2016-2021 CS GROUP. All rights reserved.