public class ApsideDetector extends AbstractDetector
This class finds apside crossing events (i.e. apogee and/or perigee crossing).
The default implementation behavior is to stop
propagation at apogee or/and perigee
crossing depending on slope selection defined PERIGEE
, APOGEE
and
PERIGEE_APOGEE
. This can be changed by overriding one of the following constructors :
ApsideDetector
: the defined action is performed at apogee OR/AND perigee depending on slope selection defined.
ApsideDetector
: the defined actions are performed at apogee AND perigee.
Beware that apside detection will fail for almost circular orbits.
Propagator.addEventDetector(EventDetector)
,
Serialized FormEventDetector.Action
Modifier and Type | Field and Description |
---|---|
static int |
APOGEE
Flag for apogee detection (slopeSelection = 1).
|
static int |
PERIGEE
Flag for perigee detection (slopeSelection = 0).
|
static int |
PERIGEE_APOGEE
Flag for both perigee and apogee detection (slopeSelection = 2).
|
DEFAULT_MAXCHECK
DECREASING, INCREASING, INCREASING_DECREASING
Constructor and Description |
---|
ApsideDetector(double maxCheck,
double threshold,
EventDetector.Action actionApogee,
EventDetector.Action actionPerigee)
Build a new instance with both apogee and perigee detection.
|
ApsideDetector(double maxCheck,
double threshold,
EventDetector.Action actionApogee,
EventDetector.Action actionPerigee,
boolean removeApogee,
boolean removePerigee)
Build a new instance with both apogee and perigee detection.
|
ApsideDetector(int slopeSelection,
double maxCheck,
double threshold)
Build a new instance.
|
ApsideDetector(int slopeSelection,
double maxCheck,
double threshold,
EventDetector.Action action)
Build a new instance with apogee OR/AND perigee detection depending on slope selection.
|
ApsideDetector(int slopeSelection,
double maxCheck,
double threshold,
EventDetector.Action action,
boolean remove)
Build a new instance with apogee OR/AND perigee detection depending on slope selection.
|
ApsideDetector(Orbit orbit,
int slopeSelection)
Build a new instance.
|
ApsideDetector(Orbit orbit,
int slopeSelection,
double threshold)
Build a new instance.
|
Modifier and Type | Method and Description |
---|---|
EventDetector |
copy()
A copy of the detector.
|
EventDetector.Action |
eventOccurred(SpacecraftState s,
boolean increasing,
boolean forward)
Handle an apside crossing event and choose what to do next.
|
double |
g(SpacecraftState s)
Compute the value of the switching function.
|
EventDetector.Action |
getActionAtApogee()
Returns action at apogee detection.
|
EventDetector.Action |
getActionAtPerigee()
Returns action at perigee detection.
|
boolean |
removeAtApogee()
Returns true if detection is removed after apogee detection.
|
boolean |
removeAtPerigee()
Returns true if detection is removed after perigee detection.
|
boolean |
shouldBeRemoved()
This method is called after
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean) has been triggered. |
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, init, resetState
public static final int PERIGEE
public static final int APOGEE
public static final int PERIGEE_APOGEE
public ApsideDetector(Orbit orbit, int slopeSelection)
The orbit is used only to set an upper bound for the max check interval to period/3 and to set the convergence threshold according to orbit size
The default implementation behavior is to stop
propagation when the expected
apside is reached.
orbit
- initial orbitslopeSelection
- PERIGEE
for perigee detection,APOGEE
for apogee detection,PERIGEE_APOGEE
for both perigee and apogee detection.public ApsideDetector(Orbit orbit, int slopeSelection, double threshold)
The orbit is used only to set an upper bound for the max check interval to period/3
The default implementation behavior is to stop
propagation when the expected
apside is reached.
orbit
- initial orbitslopeSelection
- PERIGEE
for perigee detection,APOGEE
for apogee detection,PERIGEE_APOGEE
for both perigee and apogee detection.threshold
- convergence threshold (s)public ApsideDetector(int slopeSelection, double maxCheck, double threshold)
The default implementation behavior is to stop
propagation when the expected
apside is reached.
slopeSelection
- PERIGEE
for perigee detection,APOGEE
for apogee detection,PERIGEE_APOGEE
for both perigee and apogee detection.maxCheck
- maximal checking interval (s)threshold
- convergence threshold (s)public ApsideDetector(double maxCheck, double threshold, EventDetector.Action actionApogee, EventDetector.Action actionPerigee)
maxCheck
- maximal checking interval (s)threshold
- convergence threshold (s)actionApogee
- action to be perform when the apogee is reachedactionPerigee
- action to be perform when the perigee is reachedpublic ApsideDetector(double maxCheck, double threshold, EventDetector.Action actionApogee, EventDetector.Action actionPerigee, boolean removeApogee, boolean removePerigee)
maxCheck
- maximal checking interval (s)threshold
- convergence threshold (s)actionApogee
- action to be perform when the apogee is reachedactionPerigee
- action to be perform when the perigee is reachedremoveApogee
- true if detector should be removed at apogeeremovePerigee
- true if detector should be removed at perigeepublic ApsideDetector(int slopeSelection, double maxCheck, double threshold, EventDetector.Action action)
slopeSelection
- PERIGEE
for perigee detection,APOGEE
for apogee detection,PERIGEE_APOGEE
for both perigee and apogee detection.maxCheck
- maximal checking interval (s)threshold
- convergence threshold (s)action
- action to be performed when the expected apside is reachedpublic ApsideDetector(int slopeSelection, double maxCheck, double threshold, EventDetector.Action action, boolean remove)
slopeSelection
- PERIGEE
for perigee detection,APOGEE
for apogee detection,PERIGEE_APOGEE
for both perigee and apogee detection.maxCheck
- maximal checking interval (s)threshold
- convergence threshold (s)action
- action to be performed when the expected apside is reachedremove
- true if detector should be removedpublic EventDetector.Action getActionAtPerigee()
public EventDetector.Action getActionAtApogee()
public boolean removeAtPerigee()
public boolean removeAtApogee()
public boolean shouldBeRemoved()
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean)
has been triggered. It returns true if the
current detector should be removed after first event detection. WARNING: this method
can be called only once a event has been triggered. Before, the value is not available.shouldBeRemoved
in interface EventDetector
shouldBeRemoved
in class AbstractDetector
public EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward) throws PatriusException
Handle an apside crossing event and choose what to do next.
The default implementation behavior is to stop
propagation when the expected
apside is reached.
eventOccurred
in interface EventDetector
eventOccurred
in class AbstractDetector
s
- the current state information : date, kinematics, attitudeincreasing
- if true, the value of the switching function increases when times increases
around eventforward
- if true, the integration variable (time) increases during integration.PatriusException
- if some specific error occurspublic double g(SpacecraftState s) throws PatriusException
g
in interface EventDetector
g
in class AbstractDetector
s
- the current state information: date, kinematics, attitudePatriusException
- if some specific error occurspublic EventDetector copy()
Copyright © 2019 CNES. All rights reserved.