Class ApsideDetector

  • All Implemented Interfaces:
    EventDetector

    public class ApsideDetector
    extends AbstractDetector<ApsideDetector>
    Finder for apside crossing events.

    This class finds apside crossing events (i.e. apogee or perigee crossing).

    The default implementation behavior is to continue propagation at apogee crossing and to stop propagation at perigee crossing. This can be changed by calling AbstractDetector.withHandler(EventHandler) after construction.

    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)
    • Constructor Detail

      • ApsideDetector

        public ApsideDetector​(Orbit orbit)
        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

        Parameters:
        orbit - initial orbit
      • ApsideDetector

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

        The orbit is used only to set an upper bound for the max check interval to period/3

        Parameters:
        threshold - convergence threshold (s)
        orbit - initial orbit
      • ApsideDetector

        protected ApsideDetector​(AdaptableInterval maxCheck,
                                 double threshold,
                                 int maxIter,
                                 EventHandler handler)
        Protected constructor with full parameters.

        This constructor is not public as users are expected to use the builder API with the various withXxx() methods to set up the instance in a readable manner without using a huge amount of parameters.

        Parameters:
        maxCheck - maximum checking interval
        threshold - convergence threshold (s)
        maxIter - maximum number of iterations in the event time search
        handler - event handler to call at event occurrences
        Since:
        6.1
    • Method Detail

      • create

        protected ApsideDetector create​(AdaptableInterval newMaxCheck,
                                        double newThreshold,
                                        int newMaxIter,
                                        EventHandler newHandler)
        Build a new instance.
        Specified by:
        create in class AbstractDetector<ApsideDetector>
        Parameters:
        newMaxCheck - maximum checking interval (s)
        newThreshold - convergence threshold (s)
        newMaxIter - maximum number of iterations in the event time search
        newHandler - event handler to call at event occurrences
        Returns:
        a new instance of the appropriate sub-type
      • g

        public double g​(SpacecraftState s)
        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<ApsideDetector>
        Parameters:
        s - the current state information: date, kinematics, attitude
        Returns:
        value of the switching function