Gravity Engine 2 3.0
Loading...
Searching...
No Matches
GravityEngine2.LambertUniversal Class Reference

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< GEManeuverManeuvers (int centerId=-1)
 

Static Public Attributes

static string[] errorStr
 Compute the transfer for the setup via the constructor for the specified transit time dtsec.
 

Detailed Description

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

Member Enumeration Documentation

◆ ComputeError

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.

Parameters
reverse
df
nrev
xferTimetime for the transfer
rendezvous
Returns
error ()

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

Constructor & Destructor Documentation

◆ LambertUniversal() [1/2]

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.

Parameters
fromOrbit
toOrbit
shortPathTake shortest path along the ellipse (if xfer is an ellipse)

◆ LambertUniversal() [2/2]

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.

Parameters
_fromOrbit
r_from
r_to
shortPath

Member Function Documentation

◆ GetR2()

double3 GravityEngine2.LambertUniversal.GetR2 ( )

Get the final position of the Lambert trajectory. Typically used when doing a xfer with phasing.

Returns

◆ HitPlanetRadius()

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.

Parameters
radius

Member Data Documentation

◆ errorStr

string [] GravityEngine2.LambertUniversal.errorStr
static
Initial value:
= new string[]{"OK",
"G not converged",
"Y Negative",
"180 XFER NOT POSSIBLE",
"PLANET IMPACT" }

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.

Parameters
reversedirection of motion, true for reverse path (long way around)
dfControls intial guess, undocumented in Vallado. False seems to work.
nrevNumber of revolutions until transfer (typically 0)
dtsecRequired time of flight
Returns
error ()

error = 1; // g not converged error = 2; // y negative error = 3; // impossible 180 transfer
error = 4; // trajectory impacts planet radius specified with SetPlanetRadius()


The documentation for this class was generated from the following file: