-
Notifications
You must be signed in to change notification settings - Fork 0
Physics Functions
This page covers the various functions defined to compute specific physical quantities, and are largely defined for convenience. Also included on this page are the two functions related to making patched-conic approximations when a simulated satellite crosses a celestial body's gravitational sphere of influence (SOI).
The conic patching functions are defined to streamline the otherwise tedious process of copying a system and computing the new trajectory of a satellite which has crossed a massive object's SOI.
For sake of clarity, we will refer to the dominant gravitational source as a star (
The escape
function takes two Satellite
objects (one is the object on an escape trajectory (the satellite), the other is the initial primary of the former (the planet)) and computes the new state of the system at the time of a satellite escaping a more massive satellite's SOI, and finally returns a new System
object with the relevant conic sections patched.
Making the patched conic approximation for a satellite escaping a SOI is pretty straightforward vector addition, though admittedly, it is difficult to represent mathematically in a neat fashion:
Translated to English, the position of the satellite with respect to (abbr. wrt) the star is the sum of the position of the planet to the star and the position of the satellite with respect to the planet, and same goes for finding the velocity vector. From here, the trajectory parameters are calculated using the cartesian_2_keplerian
function, which returns the six Keplerian orbital elements of the satellite in its trajectory relative to the star.
When it comes to a satellite on a trajectory around a star, when the satellite enters (encounters) the SOI of a planet, the patched conic approximation dictates that the satellite is only influenced by the gravitational force of the planet. In reality, this is inaccurate; any object with mass experiences the gravitational force from another object with mass regardless of the distance between the two. In practice, the scale of the numbers we're working with is so great that the force of gravity from a more distant, more massive body is effectively negligible for short-term considerations. Conversely, this discrepancy does play a role in the long-term evolution of a multiple-body system, like those resulting in the evolution of planetary orbits over the course of millions of years, or the very gradual increase of the Moon's semi-major axis in it orbit around Earth.
Similar to the previous function, determination of the satellite's new trajectory about the encountered planet can be determined via basic vector operations, transforming the relative position and velocity vectors from the star's reference frame to the planet's:
In English, the position of the satellite with respect to (abbr. wrt) the planet is the difference between the satellite's position relative to the star and the position of the planet relative to the star. From here, the trajectory parameters are calculated using the cartesian_2_keplerian
function, which returns the six Keplerian orbital elements of the satellite in its trajectory relative to the encountered planet.
A body's sphere of influence (abbr. SOI) is a measure of the radius away from a source of gravitation where the force of gravity from a planet is equivalent in magnitude to the force of gravity from an even more massive object like a star. This radius is particularly important for determining where a satellite is subjected to the most powerful acceleration and is especially useful in making patched conic approximations. While there is a more precise expression for finding this radius, the r_soi
function uses the more common, general relation to determine the radius of the SOI
Where
The reduced mass of a two-body system reduced_mass
function and is exclusively utilized in one of the plotting functions and is given by:
Where again,
The U_gravitational
function takes a value for a radial distance, and the masses of two bodies and computes the gravitational potential energy at the given radial distance:
The U_centrifugal
function takes the same arguments as U_gravitational
along with one more for the object's specific angular momentum
The grav_param
function takes two arguments, both for the masses of each body in a two-body system and returns the standard gravitational parameter
When Satellite
class, if the less-massive body was created with negligible=True
, the value returned will instead be given as:
The radial_velocity
function takes position
Where
Caution
This function is currently incompatible with parabolic orbits (NotImplementedError
.
The semi_latus_rectum
function takes two arguments, one for the semi-major axis
The eccentricity_vector
function takes the same arguments as radial_velocity
along with one more for the system's standard gravitational parameter
The mean_angular_motion
function takes the standard gravitational parameter of a two-body system and an optional argument for the semi-major axis. If the semi-major axis is not provided, it is assumed that the trajectory is parabolic and therefore
The true_anom_from_vectors
function takes the same arguments as the eccentricity_vector
function, and returns the true anomaly of a satellite at the given position. The first step to determine the true anomaly
Then, the angle is interpreted in the context of the eccentricity and radial velocity