ThreeBodyGravity#

class ThreeBodyGravity(state_vector: StateArray, pnt_masses: list, base_frame: Frame)#

Bases: DynamicModel

Models third-body gravitational perturbations from one or more point masses.

For each listed point mass, the acceleration follows the standard three-body formulation:

\[\mathbf{a}_{3b} = \mu_i \left( \frac{\mathbf{r}_{\mathrm{body} \to i}}{\|\mathbf{r}_{\mathrm{body} \to i}\|^3} - \frac{\mathbf{r}_{\mathrm{origin} \to i}}{\|\mathbf{r}_{\mathrm{origin} \to i}\|^3} \right)\]

If a third body is propagated in the StateArray (i.e., its position is a dynamic state), its position is taken from current_state rather than from SPICE, enabling full coupled propagation. Each \(\mu_i\) can also be estimated as a solve-for parameter; when the state vector contains a ("gm", spice_id) entry for body \(i\), its value overrides the ephemeris default at each function evaluation.

Parameters:
  • state_vector (StateArray) – State vector of the primary spacecraft, used to determine the propagation origin and to identify any propagated third bodies.

  • pnt_masses (list of str) – Names of the point-mass bodies (matching keys in scarabaeus.Constants), e.g. ["SUN", "MOON"].

  • base_frame (Frame) – Reference frame in which accelerations are returned.

Raises:

ValueError – If the gravitational parameter units for any listed point mass are not in km³·s⁻².

See also

scarabaeus.PointMassGravity

Single-body Newtonian gravity.

scarabaeus.ForceModelTranslation

Aggregator that instantiates this model.

References

Vallado, D. A. Fundamentals of Astrodynamics and Applications, 4th Ed., Microcosm Press, 2013.

Attributes:
origin_mu

Gravitational parameter of the origin body in km³·s⁻².

origin_name

Name of the propagation-origin celestial body.

pnt_masses

Ordered list of point-mass body name strings (Constants keys).

ref_frame

Reference frame in which third-body accelerations are returned.

Methods

compute_acceleration(position, ...)

Compute third-body gravitational acceleration.

compute_acceleration(position: ndarray, current_state: dict, epoch: float, body: CelestialBody) ndarray#

Compute third-body gravitational acceleration.

If a third body is propagated in the state vector, its position is taken from current_state; otherwise SPICE is used.

property origin_mu: float#

Gravitational parameter of the origin body in km³·s⁻².

property origin_name: str#

Name of the propagation-origin celestial body.

property pnt_masses: list[str]#

Ordered list of point-mass body name strings (Constants keys).

property ref_frame: Frame#

Reference frame in which third-body accelerations are returned.