T - the type of the field elementspublic class FieldEventState<T extends RealFieldElement<T>>
extends java.lang.Object
event handler during integration steps.
Each time the integrator proposes a step, the event handler switching function should be checked. This class handles the state of one handler during one integration step, with references to the state at the end of the preceding step. This information is used to decide if the handler should trigger an event or not during the proposed step.
| Modifier and Type | Field and Description |
|---|---|
private T |
convergence
Convergence threshold for event localization.
|
private boolean |
forward
Integration direction.
|
private T |
g0
Value of the events handler at the beginning of the step.
|
private boolean |
g0Positive
Simulated sign of g0 (we cheat when crossing events).
|
private FieldEventHandler<T> |
handler
Event handler.
|
private boolean |
increasing
Variation direction around pending event.
|
private double |
maxCheckInterval
Maximal time interval between events handler checks.
|
private int |
maxIterationCount
Upper limit in the iteration count for event localization.
|
private Action |
nextAction
Next action indicator.
|
private boolean |
pendingEvent
Indicator of event expected during the step.
|
private T |
pendingEventTime
Occurrence time of the pending event.
|
private T |
previousEventTime
Occurrence time of the previous event.
|
private BracketedRealFieldUnivariateSolver<T> |
solver
Root-finding algorithm to use to detect state events.
|
private T |
t0
Time at the beginning of the step.
|
| Constructor and Description |
|---|
FieldEventState(FieldEventHandler<T> handler,
double maxCheckInterval,
T convergence,
int maxIterationCount,
BracketedRealFieldUnivariateSolver<T> solver)
Simple constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
evaluateStep(FieldStepInterpolator<T> interpolator)
Evaluate the impact of the proposed step on the event handler.
|
T |
getConvergence()
Get the convergence threshold for event localization.
|
FieldEventHandler<T> |
getEventHandler()
Get the underlying event handler.
|
T |
getEventTime()
Get the occurrence time of the event triggered in the current step.
|
double |
getMaxCheckInterval()
Get the maximal time interval between events handler checks.
|
int |
getMaxIterationCount()
Get the upper limit in the iteration count for event localization.
|
void |
reinitializeBegin(FieldStepInterpolator<T> interpolator)
Reinitialize the beginning of the step.
|
FieldODEState<T> |
reset(FieldODEStateAndDerivative<T> state)
Let the event handler reset the state if it wants.
|
void |
stepAccepted(FieldODEStateAndDerivative<T> state)
Acknowledge the fact the step has been accepted by the integrator.
|
boolean |
stop()
Check if the integration should be stopped at the end of the
current step.
|
private final FieldEventHandler<T extends RealFieldElement<T>> handler
private final double maxCheckInterval
private final T extends RealFieldElement<T> convergence
private final int maxIterationCount
private T extends RealFieldElement<T> t0
private T extends RealFieldElement<T> g0
private boolean g0Positive
private boolean pendingEvent
private T extends RealFieldElement<T> pendingEventTime
private T extends RealFieldElement<T> previousEventTime
private boolean forward
private boolean increasing
private Action nextAction
private final BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>> solver
public FieldEventState(FieldEventHandler<T> handler, double maxCheckInterval, T convergence, int maxIterationCount, BracketedRealFieldUnivariateSolver<T> solver)
handler - event handlermaxCheckInterval - maximal time interval between switching
function checks (this interval prevents missing sign changes in
case the integration steps becomes very large)convergence - convergence threshold in the event time searchmaxIterationCount - upper limit of the iteration count in
the event time searchsolver - Root-finding algorithm to use to detect state eventspublic FieldEventHandler<T> getEventHandler()
public double getMaxCheckInterval()
public T getConvergence()
public int getMaxIterationCount()
public void reinitializeBegin(FieldStepInterpolator<T> interpolator) throws MaxCountExceededException
interpolator - valid for the current stepMaxCountExceededException - if the interpolator throws one because
the number of functions evaluations is exceededpublic boolean evaluateStep(FieldStepInterpolator<T> interpolator) throws MaxCountExceededException, NoBracketingException
interpolator - step interpolator for the proposed stepMaxCountExceededException - if the interpolator throws one because
the number of functions evaluations is exceededNoBracketingException - if the event cannot be bracketedpublic T getEventTime()
public void stepAccepted(FieldODEStateAndDerivative<T> state)
state - state at the end of the steppublic boolean stop()
public FieldODEState<T> reset(FieldODEStateAndDerivative<T> state)
state - state at the beginning of the next stepCopyright (c) 2003-2017 Apache Software Foundation