pyRTX.classes.Drag

Classes

Drag(spacecraft, crossectionLUT, density, ...)

A class for computing the drag acceleration on a spacecraft.

class pyRTX.classes.Drag.Drag(spacecraft, crossectionLUT, density, CD, body, precomputation=None)[source]

A class for computing the drag acceleration on a spacecraft.

__init__(spacecraft, crossectionLUT, density, CD, body, precomputation=None)[source]

Initializes the Drag object.

Parameters:
  • spacecraft (pyRTX.Spacecraft) – The spacecraft object.

  • crossectionLUT (pyRTX.classes.LookUpTable) – A lookup table of the spacecraft’s cross-sectional area.

  • density (callable) – A function that returns the atmospheric density in kg/km^3 as a function of altitude.

  • CD (float) – The drag coefficient of the spacecraft.

  • body (str) – The name of the celestial body causing the drag.

  • precomputation (pyRTX.classes.Precompute, optional) – A Precompute object with precomputed SPICE data.

compute(epochs, frame='', n_cores=None)[source]

Computes the drag acceleration for a series of epochs.

Parameters:
  • epochs (list of float) – A list of epochs in TDB seconds past J2000.

  • frame (str, optional) – The reference frame for the output acceleration. If not specified, the body-fixed frame of the celestial body is used.

  • n_cores (int, optional) – The number of CPU cores to use for parallel computation.

Returns:

A tuple containing two numpy arrays: the drag acceleration vectors and the relative velocity vectors.

Return type:

tuple

run(epoch)[source]

Computes the drag acceleration at a single epoch.

Parameters:

epoch (float) – The epoch in TDB seconds past J2000.

Returns:

A tuple containing the drag acceleration vector and the relative velocity vector.

Return type:

tuple