public final class LifetimeElements extends Object implements ICloneWithContext
LifetimeOrbitPropagator
to represent the
approximate mean classical elements associated with the periapsis of each successive
orbit over the course of a satellite's lifetime.Constructor and Description |
---|
LifetimeElements(JulianDate epoch,
int orbitCount,
double semimajorAxis,
double semimajorAxisRate,
double eccentricity,
double eccentricityRate,
double inclination,
double inclinationRate,
double argumentOfPeriapsis,
double argumentOfPeriapsisRate,
double rightAscensionOfAscendingNode,
double rightAscensionOfAscendingNodeRate,
double siderealPeriod,
double gravitationalParameter)
Initialize a set of lifetime orbit elements to represent one orbit pass.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone(CopyContext context)
Clones this object using the specified context.
|
double |
getArgumentOfPeriapsis()
Gets the argument of periapsis of the orbit, in radians.
|
double |
getArgumentOfPeriapsisRate()
Gets the current rate of change of the
ArgumentOfPeriapsis (get ), in radians per second. |
double |
getEccentricity()
Gets the eccentricity of the orbit.
|
double |
getEccentricityRate()
Gets the current rate of change of the
Eccentricity (get ), in units per second. |
double |
getGravitationalParameter()
Gets the gravitational parameter used for this element set (distance cubed per time squared).
|
double |
getInclination()
Gets the inclination of the orbit, in radians.
|
double |
getInclinationRate()
Gets the current rate of change of the
Inclination (get ), in radians per second. |
int |
getOrbitCount()
Gets the number of orbits produced by the propagator from the initial conditions to the current elements.
|
double |
getRightAscensionOfAscendingNode()
Gets the right ascension of the ascending node of the orbit, in radians.
|
double |
getRightAscensionOfAscendingNodeRate()
Gets the current rate of change of the
RightAscensionOfAscendingNode (get ), in radians per second. |
double |
getSemimajorAxis()
Gets the semimajor axis of the orbit, in meters.
|
double |
getSemimajorAxisRate()
Gets the current rate of change of the
SemimajorAxis (get ), in meters per second. |
double |
getSiderealPeriod()
Gets the approximate orbit period, in seconds, for the current orbit pass.
|
JulianDate |
getTimeOfPeriapsis()
Gets the time at the periapsis of this orbit pass.
|
KeplerianElements |
toKeplerianMeanElements()
Convert these elements to an equivalent
KeplerianElements representation at the periapsis. |
public LifetimeElements(@Nonnull JulianDate epoch, int orbitCount, double semimajorAxis, double semimajorAxisRate, double eccentricity, double eccentricityRate, double inclination, double inclinationRate, double argumentOfPeriapsis, double argumentOfPeriapsisRate, double rightAscensionOfAscendingNode, double rightAscensionOfAscendingNodeRate, double siderealPeriod, double gravitationalParameter)
The classification of the OrbitType
is exact so that if the user wants this instance of KeplerianElements
to be classified as a Circular orbit, the eccentricity
must be exactly zero.
For parabolic or hyperbolic orbits, see ModifiedKeplerianElements
.
epoch
- The time at periapsis.orbitCount
- The number of orbits, including this one, since the reference epoch.semimajorAxis
- Semimajor axis, in meters.semimajorAxisRate
- The rate of change of the semimajor axis, in meters per second.eccentricity
- Eccentricity.eccentricityRate
- The rate of change of the eccentricity, in units per second.inclination
- Inclination, in radians.inclinationRate
- The rate of change of the inclination, in radians per second.argumentOfPeriapsis
- Argument of periapsis, in radians.argumentOfPeriapsisRate
- The rate of change of the argument of periapsis, in radians per second.rightAscensionOfAscendingNode
- Right ascension of the ascending node, in radians.rightAscensionOfAscendingNodeRate
- The rate of change of the right ascension of the ascending node, in radians per second.siderealPeriod
- The time required to make one full orbit with respect to inertial space, in seconds.gravitationalParameter
- Gravitational parameter (meters cubed per second squared).ArgumentOutOfRangeException
- The given elements must represent a closed orbit. The exception
is thrown if the eccentricity is negative, not below unity, or if the semimajor axis is not finitely positive.
For other orbit types, use ModifiedKeplerianElements
.ArgumentOutOfRangeException
- The semimajor axis cannot be zero or nearly zero. Thrown if
semimajorAxis
is < Constants.Epsilon8
.ArgumentOutOfRangeException
- Thrown if the inclination
is less than zero or greater than Pi radians.public final Object clone(CopyContext context)
This method should be implemented to call a copy constructor on the class of the
object being cloned. The copy constructor should take the CopyContext
as a parameter
in addition to the existing instance to copy. The copy constructor should first call
CopyContext.addObjectMapping(T, T)
to identify the newly constructed instance
as a copy of the existing instance. It should then copy all fields, using
CopyContext.updateReference(T)
to copy any reference fields.
A typical implementation of ICloneWithContext
:
public static class MyClass implements ICloneWithContext {
public MyClass(MyClass existingInstance, CopyContext context) {
context.addObjectMapping(existingInstance, this);
someReference = context.updateReference(existingInstance.someReference);
}
@Override
public final Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
}
In general, all fields that are reference types should be copied with a call to
CopyContext.updateReference(T)
. There are a couple of exceptions:
If one of these exceptions applies, the CopyContext
should be given an opportunity
to update the reference before the reference is copied explicitly. Use
CopyContext.updateReference(T)
to update the reference. If CopyContext.updateReference(T)
returns
the original object, indicating that the context does not have a replacement registered,
then copy the object manually by invoking a Clone method, a copy constructor, or by manually
constructing a new instance and copying the values.
alwaysCopy = context.updateReference(existingInstance.alwaysCopy);
if (existingInstance.alwaysCopy != null && alwaysCopy == existingInstance.alwaysCopy) {
alwaysCopy = (AlwaysCopy) existingInstance.alwaysCopy.clone(context);
}
If you are implementing an evaluator (a class that implements IEvaluator
), the
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
method shares some responsibilities with the
copy context constructor. Code duplication can be avoided by doing the following:
CopyContext.updateReference(T)
. You should still call CopyContext.updateReference(T)
on any references to
non-evaluators.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as the last line in the constructor and pass it the
same CopyContext
passed to the constructor.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as normal. See the reference documentation for
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
for more information on implementing that method.
public MyClass(MyClass existingInstance, CopyContext context) {
super(existingInstance, context);
someReference = context.updateReference(existingInstance.someReference);
evaluatorReference = existingInstance.evaluatorReference;
updateEvaluatorReferences(context);
}
@Override
public void updateEvaluatorReferences(CopyContext context) {
evaluatorReference = context.updateReference(evaluatorReference);
}
@Override
public Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
private IEvaluator evaluatorReference;
clone
in interface ICloneWithContext
context
- The context to use to perform the copy.@Nonnull public final JulianDate getTimeOfPeriapsis()
public final int getOrbitCount()
public final double getSemimajorAxis()
public final double getEccentricity()
Eccentricity e can be calculated on the basis of semimajor axis a and semiminor axis b as follows:
e = sqrt(1 - (b / a)^2)
Referring to the following diagram, e
can also be expressed as a / f
, where f
is the distance from the center of the ellipse to the center of mass of the central body:
public final double getInclination()
The inclination of the orbit is its tilt with reference to the Equatorial plane, or, in the diagram below, the angle i between the central body's spin (Z) axis and the orbit's angular momentum vector.
In the above diagram, ω is the argument of periapsis, θ is the true anomaly, and Ω is the right ascension of the ascending node (RAAN).
public final double getArgumentOfPeriapsis()
The argument of periapsis, ω, is the angular distance between the ascending node and periapsis:
In the above diagram, Ω is the right ascension of the ascending node (RAAN), θ is the true anomaly, and i is the inclination.
public final double getRightAscensionOfAscendingNode()
The ascending node is the point where the satellite crosses the equator moving south to north. In the diagram below, this point is referenced from the +X direction, which points in the Vernal Equinox direction. The angle between the X axis and the ascending node is called the right ascension of the ascending node (RAAN), represented here by Ω.
In the above diagram, ω is the argument of periapsis, θ is the true anomaly, and i is the inclination.
public final double getGravitationalParameter()
public final double getSiderealPeriod()
public final double getEccentricityRate()
Eccentricity
(get
), in units per second.public final double getSemimajorAxisRate()
SemimajorAxis
(get
), in meters per second.public final double getInclinationRate()
Inclination
(get
), in radians per second.public final double getArgumentOfPeriapsisRate()
ArgumentOfPeriapsis
(get
), in radians per second.public final double getRightAscensionOfAscendingNodeRate()
RightAscensionOfAscendingNode
(get
), in radians per second.public final KeplerianElements toKeplerianMeanElements()
KeplerianElements
representation at the periapsis.