PointMassGravity#
- class PointMassGravity(state_vector: StateArray, base_frame: Frame)#
Bases:
DynamicModelModels 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 whoseoriginprovides the central-body name, gravitational parameter, and SPICE ID.base_frame (
Frame) – Reference frame in which accelerations are returned.
See also
scarabaeus.StateArrayRepresents 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_muThe gravitational parameter of the origin body.
origin_nameThe name of the origin body.
ref_frameThe 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