Analytic partial derivatives for trajectory sensitivities (state transition matrices): gravity gradients, and the time derivatives of the two-body rotating frame transformation.
These are general astrodynamics routines (they do not depend on the rest of HALO), intended to be moved into the Fortran Astrodynamics Toolkit eventually:
geopotential_model_pines (cnm, snm), so it can be used with that class.two_body_rotating_frame (and its inverse),
and their exact time derivatives.With and the direction cosines , the potential is
where , are the derived Legendre functions, and . Every term is a polynomial in , so there are no singularities (e.g., at the poles).
Treating as a function of and of (as independent variables), with , and the projection (since ):
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private, | parameter | :: | zero | = | 0.0_wp | |
| real(kind=wp), | private, | parameter | :: | one | = | 1.0_wp | |
| real(kind=wp), | private, | parameter | :: | two | = | 2.0_wp | |
| real(kind=wp), | private, | parameter | :: | three | = | 3.0_wp |
Gravity gradient of a point mass at the origin: .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | r |
position vector [km] |
|
| real(kind=wp), | intent(in) | :: | mu |
gravitational parameter [km^3/s^2] |
Gradient of the third-body acceleration , , with respect to the spacecraft position (the indirect term does not depend on it): . This is also the gradient of Battin's equivalent form (the same function).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | r |
spacecraft position vector [km] |
|
| real(kind=wp), | intent(in), | dimension(3) | :: | rb |
third-body position vector [km] |
|
| real(kind=wp), | intent(in) | :: | mu |
third-body gravitational parameter [km^3/s^2] |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | x | ||
| real(kind=wp), | intent(in) | :: | mu |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | a | ||
| real(kind=wp), | intent(in), | dimension(3) | :: | b |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | a | ||
| real(kind=wp), | intent(in), | dimension(3) | :: | b |
[w x]: x*v = w cross v
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | w |
Spherical harmonic gravity acceleration, and optionally its gradient , with Pines' formulation (see the module documentation). Includes the central (point mass) term.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(3) | :: | r |
position vector [km] |
|
| integer, | intent(in) | :: | nmax |
degree to use (>=0) |
||
| integer, | intent(in) | :: | mmax |
order to use (0 to |
||
| real(kind=wp), | intent(in) | :: | re |
body reference radius [km] |
||
| real(kind=wp), | intent(in) | :: | mu |
body gravitational parameter [km^3/s^2] |
||
| real(kind=wp), | intent(in), | dimension(:,0:) | :: | cnm |
unnormalized C coefficients |
|
| real(kind=wp), | intent(in), | dimension(:,0:) | :: | snm |
unnormalized S coefficients |
|
| real(kind=wp), | intent(out), | dimension(3) | :: | acc |
acceleration [km/s^2] |
|
| real(kind=wp), | intent(out), | optional, | dimension(3,3) | :: | grad |
gravity gradient [1/s^2] |
The 6x6 state transformations of a two-body rotating frame (as defined by the
toolkit's two_body_rotating_frame), and their exact time derivatives.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(6) | :: | rv |
state of the secondary w.r.t. the primary [km, km/s] |
|
| real(kind=wp), | intent(in), | dimension(3) | :: | rdot |
time derivative of |
|
| real(kind=wp), | intent(in), | dimension(3) | :: | vdot |
time derivative of |
|
| real(kind=wp), | intent(out), | optional, | dimension(6,6) | :: | m |
inertial to rotating |
| real(kind=wp), | intent(out), | optional, | dimension(6,6) | :: | mdot |
dM/dt [1/s] |
| real(kind=wp), | intent(out), | optional, | dimension(6,6) | :: | n |
rotating to inertial |
| real(kind=wp), | intent(out), | optional, | dimension(6,6) | :: | ndot |
dN/dt [1/s] |