public abstract class AbstractODEStateInterpolator extends Object implements ODEStateInterpolator
The various ODE integrators provide objects extending this class to the step handlers. The handlers can use these objects to retrieve the state vector at intermediate times between the previous and the current grid points (dense output).
ODEIntegrator
,
ODEStepHandler
,
Serialized FormModifier | Constructor and Description |
---|---|
protected |
AbstractODEStateInterpolator(boolean isForward,
ODEStateAndDerivative globalPreviousState,
ODEStateAndDerivative globalCurrentState,
ODEStateAndDerivative softPreviousState,
ODEStateAndDerivative softCurrentState,
EquationsMapper equationsMapper)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract ODEStateAndDerivative |
computeInterpolatedStateAndDerivatives(EquationsMapper equationsMapper,
double time,
double theta,
double thetaH,
double oneMinusThetaH)
Compute the state and derivatives at the interpolated time.
|
protected abstract AbstractODEStateInterpolator |
create(boolean newForward,
ODEStateAndDerivative newGlobalPreviousState,
ODEStateAndDerivative newGlobalCurrentState,
ODEStateAndDerivative newSoftPreviousState,
ODEStateAndDerivative newSoftCurrentState,
EquationsMapper newMapper)
Create a new instance.
|
ODEStateAndDerivative |
getCurrentState()
Get the state at current grid point time.
|
ODEStateAndDerivative |
getGlobalCurrentState()
Get the current global grid point state.
|
ODEStateAndDerivative |
getGlobalPreviousState()
Get the previous global grid point state.
|
ODEStateAndDerivative |
getInterpolatedState(double time)
Get the state at interpolated time.
|
protected EquationsMapper |
getMapper()
Get the mapper for ODE equations primary and secondary components.
|
ODEStateAndDerivative |
getPreviousState()
Get the state at previous grid point time.
|
boolean |
isCurrentStateInterpolated()
Determines if the
current state is computed directly by
the integrator, or if it is calculated using interpolation . |
boolean |
isForward()
Check if the natural integration direction is forward.
|
boolean |
isPreviousStateInterpolated()
Determines if the
previous state is computed directly
by the integrator, or if it is calculated using interpolation . |
AbstractODEStateInterpolator |
restrictStep(ODEStateAndDerivative previousState,
ODEStateAndDerivative currentState)
Create a new restricted version of the instance.
|
protected AbstractODEStateInterpolator(boolean isForward, ODEStateAndDerivative globalPreviousState, ODEStateAndDerivative globalCurrentState, ODEStateAndDerivative softPreviousState, ODEStateAndDerivative softCurrentState, EquationsMapper equationsMapper)
isForward
- integration direction indicatorglobalPreviousState
- start of the global stepglobalCurrentState
- end of the global stepsoftPreviousState
- start of the restricted stepsoftCurrentState
- end of the restricted stepequationsMapper
- mapper for ODE equations primary and secondary componentspublic AbstractODEStateInterpolator restrictStep(ODEStateAndDerivative previousState, ODEStateAndDerivative currentState)
The instance is not changed at all.
previousState
- start of the restricted stepcurrentState
- end of the restricted stepgetPreviousState()
,
getCurrentState()
protected abstract AbstractODEStateInterpolator create(boolean newForward, ODEStateAndDerivative newGlobalPreviousState, ODEStateAndDerivative newGlobalCurrentState, ODEStateAndDerivative newSoftPreviousState, ODEStateAndDerivative newSoftCurrentState, EquationsMapper newMapper)
newForward
- integration direction indicatornewGlobalPreviousState
- start of the global stepnewGlobalCurrentState
- end of the global stepnewSoftPreviousState
- start of the restricted stepnewSoftCurrentState
- end of the restricted stepnewMapper
- equations mapper for the all equationspublic ODEStateAndDerivative getGlobalPreviousState()
public ODEStateAndDerivative getGlobalCurrentState()
public ODEStateAndDerivative getPreviousState()
getPreviousState
in interface ODEStateInterpolator
public boolean isPreviousStateInterpolated()
previous state
is computed directly
by the integrator, or if it is calculated using interpolation
.
Typically the previous state is directly computed by the integrator, but when events are detected the steps are shortened so that events occur on step boundaries which means the previous state may be computed by the interpolator.
isPreviousStateInterpolated
in interface ODEStateInterpolator
true
if the previous state was calculated by the interpolator and
false if it was computed directly by the integrator.public ODEStateAndDerivative getCurrentState()
getCurrentState
in interface ODEStateInterpolator
public boolean isCurrentStateInterpolated()
current state
is computed directly by
the integrator, or if it is calculated using interpolation
.
Typically the current state is directly computed by the integrator, but when events are detected the steps are shortened so that events occur on step boundaries which means the current state may be computed by the interpolator.
isCurrentStateInterpolated
in interface ODEStateInterpolator
true
if the current state was calculated by the interpolator and
false if it was computed directly by the integrator.public ODEStateAndDerivative getInterpolatedState(double time)
Setting the time outside of the current step is allowed, but should be used with care since the accuracy of the interpolator will probably be very poor far from this step. This allowance has been added to simplify implementation of search algorithms near the step endpoints.
getInterpolatedState
in interface ODEStateInterpolator
time
- time of the interpolated pointpublic boolean isForward()
This method provides the integration direction as specified by the integrator itself, it avoid some nasty problems in degenerated cases like null steps due to cancellation at step initialization, step control or discrete events triggering.
isForward
in interface ODEStateInterpolator
protected EquationsMapper getMapper()
protected abstract ODEStateAndDerivative computeInterpolatedStateAndDerivatives(EquationsMapper equationsMapper, double time, double theta, double thetaH, double oneMinusThetaH) throws MathIllegalStateException
equationsMapper
- mapper for ODE equations primary and secondary componentstime
- interpolation timetheta
- normalized interpolation abscissa within the step
(theta is zero at the previous time step and one at the current time step)thetaH
- time gap between the previous time and the interpolated timeoneMinusThetaH
- time gap between the interpolated time and
the current timeMathIllegalStateException
- if the number of functions evaluations is exceededCopyright © 2016-2021 CS GROUP. All rights reserved.