public class LambertOrbitSolver extends Object
For the fixed duration based methods the solver uses the following default values:
Convergence tolerance: 1e-13.
Maximum solver iterations: 30.
Number of terms in continuous fraction calculations: 20.
Altering these values is generally not recommended.
For solving orbits that entail 180 degree transfers the orbital plane is ambiguous. Some methods take an orbital plane vector to define the plane that the transfer takes place in. This vector is crossed with the initial position vector to obtain the orbital plane. This vector is usually the initial velocity vector. If no vector is supplied and a 180 degree transfer is indicated, the algorithm will create an orbital plane vector based on the largest components of the initial position vector.
The implementation of this solver is based upon the analysis and mathematics contained in the text, "An Introduction to the Mathematics and Methods of Astrodynamics", R. Battin, 1987 and in the paper, "A Fast and Robust Multiple Revolution Lambert Algorithm Using a Cosine Transformation", N. Arora and R. Russell, AAS 13-728.
Modifier and Type | Class and Description |
---|---|
static class |
LambertOrbitSolver.FailedToConvergeEventArgs
|
Constructor and Description |
---|
LambertOrbitSolver()
Initializes a Lambert solver.
|
LambertOrbitSolver(double gravitationalParameter)
Initializes a Lambert solver.
|
LambertOrbitSolver(double gravitationalParameter,
double centralBodyRadius,
double convergenceTolerance,
int maximumIterations,
int fractionMaximumDepth)
Initializes a Lambert solver.
|
Modifier and Type | Method and Description |
---|---|
void |
addFailedToConvergeEvent(EventHandler<LambertOrbitSolver.FailedToConvergeEventArgs> value)
Adds a handler for an event that is raised when the fixed duration method fails to converge.
|
double |
getCentralBodyRadius()
Gets the central body's radius which is used in the calculations to denote the surface.
|
double |
getGravitationalParameter()
Gets the gravitational parameter of the central body, about which the solver is used.
|
agi.foundation.compatibility.Tuple2<Cartesian,Cartesian> |
lambertHodograph(Cartesian r1,
Cartesian r2,
Cartesian v1,
double semilatusRectum,
double eccentricity,
double changeInTrueAnomaly,
double timeOfFlight)
This function accomplishes 180 deg transfer(and 360 deg) for the Lambert problem.
|
void |
removeFailedToConvergeEvent(EventHandler<LambertOrbitSolver.FailedToConvergeEventArgs> value)
Removes a handler for an event that is raised when the fixed duration method fails to converge.
|
void |
setCentralBodyRadius(double value)
Sets the central body's radius which is used in the calculations to denote the surface.
|
void |
setGravitationalParameter(double value)
Sets the gravitational parameter of the central body, about which the solver is used.
|
LambertResult |
solveFixedDurationTransfer(Cartesian initialPosition,
Cartesian finalPosition,
Duration timeOfFlight,
int numberOfRevolutions,
LambertPathType pathType,
OrbitDirectionType directionOfFlight)
Solves the classic Lambert problem with the specified number of revolutions.
|
LambertResult |
solveFixedDurationTransfer(Cartesian initialPosition,
Cartesian finalPosition,
Duration timeOfFlight,
int numberOfRevolutions,
LambertPathType pathType,
OrbitDirectionType directionOfFlight,
Cartesian orbitalPlaneVector)
Solves the classic Lambert problem with the specified number of revolutions.
|
LambertResult |
solveMinimumDurationMultipleRevolutionTransfer(Cartesian initialPosition,
Cartesian finalPosition,
int numberOfRevolutions,
LambertPathType pathType,
OrbitDirectionType directionOfFlight)
Solves the constrained Lambert problem given the input.
|
LambertResult |
solveMinimumDurationMultipleRevolutionTransfer(Cartesian initialPosition,
Cartesian finalPosition,
int numberOfRevolutions,
LambertPathType pathType,
OrbitDirectionType directionOfFlight,
Cartesian orbitalPlaneVector)
Solves the constrained Lambert problem given the input.
|
LambertResult |
solveMinimumEccentricityTransfer(Cartesian initialPosition,
Cartesian finalPosition)
Solves the constrained Lambert problem given the input.
|
LambertResult |
solveMinimumEccentricityTransfer(Cartesian initialPosition,
Cartesian finalPosition,
Cartesian orbitalPlaneVector)
Solves the constrained Lambert problem given the input.
|
LambertResult |
solveMinimumEnergyTransfer(Cartesian initialPosition,
Cartesian finalPosition)
Solves the constrained Lambert problem given the input.
|
LambertResult |
solveMinimumEnergyTransfer(Cartesian initialPosition,
Cartesian finalPosition,
Cartesian orbitalPlaneVector)
Solves the constrained Lambert problem given the input.
|
LambertResult |
solveParabolicTransfer(Cartesian initialPosition,
Cartesian finalPosition,
OrbitDirectionType directionOfFlight)
Solves the constrained Lambert problem given the input.
|
LambertResult |
solveParabolicTransfer(Cartesian initialPosition,
Cartesian finalPosition,
OrbitDirectionType directionOfFlight,
Cartesian orbitalPlaneVector)
Solves the constrained Lambert problem given the input.
|
public LambertOrbitSolver()
GravitationalParameter
(get
/ set
) is set to
Earth's from WorldGeodeticSystem1984
. The CentralBodyRadius
(get
/ set
) is
set to WorldGeodeticSystem1984.SemimajorAxis
.public LambertOrbitSolver(double gravitationalParameter)
CentralBodyRadius
(get
/ set
) is
set to WorldGeodeticSystem1984.SemimajorAxis
.gravitationalParameter
- The gravitational parameter for the central body about which the transfer orbit is calculated.public LambertOrbitSolver(double gravitationalParameter, double centralBodyRadius, double convergenceTolerance, int maximumIterations, int fractionMaximumDepth)
This constructor is intended for advanced uses only. The defaults for convergence tolerance, maximum iterations, and maximum fraction depth are ideal for most use cases.
gravitationalParameter
- The gravitational parameter for the central body about which the orbit is being determined.centralBodyRadius
- The radius of the central body about which the orbit is being determined.convergenceTolerance
- The convergence tolerance for fixed duration method.maximumIterations
- The maximum number of iterations for the fixed duration method.fractionMaximumDepth
- The maximum number of terms in the continuing fraction computations.public final double getGravitationalParameter()
public final void setGravitationalParameter(double value)
public final double getCentralBodyRadius()
public final void setCentralBodyRadius(double value)
public final void addFailedToConvergeEvent(EventHandler<LambertOrbitSolver.FailedToConvergeEventArgs> value)
value
- The handler.public final void removeFailedToConvergeEvent(EventHandler<LambertOrbitSolver.FailedToConvergeEventArgs> value)
value
- The handler.@Nonnull public final LambertResult solveMinimumEccentricityTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition)
This method does not include an orbital plane vector used for transfers spanning π in angle subtended.
initialPosition
- The first position in the transfer orbit.finalPosition
- The final position in the transfer orbit.@Nonnull public final LambertResult solveMinimumEccentricityTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition, @Nonnull Cartesian orbitalPlaneVector)
initialPosition
- The first position in the transfer orbit.finalPosition
- The final position in the transfer orbit.orbitalPlaneVector
- A vector that is used in conjunction with the initial position of the spacecraft to define the orbital plane in the case of ambiguity.
Typically, the velocity at the initial position if known.@Nonnull public final LambertResult solveMinimumEnergyTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition)
This method does not include an orbital plane vector used for transfers spanning π in angle subtended.
initialPosition
- The first position in the transfer orbit.finalPosition
- The final position in the transfer orbit.@Nonnull public final LambertResult solveMinimumEnergyTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition, @Nonnull Cartesian orbitalPlaneVector)
initialPosition
- The first position in the transfer orbit.finalPosition
- The final position in the transfer orbit.orbitalPlaneVector
- A vector that is used in conjunction with the initial position of the spacecraft to define the orbital plane in the case of ambiguity.
Typically, the velocity at the initial position if known.@Nonnull public final LambertResult solveParabolicTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition, @Nonnull OrbitDirectionType directionOfFlight)
The parabolic solution is useful in providing a minimum bound for the duration of zero-revolution elliptical transfers between the two positions.
This method does not include an orbital plane vector used for transfers spanning π in angle subtended.
initialPosition
- The starting position of the orbit/transfer.finalPosition
- The ending position of the orbit/transfer.directionOfFlight
- Determines if the flight path is prograde or retrograde.@Nonnull public final LambertResult solveParabolicTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition, @Nonnull OrbitDirectionType directionOfFlight, @Nonnull Cartesian orbitalPlaneVector)
The parabolic solution is useful in providing a minimum bound for the duration of zero-revolution elliptical transfers between the two positions.
initialPosition
- The starting position of the orbit/transfer.finalPosition
- The ending position of the orbit/transfer.directionOfFlight
- Determines if the flight path is prograde or retrograde.orbitalPlaneVector
- A vector that is used in conjunction with the initial position of the spacecraft to define the orbital plane in the case of ambiguity.
Typically, the velocity at the initial position if known.@Nonnull public final LambertResult solveMinimumDurationMultipleRevolutionTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition, int numberOfRevolutions, @Nonnull LambertPathType pathType, @Nonnull OrbitDirectionType directionOfFlight)
The minimum-duration, multiple-revolution solution is useful for providing a minimum bound on the possible durations of orbits that have the desired number of revolutions.
Multiple revolution transfers spanning odd multiples of π in angle subtended (e.g. 3pi, 5pi, etc.) are difficult for the solver to calculate, so loosening the tolerances or increasing the iteration count may be necessary for convergence if the vectors are separated by angles that are close to odd multiples of pi.
Furthermore, this method does not include an orbital plane vector used for those transfers.
initialPosition
- The starting position of the orbit/transfer.finalPosition
- The ending position of the orbit/transfer.numberOfRevolutions
- The number of revolutions to reach the final position.pathType
- Specifies whether the Lambert algorithm should take the smaller or large semi-major axis path when the revolution count is greater than 0.directionOfFlight
- Determines if the flight path is prograde or retrograde.ArgumentOutOfRangeException
- Thrown if the numberOfRevolutions
is zero.@Nonnull public final LambertResult solveMinimumDurationMultipleRevolutionTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition, int numberOfRevolutions, @Nonnull LambertPathType pathType, @Nonnull OrbitDirectionType directionOfFlight, @Nonnull Cartesian orbitalPlaneVector)
The minimum-duration, multiple-revolution solution is useful for providing a minimum bound on the possible durations of orbits that have the desired number of revolutions.
Multiple revolution transfers spanning odd multiples of π in angle subtended (e.g. 3pi, 5pi, etc.) are difficult for the solver to calculate, so loosening the tolerances or increasing the iteration count may be necessary for convergence if the vectors are separated by angles that are close to odd multiples of pi.
initialPosition
- The starting position of the orbit/transfer.finalPosition
- The ending position of the orbit/transfer.numberOfRevolutions
- The number of revolutions to reach the final position.pathType
- Specifies whether the Lambert algorithm should take the smaller or large semi-major axis path when the revolution count is greater than 0.directionOfFlight
- Determines if the flight path is prograde or retrograde.orbitalPlaneVector
- A vector that is used in conjunction with the initial position of the spacecraft to define the orbital plane in the case of ambiguity.
Typically, the velocity at the initial position if known.ArgumentOutOfRangeException
- Thrown if the numberOfRevolutions
is zero.@Nonnull public final LambertResult solveFixedDurationTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition, @Nonnull Duration timeOfFlight, int numberOfRevolutions, @Nonnull LambertPathType pathType, @Nonnull OrbitDirectionType directionOfFlight)
This method does not include an orbital plane vector used for transfers spanning π in angle subtended.
initialPosition
- The starting position of the orbit/transfer.finalPosition
- The ending position of the orbit/transfer.timeOfFlight
- The Duration
taken between the initial and final points.numberOfRevolutions
- The number of revolutions to reach the final position.pathType
- Specifies whether the Lambert algorithm should take the smaller or large semi-major axis path when the revolution count is greater than 0.directionOfFlight
- Determines if the flight path is prograde or retrograde.@Nonnull public final LambertResult solveFixedDurationTransfer(@Nonnull Cartesian initialPosition, @Nonnull Cartesian finalPosition, @Nonnull Duration timeOfFlight, int numberOfRevolutions, @Nonnull LambertPathType pathType, @Nonnull OrbitDirectionType directionOfFlight, @Nonnull Cartesian orbitalPlaneVector)
initialPosition
- The starting position of the orbit/transfer.finalPosition
- The ending position of the orbit/transfer.timeOfFlight
- The Duration
taken between the initial and final points.numberOfRevolutions
- The number of revolutions to reach the final position.pathType
- Specifies whether the Lambert algorithm should take the smaller or large semi-major axis path when the revolution count is greater than 0.directionOfFlight
- Determines if the flight path is prograde or retrograde.orbitalPlaneVector
- A vector that is used in conjunction with the initial position of the spacecraft to define the orbital plane in the case of ambiguity.
Typically, the velocity at the initial position if known.@Nonnull public final agi.foundation.compatibility.Tuple2<Cartesian,Cartesian> lambertHodograph(@Nonnull Cartesian r1, @Nonnull Cartesian r2, @Nonnull Cartesian v1, double semilatusRectum, double eccentricity, double changeInTrueAnomaly, double timeOfFlight)
Thompson Journal of Guidance, Control, and Dynamics 2013 v34 n6 1925. Thompson AAS GNC 2018. D. Vallado.
r1
- The chase/initial position.r2
- The target/final position.v1
- The chase/input vector used to determine the orbital plane.semilatusRectum
- An orbital parameter.eccentricity
- The eccentricity.changeInTrueAnomaly
- The change in true anomaly.timeOfFlight
- The time of flight.