Class OsculatingElements

java.lang.Object
gaiasky.util.elements.OsculatingElements

public class OsculatingElements extends Object
Represent and manipulate osculating elements of the elliptic two-body problem. The class supports the representation in elliptical elements, or in position-velocity. Methods perform the transformation in both directions, solve the Kepler equation, propagate the motion to another date.
By default the central body is the Sun and the units are AU, AU day-1. The default GM (gravitational constant times mass) can be overridden by using the constructors taking mu as an argument.
  • Field Details

  • Constructor Details

    • OsculatingElements

      public OsculatingElements(double semiaxis, double eccent, double gamma, double bomega, double somega, double anom, double mu)
      The Constructor.
      Parameters:
      semiaxis - Semi-major axis.
      eccent - Eccentricity.
      gamma - Inclination (units: rad).
      bomega - Longitude of node (units: rad).
      somega - Argument of periastron (units: rad).
      anom - Mean anomaly (units: rad).
      mu - GM for the central body.
    • OsculatingElements

      public OsculatingElements(double[] elliptic, double mu)
      The Constructor.
      Parameters:
      elliptic - Six elliptic elements, in the following order: a, e, i, omega, pi, M.
      mu - GM for the central body.
      Throws:
      IllegalArgumentException - if the length of is different from 6.
    • OsculatingElements

      public OsculatingElements(double[] elliptic)
      Assuming the Sun is the central body.
      Parameters:
      elliptic - Six elliptic elements, in the following order: a, e, i, omega, pi, M.
    • OsculatingElements

      public OsculatingElements(double semiaxis, double eccent, double gamma, double bomega, double somega, double anom)
      Assuming the Sun is the central body.
      Parameters:
      semiaxis - Semi-major axis.
      eccent - Eccentricity.
      gamma - Inclination (units: rad).
      bomega - Longitude of node (units: rad).
      somega - Argument of periastron (units: rad).
      anom - Mean anomaly (units: rad).
    • OsculatingElements

      public OsculatingElements(Vector3d pos, Vector3d vel)
      Create elliptic elements from position-velocity, assuming the Sun as the central body.
      Parameters:
      pos - Position.
      vel - Velocity.
    • OsculatingElements

      public OsculatingElements(double mu, Vector3d pos, Vector3d vel)
      Create elliptic elements from position-velocity.
      Parameters:
      mu - GM.
      pos - Position.
      vel - Velocity.
  • Method Details

    • toElliptic

      public static double[] toElliptic(double mu, Vector3d pos, Vector3d vel)
      Compute elliptic elements corresponding to the given Cartesian representation.
      Parameters:
      mu - GM.
      pos - Position.
      vel - Velocity.
      Returns:
      the six elliptic elements in an array (order: a, e, i, node, pericenter, mean anomaly).
    • toCartesian

      public Vector3d[] toCartesian()
      Transform elliptic element into position and velocity vector.

      Units are set by the choice of GM. By default GM = k2; hence, the units are AU, and AU day-1 (k = GAUSS_CONSTANT). Another choice can be GM = 4 pi2; hence, the units will be AU, AU year-1. For an Earth satellite: GM = EARTH_GM with units m and m s-1.

      Returns:
      a Vector3d[2] with position in [0] and velocity in [1].
    • advanceTwoBody

      public Vector3d[] advanceTwoBody(double xanom)
      Advance a position-velocity vector at a new mean anomaly. It is optimized for quick computation in the final reference frame. See toCartesian for a discussion on the units.
      Parameters:
      xanom - Mean anomaly at which the motion is propagated (units: rad).
      Returns:
      a Vector3d[2] with position in [0] and velocity in [1].
    • getElements

      public double[] getElements()
      Gets the elements.
      Returns:
      the six elliptic elements of this object in an array (order: a, e, i, node, pericenter, mean anomaly).
    • getSemiMajorAxis

      public double getSemiMajorAxis()
      Gets the semi major axis.
      Returns:
      the semi-major axis.
    • getEccentricity

      public double getEccentricity()
      Gets the eccentricity.
      Returns:
      the eccentricity.
    • getInclination

      public double getInclination()
      Gets the inclination.
      Returns:
      the inclination (units: rad).
    • getNode

      public double getNode()
      Gets the node.
      Returns:
      the longitude of node (units: rad).
    • getPericenter

      public double getPericenter()
      Gets the pericenter.
      Returns:
      the argument of pericenter (units: rad).
    • getMeanAnomaly

      public double getMeanAnomaly()
      Gets the mean anomaly.
      Returns:
      the mean anomaly (units: rad).
    • getMu

      public double getMu()
      Gets the mu.
      Returns:
      the GM.
    • getPositionAtPericenter

      public Vector3d getPositionAtPericenter()
      Gets the position at pericenter.
      Returns:
      the position at pericenter.
    • getVelocityAtPericenter

      public Vector3d getVelocityAtPericenter()
      Gets the velocity at pericenter.
      Returns:
      the velocity at pericenter.