T
- the type of the field elementspublic class FieldEventState<T extends RealFieldElement<T>> extends 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 | Class | Description |
---|---|---|
static class |
FieldEventState.EventOccurrence<T extends RealFieldElement<T>> |
Class to hold the data related to an event occurrence that is needed to decide how
to modify integration.
|
Constructor | Description |
---|---|
FieldEventState(FieldODEEventHandler<T> handler,
double maxCheckInterval,
T convergence,
int maxIterationCount,
BracketedRealFieldUnivariateSolver<T> solver) |
Simple constructor.
|
Modifier and Type | Method | Description |
---|---|---|
FieldEventState.EventOccurrence<T> |
doEvent(FieldODEStateAndDerivative<T> state) |
Notify the user's listener of the event.
|
boolean |
evaluateStep(FieldODEStateInterpolator<T> interpolator) |
Evaluate the impact of the proposed step on the event handler.
|
T |
getConvergence() |
Get the convergence threshold for event localization.
|
FieldODEEventHandler<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(FieldODEStateInterpolator<T> interpolator) |
Reinitialize the beginning of the step.
|
boolean |
tryAdvance(FieldODEStateAndDerivative<T> state,
FieldODEStateInterpolator<T> interpolator) |
Try to accept the current history up to the given time.
|
public FieldEventState(FieldODEEventHandler<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 FieldODEEventHandler<T> getEventHandler()
public double getMaxCheckInterval()
public T getConvergence()
public int getMaxIterationCount()
public void reinitializeBegin(FieldODEStateInterpolator<T> interpolator) throws MathIllegalStateException
interpolator
- valid for the current stepMathIllegalStateException
- if the interpolator throws one because
the number of functions evaluations is exceededpublic boolean evaluateStep(FieldODEStateInterpolator<T> interpolator) throws MathIllegalArgumentException, MathIllegalStateException
interpolator
- step interpolator for the proposed stepMathIllegalStateException
- if the interpolator throws one because
the number of functions evaluations is exceededMathIllegalArgumentException
- if the event cannot be bracketedpublic boolean tryAdvance(FieldODEStateAndDerivative<T> state, FieldODEStateInterpolator<T> interpolator)
It is not necessary to call this method before calling doEvent(FieldODEStateAndDerivative)
with the same state. It is necessary to call this
method before you call doEvent(FieldODEStateAndDerivative)
on some other event
detector.
state
- to try to accept.interpolator
- to use to find the new root, if any.state
. In other words false
means continue
on while true
means stop and handle my event first.public FieldEventState.EventOccurrence<T> doEvent(FieldODEStateAndDerivative<T> state)
FieldODEEventHandler.resetState(FieldODEStateAndDerivative)
if necessary.state
- the state at the time of the event. This must be at the same time as
the current value of getEventTime()
.Action.RESET_STATE
. Otherwise the new state is state
. The stop time
indicates what time propagation should stop if the action is Action.STOP
.
This guarantees the integration will stop on or after the root, so that integration
may be restarted safely.public T getEventTime()
Copyright © 2016–2018 Hipparchus.org. All rights reserved.