astro_partials_module Module

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:

  • pines_gravity: spherical harmonic gravity acceleration and its gradient (the 3x3 matrix of second partials of the potential), with Pines' nonsingular formulation. It uses the same unnormalized coefficient arrays as the toolkit's geopotential_model_pines (cnm, snm), so it can be used with that class.
  • pointmass_gravity_gradient, third_body_gravity_gradient.
  • two_body_rotating_frame_matrices: the 6x6 inertial-to-rotating state transformation of the toolkit's two_body_rotating_frame (and its inverse), and their exact time derivatives.

Pines' formulation

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 ):

References

  • S. Pines, "Uniform Representation of the Gravitational Potential and its Derivatives", AIAA Journal, Vol. 11, No. 11, 1973, pp. 1508-1511.
  • J. L. Spencer, "Pines' Nonsingular Gravitational Potential Derivation, Description and Implementation", NASA CR-147478, 1976.

Uses

  • module~~astro_partials_module~~UsesGraph module~astro_partials_module astro_partials_module module~halo_kinds_module halo_kinds_module module~astro_partials_module->module~halo_kinds_module iso_fortran_env iso_fortran_env module~halo_kinds_module->iso_fortran_env

Used by

  • module~~astro_partials_module~~UsedByGraph module~astro_partials_module astro_partials_module module~halo_module halo_module module~halo_module->module~astro_partials_module module~halo_eclipse_opt_submodule halo_eclipse_opt_submodule module~halo_eclipse_opt_submodule->module~halo_module

Variables

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

Functions

public pure function pointmass_gravity_gradient(r, mu) result(grad)

Gravity gradient of a point mass at the origin: .

Arguments

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

Return Value real(kind=wp), dimension(3,3)

public pure function third_body_gravity_gradient(r, rb, mu) result(grad)

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).

Arguments

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

Return Value real(kind=wp), dimension(3,3)

private pure function point_gradient(x, mu) result(grad)

Arguments

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

Return Value real(kind=wp), dimension(3,3)

private pure function outer(a, b) result(c)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: a
real(kind=wp), intent(in), dimension(3) :: b

Return Value real(kind=wp), dimension(3,3)

private pure function cross(a, b) result(c)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: a
real(kind=wp), intent(in), dimension(3) :: b

Return Value real(kind=wp), dimension(3)

private pure function cross_matrix(w) result(x)

[w x]: x*v = w cross v

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: w

Return Value real(kind=wp), dimension(3,3)


Subroutines

public pure subroutine pines_gravity(r, nmax, mmax, re, mu, cnm, snm, acc, grad)

Spherical harmonic gravity acceleration, and optionally its gradient , with Pines' formulation (see the module documentation). Includes the central (point mass) term.

Read more…

Arguments

Type IntentOptional 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 nmax)

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 cnm(n,m)

real(kind=wp), intent(in), dimension(:,0:) :: snm

unnormalized S coefficients snm(n,m)

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]

public pure subroutine two_body_rotating_frame_matrices(rv, rdot, vdot, m, mdot, n, ndot)

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.

Read more…

Arguments

Type IntentOptional 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 rv(1:3) [km/s]

real(kind=wp), intent(in), dimension(3) :: vdot

time derivative of rv(4:6) [km/s^2]

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]