Class KeplerianOrbit

  • All Implemented Interfaces:
    Serializable, TimeInterpolable<Orbit>, TimeShiftable<Orbit>, TimeStamped, PVCoordinatesProvider

    public class KeplerianOrbit
    extends Orbit
    This class handles traditional Keplerian orbital parameters.

    The parameters used internally are the classical Keplerian elements:

         a
         e
         i
         ω
         Ω
         v
       
    where ω stands for the Perigee Argument, Ω stands for the Right Ascension of the Ascending Node and v stands for the true anomaly.

    This class supports hyperbolic orbits, using the convention that semi major axis is negative for such orbits (and of course eccentricity is greater than 1).

    When orbit is either equatorial or circular, some Keplerian elements (more precisely ω and Ω) become ambiguous so this class should not be used for such orbits. For this reason, equinoctial orbits is the recommended way to represent orbits.

    The instance KeplerianOrbit is guaranteed to be immutable.

    Author:
    Luc Maisonobe, Guylaine Prat, Fabien Maussion, Véronique Pommier-Maurussane
    See Also:
    Orbit, CircularOrbit, CartesianOrbit, EquinoctialOrbit, Serialized Form
    • Constructor Detail

      • KeplerianOrbit

        public KeplerianOrbit​(double a,
                              double e,
                              double i,
                              double pa,
                              double raan,
                              double anomaly,
                              PositionAngle type,
                              Frame frame,
                              AbsoluteDate date,
                              double mu)
                       throws IllegalArgumentException
        Creates a new instance.
        Parameters:
        a - semi-major axis (m), negative for hyperbolic orbits
        e - eccentricity
        i - inclination (rad)
        pa - perigee argument (ω, rad)
        raan - right ascension of ascending node (Ω, rad)
        anomaly - mean, eccentric or true anomaly (rad)
        type - type of anomaly
        frame - the frame in which the parameters are defined (must be a pseudo-inertial frame)
        date - date of the orbital parameters
        mu - central attraction coefficient (m³/s²)
        Throws:
        IllegalArgumentException - if frame is not a pseudo-inertial frame or a and e don't match for hyperbolic orbits, or v is out of range for hyperbolic orbits
      • KeplerianOrbit

        public KeplerianOrbit​(double a,
                              double e,
                              double i,
                              double pa,
                              double raan,
                              double anomaly,
                              double aDot,
                              double eDot,
                              double iDot,
                              double paDot,
                              double raanDot,
                              double anomalyDot,
                              PositionAngle type,
                              Frame frame,
                              AbsoluteDate date,
                              double mu)
                       throws IllegalArgumentException
        Creates a new instance.
        Parameters:
        a - semi-major axis (m), negative for hyperbolic orbits
        e - eccentricity
        i - inclination (rad)
        pa - perigee argument (ω, rad)
        raan - right ascension of ascending node (Ω, rad)
        anomaly - mean, eccentric or true anomaly (rad)
        aDot - semi-major axis derivative (m/s)
        eDot - eccentricity derivative
        iDot - inclination derivative (rad/s)
        paDot - perigee argument derivative (rad/s)
        raanDot - right ascension of ascending node derivative (rad/s)
        anomalyDot - mean, eccentric or true anomaly derivative (rad/s)
        type - type of anomaly
        frame - the frame in which the parameters are defined (must be a pseudo-inertial frame)
        date - date of the orbital parameters
        mu - central attraction coefficient (m³/s²)
        Throws:
        IllegalArgumentException - if frame is not a pseudo-inertial frame or a and e don't match for hyperbolic orbits, or v is out of range for hyperbolic orbits
        Since:
        9.0
      • KeplerianOrbit

        public KeplerianOrbit​(Orbit op)
        Constructor from any kind of orbital parameters.
        Parameters:
        op - orbital parameters to copy
    • Method Detail

      • getType

        public OrbitType getType()
        Get the orbit type.
        Specified by:
        getType in class Orbit
        Returns:
        orbit type
      • getA

        public double getA()
        Get the semi-major axis.

        Note that the semi-major axis is considered negative for hyperbolic orbits.

        Specified by:
        getA in class Orbit
        Returns:
        semi-major axis (m)
      • getADot

        public double getADot()
        Get the semi-major axis derivative.

        Note that the semi-major axis is considered negative for hyperbolic orbits.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getADot in class Orbit
        Returns:
        semi-major axis derivative (m/s)
        See Also:
        Orbit.hasDerivatives()
      • getE

        public double getE()
        Get the eccentricity.
        Specified by:
        getE in class Orbit
        Returns:
        eccentricity
      • getEDot

        public double getEDot()
        Get the eccentricity derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getEDot in class Orbit
        Returns:
        eccentricity derivative
        See Also:
        Orbit.hasDerivatives()
      • getI

        public double getI()
        Get the inclination.
        Specified by:
        getI in class Orbit
        Returns:
        inclination (rad)
      • getIDot

        public double getIDot()
        Get the inclination derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getIDot in class Orbit
        Returns:
        inclination derivative (rad/s)
        See Also:
        Orbit.hasDerivatives()
      • getPerigeeArgument

        public double getPerigeeArgument()
        Get the perigee argument.
        Returns:
        perigee argument (rad)
      • getPerigeeArgumentDot

        public double getPerigeeArgumentDot()
        Get the perigee argument derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Returns:
        perigee argument derivative (rad/s)
        Since:
        9.0
      • getRightAscensionOfAscendingNode

        public double getRightAscensionOfAscendingNode()
        Get the right ascension of the ascending node.
        Returns:
        right ascension of the ascending node (rad)
      • getRightAscensionOfAscendingNodeDot

        public double getRightAscensionOfAscendingNodeDot()
        Get the right ascension of the ascending node derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Returns:
        right ascension of the ascending node derivative (rad/s)
        Since:
        9.0
      • getTrueAnomaly

        public double getTrueAnomaly()
        Get the true anomaly.
        Returns:
        true anomaly (rad)
      • getTrueAnomalyDot

        public double getTrueAnomalyDot()
        Get the true anomaly derivative.
        Returns:
        true anomaly derivative (rad/s)
      • getEccentricAnomaly

        public double getEccentricAnomaly()
        Get the eccentric anomaly.
        Returns:
        eccentric anomaly (rad)
      • getEccentricAnomalyDot

        public double getEccentricAnomalyDot()
        Get the eccentric anomaly derivative.
        Returns:
        eccentric anomaly derivative (rad/s)
        Since:
        9.0
      • getMeanAnomaly

        public double getMeanAnomaly()
        Get the mean anomaly.
        Returns:
        mean anomaly (rad)
      • getMeanAnomalyDot

        public double getMeanAnomalyDot()
        Get the mean anomaly derivative.
        Returns:
        mean anomaly derivative (rad/s)
        Since:
        9.0
      • getAnomaly

        public double getAnomaly​(PositionAngle type)
        Get the anomaly.
        Parameters:
        type - type of the angle
        Returns:
        anomaly (rad)
      • getAnomalyDot

        public double getAnomalyDot​(PositionAngle type)
        Get the anomaly derivative.
        Parameters:
        type - type of the angle
        Returns:
        anomaly derivative (rad/s)
        Since:
        9.0
      • ellipticEccentricToTrue

        public static double ellipticEccentricToTrue​(double E,
                                                     double e)
        Computes the true anomaly from the elliptic eccentric anomaly.
        Parameters:
        E - eccentric anomaly (rad)
        e - eccentricity
        Returns:
        v the true anomaly
        Since:
        9.0
      • trueToEllipticEccentric

        public static double trueToEllipticEccentric​(double v,
                                                     double e)
        Computes the elliptic eccentric anomaly from the true anomaly.
        Parameters:
        v - true anomaly (rad)
        e - eccentricity
        Returns:
        E the elliptic eccentric anomaly
        Since:
        9.0
      • hyperbolicEccentricToTrue

        public static double hyperbolicEccentricToTrue​(double H,
                                                       double e)
        Computes the true anomaly from the hyperbolic eccentric anomaly.
        Parameters:
        H - hyperbolic eccentric anomaly (rad)
        e - eccentricity
        Returns:
        v the true anomaly
      • trueToHyperbolicEccentric

        public static double trueToHyperbolicEccentric​(double v,
                                                       double e)
        Computes the hyperbolic eccentric anomaly from the true anomaly.
        Parameters:
        v - true anomaly (rad)
        e - eccentricity
        Returns:
        H the hyperbolic eccentric anomaly
        Since:
        9.0
      • meanToEllipticEccentric

        public static double meanToEllipticEccentric​(double M,
                                                     double e)
        Computes the elliptic eccentric anomaly from the mean anomaly.

        The algorithm used here for solving Kepler equation has been published in: "Procedures for solving Kepler's Equation", A. W. Odell and R. H. Gooding, Celestial Mechanics 38 (1986) 307-334

        Parameters:
        M - mean anomaly (rad)
        e - eccentricity
        Returns:
        E the eccentric anomaly
      • meanToHyperbolicEccentric

        public static double meanToHyperbolicEccentric​(double M,
                                                       double ecc)
        Computes the hyperbolic eccentric anomaly from the mean anomaly.

        The algorithm used here for solving hyperbolic Kepler equation is Danby's iterative method (3rd order) with Vallado's initial guess.

        Parameters:
        M - mean anomaly (rad)
        ecc - eccentricity
        Returns:
        H the hyperbolic eccentric anomaly
      • ellipticEccentricToMean

        public static double ellipticEccentricToMean​(double E,
                                                     double e)
        Computes the mean anomaly from the elliptic eccentric anomaly.
        Parameters:
        E - eccentric anomaly (rad)
        e - eccentricity
        Returns:
        M the mean anomaly
        Since:
        9.0
      • hyperbolicEccentricToMean

        public static double hyperbolicEccentricToMean​(double H,
                                                       double e)
        Computes the mean anomaly from the hyperbolic eccentric anomaly.
        Parameters:
        H - hyperbolic eccentric anomaly (rad)
        e - eccentricity
        Returns:
        M the mean anomaly
        Since:
        9.0
      • getEquinoctialEx

        public double getEquinoctialEx()
        Get the first component of the equinoctial eccentricity vector derivative.
        Specified by:
        getEquinoctialEx in class Orbit
        Returns:
        first component of the equinoctial eccentricity vector derivative
      • getEquinoctialExDot

        public double getEquinoctialExDot()
        Get the first component of the equinoctial eccentricity vector.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getEquinoctialExDot in class Orbit
        Returns:
        first component of the equinoctial eccentricity vector
        See Also:
        Orbit.hasDerivatives()
      • getEquinoctialEy

        public double getEquinoctialEy()
        Get the second component of the equinoctial eccentricity vector derivative.
        Specified by:
        getEquinoctialEy in class Orbit
        Returns:
        second component of the equinoctial eccentricity vector derivative
      • getEquinoctialEyDot

        public double getEquinoctialEyDot()
        Get the second component of the equinoctial eccentricity vector.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getEquinoctialEyDot in class Orbit
        Returns:
        second component of the equinoctial eccentricity vector
        See Also:
        Orbit.hasDerivatives()
      • getHx

        public double getHx()
        Get the first component of the inclination vector.
        Specified by:
        getHx in class Orbit
        Returns:
        first component of the inclination vector
      • getHxDot

        public double getHxDot()
        Get the first component of the inclination vector derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getHxDot in class Orbit
        Returns:
        first component of the inclination vector derivative
        See Also:
        Orbit.hasDerivatives()
      • getHy

        public double getHy()
        Get the second component of the inclination vector.
        Specified by:
        getHy in class Orbit
        Returns:
        second component of the inclination vector
      • getHyDot

        public double getHyDot()
        Get the second component of the inclination vector derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getHyDot in class Orbit
        Returns:
        second component of the inclination vector derivative
        See Also:
        Orbit.hasDerivatives()
      • getLv

        public double getLv()
        Get the true longitude argument.
        Specified by:
        getLv in class Orbit
        Returns:
        v + ω + Ω true longitude argument (rad)
      • getLvDot

        public double getLvDot()
        Get the true longitude argument derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getLvDot in class Orbit
        Returns:
        d(v + ω + Ω)/dt true longitude argument derivative (rad/s)
        See Also:
        Orbit.hasDerivatives()
      • getLE

        public double getLE()
        Get the eccentric longitude argument.
        Specified by:
        getLE in class Orbit
        Returns:
        E + ω + Ω eccentric longitude argument (rad)
      • getLEDot

        public double getLEDot()
        Get the eccentric longitude argument derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getLEDot in class Orbit
        Returns:
        d(E + ω + Ω)/dt eccentric longitude argument derivative (rad/s)
        See Also:
        Orbit.hasDerivatives()
      • getLM

        public double getLM()
        Get the mean longitude argument.
        Specified by:
        getLM in class Orbit
        Returns:
        M + ω + Ω mean longitude argument (rad)
      • getLMDot

        public double getLMDot()
        Get the mean longitude argument derivative.

        If the orbit was created without derivatives, the value returned is Double.NaN.

        Specified by:
        getLMDot in class Orbit
        Returns:
        d(M + ω + Ω)/dt mean longitude argument derivative (rad/s)
        See Also:
        Orbit.hasDerivatives()
      • initPVCoordinates

        protected TimeStampedPVCoordinates initPVCoordinates()
        Compute the position/velocity coordinates from the canonical parameters.
        Specified by:
        initPVCoordinates in class Orbit
        Returns:
        computed position/velocity coordinates
      • shiftedBy

        public KeplerianOrbit shiftedBy​(double dt)
        Get a time-shifted orbit.

        The orbit can be slightly shifted to close dates. The shifting model is a Keplerian one if no derivatives are available in the orbit, or Keplerian plus quadratic effect of the non-Keplerian acceleration if derivatives are available. Shifting is not intended as a replacement for proper orbit propagation but should be sufficient for small time shifts or coarse accuracy.

        Specified by:
        shiftedBy in interface TimeShiftable<Orbit>
        Specified by:
        shiftedBy in class Orbit
        Parameters:
        dt - time shift in seconds
        Returns:
        a new orbit, shifted with respect to the instance (which is immutable)
      • interpolate

        public KeplerianOrbit interpolate​(AbsoluteDate date,
                                          Stream<Orbit> sample)
        Get an interpolated instance.

        Note that the state of the current instance may not be used in the interpolation process, only its type and non interpolable fields are used (for example central attraction coefficient or frame when interpolating orbits). The interpolable fields taken into account are taken only from the states of the sample points. So if the state of the instance must be used, the instance should be included in the sample points.

        Note that this method is designed for small samples only (say up to about 10-20 points) so it can be implemented using polynomial interpolation (typically Hermite interpolation). Using too much points may induce Runge's phenomenon and numerical problems (including NaN appearing).

        The interpolated instance is created by polynomial Hermite interpolation on Keplerian elements, without derivatives (which means the interpolation falls back to Lagrange interpolation only).

        As this implementation of interpolation is polynomial, it should be used only with small samples (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).

        If orbit interpolation on large samples is needed, using the Ephemeris class is a better way than using this low-level interpolation. The Ephemeris class automatically handles selection of a neighboring sub-sample with a predefined number of point from a large global sample in a thread-safe way.

        Parameters:
        date - interpolation date
        sample - sample points on which interpolation should be done
        Returns:
        a new instance, interpolated at specified date
      • computeJacobianMeanWrtCartesian

        protected double[][] computeJacobianMeanWrtCartesian()
        Compute the Jacobian of the orbital parameters with mean angle with respect to the Cartesian parameters.

        Element jacobian[i][j] is the derivative of parameter i of the orbit with respect to Cartesian coordinate j. This means each row correspond to one orbital parameter whereas columns 0 to 5 correspond to the Cartesian coordinates x, y, z, xDot, yDot and zDot.

        Specified by:
        computeJacobianMeanWrtCartesian in class Orbit
        Returns:
        6x6 Jacobian matrix
        See Also:
        Orbit.computeJacobianEccentricWrtCartesian(), Orbit.computeJacobianTrueWrtCartesian()
      • computeJacobianEccentricWrtCartesian

        protected double[][] computeJacobianEccentricWrtCartesian()
        Compute the Jacobian of the orbital parameters with eccentric angle with respect to the Cartesian parameters.

        Element jacobian[i][j] is the derivative of parameter i of the orbit with respect to Cartesian coordinate j. This means each row correspond to one orbital parameter whereas columns 0 to 5 correspond to the Cartesian coordinates x, y, z, xDot, yDot and zDot.

        Specified by:
        computeJacobianEccentricWrtCartesian in class Orbit
        Returns:
        6x6 Jacobian matrix
        See Also:
        Orbit.computeJacobianMeanWrtCartesian(), Orbit.computeJacobianTrueWrtCartesian()
      • computeJacobianTrueWrtCartesian

        protected double[][] computeJacobianTrueWrtCartesian()
        Compute the Jacobian of the orbital parameters with true angle with respect to the Cartesian parameters.

        Element jacobian[i][j] is the derivative of parameter i of the orbit with respect to Cartesian coordinate j. This means each row correspond to one orbital parameter whereas columns 0 to 5 correspond to the Cartesian coordinates x, y, z, xDot, yDot and zDot.

        Specified by:
        computeJacobianTrueWrtCartesian in class Orbit
        Returns:
        6x6 Jacobian matrix
        See Also:
        Orbit.computeJacobianMeanWrtCartesian(), Orbit.computeJacobianEccentricWrtCartesian()
      • addKeplerContribution

        public void addKeplerContribution​(PositionAngle type,
                                          double gm,
                                          double[] pDot)
        Add the contribution of the Keplerian motion to parameters derivatives

        This method is used by integration-based propagators to evaluate the part of Keplerian motion to evolution of the orbital state.

        Specified by:
        addKeplerContribution in class Orbit
        Parameters:
        type - type of the position angle in the state
        gm - attraction coefficient to use
        pDot - array containing orbital state derivatives to update (the Keplerian part must be added to the array components, as the array may already contain some non-zero elements corresponding to non-Keplerian parts)
      • toString

        public String toString()
        Returns a string representation of this Keplerian parameters object.
        Overrides:
        toString in class Object
        Returns:
        a string representation of this object