PointMassGravity#

class PointMassGravity(state_vector: StateArray, base_frame: Frame)#

Bases: DynamicModel

Models the gravitational acceleration due to a point mass source using Keplerian dynamics.

The gravitational acceleration is:

\[\mathbf{a} = -\frac{\mu}{\|\mathbf{r}\|^3}\,\mathbf{r}\]

where \(\mu\) is the gravitational parameter of the central body and \(\mathbf{r}\) is the position vector of the spacecraft relative to that body. The gravitational parameter \(\mu\) can be estimated as a solve-for parameter; when the state vector contains a ("gm", spice_id) entry, its value overrides the default at each function evaluation.

Parameters:
  • state_vector (StateArray) – State vector whose origin provides the central-body name, gravitational parameter, and SPICE ID.

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

See also

scarabaeus.StateArray

Represents state vectors with origin and reference frames.

References

Vallado, D. A. (2013). Fundamentals of Astrodynamics and Applications, 4th Ed. Montenbruck, O., & Gill, E. (2000). Satellite Orbits: Models, Methods, and Applications.

Attributes:
origin_mu

The gravitational parameter of the origin body.

origin_name

The name of the origin body.

ref_frame

The reference frame associated with the input state vector.

Methods

compute_acceleration(position, ...)

Computes the Keplerian acceleration acting on the spacecraft.

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

Computes the Keplerian acceleration acting on the spacecraft.

The acceleration follows the inverse-square law, where the gravitational force exerted by the central body is proportional to the inverse cube of the position vector magnitude.

Parameters:
  • position (np.ndarray) – 3x1 vector describing the spacecraft’s position relative to the central body. Assumed in units of kilometers.

  • current_state (dict) – Dictionary containing the current state parameters.

  • epoch (float) – Current simulation epoch in seconds.

  • body (CelestialBody) – The celestial body exerting the gravitational force.

Returns:

acc_vec – 3x1 vector describing the Keplerian acceleration. Assumed in \(\frac{km}{s^2}\).

Return type:

np.ndarray

property origin_mu: float#

The gravitational parameter of the origin body. Assumed in units of of \(\frac{km^3}{s^2}\).

property origin_name: str#

The name of the origin body.

property ref_frame: str#

The reference frame associated with the input state vector.