Gravity Engine 2 5.1
|
Calculate the universal Lambert transfer. This algorithm allows the transfer to be elliptic or hyperbolic as necessary to meet the designated transfer time. The transfer code can be used to determine the minimum energy transfer between the desired points/orbits - in this case the time of transfer is not specified. Additional API calls can be used to request a specific transfer time. It is frquently useful to obtain the most efficient transfer time and then use this as a baseline from which to investigate the dV cost of faster transfers. More...
Public Types | |
enum | ComputeError { OK , G_NOT_CONVERGED , Y_NEGATIVE , XFER_180 , IMPACT , PROP_ERR } |
Determine the Lambert transfer in the specified time to the position that target object will be at in that time. If the rendezvous flag is set, then a GEManeuver will be generated to match the target. If not set then the ship will intercept the target. More... | |
Public Member Functions | |
LambertUniversal (Orbital.COE fromOrbit, double3 r_to, bool retrograde) | |
Create a Lambert transfer from a given NBody orbit to a position in physics space. | |
LambertUniversal (Orbital.COE fromOrbit, Orbital.COE toOrbit, bool retrograde=false) | |
Setup for Lambert Universal construction. Calculation is done via ComputeXfer and may be done more than once for different transit times. | |
void | ClearPlanetRadius () |
ComputeError | ComputeXfer (double xferTime, LambertMode mode, bool retrograde=false, bool df=false, int nrev=0) |
double | DeltaV () |
double | GetMinTime () |
double3 | GetR2 () |
Get the final position of the Lambert trajectory. Typically used when doing a xfer with phasing. | |
void | HitPlanetRadius (double radius) |
Set the radius of the planet around which transfer is to be computed. A check to see if the xfer path hits the planet is conducted and a status of IMPACT is returned if there is a hit. | |
List< GEManeuver > | Maneuvers (int centerId=-1) |
Static Public Attributes | |
static string[] | errorStr |
Compute the transfer for the setup via the constructor for the specified transit time dtsec. | |
Calculate the universal Lambert transfer. This algorithm allows the transfer to be elliptic or hyperbolic as necessary to meet the designated transfer time. The transfer code can be used to determine the minimum energy transfer between the desired points/orbits - in this case the time of transfer is not specified. Additional API calls can be used to request a specific transfer time. It is frquently useful to obtain the most efficient transfer time and then use this as a baseline from which to investigate the dV cost of faster transfers.
Usage of this class differs from the the other orbit transfer classes. The constructor is used to provide initial details in one of several ways: fromOrbit/toOrbit: use this when the goal is to attain the toOrbit or rendezvous with an object in the toOrbit
fromOrbit/R-to: use when want to get to the specific point R_to
Both constructors will invoke ComputeMinTime() and determine the minimum transfer time. This is then retrieved by: GetTMin()
Calls to ComputeXfer() are then used to calculate the GEManeuvers required for the specified transfer time.
This algorithm does not provide an answer when the transfer is 180 degrees (Battin is a good alternative in this case).
This algorithm is more general than the Lambert minimum energy solution since it provides the path for a specified time of flight and also the final velocity.
Code adapted from Vallado, Fundamentals of Astrophysics and Applications https://celestrak.com/software/vallado-sw.asp
Determine the Lambert transfer in the specified time to the position that target object will be at in that time. If the rendezvous flag is set, then a GEManeuver will be generated to match the target. If not set then the ship will intercept the target.
This method requires that the class was created with the constructor that defines toOrbit.
In some cases the transfer trajectory may intersect the central body. This can optionally be checked if the API SetPlanetRadius() is called prior to the use of this method. If the requested trajectory hits the planet an error code 4.
reverse | |
df | |
nrev | |
xferTime | time for the transfer |
rendezvous |
error = 1; // g not converged error = 2; // y negative error = 3; // impossible 180 transfer
error = 4; // trajectory impacts planet radius specified with SetPlanetRadius()
error = 5; target prop errir
GravityEngine2.LambertUniversal.LambertUniversal | ( | Orbital::COE | fromOrbit, |
Orbital::COE | toOrbit, | ||
bool | retrograde = false ) |
Setup for Lambert Universal construction. Calculation is done via ComputeXfer and may be done more than once for different transit times.
Initial conditions are passed in when created.
The transfer assumes there is an active NBody at the fromOrbit to be GEManeuvered to the orbit specified by the toOrbit. If the toOrbit has a NBody, then it is used as the target point, otherwise the phase in the targetOrbit is used to designate a target point. One of the from/to orbit data elements must have a centerNBody.
The time for a minimum energy transfer is computed using the provided value of shortPath.
fromOrbit | |
toOrbit | |
shortPath | Take shortest path along the ellipse (if xfer is an ellipse) |
GravityEngine2.LambertUniversal.LambertUniversal | ( | Orbital::COE | fromOrbit, |
double3 | r_to, | ||
bool | retrograde ) |
Create a Lambert transfer from a given NBody orbit to a position in physics space.
The constructor will compute the minimum energy transfer to the point taking the shortest path setting into account. The time for the transfer can then be retreived.
_fromOrbit | |
r_from | |
r_to | |
shortPath |
double3 GravityEngine2.LambertUniversal.GetR2 | ( | ) |
Get the final position of the Lambert trajectory. Typically used when doing a xfer with phasing.
void GravityEngine2.LambertUniversal.HitPlanetRadius | ( | double | radius | ) |
Set the radius of the planet around which transfer is to be computed. A check to see if the xfer path hits the planet is conducted and a status of IMPACT is returned if there is a hit.
radius |
|
static |
Compute the transfer for the setup via the constructor for the specified transit time dtsec.
This determines the GEManeuvers requires and places them in the parent classes GEManeuver list. They can be retrieved by GetGEManeuvers().
There will be 1 or 2 GEManeuvers depending on the configuration. If a target orbit is specified and the mode is not intercept then a second GEManeuver will be used to attain the desired target orbit.
The algorithm used comes from Vallado 4th edition Algorithm 58 (p492).
Note: Unlike the min. energy calculation it does NOT require r1 < r2.
reverse | direction of motion, true for reverse path (long way around) |
df | Controls intial guess, undocumented in Vallado. False seems to work. |
nrev | Number of revolutions until transfer (typically 0) |
dtsec | Required time of flight |
error = 1; // g not converged error = 2; // y negative error = 3; // impossible 180 transfer
error = 4; // trajectory impacts planet radius specified with SetPlanetRadius()