public interface MultiEventDetector
This interface is copied from EventDetector
and adapted to multi
propagation.
This interface represents space-dynamics aware events detectors.
It mirrors the EventHandler
interface from commons-math but provides a
space-dynamics interface to the methods.
Events detectors are a useful solution to meet the requirements of propagators concerning discrete conditions. The state of each event detector is queried by the integrator at each step. When the sign of the underlying g switching function changes, the step is rejected and reduced, in order to make sure the sign changes occur only at steps boundaries.
When step ends exactly at a switching function sign change, the corresponding event is triggered, by calling the
eventOccurred(Map, boolean, boolean)
method. The method can do whatever it needs with the event (logging it,
performing some processing, ignore it ...). The return value of the method will be used by the propagator to stop or
resume propagation, possibly changing the state vector or the future event detection.
Modifier and Type | Field and Description |
---|---|
static int |
DECREASING
Decreasing g-function related events parameter.
|
static int |
INCREASING
Increasing g-function related events parameter.
|
static int |
INCREASING_DECREASING
Both increasing and decreasing g-function related events parameter.
|
Modifier and Type | Method and Description |
---|---|
EventDetector.Action |
eventOccurred(Map<String,SpacecraftState> s,
boolean increasing,
boolean forward)
Handle an event and choose what to do next.
|
double |
g(Map<String,SpacecraftState> s)
Compute the value of the switching function.
|
double |
getMaxCheckInterval()
Get maximal time interval between switching function checks.
|
int |
getMaxIterationCount()
Get maximal number of iterations in the event time search.
|
int |
getSlopeSelection()
Get the parameter in charge of the selection of detected events by the slope of the g-function.
|
double |
getThreshold()
Get the convergence threshold in the event time search.
|
void |
init(Map<String,SpacecraftState> s0,
AbsoluteDate t)
Initialize event handler at the start of a propagation.
|
Map<String,SpacecraftState> |
resetStates(Map<String,SpacecraftState> oldStates)
Reset the states (including additional states) prior to continue propagation.
|
boolean |
shouldBeRemoved()
This method is called after the step handler has returned and before the next step is started, but only when
eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean) has been called. |
static final int INCREASING
static final int DECREASING
static final int INCREASING_DECREASING
void init(Map<String,SpacecraftState> s0, AbsoluteDate t)
This method is called once at the start of the propagation. It may be used by the event handler to initialize some internal data if needed.
s0
- map of initial statest
- target time for the integrationdouble g(Map<String,SpacecraftState> s) throws PatriusException
This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.
s
- the current states information: date, kinematics, attitudes for forces
and events computation, and additional states for each statesPatriusException
- if some specific error occursEventDetector.Action eventOccurred(Map<String,SpacecraftState> s, boolean increasing, boolean forward) throws PatriusException
The scheduling between this method and the MultiOrekitStepHandler method handleStep is to call this method first
and handleStep
afterwards. This scheduling allows the propagator to pass true
as the
isLast
parameter to the step handler to make it aware the step will be the last one if this method
returns EventDetector.Action.STOP
. As the interpolator may be
used to navigate back throughout the last step MultiOrekitStepNormalizer does for example), user code called by
this method and user code called by step handlers may experience apparently out of order values of the
independent time variable. As an example, if the same user object implements both this MultiEventDetector
interface and the MultiOrekitFixedStepHandler interface, a forward integration may
call its eventOccurred
method with a state at 2000-01-01T00:00:10 first and call its
handleStep
method with a state at 2000-01-01T00:00:09 afterwards. Such out of order calls are
limited to the size of the integration step for MultiOrekitStepHandler and to the size of the fixed step for
MultiOrekitFixedStepHandler.
s
- the current states information: date, kinematics, attitude for forces
and events computation, and additional states for each statesincreasing
- if true, the value of the switching function increases
when times increases around event (note that increase is measured with respect
to physical time, not with respect to propagation which may go backward in time)forward
- if true, the integration variable (time) increases during integration.EventDetector.Action.STOP
,
EventDetector.Action.RESET_STATE
,
EventDetector.Action.RESET_DERIVATIVES
,
EventDetector.Action.CONTINUE
PatriusException
- if some specific error occursboolean shouldBeRemoved()
This method is called after the step handler has returned and before the next step is started, but only when
eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean)
has been called.
Map<String,SpacecraftState> resetStates(Map<String,SpacecraftState> oldStates) throws PatriusException
This method is called after the step handler has returned and before the next step is started, but only when
eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean)
has itself returned the
EventDetector.Action.RESET_STATE
indicator. It allows the user
to reset the state for the next step, without perturbing the step handler of the finishing step. If the
eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean)
never returns the
EventDetector.Action.RESET_STATE
indicator, this function will
never be called, and it is safe to simply return null.
oldStates
- old statesPatriusException
- if the states cannot be reseteddouble getThreshold()
double getMaxCheckInterval()
int getMaxIterationCount()
int getSlopeSelection()
Copyright © 2019 CNES. All rights reserved.