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 and Description |
|---|---|
| private static class | EventState.
Local wrapper to propagate exceptions. |
| Modifier and Type | Field and Description |
|---|---|
| private final double | convergence
Convergence threshold for event localization. |
| private ExpandableStatefulODE | expandable
Equation being integrated. |
| private boolean | forward
Integration direction. |
| private double | 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 final EventHandler | handler
Event handler. |
| private boolean | increasing
Variation direction around pending event. |
| private final double | maxCheckInterval
Maximal time interval between events handler checks. |
| private final int | maxIterationCount
Upper limit in the iteration count for event localization. |
| private EventHandler. | nextAction
Next action indicator. |
| private boolean | pendingEvent
Indicator of event expected during the step. |
| private double | pendingEventTime
Occurrence time of the pending event. |
| private double | previousEventTime
Occurrence time of the previous event. |
| private final UnivariateSolver | solver
Root-finding algorithm to use to detect state events. |
| private double | t0
Time at the beginning of the step. |
| Access | Constructor and Description |
|---|---|
| public | EventState(final EventHandler
event handler handler, final double maximal time interval between switching
function checks (this interval prevents missing sign changes in
case the integration steps becomes very large) maxCheckInterval, final double convergence threshold in the event time search convergence, final int upper limit of the iteration count in
the event time search maxIterationCount, final UnivariateSolver Root-finding algorithm to use to detect state events solver)Simple constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the event handler triggers an event before the end of the proposed stepstep interpolator for the proposed step interpolator)Evaluate the impact of the proposed step on the event handler. |
| private double[] | Returns: complete stateinterpolator to use interpolator)Get the complete state (primary and secondary). |
| public double | Returns: convergence threshold for event localizationGet the convergence threshold for event localization. |
| public EventHandler | |
| public double | Returns: occurrence time of the event triggered in the current step or infinity if no events are triggeredGet the occurrence time of the event triggered in the current step. |
| public double | Returns: maximal time interval between events handler checksGet the maximal time interval between events handler checks. |
| public int | Returns: upper limit in the iteration count for event localizationGet the upper limit in the iteration count for event localization. |
| public void | reinitializeBegin(final StepInterpolator
valid for the current step interpolator)Reinitialize the beginning of the step. |
| public boolean | Returns: true if the integrator should reset the derivatives toovalue of the independent time variable at the
beginning of the next step t, final double[] array were to put the desired state vector at the beginning
of the next step y)Let the event handler reset the state if it wants. |
| public void | |
| public void | stepAccepted(final double
value of the independent time variable at the
end of the step t, final double[] array containing the current value of the state vector
at the end of the step y)Acknowledge the fact the step has been accepted by the integrator. |
| public boolean | Returns: true if the integration should be stoppedCheck if the integration should be stopped at the end of the current step. |
| convergence | back to summary |
|---|---|
| private final double convergence Convergence threshold for event localization. | |
| expandable | back to summary |
|---|---|
| private ExpandableStatefulODE expandable Equation being integrated. | |
| forward | back to summary |
|---|---|
| private boolean forward Integration direction. | |
| g0 | back to summary |
|---|---|
| private double g0 Value of the events handler at the beginning of the step. | |
| g0Positive | back to summary |
|---|---|
| private boolean g0Positive Simulated sign of g0 (we cheat when crossing events). | |
| handler | back to summary |
|---|---|
| private final EventHandler handler Event handler. | |
| increasing | back to summary |
|---|---|
| private boolean increasing Variation direction around pending event. (this is considered with respect to the integration direction) | |
| maxCheckInterval | back to summary |
|---|---|
| private final double maxCheckInterval Maximal time interval between events handler checks. | |
| maxIterationCount | back to summary |
|---|---|
| private final int maxIterationCount Upper limit in the iteration count for event localization. | |
| nextAction | back to summary |
|---|---|
| private EventHandler. Next action indicator. | |
| pendingEvent | back to summary |
|---|---|
| private boolean pendingEvent Indicator of event expected during the step. | |
| pendingEventTime | back to summary |
|---|---|
| private double pendingEventTime Occurrence time of the pending event. | |
| previousEventTime | back to summary |
|---|---|
| private double previousEventTime Occurrence time of the previous event. | |
| solver | back to summary |
|---|---|
| private final UnivariateSolver solver Root-finding algorithm to use to detect state events. | |
| t0 | back to summary |
|---|---|
| private double t0 Time at the beginning of the step. | |
| EventState | back to summary |
|---|---|
| public EventState(final EventHandler handler, final double maxCheckInterval, final double convergence, final int maxIterationCount, final UnivariateSolver solver) Simple constructor.
| |
| evaluateStep | back to summary |
|---|---|
| public boolean evaluateStep(final StepInterpolator interpolator) throws MaxCountExceededException, NoBracketingException Evaluate the impact of the proposed step on the event handler.
| |
| getCompleteState | back to summary |
|---|---|
| private double[] getCompleteState(final StepInterpolator interpolator) Get the complete state (primary and secondary).
| |
| getConvergence | back to summary |
|---|---|
| public double getConvergence() Get the convergence threshold for event localization.
| |
| getEventHandler | back to summary |
|---|---|
| public EventHandler getEventHandler() Get the underlying event handler.
| |
| getEventTime | back to summary |
|---|---|
| public double getEventTime() Get the occurrence time of the event triggered in the current step.
| |
| getMaxCheckInterval | back to summary |
|---|---|
| public double getMaxCheckInterval() Get the maximal time interval between events handler checks.
| |
| getMaxIterationCount | back to summary |
|---|---|
| public int getMaxIterationCount() Get the upper limit in the iteration count for event localization.
| |
| reinitializeBegin | back to summary |
|---|---|
| public void reinitializeBegin(final StepInterpolator interpolator) throws MaxCountExceededException Reinitialize the beginning of the step.
| |
| reset | back to summary |
|---|---|
| public boolean reset(final double t, final double[] y) Let the event handler reset the state if it wants.
| |
| setExpandable | back to summary |
|---|---|
| public void setExpandable(final ExpandableStatefulODE expandable) Set the equation.
| |
| stepAccepted | back to summary |
|---|---|
| public void stepAccepted(final double t, final double[] y) Acknowledge the fact the step has been accepted by the integrator.
| |
| stop | back to summary |
|---|---|
| public boolean stop() Check if the integration should be stopped at the end of the current step.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Serializable UID.
|
| private final MaxCountExceededException | wrapped
Wrapped exception. |
| Access | Constructor and Description |
|---|---|
| pack-priv | LocalMaxCountExceededException(final MaxCountExceededException
exception to wrap exception)Simple constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public MaxCountExceededException |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Serializable UID. | |
| wrapped | back to summary |
|---|---|
| private final MaxCountExceededException wrapped Wrapped exception. | |
| LocalMaxCountExceededException | back to summary |
|---|---|
| pack-priv LocalMaxCountExceededException(final MaxCountExceededException exception) Simple constructor.
| |
| getException | back to summary |
|---|---|
| public MaxCountExceededException getException() Get the wrapped exception.
| |