T - the type of the field elementspublic class ContinuousOutputFieldModel<T extends RealFieldElement<T>> extends java.lang.Object implements FieldStepHandler<T>
This class act as a step handler from the integrator point of
view. It is called iteratively during the integration process and
stores a copy of all steps information in a sorted collection for
later use. Once the integration process is over, the user can use
the getInterpolatedState
method to retrieve this information at any time. It is important to wait
for the integration to be over before attempting to call getInterpolatedState(RealFieldElement) because some internal
variables are set only once the last step has been handled.
This is useful for example if the main loop of the user application should remain independent from the integration process or if one needs to mimic the behaviour of an analytical model despite a numerical model is used (i.e. one needs the ability to get the model value at any time or to navigate through the data).
If problem modeling is done with several separate integration phases for contiguous intervals, the same ContinuousOutputModel can be used as step handler for all integration phases as long as they are performed in order and in the same direction. As an example, one can extrapolate the trajectory of a satellite with one model (i.e. one set of differential equations) up to the beginning of a maneuver, use another more complex model including thrusters modeling and accurate attitude control during the maneuver, and revert to the first model after the end of the maneuver. If the same continuous output model handles the steps of all integration phases, the user do not need to bother when the maneuver begins or ends, he has all the data available in a transparent manner.
One should be aware that the amount of data stored in a
ContinuousOutputFieldModel instance can be important if the state vector
is large, if the integration interval is long or if the steps are
small (which can result from small tolerance settings in adaptive
step size integrators).
FieldStepHandler,
FieldStepInterpolator| Modifier and Type | Field and Description |
|---|---|
private T |
finalTime
Final integration time.
|
private boolean |
forward
Integration direction indicator.
|
private int |
index
Current interpolator index.
|
private T |
initialTime
Initial integration time.
|
private java.util.List<FieldStepInterpolator<T>> |
steps
Steps table.
|
| Constructor and Description |
|---|
ContinuousOutputFieldModel()
Simple constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(ContinuousOutputFieldModel<T> model)
Append another model at the end of the instance.
|
private void |
checkDimensionsEquality(int d1,
int d2)
Check dimensions equality.
|
T |
getFinalTime()
Get the final integration time.
|
T |
getInitialTime()
Get the initial integration time.
|
FieldODEStateAndDerivative<T> |
getInterpolatedState(T time)
Get the state at interpolated time.
|
void |
handleStep(FieldStepInterpolator<T> interpolator,
boolean isLast)
Handle the last accepted step.
|
void |
init(FieldODEStateAndDerivative<T> initialState,
T t)
Initialize step handler at the start of an ODE integration.
|
private int |
locatePoint(T time,
FieldStepInterpolator<T> interval)
Compare a step interval and a double.
|
private T extends RealFieldElement<T> initialTime
private T extends RealFieldElement<T> finalTime
private boolean forward
private int index
private java.util.List<FieldStepInterpolator<T extends RealFieldElement<T>>> steps
public ContinuousOutputFieldModel()
public void append(ContinuousOutputFieldModel<T> model) throws MathIllegalArgumentException, MaxCountExceededException
model - model to add at the end of the instanceMathIllegalArgumentException - if the model to append is not
compatible with the instance (dimension of the state vector,
propagation direction, hole between the dates)DimensionMismatchException - if the dimensions of the states or
the number of secondary states do not matchMaxCountExceededException - if the number of functions evaluations is exceeded
during step finalizationprivate void checkDimensionsEquality(int d1,
int d2)
throws DimensionMismatchException
d1 - first dimensiond2 - second dimansionDimensionMismatchException - if dimensions do not matchpublic void init(FieldODEStateAndDerivative<T> initialState, T t)
This method is called once at the start of the integration. It may be used by the step handler to initialize some internal data if needed.
init in interface FieldStepHandler<T extends RealFieldElement<T>>initialState - initial time, state vector and derivativet - target time for the integrationpublic void handleStep(FieldStepInterpolator<T> interpolator, boolean isLast) throws MaxCountExceededException
handleStep in interface FieldStepHandler<T extends RealFieldElement<T>>interpolator - interpolator for the last accepted step.isLast - true if the step is the last oneMaxCountExceededException - if the number of functions evaluations is exceeded
during step finalizationpublic T getInitialTime()
public T getFinalTime()
public FieldODEStateAndDerivative<T> getInterpolatedState(T time)
time - time of the interpolated pointprivate int locatePoint(T time, FieldStepInterpolator<T> interval)
time - point to locateinterval - step intervalCopyright (c) 2003-2017 Apache Software Foundation