Basic orbital mechanics routines.
Compute the two-body orbital period.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | mu |
gravitational parameter [] |
||
real(kind=wp), | intent(in) | :: | a |
semimajor axis [km] |
two-body orbital period [s]
Compute the two-body orbital energy.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | mu |
gravitational parameter [] |
||
real(kind=wp), | intent(in), | dimension(6) | :: | rv |
position and velocity vector [km,km/s] |
two-body orbital energy []
Computes the sphere-of-influence radius of the secondary body.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | mu_primary |
primary body gravitational parameter [km^3/s^2] |
||
real(kind=wp), | intent(in) | :: | mu_secondary |
secondary body gravitational parameter [km^3/s^2] |
||
real(kind=wp), | intent(in) | :: | r_ps |
distance between the two bodies [km] |
sphere of influence radius [km]
Computes the sphere-of-influence radius of the secondary body.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | mu_primary |
primary body gravitational parameter [km^3/s^2] |
||
real(kind=wp), | intent(in) | :: | mu_secondary |
secondary body gravitational parameter [km^3/s^2] |
||
real(kind=wp), | intent(in), | dimension(3) | :: | r |
vector from the secondary body to the spacecraft [km] |
|
real(kind=wp), | intent(in), | dimension(3) | :: | r_sp |
vector from the secondary to the primary body [km] |
sphere of influence radius of the secondary body [km]
Convert position and velocity vectors to orbital elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | mu |
gravitational parameter [] |
||
real(kind=wp), | intent(in), | dimension(3) | :: | r |
position vector [km] |
|
real(kind=wp), | intent(in), | dimension(3) | :: | v |
velocity vector [km/s] |
|
real(kind=wp), | intent(out) | :: | p |
semiparameter [km] |
||
real(kind=wp), | intent(out) | :: | ecc |
eccentricity [--] |
||
real(kind=wp), | intent(out) | :: | inc |
inclination [rad] |
||
real(kind=wp), | intent(out) | :: | raan |
raan [rad] |
||
real(kind=wp), | intent(out) | :: | aop |
argument of peripsis [rad] |
||
real(kind=wp), | intent(out) | :: | tru |
true anomaly [rad] |
Convert orbital elements to position and velocity vectors.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | mu |
gravitational parameter [] |
||
real(kind=wp), | intent(in) | :: | p |
semiparameter [km] |
||
real(kind=wp), | intent(in) | :: | ecc |
eccentricity [--] |
||
real(kind=wp), | intent(in) | :: | inc |
inclination [rad] |
||
real(kind=wp), | intent(in) | :: | raan |
raan [rad] |
||
real(kind=wp), | intent(in) | :: | aop |
argument of peripsis [rad] |
||
real(kind=wp), | intent(in) | :: | tru |
true anomaly [rad] |
||
real(kind=wp), | intent(out), | dimension(3) | :: | r |
position vector [km] |
|
real(kind=wp), | intent(out), | dimension(3) | :: | v |
velocity vector [km/s] |
Check the orbit for singularities.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | ecc |
eccentricity |
||
real(kind=wp), | intent(in) | :: | inc |
inclination [rad] |
||
logical, | intent(out) | :: | circular |
is the orbit circular? |
||
logical, | intent(out) | :: | equatorial |
is the orbit equatorial? |
Compute the periapsis and apoapsis position and velocity magnitudes.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | mu |
gravitational parameter [] |
||
real(kind=wp), | intent(in) | :: | a |
semimajor axis [km] |
||
real(kind=wp), | intent(in) | :: | e |
eccentricity [--] |
||
real(kind=wp), | intent(out) | :: | rp |
periapsis position magnitude [km] |
||
real(kind=wp), | intent(out) | :: | ra |
apoapsis position magnitude [km] |
||
real(kind=wp), | intent(out) | :: | vp |
periapsis velocity magnitude [km/s] |
||
real(kind=wp), | intent(out) | :: | va |
apoapsis velocity magnitude [km/s] |