orbital_mechanics_module Module

Basic orbital mechanics routines.


Uses

  • module~~orbital_mechanics_module~~UsesGraph module~orbital_mechanics_module orbital_mechanics_module module~kind_module kind_module module~orbital_mechanics_module->module~kind_module module~math_module math_module module~orbital_mechanics_module->module~math_module module~numbers_module numbers_module module~orbital_mechanics_module->module~numbers_module module~vector_module vector_module module~orbital_mechanics_module->module~vector_module iso_fortran_env iso_fortran_env module~kind_module->iso_fortran_env module~math_module->module~kind_module module~math_module->module~numbers_module module~numbers_module->module~kind_module module~vector_module->module~kind_module module~vector_module->module~numbers_module

Used by

  • module~~orbital_mechanics_module~~UsedByGraph module~orbital_mechanics_module orbital_mechanics_module module~fortran_astrodynamics_toolkit fortran_astrodynamics_toolkit module~fortran_astrodynamics_toolkit->module~orbital_mechanics_module proc~rk_test_variable_step rk_module_variable_step::rk_test_variable_step proc~rk_test_variable_step->module~orbital_mechanics_module

Functions

public pure function orbit_period(mu, a) result(period)

Compute the two-body orbital period.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: mu

gravitational parameter []

real(kind=wp), intent(in) :: a

semimajor axis [km]

Return Value real(kind=wp)

two-body orbital period [s]

public pure function orbit_energy(mu, rv) result(energy)

Compute the two-body orbital energy.

Arguments

Type IntentOptional 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]

Return Value real(kind=wp)

two-body orbital energy []

public pure function sphere_of_influence(mu_primary, mu_secondary, r_ps) result(r_soi)

Computes the sphere-of-influence radius of the secondary body.

Read more…

Arguments

Type IntentOptional 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]

Return Value real(kind=wp)

sphere of influence radius [km]

public pure function sphere_of_influence_earth_moon(mu_primary, mu_secondary, r, r_sp) result(r_soi)

Computes the sphere-of-influence radius of the secondary body.

Read more…

Arguments

Type IntentOptional 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]

Return Value real(kind=wp)

sphere of influence radius of the secondary body [km]


Subroutines

public pure subroutine rv_to_orbital_elements(mu, r, v, p, ecc, inc, raan, aop, tru)

Convert position and velocity vectors to orbital elements.

Read more…

Arguments

Type IntentOptional 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]

public pure subroutine orbital_elements_to_rv(mu, p, ecc, inc, raan, aop, tru, r, v)

Convert orbital elements to position and velocity vectors.

Arguments

Type IntentOptional 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]

private pure subroutine orbit_check(ecc, inc, circular, equatorial)

Check the orbit for singularities.

Arguments

Type IntentOptional 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?

public pure subroutine periapsis_apoapsis(mu, a, e, rp, ra, vp, va)

Compute the periapsis and apoapsis position and velocity magnitudes.

Arguments

Type IntentOptional 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]