PointMassGravity#
- class PointMassGravity(origin: CelestialBody, 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:
- originCelestialBody
Central body: supplies the name, gravitational parameter and SPICE ID.
- base_frameFrame
Reference frame in which accelerations are returned.
- 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.
See also
scarabaeus.StateArrayRepresents state vectors with origin and reference frames.
References
[1]Vallado, D. A. (2013). Fundamentals of Astrodynamics and Applications, 4th Ed.
[2]Montenbruck, O., & Gill, E. (2000). Satellite Orbits: Models, Methods, and Applications.
- 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:
- positionnp.ndarray
3x1 vector describing the spacecraft’s position relative to the central body. Assumed in units of kilometers.
- current_statedict
Dictionary containing the current state parameters.
- epochfloat
Current simulation epoch in seconds.
- bodyCelestialBody
The celestial body exerting the gravitational force.
- Returns:
- acc_vecnp.ndarray
3x1 vector describing the Keplerian acceleration. Assumed in \(\frac{km}{s^2}\).