org.orekit.propagation.events
Class ApsideDetector

java.lang.Object
  extended by org.orekit.propagation.events.AbstractDetector
      extended by org.orekit.propagation.events.ApsideDetector
All Implemented Interfaces:
Serializable, EventDetector

public class ApsideDetector
extends AbstractDetector

Finder for apside crossing events.

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 :

Beware that apside detection will fail for almost circular orbits. If for example an apside detector is used to trigger an ImpulseManeuver and the maneuver change the orbit shape to circular, then the detector may completely fail just after the maneuver has been performed!

Author:
Luc Maisonobe
See Also:
Propagator.addEventDetector(EventDetector), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.orekit.propagation.events.EventDetector
EventDetector.Action
 
Field Summary
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).
 
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
 
Fields inherited from interface org.orekit.propagation.events.EventDetector
DECREASING, INCREASING, INCREASING_DECREASING
 
Constructor Summary
ApsideDetector(double maxCheck, double threshold, EventDetector.Action action_apogee, EventDetector.Action action_perigee)
          Build a new instance with both apogee and perigee detection.
ApsideDetector(double maxCheck, double threshold, EventDetector.Action action_apogee, EventDetector.Action action_perigee, boolean remove_apogee, boolean remove_perigee)
          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.
 
Method Summary
 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.
 boolean shouldBeRemoved()
          This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered.
 
Methods inherited from class org.orekit.propagation.events.AbstractDetector
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, init, resetState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERIGEE

public static final int PERIGEE
Flag for perigee detection (slopeSelection = 0).

See Also:
Constant Field Values

APOGEE

public static final int APOGEE
Flag for apogee detection (slopeSelection = 1).

See Also:
Constant Field Values

PERIGEE_APOGEE

public static final int PERIGEE_APOGEE
Flag for both perigee and apogee detection (slopeSelection = 2).

See Also:
Constant Field Values
Constructor Detail

ApsideDetector

public ApsideDetector(Orbit orbit,
                      int slopeSelection)
Build a new instance.

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.

Parameters:
orbit - initial orbit
slopeSelection -
PERIGEE for perigee detection,
APOGEE for apogee detection,
PERIGEE_APOGEE for both perigee and apogee detection.

ApsideDetector

public ApsideDetector(Orbit orbit,
                      int slopeSelection,
                      double threshold)
Build a new instance.

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.

Parameters:
orbit - initial orbit
slopeSelection -
PERIGEE for perigee detection,
APOGEE for apogee detection,
PERIGEE_APOGEE for both perigee and apogee detection.
threshold - convergence threshold (s)

ApsideDetector

public ApsideDetector(int slopeSelection,
                      double maxCheck,
                      double threshold)
Build a new instance.

The default implementation behavior is to stop propagation when the expected apside is reached.

Parameters:
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)

ApsideDetector

public ApsideDetector(double maxCheck,
                      double threshold,
                      EventDetector.Action action_apogee,
                      EventDetector.Action action_perigee)
Build a new instance with both apogee and perigee detection.

Parameters:
maxCheck - maximal checking interval (s)
threshold - convergence threshold (s)
action_apogee - action to be perform when the apogee is reached
action_perigee - action to be perform when the perigee is reached

ApsideDetector

public ApsideDetector(double maxCheck,
                      double threshold,
                      EventDetector.Action action_apogee,
                      EventDetector.Action action_perigee,
                      boolean remove_apogee,
                      boolean remove_perigee)
Build a new instance with both apogee and perigee detection.

Parameters:
maxCheck - maximal checking interval (s)
threshold - convergence threshold (s)
action_apogee - action to be perform when the apogee is reached
action_perigee - action to be perform when the perigee is reached
remove_apogee - true if detector should be removed at apogee
remove_perigee - true if detector should be removed at perigee
Since:
3.1

ApsideDetector

public ApsideDetector(int slopeSelection,
                      double maxCheck,
                      double threshold,
                      EventDetector.Action action)
Build a new instance with apogee OR/AND perigee detection depending on slope selection.

Parameters:
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 reached

ApsideDetector

public 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.

Parameters:
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 reached
remove - true if detector should be removed
Method Detail

shouldBeRemoved

public boolean shouldBeRemoved()
This method is called after EventDetector.eventOccurred(org.orekit.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.

Specified by:
shouldBeRemoved in interface EventDetector
Specified by:
shouldBeRemoved in class AbstractDetector
Returns:
true if the current detector should be removed after first event detection

eventOccurred

public EventDetector.Action eventOccurred(SpacecraftState s,
                                          boolean increasing,
                                          boolean forward)
                                   throws OrekitException

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.

Specified by:
eventOccurred in interface EventDetector
Specified by:
eventOccurred in class AbstractDetector
Parameters:
s - the current state information : date, kinematics, attitude
increasing - if true, the value of the switching function increases when times increases around event
forward - if true, the integration variable (time) increases during integration.
Returns:
the action performed when the expected apside is reached.
Throws:
OrekitException - if some specific error occurs

g

public double g(SpacecraftState s)
         throws OrekitException
Compute the value of the switching function. This function computes the dot product of the 2 vectors : position.velocity.

Specified by:
g in interface EventDetector
Specified by:
g in class AbstractDetector
Parameters:
s - the current state information: date, kinematics, attitude
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs


Copyright © 2017 CNES. All Rights Reserved.