Computes the sphere-of-influence radius of the secondary body.
r
and r_sp
should be in the same inertial frame.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]
pure function sphere_of_influence_earth_moon(mu_primary, mu_secondary, r, r_sp) 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),dimension(3),intent(in) :: r !! vector from the secondary body to the spacecraft [km] real(wp),dimension(3),intent(in) :: r_sp !! vector from the secondary to the primary body [km] real(wp) :: r_soi !! sphere of influence radius of the secondary body [km] real(wp) :: r_mag, r_sp_mag, alpha, ca, ca2, denom r_mag = norm2(r) r_sp_mag = norm2(r_sp) if (mu_primary>zero .and. mu_secondary>zero .and. r_mag>zero .and. r_sp_mag>zero) then alpha = angle_between_vectors(r,r_sp) ca = cos(alpha) ca2 = ca * ca denom = (mu_secondary**2/mu_primary**2)**(one/five)*(one+three*ca2)**(one/ten) + & (two/five)*ca*((one+six*ca2)/(one+three*ca2)) r_soi = r_sp_mag / denom else r_soi = zero end if end function sphere_of_influence_earth_moon