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]
pure function sphere_of_influence(mu_primary, mu_secondary, r_ps) result(r_soi) implicit none real(wp),intent(in) :: mu_primary !! primary body gravitational parameter [km^3/s^2] real(wp),intent(in) :: mu_secondary !! secondary body gravitational parameter [km^3/s^2] real(wp),intent(in) :: r_ps !! distance between the two bodies [km] real(wp) :: r_soi !! sphere of influence radius [km] real(wp),parameter :: two_fifths = two/five if (mu_primary>zero .and. mu_secondary>zero .and. r_ps>zero) then r_soi = r_ps * (mu_secondary/mu_primary)**two_fifths else r_soi = zero end if end function sphere_of_influence