An general orbit is often described by the six “classical orbital elements” (COE) as defined in the general case by the illustration below.
These can be thought of as four groups:
- Shape Parameters: The size of the semi-major axis (a) and the eccentricity (e).
- Orientation Of the Plane: The orientation of the orbital plane in space:
- Inclination: the angle the orbit is tilted from the XY plane (the angle the normal to the orbit makes with the z-axis). The points where the orbit crosses the XY plane are called nodes (ascending and descending)
- : The rotation of the nodes with respect to the X-axis in the XY plane. This parameter only make sense if there is an inclination. This is also referred to as RAAN (right ascension of the ascending node). It is the point at which the orbit crosses the XY plane in the +Z direction.
- Orientation of periapse (closest approach) within the plane
- : The rotation of the periapse in the orbital plane. This only makes sense when the orbit is not circular () i.e. there is a point of closest approach
- Position parameter: referred to as the true anomaly. The location on the orbit where the planet is positioned. This angle is measured from the position of the central body which is at one of the foci of the ellipse (and not from the center of the ellipse!).
Clearly there are some special cases and in those cases an alternate terminology may get used. (What follows is paraphrased from Vallado’s Fundamentals of Astrodynamics and Applications. Gravity engine relies heavily on this book and the algorithms within).
If the orbit is not inclined but is elliptical then the location of the periapsis can be viewed as , i.e. if the diagram above is flattened to . In this case the variable referred to as the longitude of perigee is sometimes specified instead. Within GE an orbit predictor will handle this case by putting the angle into the value and setting . To do this it must first determine if the inclination is close enough to zero to trigger this as a special case. The test checks for .
Determining Orbit Parameters in Gravity Engine
OrbitPredictor
The OrbitUniversal class specifies the initial parameters for an orbit. It allows the orbit to be specified in COE elements as well as a few variations. When an object with an OrbitUniversal in GRAVITY_ENGINE mode is added to GE the orbit parameters are converted in a position and velocity and then numerical evolution commences. If an OrbitPredictor is attached, it retrieves the position and velocity and computes the orbit parameters. Assuming there has been no gravitational influence from other bodies (i.e. the orbit has not changed) there are still some cases in which the parameters that are returned may not exactly match the initial values from the OrbitUniversal. These correspond to the special cases mentioned above.
The OrbitPredictor
code makes use of an OrbitUniversal
to determine the classical orbital elements. OrbitUniversal
in turn calls OrbitUtils.RVtoCOE
and gets back an OrbitElements
class which contains:
- raan: right ascension of ascending node (inclined orbit)
- argp: argument of perigee (inclined orbit)
- lonper: longitude of periapsis (when i=0)
- truelon: angular position for circular, non-inclined orbit
- arglat: angular position for the case where orbit is circular and inclined
- nu: true anomaly for the case where the orbit is non-circular and inclined.
In this context an orbit is considered non-inclined if the inclination is less than 1E-3.
An orbit is considered circular if the eccentricity is less than 1E-3.
The code in OrbitUniversal.RVtoCOEWrapper
tests to see if the orbit is circular and/or inclined and assigns values to , and phase as follows:
Eccentricity | Inclination | phase | ||
---|---|---|---|---|
e = 0 (circular) | i = 0 | 0 | 0 | truelon |
e = 0 (circular) | i != 0 (inclined) | raan | 0 | arglat |
e != 0 (elliptical) | i = 0 | 0 | lonper | nu |
e != 0 (elliptical) | i != 0 (inclined) | raan | argp | nu |
As an example of an orbit where the initial COE values in OrbitUniversal will not be retrieved via the OrbitPredictor values consider a non-inclined eccentric orbit in which the user sets and . The orbit predictor will report the parameters as and since it uses only in this special case. This is in fact the same orbit, just specified in a different form.