Gooding's Kepler and universal elements conversion routines.
The Gooding universal elements are:
alpha
- mu/a [km^2/s^2]rp
- periapsis radius [km]inc
- inclination [rad]raan
- right ascension of the ascending node [rad]w
- argument of periapsis [rad]tau
- time since last periapsis passage [sec]Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | private, | parameter | :: | ntwo | = | -two | |
real(kind=wp), | private, | parameter | :: | pineg | = | -pi | |
real(kind=wp), | private, | parameter | :: | half | = | 0.5_wp | |
real(kind=wp), | private, | parameter | :: | athird | = | one/three | |
real(kind=wp), | private, | parameter | :: | asixth | = | one/six |
Kepler's equation, em = ekepl - (1 - e1)*sin(ekepl)
,
with e1
in range 1 to 0 inclusive, solved accurately
(based on ekepl3, but entering e1
, not e
)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | em | |||
real(kind=wp), | intent(in) | :: | e1 |
Solve kepler's equation, em = ekepl - e*sin(ekepl)
,
with legendre-based starter and halley iterator
(function has also been used under the name eafkep)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | em | |||
real(kind=wp), | intent(in) | :: | e |
Kepler's equation, em = ekepl - e*sin(ekepl)
with
e in range 0 to 1 inclusive, solved accurately
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | em | |||
real(kind=wp), | intent(in) | :: | e |
Accurate computation of ee - e*sin(ee)
when (e, ee) is close to (1, 0)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | e | |||
real(kind=wp), | intent(in) | :: | ee |
Similar to emkepl, except input is 1-e
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | e1 | |||
real(kind=wp), | intent(in) | :: | ee |
Equation el = shkepl + (g1 - 1)*asinh(shkepl)
,
with g1 in range 0 to 1 inclusive, solved accurately.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | el | |||
real(kind=wp), | intent(in) | :: | g1 |
Accurate computation of s - (1 - g1)*asinh(s)
when (g1, s) is close to (0, 0)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | g1 | |||
real(kind=wp), | intent(in) | :: | s |
Solution to a*x**3 + 3*b*x - 2c = 0
, where
a
and b**3 + a*c**2
are both non-negative
(zero generated, in lieu of infinity, if a = b = 0
)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | a | |||
real(kind=wp), | intent(in) | :: | b | |||
real(kind=wp), | intent(in) | :: | c |
Cube root computed accurately, by incorporating one Newton-Raphson iteration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x |
Basic two-body propagator using the Gooding universal element routines.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | mu |
grav. parameter [km^3/s^2] |
||
real(kind=wp), | intent(in), | dimension(6) | :: | rv0 |
initial state [km, km/s] |
|
real(kind=wp), | intent(in) | :: | dt |
time step [sec] |
||
real(kind=wp), | intent(out), | dimension(6) | :: | rvf |
final state [km, km/s] |
Algorithm for two-dimensional conversion from orbital elements to position and velocity.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | gm |
grav. parameter [km^3/s^2] |
||
real(kind=wp), | intent(in) | :: | al |
alpha [km^2/s^2] |
||
real(kind=wp), | intent(in) | :: | q |
periapsis distance [km] |
||
real(kind=wp), | intent(in) | :: | om |
argument of periapsis relative to assumed reference direction [rad] |
||
real(kind=wp), | intent(in) | :: | tau |
time from periapsis [sec] |
||
real(kind=wp), | intent(out) | :: | r |
radial distance [km] |
||
real(kind=wp), | intent(out) | :: | u |
angle from reference direction [rad] |
||
real(kind=wp), | intent(out) | :: | vr |
radial velocity [km/2] |
||
real(kind=wp), | intent(out) | :: | vt |
transverse velocity >=0 [km/s] |
Algorithm for three-dimensional conversion from orbital elements to position and velocity
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | gm |
grav. parameter [km^3/sec^2] |
||
real(kind=wp), | intent(in), | dimension(6) | :: | e |
[al, q, ei, bom, om, tau] |
|
real(kind=wp), | intent(out), | dimension(6) | :: | pv |
[x, y, z, xdot, ydot, zdot] |
Algorithm for two-dimensional conversion from position and velocity to orbital elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | gm |
grav. parameter [km^3/s^2] |
||
real(kind=wp), | intent(in) | :: | r |
radial distance [km] |
||
real(kind=wp), | intent(in) | :: | u |
angle from assumed reference direction [rad] |
||
real(kind=wp), | intent(in) | :: | vr |
radial velocity [km/2] |
||
real(kind=wp), | intent(in) | :: | vt |
transverse velocity >=0 [km/s] |
||
real(kind=wp), | intent(out) | :: | al |
alpha: gm/a [km^2/s^2] |
||
real(kind=wp), | intent(out) | :: | q |
periapsis distance [km] |
||
real(kind=wp), | intent(out) | :: | om |
argument of periapsis relative to reference direction [rad] |
||
real(kind=wp), | intent(out) | :: | tau |
time from periapsis [sec] |
Algorithm for three-dimensional conversion from position and velocity to orbital elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | gm |
grav. parameter [km^3/s^2] |
||
real(kind=wp), | intent(in), | dimension(6) | :: | pv |
[x, y, z, xdot, ydot, zdot] |
|
real(kind=wp), | intent(out), | dimension(6) | :: | e |
[al, q, ei, bom, om, tau] |