Escolar Documentos
Profissional Documentos
Cultura Documentos
This document is the user’s manual for a computer program called ca_sc2moon that can be used to
estimate the time of closest approach between a spacecraft and the Moon. This information can be
used to access an initial guess for other lunar trajectory analysis computer programs.
The software also includes the option to propagate a spacecraft’s trajectory for a user-specified time
duration. This allows the user to access the effects of such trajectory characteristics as TLI calendar
date, initial park orbit orientation and so forth.
The important numerical methods used in this computer program are as follows:
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
ca_sc2moon lro1.in
If the software is executed without an input file on the command line, the computer program will
display the following information screen and file name prompt:
*************************************
* program ca_sc2moon *
* *
* closest approach between *
* a spacecraft and the Moon *
* *
* July 25, 2005 *
*************************************
At this point the user should supply the name of a compatible input file. The next section of this
document describes the proper format for an input file for this computer program.
page 1
Typical input file
The ca_sc2moon software is “data-driven” by a user-created text file. The following is a typical
input file used by this computer program. This example searches for closest approach using a
gravity-turn propulsive maneuver.
Each data item within an input file is preceded by one or more lines of annotation text. Do not
delete any of these annotation lines or increase or decrease the number of lines reserved for each
comment. However, you may change them to reflect your own explanation. The annotation line
also includes the correct units and when appropriate, the valid range of the input. ASCII text input
is not case sensitive but must be spelled correctly.
In the following discussion the actual input file contents are in courier font and all explanations
are in times italic font.
The first six lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with six and only six initial text lines.
*****************************************************
** closest approach between a spacecraft and the moon
** n-body geocentric motion
** continuous, low-thrust TLI maneuver
** lro1.in - July 25, 2005
*****************************************************
The first program input is an integer that specifies the type of simulation. Option 1 will simply
propagate the spacecraft for a user-defined duration and option 2 will search for close approach.
simulation type (1 = propagation, 2 = close approach)
2
The next inputs are the initial spacecraft mass, thrust magnitude and specific impulse.
initial spacecraft mass (kilograms)
1000.0
The next input is a number that represents either a guess for the transfer time to closest approach
or the time duration for the orbit propagation option.
transfer time guess or propagation duration (hours)
120
page 2
These inputs define the trans-lunar injection (TLI) launch calendar date and universal time. Be
sure to include all four digits of the calendar year.
******************
* TLI CONDITIONS *
******************
The next six inputs are the classical orbital elements of the park orbit at the beginning of the TLI
propulsive maneuver. These elements should be specified with respect to the Earth mean equator
and equinox of J2000 (EME2000) coordinate system.
******************
initial park orbit
******************
The next two inputs specify the third-body perturbations to include in the simulation.
*********************
orbital perturbations
*********************
The next input is the name of the data file that will contain the trajectory information.
name of solution output file
lro1.csv
The final input specifies the time step size for the data in the output file.
output file step size (minutes)
10.0
page 3
Program solution and graphics
The software will display the characteristics of the finite-burn TLI maneuver and the trajectory
characteristics at closest approach or at the end of the propagation interval.
program ca_sc2moon
page 4
conditions at lunar closest approach
(Earth mean equator and equinox of J2000)
-----------------------------------------
-----------------------------------------
page 5
The ca_sc2moon software will create a comma-separated-variable (csv) output file. This file
contains the EME2000 position vectors of the spacecraft and moon. The following plot is a view of
the trajectory and planetary orbits from the Earth’s north pole looking down on the equatorial plane.
40
Lunar Orbit
lunar transfer
trajectory
20
y coordinate (ER)
0
TLI
-20
0 20 40 60
x coordinate (ER)
400000
spacecraft-to-moon distance (km)
300000
200000
100000
0
0 40 80 120
mission elapsed time (hours)
page 6
Technical Discussion
f ( t ) = ∆r ( t ) = rm − rsc
where rp is the geocentric position vector of the Moon and rsc is the geocentric position vector of
the spacecraft at any simulation time t. This close approach algorithm uses the launch date, thrust
and spacecraft mass provided by the user.
The software allows the user to select the type of steering method used to generate an initial guess
for the trajectory. The two options available are tangential or gravity turn steering. For gravity turn
steering the thrust vector is aligned with the instantaneous velocity vector. For tangential thrusting
the unit thrust vector in the modified equinoctial frame at all times is simply uT = [0 1 0] .
T
For the gravity-turn steering option, the software creates the unit thrust vector in the Earth-centered-
inertial (ECI) coordinate system and integrates the equations of motion in the modified equinoctial
or radial frame system. The relationship between a unit thrust vector in the ECI coordinate system
uˆ TECI and the corresponding unit thrust vector in the modified equinoctial system uˆ TMEE is given by
uˆ TECI = ⎡⎣ ˆi r ˆi
t
ˆi ⎤ uˆ
n ⎦ TMEE
where
ˆi = r ˆi = r × v ˆi = ˆi × ˆi = ( r × v ) × r
r×v r×v r
r n t n r
r
⎡ rˆ
⎢ x ( hˆ × rˆ ) x
hˆ x ⎤
⎥
uˆ TECI = [Q ] uˆ TMEE = ⎢rˆy
⎢ ( hˆ × rˆ ) y
hˆ y ⎥ uˆ TMEE
⎥
⎢ ⎥
⎢⎣ rˆz ( hˆ × rˆ ) z
hˆ z ⎥
⎦
Finally, the transformation of the unit thrust vector in the ECI system to the modified equinoctial
coordinate system is given by
uˆ TMEE = [Q ] uˆ TECI
T
page 7
For tangential thrusting, the unit thrust vector in the modified equinoctial frame at all times is
uT = [ 0 1 0 ] .
T
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These
equations exhibit no singularity for zero eccentricity and orbital inclinations equal to 0 and 90
degrees. However, two components of the orbital element set are singular for an orbital inclination
of 180 degrees.
The relationship between direct modified equinoctial and classical orbital elements is defined by the
following definitions
p = a (1 − e 2 )
f = e cos (ω + Ω )
g = e sin (ω + Ω )
h = tan ( i 2 ) cos Ω
k = tan ( i 2 ) sin Ω
L = Ω +ω +θ
where
p= semiparameter
a= semimajor axis
e= orbital eccentricity
i= orbital inclination
ω= argument of periapsis
Ω= right ascension of the ascending node
θ= true anomaly
L= true longitude
The relationship between classical and modified equinoctial orbital elements is summarized as
follows:
semimajor axis
p
a=
1 − f 2 − g2
orbital eccentricity
e= f 2 + g2
orbital inclination
page 8
i = 2 tan −1 ( h2 + k 2 )
argument of periapsis
ω = tan −1 ( g f ) − tan −1 ( k h )
Ω = tan −1 ( k h )
true anomaly
θ = L − ( Ω + ω ) = L − tan −1 ( g f )
The mathematical relationships between an inertial state vector and the corresponding modified
equinoctial elements are summarized as follows:
position vector
⎡r ⎤
⎢ s 2 ( cos L + α cos L + 2hk sin L ) ⎥
2
⎢ ⎥
r = ⎢ 2 ( sin L − α 2 sin L + 2hk cos L ) ⎥
r
⎢s ⎥
⎢ 2r ⎥
⎢ ( h sin L − k cos L ) ⎥
⎣⎢ s2 ⎦⎥
velocity vector
⎡ 1 µ ⎤
⎢ − 2 ( sin L + α 2 sin L − 2hk cos L + g − 2 f h k + α 2 g ) ⎥
⎢ s p ⎥
⎢ 1 µ ⎥
v = ⎢− 2 ( − cos L + α 2 cos L + 2hk sin L − f + 2 gh k + α 2 f ) ⎥
⎢ s p ⎥
⎢ ⎥
⎢ 2 µ ⎥
⎢⎣
( h cos L + k sin L + f h + gk ) ⎥⎦
s2 p
where
α 2 = h2 − k 2
s2 = 1 + h2 + k 2
p
r=
w
w = 1 + f cos L + g sin L
page 9
The system of first-order modified equinoctial equations of orbital motion are given by
dp 2 p p
p= = ∆t
dt w µ
df p⎡ ∆ g∆ ⎤
f = = ⎢ ∆ r sin L + ⎡⎣( w + 1) cos L + f ⎤⎦ t − ( h sin L − k cos L ) n ⎥
dt µ⎣ w w ⎦
dg p⎡ ∆ g∆ ⎤
g= = ⎢ −∆ r cos L + ⎡⎣( w + 1) sin L + g ⎤⎦ t + ( h sin L − k cos L ) n ⎥
dt µ⎣ w w ⎦
dh p s2∆n
h= = cos L
dt µ 2w
dk p s2 ∆n
k= = sin L
dt µ 2w
2
dL ⎛ w⎞ 1 p
L= = µp ⎜ ⎟ + ( h sin L − k cos L ) ∆ n
dt ⎝ p⎠ w µ
where ∆ r , ∆ t , ∆ n are non-two-body perturbations in the radial, tangential and normal directions,
respectively. For a lunar spacecraft, the radial direction is along the geocentric radius vector of the
spacecraft measured positive in a direction away from the gravitational center, the tangential
direction is perpendicular to this radius vector measured positive in the direction of orbital motion,
and the normal direction is positive along the angular momentum vector of the spacecraft’s orbit.
The equations of orbital motion can also be expressed in vector form as follows:
dy
y= = A (y) P + b
dt
where
2 T
⎡ ⎛ w⎞ ⎤
b = ⎢0 0 0 0 0 µp⎜ ⎟ ⎥
⎢⎣ ⎝ p⎠ ⎥⎦
and
page 10
⎧ 2p p ⎫
⎪ 0 0 ⎪
⎪ w µ ⎪
⎪ p p 1 p g ⎪
⎪ sin L ⎡⎣( w + 1) cos L + f ⎤⎦ − [h sin L − k cos L]⎪
⎪ µ µ w µ w ⎪
⎪ ⎪
⎪− p p p f
⎪⎪
cos L ⎡⎣( w + 1) sin L + g ⎤⎦ [h sin L − k cos L] ⎪⎪
µ µ µ w ⎪
A=⎨ ⎬
⎪ p s 2 cos L ⎪
0 0
⎪ µ 2w ⎪
⎪ ⎪
⎪ p s 2 sin L ⎪
⎪ 0 0 ⎪
⎪ µ 2w ⎪
⎪ p ⎪
⎪ 0 0 [ h sin L − k cos L] ⎪
⎩⎪ µ ⎭⎪
P = ∆ r ˆi r + ∆ t ˆit + ∆ n ˆi n
where ˆi r , ˆit and ˆin are unit vectors in the radial, tangential and normal directions. These unit
vectors can be computed from the inertial position vector r and velocity vector v according to
ˆi = r
r
r
ˆi = r × v
r×v
n
ˆi = ˆi × ˆi = ( r × v ) × r
r×v r
t n r
For unperturbed two-body motion, P = 0 and the first five equations of motion are simply
p = f = g = h = k = 0 . Therefore, for two-body motion these modified equinoctial orbital
elements are constant. The true longitude is often called the fast variable of this orbital element set.
g = g N ˆi N − g r ˆi r
where
page 11
ˆi = ( )
eˆ N − eˆ TN ˆi r ˆi r
− ( eˆ ˆi ) ˆi
N
T
eˆ N N r r
and
eˆ N = [0 0 1]
T
In these equations, the north direction component is indicated by subscript N and the radial direction
component is subscript r.
µ cos φ
k
4
⎛ Re ⎞ '
gN = −
r2
∑ ⎜ ⎟ Pk J k
k =2 ⎝ r ⎠
µ
k
4
⎛R ⎞
g r = − 2 ∑ ( k + 1) ⎜ e ⎟ Pk J k
r k =2 ⎝ r ⎠
where
µ = gravitational constant
r = geocentric distance of the spacecraft
Re = equatorial radius of the Earth
φ = geocentric latitude
J k = zonal gravity coefficient
Pk = k th order Legendre polynomial
For a zonal-only Earth gravity model, the east component is identically zero.
a g = QT g
where Q = ⎡⎣ ˆi r ˆit ˆi n ⎤⎦ .
∆ J2 = − 1 −
r
2r 4 ⎢
⎣ (1 + h 2
+ k ) ⎥⎦
2 2
page 12
6µ J 2 Re2 ⎡⎢ (1 − h − k ) ( h sin L − k cos L ) ⎤⎥
2 2
∆ J2 =−
n
r4 ⎢
⎣ (1 + h 2
+ k )
2 2 ⎥
⎦
Propulsive thrust
T
aT = uˆ
m
where T is the thrust, m is the spacecraft mass and uˆ = [ ur ut un ] is the unit pointing thrust vector
expressed in the spacecraft-centered radial-tangential-normal coordinate system. The components
of the unit thrust vector can also be defined in terms of the in-plane pitch angle θ and the out-of-
plane yaw angle ψ as follows:
ur = sin θ
ut = cos θ cosψ
un = cos θ sinψ
Finally, the pitch and yaw angles can be determined from the components of the unit thrust vector
according to
θ = sin −1 ( ur )
ψ = tan −1 ( un , ut )
The pitch angle is positive above the “local horizontal” and the yaw angle is positive in the direction
of the angular momentum vector.
During the TLI propulsive maneuver, the system of equations of motion also include the thrust
acceleration and the propellant flow rate given by
dm F
m= =
dt g I sp
where F is the thrust, g is the acceleration of gravity, and I sp is the specific impulse. The thrust
acceleration is used to predict the accumulated delta-v and the propellant flow rate is used to predict
the propellant consumed during the TLI propulsive maneuver.
The B-plane
The derivation of B-plane coordinates is described in the classic JPL reports, “A Method of
Describing Miss Distances for Lunar and Interplanetary Trajectories” and “Some Orbital Elements
page 13
Useful in Space Trajectory Calculations”, both by William Kizner. The following diagram
illustrates the fundamental geometry of the B-plane coordinate system.
⎧cos δ ∞ cos α ∞ ⎫
⎪ ⎪
Sˆ = ⎨ cos δ ∞ sin α ∞ ⎬
⎪ ⎪
⎩ sin δ ∞ ⎭
where δ ∞ and α ∞ are the declination and right ascension of the asymptote of the incoming
hyperbola.
The following computational steps summarize the calculation of the predicted B-plane vector from
a moon-centered position vector r and velocity vector v at closest approach.
page 14
radius rate
ri v
r=
r
semiparameter
h2
p=
µ
semimajor axis
r
a=
⎛ r v2 ⎞
⎜ −
µ ⎟⎠
2
⎝
orbital eccentricity
e = 1− p a
true anomaly
p−r
cosθ =
er
rh
sin θ =
eµ
B-plane magnitude
B= pa
fundamental vectors
r v − rr
zˆ =
h
pˆ = cos θ rˆ − sin θ zˆ
qˆ = sin θ rˆ + cos θ zˆ
S vector
a b
S=− pˆ + qˆ
a 2 + b2 a 2 + b2
B vector
b2 ab
B= pˆ + qˆ
a 2 + b2 a 2 + b2
page 15
T vector
(S , − S x2 ,0 )
2 T
T=
y
S x2 + S y2
R vector
R = S × T = ( − S zTy , S zTx , S xTy − S yTx )
T
In this computer program the B-plane coordinates are based on the selenocentric flight conditions at
closest approach.
If the encounter trajectory is not hyperbolic, these coordinates can not be computed and the
software will display zeroes for this information.
This section describes the transformation of coordinates between the Earth mean equator and
equinox of J2000 (EME2000) and lunar mean equator and IAU node of epoch coordinate systems.
This transformation is used to compute the B-plane coordinates at lunar encounter.
A unit vector in the direction of the pole of the moon can be determined from
⎡cos α p cos δ p ⎤
⎢ ⎥
pˆ Moon = ⎢ sin α p cos δ p ⎥
⎢⎣ sin δ p ⎥⎦
The right ascension and declination of the lunar pole in the EME2000 coordinate system are given
by the following expressions
where T is the time in Julian centuries given by T = ( JD − 2451545.0 ) / 36525 and JD is the TDB
Julian Date.
page 16
E1 = 125.045 − 0.0529921d
E 2 = 250.089 − 0.1059842d
E 3 = 260.008 + 13.0120009d
E 4 = 176.625 + 13.3407154d
E 6 = 311.589 + 26.4057084d
E 7 = 134.963 + 13.0649930d
E10 = 15.134 − 0.1589763d
E13 = 25.053 + 12.9590088d
where d = JD − 2451545 is the number of days since January 1.5, 2000. These equations are given
in “Report of the IAU/IAG Working Group on Cartographic Coordinates and Rotational Elements
of the Planets and Satellites: 2000”, Celestial Mechanics and Dynamical Astronomy, 82: 83-110,
2002.
The unit vector in the x-axis direction of this selenocentric coordinate system is given by
xˆ = zˆ × pˆ Moon
where zˆ = [0 0 1] .
T
yˆ = pˆ Moon × xˆ
Finally, the components of the matrix that transforms coordinates from the EME2000 system to the
moon-centered (selenocentric) mean equator and IAU node of epoch system are as follows:
⎡ xˆ ⎤
M = ⎢ yˆ ⎥
⎢ ⎥
⎢⎣ pˆ Moon ⎥⎦
The software models the coordinates of the sun and moon using the DE405 algorithm from JPL.
This numerical method and binary data file provide position and velocity vectors of the sun and
moon relative to the Earth mean equator and equinox of J2000. The binary data file is named
de405.bin and must be located in the same directory as the ca_sc2moon program.
page 17
References and Bibliography
“Optimal Interplanetary Orbit Transfers by Direct Transcription”, John T. Betts, The Journal of the
Astronautical Sciences, Vol. 42, No. 3, July-September 1994, pp. 247-268.
“Using Sparse Nonlinear Programming to Compute Low Thrust Orbit Transfers”, John T. Betts,
The Journal of the Astronautical Sciences, Vol. 41, No. 3, July-September 1993, pp. 349-371.
“Optimal Low Thrust Trajectories to the Moon”, John T. Betts and Sven O. Erb, SIAM Journal on
Applied Dynamical Systems, Vol. 2, No. 2, pp. 144-170, 2003.
“Modern Astrodynamics”, Victor R. Bond and Mark C. Allman, Princeton University Press, 1996.
page 18
Orbital Mechanics with MATLAB
JED 2451545
t
36525
where JED is the Julian Date on the terrestrial time (TDT or TT) scale.
The osculating orbital elements are calculated from series of the form
a 383397.6 Sa tSa
where
30
Sa an cos n n t n 104 t 2 n 106 t 3 n 108 t 4
0 1 2 3 4
n 1
3
Sa an cos n n t
0 1
n 1
The first few multipliers and trigonometric arguments for this orbital element are
% input
page 1
Orbital Mechanics with MATLAB
% output
This software suite includes a script called demo_elp that demonstrates how to interact with this
MATLAB function. The following is a typical user interaction with this script.
program demo_elp
? 9
The following are two graphics displays created for this example. The first plot is the geocentric orbital
inclination of the moon and the second display is the orbital eccentricity of the moon’s orbit.
page 2
Orbital Mechanics with MATLAB
page 3
Lunar Free-Return Trajectory Analysis with MATLAB
This document is the user’s guide for a MATLAB script named free_return that can be used to
design two-dimensional lunar free-return trajectories. The system dynamics are modeled as a simplified
circular-restricted three-body problem (CRTBP). Additional modeling assumptions are;
the massless third body is subject only to the point-mass gravity of the earth and moon
the moon is subject only to the point mass gravity of the earth
the moon’s orbit is circular and all motion lies in the moon’s orbital plane
departure from the earth park orbit is the counterclockwise direction
trans-lunar injection (TLI) occurs impulsively from a circular earth park orbit
the TLI departure maneuver is applied tangential to the earth park orbit
the earth orbit insertion (EOI) impulsive maneuver is applied tangential to the return trajectory
the lunar flyby is a no maneuver, ballistic trajectory
The algorithm implemented in this MATLAB script is based on the technical report “Optimal Free-
Return Trajectories for Moon and Mars Missions”, by A. Miele, T. Wang and S. Mancuso, The Journal
of the Astronautical Sciences, Vol. 48, Nos. 2 and 3, April-September 2000, pp. 183-206.
The free_return script uses the SNOPT nonlinear programming (NLP) method for optimizing the
lunar free-return problem implemented in this script. MATLAB versions of SNOPT mex and support
m-files for several computer platforms can be found at Professor Philip Gill’s web site which is located
at http://scicomp.ucsd.edu/~peg/. Professor Gill’s web site also includes a PDF version of the SNOPT
software user’s guide.
The free_return MATLAB script is “data-driven” by a simple text file created by the user. This
section describes a typical input data file. In the following discussion the actual input file contents are in
courier font and all explanations are in times italic font.
Each data item within an input file is preceded by one or more lines of annotation text. Do not delete
any of these annotation lines or increase or decrease the number of lines reserved for each comment.
However, you may change them to reflect your own explanation. The annotation line also includes the
correct units and when appropriate, the valid range of the input data.
The first four lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with four and only four initial text lines.
=================================
input file for free_return.m
free_return1.in January 17, 2014
=================================
The first four inputs define the gravitational constants and radius of the earth and moon.
page 1
gravitational constant of the moon (kilometers^3/second^2)
4902.8
The next two inputs specify the (constant) distance from the earth to the moon and the radius of the
lunar sphere-of-influence (SOI).
The next two inputs define the altitudes of the circular earth park orbit and the lunar close approach.
The final two numeric inputs specify the user’s initial guess for the geocentric angular location of the
TLI maneuver and the scalar magnitude of the TLI delta-v.
initial guess for geocentric angular location of the tli delta-v (degrees)
227.5
After typing free_return in the MATLAB command window, the software will ask you for the name
of the input data file with a display similar to
page 2
The file type defaults to names with a *.in filename extension. However, you can select any
free_return compatible ASCII data file by selecting the Files of type: field or by typing the name of
the file directly in the File name: field.
The following is the script output for the example given earlier. The first part of the output summarize
the SNOPT algorithm results.
page 3
rx (km) ry (km) rz (km) rmag (km)
-4.62495669538951e+03 -5.04092968264503e+03 +0.00000000000000e+00 +6.84114000000000e+03
Please see the Technical Discussion section for an explanation of these last four items.
page 4
The simulation summary screen display contains the following information:
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
rmag (km) = scalar magnitude of the third body position vector in kilometers
vx (km/sec) = x-component of the third body velocity vector in kilometers per second
vy (km/sec) = y-component of the third body velocity vector in kilometers per second
vz (km/sec) = z-component of the third body velocity vector in kilometers per second
vmag (km/sec) = scalar magnitude of the third body velocity vector in kilometers per
second
All altitudes are with respect to a spherical earth or moon. The flight path angle is the angle of
the velocity vector relative to the “local” horizontal, measured positive above and negative below the
horizontal. The circularization delta-v is the scalar magnitude of the maneuver required to
create a circular orbit at earth closest approach on the return trajectory.
The moon-third body geocentric separation angle is the geocentric separation angle
between the third body and the moon at lunar closest approach.
After the main calculations are finished, the free_return script will ask if you would like to create
graphic displays of the solution with the following prompt;
A user response of yes will create several graphic displays which are described in the next section.
Each display will also be saved to a disk file in encapsulated Postscript format with a MATLAB
command similar to the following;
page 5
This first plot illustrates the entire free-return trajectory in a geocentric inertial coordinate system. The
surface of the earth and the circular park orbit are green, the third body trajectory is blue, and the
circular orbit of the moon is red. The moon in its orbit is marked every twelve hours. Note that all
graphics are to scale with the fundamental measurement unit being the radius of the earth.
The next two plots depict the earth departure and arrival trajectory and the lunar flyby trajectory. Both
plots are relative to the inertial coordinate system. The departure/arrival trajectory is geocentric and the
flyby trajectory is selenocentric or “moon-centered”. The surface of the moon and the lunar circular
park orbit are black. Notice that the third body travels around the moon in a clockwise direction.
page 6
This next plot illustrates the entire free-return trajectory in a geocentric rotating coordinate system. As
before, all graphics are to scale with the fundamental measurement unit being the earth radius.
The next two “zoomed-in” plots illustrate the earth departure and arrival trajectory and the lunar flyby
trajectory. Both plots are relative to the rotating coordinate system.
The final plot is the hyperbolic lunar flyby trajectory in a selenocentric inertial coordinate system. The
fundamental distance unit for this display is the radius of the moon. The large black circle represents the
lunar sphere-of-influence with a radius equal to 64,000 kilometers (~36.8 lunar radii).
page 7
The field of view of each trajectory display is set with a MATLAB command similar to
The syntax of this MATLAB command is axis xmin xmax ymin ymax where the minimum and maximum
x-coordinates are xmin and xmax . The minimum and maximum y-coordinates are ymin and ymax . The
user can edit any or all of the default axis commands in the free_return script to change the
geocentric and/or selenocentric views.
Technical Discussion
This section provides additional details about the numerical algorithms implemented in this computer
program. It includes a discussion about coordinate systems, equations of motion, and verification of the
“image trajectory” solution. A brief outline of trajectory optimization is also provided.
Coordinate systems
The origin of the inertial coordinate system is the center of the earth. The x-axis points in the direction
of the moon at the initial time and the y-axis is perpendicular to the x-axis. Since the moon’s orbit
around the earth is circular, the y-axis is also parallel to the initial inertial velocity of the moon.
The origin of the rotating coordinate is also the center of the earth. The x-axis of this system points at
the instantaneous location of the moon. It is also parallel to the initial x-axis of the inertial system. The
y-axis is perpendicular to the instantaneous x-axis. The axes of this system rotate at constant angular
speed relative to the axes of the inertial system. In this rotating coordinate system, the moon appears at
rest relative to the earth.
In the graphic images described earlier, the inertial x-axis is the horizontal line positive to the right.
page 8
Equations of motion
The geocentric second-order differential equations of motion of the third body in a simplified two-
dimensional circular-restricted system are given by
xE B 3 E xE B 3 M xE B xE M
rE B rM B
yE B 3 E yE B 3 M yE B yE M
rE B rM B
where the subscript E-B denotes the location of the third body relative to the earth, M-B is the location of
the third body relative to the moon, and E-M is the location of the moon relative to the earth. In these
two equations, E and M are the gravitational constants of the earth and moon, respectively.
The geocentric and selenocentric (moon-centered) distances of the third body are determined from the x
and y components of the position vector according to
The selenocentric x and y coordinates of the third body are determined from
xM B xE B xE M y M B yE B yE M
The geocentric inertial x and y coordinates of the moon are computed from
xE M rE M cos( t ) yE M rE M sin( t )
where t is the elapsed time since the TLI departure maneuver. In these equations, is the rotation rate
or mean motion of the moon in its circular orbit around the earth which is given by E rE3 M . The
velocity of the moon in its orbit is VM E rE M .
y (1) xE B y (2) yE B
y (3) 3 E xE B 3 M xE B xE M
rE B rM B
y (4) 3 E yE B 3 M yE B yE M
rE B rM B
page 9
The x- and y-coordinates of the third body in the rotating system are given by
The mission elapsed time at which the third body reaches closest approach to the moon is calculated
using the event prediction capability of the MATLAB ode45 algorithm. During the numerical
integration of the third body’s geocentric equations of motion, the ode45 numerical method searches for
the time at which the sine of the flight path angle with respect to the moon is nearly zero.
rv
sin
rv
where r and v are the moon-centered or selenocentric position and velocity vectors, respectively.
The following is the MATLAB source code that determines the time and trajectory conditions at closest
approach to the moon.
[t, ysol, tevent, yevent, ie] = ode45(@free_return_eqm, [0 tend], [ri vi], options);
Note that the numerical values for RelTol and AbsTol determine how well the algorithm integrates the
equations of motion.
The following is the MATLAB source code which calculates the sine of the selenocentric flight path
angle required by the event prediction code.
% input
% output
page 10
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
theta_moon = omega_moon * t;
isterminal = 1;
direction = [];
y t
z
u t
consisting of the state variables y and the control variables u for any time t. In this discussion vectors
are denoted in bold.
The system dynamics are defined by a vector system of ordinary differential equations called the state
equations that can be represented as follows:
dy
y f y t , u t , p, t
dt
page 11
The initial dynamic variables at time t0 are defined by ψ0 ψ y t0 , u t0 , t0 and the terminal
conditions at the final time t f are defined by ψ f ψ y t f , u t f , t f . These conditions are called the
boundary values of the trajectory problem.
For any mission time t there are also simple bounds on the state variables
yl y t yu
The basic nonlinear programming problem (NLP is to determine the control vector history and problem
parameters that minimize the scalar performance index or objective function given by
J y t0 , t0 , y t f , t f , p
In this MATLAB script, the control variables consist of the geocentric angular location of the TLI
maneuver and the scalar magnitude of this maneuver. The objective function or performance index is
the scalar magnitude of the TLI delta-v.
The geocentric angular location of the TLI maneuver during the optimization is bounded according to
g 10 g 10
where g corresponds to the user’s initial guess in degrees. Note that this angle is also equal to the
argument of latitude of the TLI maneuver at earth departure. It is measured positive counterclockwise
relative to the x-axis of the inertial coordinate system.
where Vg is the initial guess for the scalar magnitude of the TLI delta-v maneuver in meters per
second. Values for both the angular location and maneuver magnitude initial guesses are taken from the
technical paper mentioned at the being of this document.
page 12
The additional mission constraints for this problem are the user-defined lunar radius at closest approach
and the y-component of the third body velocity in the geocentric rotating coordinate system. The first
constraint ensures that the user’s lunar flyby altitude is satisfied. The second constraint ensures that at
the moment of lunar closest approach, the third body is exactly on the line from the earth to the moon in
either the inertial or rotating coordinate systems.
rfbp rM rfbu rM 0
yER B 0
In the first equation, rfbp represents the radius at the lunar flyby predicted by the software and rfbu is the
user-defined flyby radius. Notice that both values are normalized by the radius of the moon rM for
improved problem scaling.
Notice that the flight path angle constraint described earlier indirectly satisfies the image trajectory
mission constraint that the x-component of third body velocity in the rotating system is zero at the
moment of lunar closest approach.
The following MATLAB source code illustrates how the main script interacts with the SNOPT
nonlinear programming function. This code provides initial guesses (xg) and lower and upper bounds
(xlwr and xupr) for the control variables (theta_tli and deltav_tli) and the objective function
(flow and fupp).
% initial guesses
xg(2) = deltav_tli;
xg = xg';
xlwr = xlwr';
xupr = xupr';
flow(1) = 0.0d0;
fupp(1) = +Inf;
page 13
flow(2) = radius_lmo / radius_moon;
flow(3) = 0.0;
fupp(3) = 0.0;
flow = flow';
fupp = fupp';
snscreen on;
[x, f, inform, xmul, fmul] = snopt(xg, xlwr, xupr, flow, fupp, 'free_return_shoot');
% extract solution
theta_tli = x(1);
deltav_tli = x(2);
In the call to the SNOPT algorithm, the free_return_shoot MATLAB function implements a simple
shooting method that predicts lunar closest approach while solving the mission constraint equations.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
theta_pe = x(1);
page 14
vpe = vlc_leo + x(2);
[t, ysol, tevent, yevent, ie] = ode45(@free_return_eqm, [0 tend], [ri vi], options);
rrel(3) = 0.0;
f(1) = x(2);
% f(4) = vrel(1);
f = f';
% no derivatives
g = [];
After the free_return script solves for the orbital characteristics and transfer time of the outbound or
departure trajectory, the program then propagates the equations of motion for the entire free-return
mission. Here is the MATLAB source code that calculates the initial conditions for the optimal solution
(inertial geocentric position and velocity vectors), the total time of flight and performs these calculations
using the MATLAB ode45 function.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% propagate system of first-order differential equations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The following is the MATLAB source code for the function that evaluates the first-order inertial
equations of motion. It uses Professor Richard Battin’s f q functions to calculate the point-mass
gravity acceleration due to the moon.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
page 16
global mu_moon mu_earth omega_moon distance_e2m
r1 = sqrt(r2);
r3 = r2 * r1;
for i = 1:1:3
end
theta_moon = omega_moon * t;
rmoon(3) = 0.0;
for i = 1:1:3
end
% f(q) formulation
for i = 1:1:3
end
d3moon = norm(rm2sc)^3;
for i = 1:1:3
end
ydot = [ y(4)
y(5)
y(6)
agrav(1) + amoon(1)
page 17
agrav(2) + amoon(2)
agrav(3) + amoon(3)];
At the end of the numerical calculations, the free_return script provides information about how well
the solution satisfied the trajectory constraints at lunar closest approach. Here is that information for the
trajectory example solved earlier.
The first data item is the value for the y-component of the relative position vector. This number defines
how close the third body was to the earth-moon line at the time of lunar closest approach.
The second item is the x-component of the relative velocity vector, also at lunar closest approach. This
number indicates how “perpendicular” the trajectory was at closest approach.
The third data item is the angle between the moon and third body as seen from the earth, also at closest
approach. This angle is computed from cos1 uˆ E B uˆ E M where uˆ E B is a unit pointing vector
from the earth to the third body and uˆ E M is a unit pointing vector from the earth to the moon, both
calculated at the time of lunar closest approach.
Finally, the last data item is the geocentric inertial flight path angle of the third body at lunar closest
approach. It too is a measure of the orthogonality of the flyby trajectory.
Additional information about the unique properties of image trajectories can be found in Professor
Angelo Miele’s classic paper, “Theorem of Image Trajectories in the Earth-Moon Space”, XI
International Astronautical Congress, Stockholm, 1960.
page 18
Algorithm resources
“Revisit of the Theorem of Image Trajectories in the Earth-Moon Space”, Angelo Miele, Journal of
Optimization Theory and Applications, 2010.
“Automated Lunar Free Return Trajectory Generation”, Mark C. Jesick and Cesar A. Ocampo, AAS 09-
192, American Astronautical Society.
“Circumlunar Trajectory Calculations”, MIT Instrumentation Laboratory Report R-353, April 1962.
“Design of Earth-Moon Free-Return Trajectories”, Qinqin Luo, Jianfeng Yin and Chao Han, AIAA
Journal of Guidance, Control and Dynamics, Vol. 36, No. 1, January-February 2013, pp. 263-271.
“Injection Conditions for Lunar Trajectories”, R. Kolenkiewicz and W. Putney, NASA TM X-55390,
November 1965.
“Coplanar Three-Body Trans-Earth Lunar Trajectory Simulation Methodology”, H. Ikawa, AIAA 88-
0381, AIAA 26th Aerospace Sciences Meeting, Reno, Nevada, January 11-14, 1988.
“Lunar Constants and Models Document”, JPL D-32296, September 23, 2005.
page 19
Celestial Computing with MATLAB
This document describes a MATLAB script named leclipse.m that can be used to predict local
circumstances of lunar eclipses. This software provides the eclipse type, the universal times and
topocentric coordinates of the Moon at the beginning and end of the penumbra contacts, and the time
and coordinates at maximum eclipse. The source ephemeris for this routine is a JPL binary ephemeris
file. This application uses several functions ported to MATLAB from the Fortran version of the
NOVAS (Naval Observatory Vector Astrometry Subroutines) source code developed at the United
States Naval Observatory (www.usno.navy.mil/USNO/astronomical-applications/software-
products/novas). JPL binary ephemeris files for Windows compatible computers can be downloaded at
www.cdeagle.com.
This MATLAB script uses a combination of one-dimensional minimization and root-finding to solve
this classic problem. The objective function used in these calculations involves the geocentric
separation angle between the center of the Moon and the anti-Sun position vector or shadow axis, and
the semidiameter and horizontal parallax of the Sun and Moon. This function is given by the following
expression:
f t cos1 uˆ m uˆ s f1 sm
where
uˆ s geocentric unit position vector of the Sun
uˆ m geocentric unit position vector of the Moon
f1 1.02 1 s ss size of penumbra shadow
1 0.99834 m corrected parallax
m horizontal parallax of the Moon
s horizontal parallax of the Sun
sm semidiameter of the Moon
ss semidiameter of the Sun
If we let represent the minimum geocentric separation angle of the Moon relative to the shadow axis,
a penumbral lunar eclipse occurs whenever the following geometric condition is satisfied:
1.02 1 s ss sm
1.02 1 s ss sm
1.02 1 s ss sm
page 1
Celestial Computing with MATLAB
In these expressions
req req
m sin 1 s sin 1
dm ds
r r
sm sin 1 m ss sin 1 s
dm ds
where req is the equatorial radius of the Earth (6378.14 kilometers), rm is the radius of the Moon (1738
kilometers), rs is the radius of the Sun (696,000 kilometers), d m is the geocentric distance of the Moon,
and d s is the geocentric distance of the Sun.
The following is a typical user interaction with this script. The screen output created by the script
illustrates the local circumstances of a total lunar eclipse. The initial calendar date was January 1, 2000,
the search duration was 30 days, and the observer was located at the Chamberlin Observatory in Denver,
Colorado. The calendar date and time displayed is on the UTC time scale.
page 2
Celestial Computing with MATLAB
The following are the results for this same eclipse using the Multiyear Interactive Computer Almanac
(MICA) published by the United States Naval Observatory.
Moon's Position
UT1 Altitude Azimuth Angle
d h m ° ° °
Moon enters penumbra 21 02:03.0 22.7 83.1 85.8
Moon enters umbra 21 03:01.5 33.6 91.9 79.9
Moon enters totality 21 04:04.6 45.2 102.9 238.3
Maximum Eclipse 21 04:43.5 52.1 111.4 6.7
Moon exits totality 21 05:22.4 58.6 122.2 135.2
Moon exits umbra 21 06:25.5 66.9 148.5 293.6
Moon exits penumbra 21 07:24.1 69.5 184.6 287.6
page 3
Orbital Mechanics with MATLAB
This document describes a MATLAB script named levents.m that can be used to compute important
orbital events of the Moon. The motion of the Moon is modeled using the JPL DE421 binary ephemeris
and this script uses routines from the MICE software suite to read and evaluate this ephemeris. The
MICE routines and ephemeris file are available at naif.jpl.nasa.gov/naif/toolkit_MATLAB.html. MICE
is a MATLAB implementation of the SPICE library created by JPL.
Using a combination of one-dimensional minimization and root-finding, the levents MATLAB script
computes the following geocentric characteristics of the Moon’s orbital motion.
Script options 1, 2, and 6 are minimum and maximum conditions of the lunar orbit. The nodal crossings
correspond to times when the Moon crosses the Earth’s equatorial plane.
The levents MATLAB script will prompt you for the calendar date at which to start the events search
along with a search duration in days. The following illustrates these two prompts along with typical user
inputs shown in bold font. Please be sure to provide all digits of the calendar year.
program levents
The script will then display a list of event options with the following menu;
page 1
Orbital Mechanics with MATLAB
<5> user-defined true anomaly
For menu option 3, the script will also prompt for the user-defined value of geocentric right ascension
with the following display;
For menu option 4, the script will also prompt for the user-defined value of geocentric declination with
the following display;
For menu option 5, the script will also prompt for the user-defined value of true anomaly with the
following display;
For each of these script options, the input unit is degrees. Please note the range of valid input.
Script example
The following is a typical user interaction with this MATLAB script along with the program output for
the minimum and maximum geocentric declination of the moon during January 2014.
program levents
page 2
Orbital Mechanics with MATLAB
? 2
page 3
Orbital Mechanics with MATLAB
The orbital event summary screen contains the following information:
TDB Julian date = Julian Date of trajectory event on TDB time scale
UTC Julian date = Julian Date of trajectory event on UTC time scale
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
vmag (kps) = scalar magnitude of the Moon’s velocity vector in kilometers per second
Technical Discussion
In this MATLAB script, the orbital motion of the Moon is evaluated in the Earth mean equator and
equinox of J2000 (EME2000) coordinate system. The following figure illustrates the geometry of the
EME2000 coordinate system. The origin of this ECI inertial coordinate system is the geocenter and the
fundamental plane is the Earth’s mean equator. The z-axis of this system is normal to the Earth’s mean
equator at epoch J2000, the x-axis is parallel to the vernal equinox of the Earth’s mean orbit at epoch
J2000, and the y-axis completes the right-handed coordinate system. The epoch J2000 is the Julian Date
2451545.0 which corresponds to January 1, 2000, 12 hours Terrestrial Time (TT).
page 4
Orbital Mechanics with MATLAB
MATLAB functions
In this MATLAB script, the geocentric position and velocity vectors of the Moon are computed using a
function named jpleph_mice which requires initialization the first time it is called. The proper
initialization for this function is as follows:
iephem = 1;
ephname = 'de421.bsp';
km = 1;
The second item is the name of the binary ephemeris file to use for all calculations. The third item
determines the units of the output. If km = 1, the output will be in the units of kilometers and
kilometers per second. If km = 0, the output will be in the units of Astronomical Units and
Astronomical Units per day. These three items should be placed in a global statement at the beginning
of the main script which calls either of these functions.
Note that the value of the Astronomical Unit, in kilometers, used in a particular JPL ephemeris is
available as the constant au which is placed in global by the main script. The actual value used in a
particular JPL ephemeris can be found in the header file posted on the JPL website. For example, the
following are the first three lines in the header.421 data file. The value of Astronomical Unit used in
this ephemeris is the first number in row three of this data file.
% reads the jpl planetary ephemeris and gives the position and velocity
% of the point 'ntarg' with respect to point 'ncent' using MICE routines
% input
% 1 = mercury 8 = neptune
% 2 = venus 9 = pluto
% 3 = earth 10 = moon
% 4 = mars 11 = sun
% 5 = jupiter
% 6 = saturn
% 7 = uranus
% output
% global
It is good programming practice to close the binary ephemeris file at the end of the main script with the
following statement:
% unload ephemeris
cspice_unload('de421.bsp');
Time systems
Coordinated Universal Time (UTC) is the time scale available from broadcast time signals. It is a
compromise between the highly stable atomic time and the irregular earth rotation. UTC is the
international basis of civil and scientific time.
page 6
Orbital Mechanics with MATLAB
Terrestrial Time, TT
Terrestrial Time is the time scale that would be kept by an ideal clock on the geoid - approximately, sea
level on the surface of the Earth. Since its unit of time is the SI (atomic) second, TT is independent of
the variable rotation of the Earth. TT is meant to be a smooth and continuous “coordinate” time scale
independent of Earth rotation. In practice TT is derived from International Atomic Time (TAI), a time
scale kept by real clocks on the Earth's surface, by the relation TT = TAI + 32s.184. It is the time scale
now used for the precise calculation of future astronomical events observable from Earth.
In this equation, the coefficients are in seconds, the angular arguments are in radians, and T is the
number of Julian centuries of TT from J2000; T = (Julian Date(TT) – 2451545.0) / 36525.
The following is the MATLAB source code for the routine ported from the NOVAS Fortran subroutine.
Notice that the NOVAS name was simply times and the ported version is named novas_times to
avoid confusion with the built-in MATLAB function.
% input
page 7
Orbital Mechanics with MATLAB
% tdbjd = tdb julian date
% output
%%%%%%%%%%%%%%%%%%%%%%%
t0 = 2451545.0d0;
The fundamental time argument for the lunar ephemeris function used in this MATLAB script is
“ephemeris” time. As implemented here, we assume this time argument to be Barycentric Dynamical
Time (TDB). To report the time of these celestial events in Universal Coordinated Time (UTC) or civil
time, we need an algorithm to make this time conversion.
The following is the MATLAB source code for a function which iteratively performs this calculation
using Brent’s root-finding method.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global jdsaved
page 8
Orbital Mechanics with MATLAB
jdsaved = jdtdb;
% convergence tolerance
rtol = 1.0d-8;
x1 = jdsaved - 0.1;
x2 = jdsaved + 0.1;
jdutc = xroot;
end
This function calls the following MATLAB objective function during the calculations.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global jdsaved
tai_utc = findleap(jdin);
end
Notice that this function requires the findleap function which calculates the number of leap seconds
for the current UTC Julian date value. The jdfunc function is computing the difference between the
TDB Julian date input by the user and the value computed by the utc2tdb MATLAB function. The
algorithm has converged whenever this value is less than or equal to the user-defined tolerance rtol.
The difference between International Atomic Time (TAI) and Universal Coordinated Time (UTC) is the
number of current leap seconds. International Atomic Time (TAI, Temps Atomique International) is a
physical time scale with the unit of the SI (System International) second and derived from a statistical
page 9
Orbital Mechanics with MATLAB
timescale based on a large number of atomic clocks. Coordinated Universal Time (UTC) is the time
scale available from broadcast time signals. It is a compromise between the highly stable atomic time
and the irregular earth rotation. UTC is the international basis of civil and scientific time.
The calculation of leap seconds in this MATLAB script is performed by a function that reads a simple
ASCII data file and evaluates the current value of leap seconds. The leap second function must be
initialized by including the following statements in the main script.
readleap;
The readleap MATLAB function reads the contents of the following simple comma-separated-
variable (csv) two column data file. The name of this file is tai-utc.dat.
2441317.5, 10.0
2441499.5, 11.0
2441683.5, 12.0
2442048.5, 13.0
2442413.5, 14.0
2442778.5, 15.0
2443144.5, 16.0
2443509.5, 17.0
2443874.5, 18.0
2444239.5, 19.0
2444786.5, 20.0
2445151.5, 21.0
2445516.5, 22.0
2446247.5, 23.0
2447161.5, 24.0
2447892.5, 25.0
2448257.5, 26.0
2448804.5, 27.0
2449169.5, 28.0
2449534.5, 29.0
2450083.5, 30.0
2450630.5, 31.0
2451179.5, 32.0
2453736.5, 33.0
2454832.5, 34.0
The first column of this data file is the Julian date, on the UTC time scale, at which the leap second
became valid. The second column is the leap second value, in seconds.
Note that this data is passed between the leap second MATLAB functions by way of a global statement.
The MATLAB function that actually reads and evaluates the current value of leap seconds has the
following syntax and single argument.
page 10
Orbital Mechanics with MATLAB
% input
% output
The leap seconds data file should be updated whenever the International Earth Rotation and Reference
Systems Service (IERS) announces a new leap second.
page 11
Orbital Mechanics with MATLAB
Appendix A
Additional Script Examples
This appendix includes output created by several of the other levents script options.
program levents
? 3
program levents
? 6
page 13
Orbital Mechanics with MATLAB
calendar date 30-Jan-2014
program levents
? 7
page 14
Orbital Mechanics with MATLAB
page 15
Celestial Computing with MATLAB
This document describes a MATLAB script named loccult.m that can be used to predict the local
circumstances of lunar occultations of a planet or star. The source ephemeris for this routine is a JPL
binary ephemeris file. This application uses several functions ported to MATLAB from the Fortran
version of the NOVAS (Naval Observatory Vector Astrometry Subroutines) source code developed at
the United States Naval Observatory (www.usno.navy.mil/USNO/astronomical-applications/software-
products/novas). JPL binary ephemeris files for Windows compatible computers can be downloaded at
www.cdeagle.com.
This script uses a combination of one-dimensional minimization and root-finding to solve this problem.
The objective function used in these calculations is the topocentric separation angle between the center
of the Moon and the object being occulted. This function is given by the following expression:
f t cos1 uˆ m uˆ b sm sb
where
uˆ m topocentric unit position vector of the Moon
uˆ b topocentric unit position vector of the object
sm semidiameter of the Moon
sb semidiameter of the object
r
sm sin 1 m
dm
where rm is the radius of the Moon (1738 kilometers) and d m is the topocentric distance of the Moon.
s p0
sp
rp
where s p0 is the semidiameter of the planet at a distance of one astronomical unit and rp is the
topocentric distance of the planet.
If the target body is a star, the software will prompt you for the name of the star data file with a screen
display similar to
page 1
Celestial Computing with MATLAB
The file type defaults to names with a *.dat filename extension. However, you can select any
loccult compatible ASCII data file by selecting the Files of type: field or by typing the name of the
file directly in the File name: field.
The following is a typical star data file named spica.dat. Do not delete any lines of text or data as the
software expects to find exactly 20 lines of information. Please note the proper units.
star name
SPICA
parallax (arcseconds)
0.0210
The following is a typical user interaction with this MATLAB script. It illustrates a lunar occultation of
the star Spica relative to an observer located in Denver, Colorado.
<1> Mercury
<2> Venus
<3> Mars
<4> Jupiter
<5> Saturn
<6> Uranus
<7> Neptune
<8> Pluto
<9> Star
page 3
Computer Methods for TransEarth TCM
Delta-V Design and Optimization
This document describes three computer programs that can be used to design and optimize an
impulsive trajectory correction maneuver (TCM) during the transEarth phase of lunar flight. The first
algorithm “targets” the maneuver to achieve Earth relative flight path coordinates at the Earth entry
interface (EI). The other two numerical methods attempt to minimize the magnitude of the TCM delta-
v and also achieve the EI targets or mission constraints.
The following is a summary of the numerical methods used in each computer program.
Each computer program is data-driven by a simple ASCII input file created by the user. The software
allows the user to specify the order and degree of the Earth gravity model used in the geocentric
equations of motion. The user also has the option to include point-mass gravity perturbations of the
Sun and Moon. The solar and lunar ephemeris is based on the JPL DE405 development ephemeris.
The user can choose a subset of EI flight path coordinates that includes the geodetic altitude, geodetic
latitude, geographic longitude, and the relative azimuth angle. The relative flight path angle must be
specified for all three algorithms. Finally, the user can also provide an initial guess for the three
components of the TCM delta-v maneuver.
This section illustrates a typical input data file for the TCM software suite.
******************************************
** trans-Earth TCM trajectory optimization
** n-body geocentric motion
** Moon-to-Earth data file - cev1.in
** November 19, 2007
******************************************
TCM epoch
Aug 6 2018 15:59:59.994 TDB
************************************************
geocentric EME2000 orbital elements prior to TCM
************************************************
page 1
argument of perigee (degrees)
0.347338533437D+03
**********************************************************
initial guess and bounds for geocentric TCM delta-v vector
**********************************************************
*****************************************************
entry interface constraints (set to 1.0d99 to ignore)
*****************************************************
************************
trajectory perturbations
************************
**********************************************
root-finding and integration algorithm control
**********************************************
page 2
root-finding tolerance
1.0d-8
RKF7(8) truncation error tolerance
1.0d-12
PROGRAM OUTPUT
The following is a summary of the program output from each computer program for this example. The
entry interface targets for this example were the geodetic altitude (121.92 kilometers) and latitude (-
19.5 degrees), and the geographic east longitude (121 degrees). The EI relative flight path angle target
is -6.2 degrees.
----------------------------------
time and conditions prior to TCM
(geocentric - EME2000 coordinates)
----------------------------------
----------------------------------
time and conditions after the TCM
(geocentric - EME2000 coordinates)
----------------------------------
page 3
--------------------------------
TCM delta-v vector and magnitude
(geocentric EME2000)
--------------------------------
--------------------------------------
time and conditions at entry interface
(geocentric - EME2000 coordinates)
--------------------------------------
--------------------------------
TCM delta-v vector and magnitude
(geocentric EME2000)
--------------------------------
page 4
delta-vx 7.795236204346402 meters/second
delta-vy -2.814543163808415 meters/second
delta-vz -5.788454575706034 meters/second
The following is the delta-v summary and the targets achieved at the entry interface.
page 5
TECHNICAL DISCUSSION
This section describes the fundamental algorithms implemented in this software suite. It includes a
summary of the simple shooting method used in the first two computer programs, the equations of
motion, and the transformation of the inertial state vector at the entry interface to the corresponding
flight path coordinates which are targets or mission constraints. In these applications, the fundamental
time system is barycentric dynamical time (TDB) and the coordinate system is the Earth mean equator
and equinox of J2000 (EME2000).
The first program attempts to solve a system of three nonlinear constraint equations similar to
hp − ht = 0
φ p − φt = 0
λ p − λt = 0
where the p subscript denotes a predicted coordinate and the t subscript is a user-defined target.
The other two programs attempt to minimize a scalar performance index given by
where ∆Vx , ∆Vy , ∆Vz are the components of the impulsive TCM delta-v.
Shooting method
The elapsed time from the TCM until the spacecraft reaches the entry interface with the user-defined
relative flight path angle is determined by an algorithm that includes Brent’s one-dimensional root-
finder embedded within a Runge-Kutta-Fehlberg 7(8) numerical integration method. This technique
searches for the time at which the difference between the predicted and user-defined relative flight path
angles is within a small tolerance ( γ p − γ t < ε ) .
The TCM computer programs implement a special perturbation technique which numerically
integrates the vector system of second-order, nonlinear differential equations of motion of a spacecraft
given by
a ( r, t ) =
r ( r, t ) = a g ( r, t ) + a m ( r, t ) + a s ( r,t )
where
page 6
t = barycentric dynamical time
r = inertial position vector of the spacecraft
a g = acceleration due to the Earth's gravity
a m = acceleration due to the Moon
a s = acceleration due to the Sun
This computer program uses a spherical harmonic representation of the Earth’s geopotential function
given by
µ µ µ ∞ n ⎛R⎞
∞ n n
⎛R⎞
Φ ( r, φ , λ ) = + ∑ C ⎜ ⎟ Pn0 ( u ) + ∑∑ ⎜ ⎟ Pnm ( u ) ⎡⎣ Snm sin mλ + Cnm cos mλ ⎤⎦
0
n
r r n =1 ⎝ r ⎠ r n =1 m =1 ⎝ r ⎠
where φ is the geocentric latitude of the spacecraft, λ is the geocentric east longitude of the spacecraft
and r = r = x 2 + y 2 + z 2 is the geocentric distance of the spacecraft. In this expression the S’s and
C’s are unnormalized harmonic coefficients of the geopotential, and the P’s are associated Legendre
polynomials of degree n and order m with argument u = sin φ .
The software calculates the spacecraft’s acceleration due to the Earth’s gravity field with a vector
equation derived from the gradient of the potential function expressed as a g ( r, t ) = ∇Φ ( r, t ) .
This acceleration vector is a combination of pure two-body or point mass gravity acceleration and the
gravitational acceleration due to higher order nonspherical terms in the Earth’s geopotential. In terms
of the Earth’s geopotential Φ , the inertial rectangular cartesian components of the spacecraft’s
acceleration vector are as follows:
⎛1∂Φ⎞ ⎛ x2 + y2 ∂ Φ ⎞
z=⎜
⎟ z + ⎜ ⎟
⎝r ∂r ⎠ ⎜ r 2
∂φ ⎟
⎝ ⎠
The three partial derivatives of the geopotential with respect to r, φ , λ are given by
∂Φ 1⎛ µ ⎞ N ⎛ R⎞
n
∂r r ⎝ r ⎠ n =2 ⎝ r ⎠ m =0
∂Φ ⎛µ⎞ N ⎛R⎞
n n
= ∑
∂φ ⎜⎝ r ⎟⎠ n =2 ⎜⎝ r ⎟⎠
∑ (C
m =0
m
n cos mλ + Snm sin mλ ) ⎡⎣ Pnm +1 ( sin φ ) − m tan φ Pnm ( sin φ ) ⎤⎦
page 7
∂Φ ⎛µ⎞ N ⎛R⎞
n n
= ∑
∂λ ⎜⎝ r ⎟⎠ n =2 ⎜⎝ r ⎟⎠
∑ m (S
m =0
m
n cos mλ − Cnm sin mλ ) Pnm ( sin φ )
where
R = radius of the Earth
r = geocentric distance of the spacecraft
Snm , Cnm = harmonic coefficients
φ = geocentric latitude of the spacecraft = sin −1 ( z r )
λ = longitude of the spacecraft = α − α g
α = right ascension of the spacecraft = tan −1 ( ry rx )
α g = right ascension of Greenwich
Right ascension is measured positive east of the vernal equinox, longitude is measured positive east of
Greenwich, and latitude is positive above the Earth’s equator and negative below.
For m = 0 , the coefficients are called zonal terms, when m = n the coefficients are sectorial terms, and
for n > m ≠ 0 the coefficients are called tesseral terms.
The Legendre polynomials with argument sin φ are computed using recursion relationships given by:
1
Pn0 ( sin φ ) = ⎡⎣( 2n − 1) sin φ Pn0−1 ( sin φ ) − ( n − 1) Pn0−2 ( sin φ ) ⎤⎦
n
Pnn ( sin φ ) = ( 2n − 1) cos φ Pnn−−11 ( sin φ ) , m ≠ 0, m < n
The true-of-date position vector required in the previous equations is computed according to
page 8
rTOD = [ PN ] rEME 2000
The east longitude required in the gravity model calculations is computed from the x and y components
of the true-of-date position vector according to
λ = tan −1 ( ry , rx ) − α g
The true-of-date gravity vector is converted to the EME2000 system for use in the equations of motion
using the transpose of the combined precession-nutation matrix as follows
⎛ G G
G G rm −b re−m ⎞
am ( r , t ) = − µ m ⎜ +
G 3 G 3 ⎟⎟
⎜ rm −b re−m ⎠
⎝
where
µm = gravitational constant of the moon
G
rm −b = position vector from the moon to the spacecraft
G
re−m = position vector from the Earth to the moon
Likewise, the acceleration contribution of the sun represented by a point mass is given by
G G ⎛ rG G
re− s ⎞
as ( r , t ) = − µ s ⎜ G 3 + G 3 ⎟
s −b
⎜r re− s ⎟⎠
⎝ s −b
where
µ s = gravitational constant of the sun
G
rs −b = position vector from the sun to the spacecraft
G
re− s = position vector from the Earth to the sun
page 9
⎡ 3 + 3qk + qk2 ⎤
f ( qk ) = qk ⎢ 3⎥
(
⎢⎣1 + 1 + qk ⎥⎦ )
where
r T ( r − 2s k )
qk =
sTk sk
n
µk
r = −∑
⎡r + f ( qk ) s k ⎤⎦
k =1 d k3 ⎣
This section describes the algorithms used to compute the following flight path coordinates at the entry
interface.
r = geocentric radius
V = speed
γ = flight path angle
δ = geocentric declination
λ = geographic longitude ( + east )
ψ = flight azimuth ( + clockwise from north )
The transformation of an Earth-centered inertial (ECI) position vector rECI to an Earth-centered fixed
(ECF) position vector rECF is given by the following vector-matrix operation
rECF = [ T ] rECI
⎡ cosθ sin θ 0⎤
[ T] = ⎢⎢ − sin θ cosθ 0⎥
⎥
⎢⎣ 0 0 1⎥⎦
and θ is the Greenwich apparent sidereal time at the moment of interest. Greenwich sidereal time is
given by the following expression:
θ = θ g 0 + ω et
where θ g 0 is the Greenwich sidereal time at 0 hours UT, ω e is the inertial rotation rate of the Earth,
and t is the elapsed time since 0 hours UT.
page 10
Finally, the flight path coordinates are determined from the following set of equations
r = rECF
2
+ rECF
2
y
+ rECF
2
v = vECF
2
+ vECF
2
y
+ vECF
2
z
(
λ = tan −1 rECF , rECFy x
)
⎛ rECFz ⎞
δ = sin −1 ⎜⎜ ⎟⎟
⎝ rECF ⎠
⎛ vRz ⎞
γ = sin −1 ⎜⎜ − ⎟
⎝ v R ⎟⎠
ψ = tan −1 ⎡⎣vR , vR ⎤⎦
y x
where
⎡ − sin δ cos λ − sin δ sin λ cos δ ⎤
v R = ⎢⎢ − sin λ cos λ 0 ⎥⎥ v ECF
⎢⎣ − cos δ cos λ − cos δ sin λ − sin δ ⎥⎦
Please note that the two argument inverse tangent calculation is a four quadrant operation.
These computer programs use a series solution to convert geocentric radius and declination to geodetic
altitude and latitude. The following diagram illustrates the geometric relationship between geocentric
and geodetic coordinates.
page 11
In this diagram, δ is the geocentric declination, φ is the geodetic latitude, r is the geocentric distance,
and h is the geodetic altitude. The exact mathematical relationship between geocentric and geodetic
coordinates is given by the following system of two nonlinear equations
( c + h ) cos φ − r cos δ =0
( s + h ) sin φ − r sin δ =0
req
c=
1 − ( 2 f − f 2 ) sin 2 φ
s = c (1 − f )
2
and req is the Earth equatorial radius and f is the flattening factor for the Earth.
In these computer programs, the geodetic latitude is determined using the following expression:
⎛ sin 2δ ⎞ ⎡⎛ 1 1 ⎞ ⎤
φ =δ +⎜ ⎟ f + ⎢⎜ 2 − ⎟ sin 4δ ⎥ f 2
⎝ ρ ⎠ ⎣⎝ ρ 4ρ ⎠ ⎦
⎧⎪⎛ 1 − cos 2δ ⎞ ⎡⎛ 1 1⎞ ⎤ 2 ⎫⎪
hˆ = ( rˆ − 1) + ⎨⎜ ⎟ f + ⎢⎜ − ⎟ (1 − cos 4δ ) ⎥f ⎬
⎩⎪⎝ 2 ⎠ ⎣⎝ 4 ρ 16 ⎠ ⎦ ⎪⎭
In these equations, ρ is the geocentric distance of the satellite, hˆ = h / req and rˆ = ρ / req .
page 12
Transformation to and from the lunar ME and PA Coordinate Systems
According to JPL D-32296, “Lunar Constants and Models Document” and the IAU 2000
resolutions, the constant transformation matrix from the lunar Mean Earth/polar axis
(ME) system to the lunar Principal axis (PA) system is given by the following (1-2-3)
rotation sequence;
These numbers have been confirmed using the following Fortran call to the sxform
subroutine of the JPL Spice library;
The following Fortran data statement can be used to include the ME-to-PA
transformation matrix in an analysis program.
data tm_me2pa
& / 0.999999878527094d0, -3.097891271165531d-4,
& 3.833751355924360d-4,
& 3.097894216177013d-4, 0.999999952015005d0,
& -7.087975496937868d-7,
& -3.833748976184077d-4, 8.275630251118771d-7,
& 0.999999926511499d0 /
π
The conversion from arc-seconds to radians is given by .
648000
Approximate lunar pole right ascension, declination and prime meridian in the PA
system
Page 1
Page 7 of the JPL document also provides the following “tweaks” to the orientation of the
moon in order to approximate the orientation in the PA system.
Wp = 38.3213 + Wd − 1.4i10−12 d 2
and
α IAU = 269.9949 + 0.0031T − 3.8787 sin E1 − 0.1204sin E 2
+0.0700sin E 3 − 0.0172sin E 4 + 0.0072sin E 6
−0.0052sin E10 + 0.0043sin E13
Page 2
E1 = 125.045 − 0.0529921d
E 2 = 250.089 − 0.1059842d
E 3 = 260.008 + 13.0120009d
E 4 = 176.625 + 13.3407154d
E 5 = 357.529 + 0.9856003d
E 6 = 311.589 + 26.4057084d
E 7 = 134.963 + 13.0649930d
E 8 = 276.617 + 0.3287146d
E 9 = 34.226 + 1.7484877d
E10 = 15.134 − 0.1589763d
E11 = 119.743 + 0.0036096d
E12 = 239.961 + 0.1643573d
E13 = 25.053 + 12.9590088d
where d = JD − 2451545 is the number of days since January 1.5, 2000. These equations
are given in “Report of the IAU/IAG Working Group on Cartographic Coordinates and
Rotational Elements of the Planets and Satellites: 2000”, Celestial Mechanics and
Dynamical Astronomy, 82: 83-110, 2002.
Page 3
A Moon-Centered, Inertial Coordinate System for Spice
This memo describes the steps used to create a right-handed, orthogonal selenocentric or moon-
centered inertial frame definition and data file (“frame kernel”) for Spice. The fundamental
plane of this inertial system is the lunar mean equator and the fundamental x-axis is the IAU
node of J2000. The y-axis is advanced 90 degrees along the lunar equator from the x-axis, and
the z-axis is perpendicular to the mean equator of the moon. The term mean indicates that
precession has been accounted for, but not the effect of nutation.
The following figure illustrates the orientation of this coordinate system relative to the Earth’s
mean equator and north pole of J2000 (EME2000). The x-axis or Q-vector is formed from the
cross product of the Earth’s mean pole of J2000 and the Moon’s north pole relative to EME2000.
In general, the x-axis is called the IAU node of epoch. For this application, we will set or
“freeze” the epoch to J2000 (January 1.5, 2000).
Figure 1. Moon mean equator and IAU node of epoch coordinate system
Page 1
Lunar pole right ascension and declination relative to EME2000
The following two equations describe the time evolution of the right ascension and declination of
the moon’s mean pole, in degrees, with respect to the Earth mean equator and equinox of J2000
(EME2000) coordinate system.
T JD 2451545.0 / 36525
The trigonometric arguments, in degrees, for the pole orientation equations are
E1 125.045 0.0529921d
E 2 250.089 0.1059842d
E 3 260.008 13.0120009d
E 4 176.625 13.3407154d
E 6 311.589 26.4057084d
E 7 134.963 13.0649930d
E10 15.134 0.1589763d
E13 25.053 12.9590088d
where d JD 2451545 is the number of days since January 1.5, 2000. These equations are
given in “Report of the IAU/IAG Working Group on Cartographic Coordinates and Rotational
Elements of the Planets and Satellites: 2000”, Celestial Mechanics and Dynamical Astronomy,
82: 83-110, 2002.
The three rotation angles used to create an Euler frame definition file for Spice are given by
1 90
2 90
3 0
Page 2
In order to define a frame relative to the IAU node of J2000, the values of both T and d used in
the polynomials evaluated to compute these angles are identically zero.
The following are the contents of a simple ASCII text file named moon_j2000.tf that provides
the frame definition information needed by Spice.
\begintext
\begindata
FRAME_MOON_J2000 = 4902
FRAME_4902_NAME = 'MOON_J2000'
FRAME_4902_CLASS = 5
FRAME_4902_CLASS_ID = 4902
FRAME_4902_CENTER = 301
FRAME_4902_RELATIVE = 'J2000'
FRAME_4902_DEF_STYLE = 'PARAMETERIZED'
FRAME_4902_FAMILY = 'EULER'
FRAME_4902_EPOCH = @2000-JAN-1/12:00:00
FRAME_4902_AXES = ( 3 1 3 )
FRAME_4902_UNITS = 'DEGREES'
FRAME_4902_ANGLE_1_COEFFS = ( -356.857733 0.0 0.0 )
FRAME_4902_ANGLE_2_COEFFS = ( -24.3588973 0.0 0.0 )
FRAME_4902_ANGLE_3_COEFFS = ( 0.0 0.0 0.0 )
Additional information can be found in the “FRAMES Required Reading” document, NAIF
Document No. 349.10, last modified 27 NOV 2006.
The numerical elements of the EME2000-to-Moon mean equator and IAU node of J2000
transformation matrix are as follows.
The following is the Fortran subroutine that was used to compute the two angles defined in the
Spice frame definition file. For the example described in this document, the input argument
xjdate was equal to 2451545.
c input
c output
Page 3
c tmatrix = transformation matrix
c ************************************
c time arguments
d = xjdate - 2451545.0d0
e1 = 125.045d0 - 0.0529921d0 * d
e2 = 250.089d0 - 0.1059842d0 * d
e3 = 260.008d0 + 13.0120009d0 * d
e4 = 176.625d0 + 13.3407154d0 * d
e5 = 357.529d0 + 0.9856003d0 * d
e6 = 311.589d0 + 26.4057084d0 * d
e7 = 134.963d0 + 13.0649930d0 * d
e8 = 276.617d0 + 0.3287146d0 * d
Page 4
& + 0.0239d0 * cos(dtr * e2)
& - 0.0278d0 * cos(dtr * e3)
& + 0.0068d0 * cos(dtr * e4)
& - 0.0029d0 * cos(dtr * e6)
& + 0.0009d0 * cos(dtr * e7)
& + 0.0008d0 * cos(dtr * e10)
& - 0.0009d0 * cos(dtr * e13)
zhat(1) = 0.0d0
zhat(2) = 0.0d0
zhat(3) = 1.0d0
c compute y-direction
tmatrix(1, 1) = xhat(1)
tmatrix(1, 2) = xhat(2)
tmatrix(1, 3) = xhat(3)
tmatrix(2, 1) = yhat(1)
tmatrix(2, 2) = yhat(2)
tmatrix(2, 3) = yhat(3)
tmatrix(3, 1) = phat_moon(1)
tmatrix(3, 2) = phat_moon(2)
tmatrix(3, 3) = phat_moon(3)
return
end
The following figure illustrates the geometry of the EME2000 coordinate system. Both
coordinate system illustrations used in this memo were extracted from JPL D-32296, “Lunar
Constants and Models Document” dated September 23, 2005.
Page 5
Figure 2. Earth mean equator and equinox of J2000 coordinate system
Page 6
Coordinate Transformation from the Moon Mean Equator and
IAU Node of J2000 System to the Lunar PA Coordinate System
M EME 2000 Rz Rx Rz
PA
In this equation, is the angle along the ICRF (International Celestial Reference Frame)
equator, from the ICRF x-axis to the ascending node of the lunar equator, is the
inclination of the lunar equator to the ICRF equator, and is the angle along the lunar
equator from the node to the lunar prime meridian. These three Euler angles represent
the numerically integrated physical librations of the Moon.
The principal axis frame is aligned with the three maximum moments of inertia of the
Moon. The LP150Q lunar gravity model was developed using this frame.
The relationship between these angles and the classical IAU (International Astronomical
Union) orientation angles is
90
90
W
For long-term orbit prediction of low lunar orbits (LLO), we require the transformation
between the inertial Moon mean equator and IAU node of J2000 system and the body-
fixed PA coordinate system.
The transformation from this inertial system which we will call moon_j2000 to the PA
system is given by the following matrix multiplication;
Page 1
For accurate orbital analysis, the lunar libration angles can be obtained from a lunar
ephemeris. The JPL Developmental Ephemeris DE403 is considered the best currently
available lunar ephemeris. Chebyshev polynomial representations of the Euler angles
and their rates in the PA system are included in the DE403 ephemeris file which is
available from http://ssd.jpl.nasa.gov.
Fortran subroutine
The following is the source code listing for a Fortran subroutine that evaluates the DE403
ephemeris file and computes this coordinate transformation.
c moon_j2000-to-moon_pa transformation
c matrix using DE403.bin binary ephemeris
c input
c output
c ************************************
dimension tmatrix(3, 3)
data tmatrix2
& / 0.998496505205088d0,
& -5.481540926807404d-2,
& 0.0d0,
& 4.993572939853833d-2,
& 0.909610125238044d0,
& 0.412451018902688d0,
& -2.260867140418499d-2,
& -0.411830900942612d0,
& 0.910979778593430d0 /
icent = 0
itarg = 15
Page 2
phi = sv(1)
theta = sv(2)
psi = sv(3)
end
In this subroutine, jpleph is a subroutine that evaluates the binary ephemeris file,
matran is a subroutine that performs a sequence of ordered rotations, and matxmat is a
Fortran subroutine that performs multiplies two matrices. The source code for the
jpleph subroutine is provided by JPL as are routines for creating a binary DE403
ephemeris file from the ASCII source data. It also includes routines that open and read
the binary file.
Page 3
Orbital Mechanics with MATLAB
This document describes a MATLAB script named moon_plot.m that can be used to graphically
display orbital information about the Moon. The lunar motion is modeled using the JPL DE421
ephemeris and this script uses routines from the MICE software suite to read and evaluate this
ephemeris. MICE is a MATLAB implementation of the SPICE library created by JPL. The MICE
routines and ephemeris file are available at naif.jpl.nasa.gov/naif/toolkit_MATLAB.html.
Script example
program moon_plot
<2> eccentricity
page 1
Orbital Mechanics with MATLAB
? 3
Here’s a graphics display of the orbital inclination relative to the ecliptic plane for this same time period.
page 2
Orbital Mechanics with MATLAB
In this MATLAB script, the orbital motion of the Moon is evaluated in the Earth mean equator and
equinox of J2000 (EME2000) coordinate system. The following figure illustrates the geometry of the
EME2000 coordinate system. The origin of this ECI inertial coordinate system is the geocenter and the
fundamental plane is the Earth’s mean equator. The z-axis of this system is normal to the Earth’s mean
equator at epoch J2000, the x-axis is parallel to the vernal equinox of the Earth’s mean orbit at epoch
J2000, and the y-axis completes the right-handed coordinate system. The epoch J2000 is the Julian Date
2451545.0 which corresponds to January 1, 2000, 12 hours Terrestrial Time (TT).
Figure 1. Earth mean equator and equinox of J2000 (EME2000) coordinate system
The ecliptic inclination, argument of perigee and longitude of the ascending node are computed using
the geocentric position and velocity vectors of the Moon in the Earth mean ecliptic and equinox of
J2000 coordinate system.
T T
1 0 0 1 0 0
v ec 0 cos sin v eq 0 0.917482062069182 -0.397777155931914 v eq
0 sin cos 0 0.397777155931914 0.917482062069182
where v ec is a vector in the ecliptic frame, v eq is a vector in the Earth equatorial frame and is the
mean obliquity of the ecliptic at J2000. The J2000 value of the mean obliquity of the ecliptic is equal to
23 2621.448 .
page 3
Orbital Mechanics with MATLAB
The moon_plot MATLAB script will also create a comma separated variable (csv) data file of the lunar
coordinates used to create the graphic displays. The name of this data file is moon_plot.csv. It
contains the Julian date on the Barycentric Dynamical Time (TDB) scale in column 1, the three
components of the EME2000 geocentric position vector of the Moon in columns 2, 3 and 4, and the
geocentric velocity vector in columns 5, 6, and 7. The units are kilometers for the position vector and
kilometers per second for the velocity vector. The data is written at the step size specified by the user.
This MATLAB script will also create a color encapsulated Postscript (eps) graphic image with a TIFF
preview. The name of the disk file is moon_plot.eps. The following source code performs this
operation.
page 4
A Computer Program for Propagating Spacecraft Trajectories from Earth to the Moon
This document is the user’s manual for a Windows compatible executable computer program called
pprop_lunar that can be used to numerically integrate the geocentric orbital equations of motion of a
spacecraft traveling from the Earth to the Moon. This scientific simulation begins at a user-defined
epoch and state vector somewhere along the trans-lunar trajectory and ends at (1) closest approach to the
moon, (2) a user-defined lunar (selenocentric) distance, or (3) at a user-defined epoch.
This manual also includes a technical discussion that summarizes the numerical technique and methods
implemented in this computer program. Barycentric Dynamical Time (TDB) is the fundamental time
argument for this simulation and the fundamental solar, lunar and planetary ephemeris is DE421. This
computer program also uses version 3.1 of the Naval Observatory Vector Astrometry Software
(NOVAS) library for coordinate conversions. The software was created using Intel Visual Fortran.
All internal calculations and the output provided by the pprop_lunar software are performed in the
metric system. The geocentric equations of spacecraft motion include the non-spherical gravity effects
of the Earth and the point-mass gravity of the moon and (optionally) the point-mass gravity of the sun
and planets. The option to include the effect of solar radiation pressure in the trans-lunar trajectory is
also provided.
The pprop_lunar software is “data-driven” by a user-created text file. The following is a typical input
file used by this computer program. Each data item within an input file is preceded by one or more lines
of annotation text. Do not delete any of these annotation lines or change the number of lines reserved
for each comment and data item. However, you may change them to reflect your own explanation or
information. The annotation line also includes the correct units and when appropriate, the valid range of
the input. ASCII text input is not case sensitive but must be spelled correctly. In the following
discussion the actual input file contents are in courier font and all explanations are in times italic font.
The first four lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with four and only four initial text lines.
**********************************************
* pprop_lunar input data file - pprop_lunar.in
* Earth-to-Moon trajectory example
**********************************************
The first program input is the name of a constants and models data file. This ASCII data file contains
user-defined astrodynamic constants and other information.
name of constants and models data file
--------------------------------------
pprop_lunar_cm.dat
The following is a typical constants and models data file. Do not delete any of these annotation lines or
increase or decrease the number of lines reserved for each comment or data item. Also, please note the
proper units for each data item.
********************************************
* pprop_lunar constants and models data file
********************************************
page 1
astronomical unit (kilometers)
------------------------------
149597870.691d0
The second program input is the difference between ephemeris time (ET) and Universal Coordinated
Time (UTC) in seconds.
ET-UTC (seconds)
65.184d0
This next option specifies the type of final conditions of the propagated trajectory. Option 1 propagates
to closest approach to the Moon, option 2 propagates to a user-defined selenocentric distance, and
option 3 propgates to a user-defined final epoch.
type of propagation final condition
1 = lunar closest approach
2 = user-defined lunar distance
3 = user-defined final epoch
-----------------------------
1
The next two sets of inputs define the calendar date and UTC time of the final epoch for option 3
described above. Be sure to include all four digits of the calendar year.
user-defined final calendar date
(1 <= month <= 12, 1 <= day <= 31, year = all digits!)
------------------------------------------------------
9, 20, 2008
The next input defines the final user-defined lunar distance for program option 2 described above.
user-defined lunar distance (kilometers)
10000.0d0
page 2
The next two inputs define the calendar date and UTC at the initial time.
initial calendar date
(1 <= month <= 12, 1 <= day <= 31, year = all digits!)
------------------------------------------------------
9, 15, 2008
The next three data items define the x, y, and z components of the geocentric position vector of the
spacecraft at the initial time.
Earth departure geocentric position vector components
(mean equator and equinox j2000 - kilometers)
---------------------------------------------
-0.335854711130D+04
-0.487114690579D+04
-0.284095894469D+04
The next three data items define the x, y, and z components of the geocentric velocity vector of the
spacecraft at the initial time. The position and velocity vectors must be specified relative to the Earth
mean equator and equinox of J2000 (EME2000) coordinate system.
Earth departure geocentric velocity vector components
(mean equator and equinox j2000 - kilometers/second)
----------------------------------------------------
0.936637513219D+01
-0.517963813841D+01
-0.219458266670D+01
The next two integers allow the user to specify what types of third body point-mass gravity perturbations
are included during the geocentric trajectory propagation. To activate an option, the input should be
set to 1. Otherwise, the input should be 0.
include solar point-mass perturbation (1 = yes, 0 = no)
-------------------------------------------------------
1
The name of the ASCII data file containing the Earth gravity model data is specified in the next line.
name of Earth gravity model data file
egm96.dat
The order (zonals) of the Earth gravity model is an integer defined in the next line.
order of the gravity model (zonals)
8
The degree (tesserals) of the Earth gravity model is an integer defined in this next line.
degree of the gravity model (tesserals)
8
page 3
The next series of inputs define the spacecraft characteristics used for solar radiation pressure
perturbation calculations. These three items include the spacecraft’s mass, reference cross-sectional
area, and reflectivity coefficient. To exclude this perturbation, input a spacecraft mass of zero.
spacecraft mass (kilograms; input 0 to ignore SRP calculations)
---------------------------------------------------------------
0.0d0
This next text input is the name of the data file that contains the geocentric flight conditions of the
spacecraft.
name of geocentric flight conditions data file
----------------------------------------------
pprop_lunar_geo.csv
The next input is the step size for the information in the geocentric data file.
step size for geocentric flight conditions data file (minutes)
--------------------------------------------------------------
10.0
This next text input is the name of the data file that contains the selenocentric flight conditions of the
spacecraft.
name of selenocentric flight conditions data file
-------------------------------------------------
pprop_lunar_sel.csv
The next input is the step size for the information in the selenocentric data file.
step size for selenocentric flight conditions data file (minutes)
-----------------------------------------------------------------
10.0
The final input is the user-defined value for the selenocentric distance at which the simulation will start
capturing the selenocentric flight conditions.
selenocentric distance to begin creating data file (kilometers)
---------------------------------------------------------------
50000.0
Program execution
The pprop_lunar computer program can be executed by typing the following from a DOS command
line
pprop_lunar input_file
where input_file is the name of the input data file, including the file name extension.
page 4
If the user types pprop_lunar without a file name, the software will request a file name with the
following interactive prompt,
please input the name of the simulation definition file
At this point the user should provide a compatible file name, complete with extension.
To create a DOS command window in Windows 7, select start, then All Programs, then Accessories
and finally Command Prompt. The size, font and other characteristics of the screen can be controlled
by the user with the c:\ icon in the upper left corner of the window. To log into the subdirectory created
during the installation of the Fortran executable and support files, type root:\ and then cd subdirectory
from the DOS command line where root is the name of the root directory, usually c:, and subdirectory is
the name of the subdirectory created by the user. The DOS command line prompt looks similar to
C:\pprop_lunar>_.
Program example
The following is the program output for a typical simulation. Explanatory text is provided in italic times
Roman font. Appendix A contains a brief explanation of these data items.
The first part of the output summarizes the file names of the data used in the simulation.
program pprop_lunar
-------------------
DE421 ephemeris
The next part of the output summarizes the geocentric initial time and flight conditions.
initial time and flight conditions
(geocentric Earth mean equator and equinox of J2000)
----------------------------------------------------
page 5
rx (km) ry (km) rz (km) rmag (km)
-.335854711130D+04 -.487114690579D+04 -.284095894469D+04 0.656345630000D+04
This section of the display summarizes the time and conditions at closest approach to the Moon. It
includes both the EME2000 geocentric state along with the selenocentric coordinates and the B-plane
coordinates of the spacecraft with respect to a Moon-centered mean equator and IAU node of epoch
coordinate system.
time and conditions at lunar closest approach
(geocentric Earth mean equator and equinox of J2000)
----------------------------------------------------
page 6
vx (kps) vy (kps) vz (kps) vmag (kps)
0.130806368237D+01 -.864539484913D+00 -.189545707588D+01 0.245992208100D+01
The pprop_lunar computer program will also create two comma-separated-variable (csv) data files
with filenames and step sizes defined by the user. The first file contains the geocentric flight conditions
of the spacecraft and the second file consists of the selenocentric flight conditions. A summary of the
information contained in these files can be found in Appendix A.
page 7
The pprop_lunar software suite also includes two interactive MATLAB scripts that can be used to
create three-dimensional geocentric and selenocentric graphics of the solution. The script that creates
selenocentric graphics is called lplt1.m and the script that displays geocentric graphics is called
lplot2.m. Each script will prompt the user for the name of a flight conditions data file. The graphics
data is displayed at the user-defined step sizes provided in the input file. A plot step size of ten minutes
is recommended. However, for zoomed plots of either the geocentric or selenocentric trajectory, smaller
plot step sizes will create “smoother” trajectory displays.
Important note!!
You must delete the first or “header” line of the solution file in order for the MATLAB scripts to work.
These scripts use the MATLAB csvread function to read the data file which can only contain comma-
separated-variable numerical data.
The following is a plot of the geocentric transfer trajectory and the Moon’s orbit for this example.
Please note that the coordinates are displayed in the units of Earth radii (ER). The blue asterisk symbol
is the beginning of the trajectory and the red asterisk is the spacecraft location at the final event. The x-
axis of this EME2000 coordinate system is red, the y-axis green and the z-axis blue.
The interactive graphic features of MATLAB will allow the user to rotate and “zoom” the displays in
and out. These capabilities allow the user to interactively find the “best” viewpoint as well as verify the
basic orbital geometry of the geocentric and selenocentric trajectories.
The following is a plot of the seleocentric or Moon-centered trajectory for this example. Please note that
the coordinates are displayed in the units of the Moon’s radius (MR). The blue asterisk symbol is the
beginning of the selenocentric trajectory as defined by the user in the selenocentric distance to
begin creating data file section of the input data file. The x-axis of this lunar mean equator
and IAU node of epoch coordinate system is red, the y-axis green and the z-axis blue.
page 8
Technical Discussion
The spaceraft’s orbital motion is modeled with respect to the Earth mean equator and equinox of J2000
(EME2000) coordinate system. The following figure illustrates the geometry of the EME2000
coordinate system. The origin of this Earth-centered-inertial (ECI) inertial coordinate system is the
geocenter and the fundamental plane is the Earth’s mean equator. The z-axis of this system is normal to
the Earth’s mean equator at epoch J2000, the x-axis is parallel to the vernal equinox of the Earth’s mean
orbit at epoch J2000, and the y-axis completes the right-handed coordinate system. The epoch J2000 is
the Julian Date 2451545.0 which corresponds to January 1, 2000, 12 hours Terrestrial Time (TT).
page 9
Program pprop_lunar implements a special perturbation technique which numerically integrates the
vector system of second-order, nonlinear differential equations of motion of a spacecraft given by
where
t dynamical time
r inertial position vector of the spacecraft
a g acceleration due to Earth gravity
a s acceleration due to the sun
am acceleration due to the moon
a p acceleration due to the planets
a srp acceleration due to solar radiation pressure
The software uses a spherical harmonic representation of the Earth’s geopotential function given by
n R
n n
R
r, , C Pn0 u Pnm u Snm sin m Cnm cos m
0
n
r r n 1 r r n 1 m1 r
where is the geocentric latitude of the spacecraft, is the geocentric east longitude of the spacecraft
and r r x 2 y 2 z 2 is the geocentric distance of the spacecraft. In this expression the S’s and
C’s are harmonic coefficients of the geopotential, and the P’s are associated Legendre polynomials of
degree n and order m with argument u sin .
The software calculates the spacecraft’s acceleration due to the Earth’s gravity field with a vector
equation derived from the gradient of the potential function expressed as
a g r, t r, t
This acceleration vector is a combination of pure two-body or point mass gravity acceleration and the
gravitational acceleration due to higher order nonspherical terms in the Earth’s geopotential.
In terms of the Earth’s geopotential , the inertial rectangular cartesian components of the spacecraft’s
acceleration vector are as follows:
1 N R
n
r r r n 2 r m 0
N R
n n
r n2 r
C
m 0
m
n cos m Snm sin m Pnm1 sin m tan Pnm sin
N R
n n
r n2 r
mS
m 0
m
n cos m Cnm sin m Pnm sin
where
R radius of the Earth
r geocentric distance of the satellite
Snm , Cnm harmonic coefficients
z
geocentric declination of the satellite sin 1
r
longitude of the satellite g
y
right ascension of the satellite tan 1
x
g right ascension of Greenwich
The right ascension is measure positive east of the vernal equinox, longitude is measured positive east of
Greenwich, and declination is positive above the Earth’s equator and negative below.
For m 0 the coefficients are called zonal terms, when m n the coefficients are sectorial terms, and
for n m 0 the coefficients are called tesseral terms.
The Legendre polynomials with argument sin are computed using recursion relationships given by:
1
Pn0 sin 2n 1 sin Pn01 sin n 1 Pn02 sin
n
Pn sin 2n 1 cos Pnn11 sin ,
n
m 0, m n
Pnm sin Pnm2 sin 2n 1 cos Pnm11 sin , m 0, m n
page 11
sin m 2 cos sin m 1 sin m 2
cos m 2 cos cos m 1 cos m 2
m tan m 1 tan tan
These gravity model data files are simple space delimited ASCII data files. The following is a portion
of a typical gravity model data file. In this file, column one is the degree index, column two is the
model order index, and columns three and four are the corresponding un-normalized gravity coefficients
(zonals and tesserals, respectively).
2 0 -0.10826300D-02 0.00000000D+00
3 0 0.25321531D-05 0.00000000D+00
4 0 0.16109876D-05 0.00000000D+00
5 0 0.23578565D-06 0.00000000D+00
6 0 -0.54316985D-06 0.00000000D+00
7 0 0.33237640D-06 0.00000000D+00
8 0 0.17721040D-06 0.00000000D+00
9 0 0.14459876D-06 0.00000000D+00
10 0 0.23339780D-06 0.00000000D+00
11 0 -0.27870829D-06 0.00000000D+00
12 0 0.17036617D-06 0.00000000D+00
13 0 0.25024428D-06 0.00000000D+00
14 0 -0.13764093D-06 0.00000000D+00
15 0 -0.30920023D-07 0.00000000D+00
16 0 0.55350560D-07 0.00000000D+00
Gravity model coefficients are often published in normalized form. The relationship between
normalized Cl ,m , Sl ,m and un-normalized gravity coefficients Cl ,m , Sl ,m is given by the following
expression:
l m ! Cl ,m
12
Cl ,m 1
Sl ,m 2 m 0 2l 1 l m ! Sl ,m
r r
am r, t m msc 3 em 3
r rem
msc
where
m gravitational constant of the moon
rmsc position vector from the moon to the spacecraft
rem position vector from the Earth to the moon
page 12
The acceleration contribution of the sun represented by a point mass is given by
r r
a s r, t s s sc 3 es 3
r res
s sc
where
s gravitational constant of the sun
rs sc position vector from the sun to the spacecraft
re s position vector from the Earth to the sun
r re p
a p r, t p s sc
rs sc 3 re p 3
where
s gravitational constant of the sun
rs sc position vector from the sun to the spacecraft
re p position vector from the Earth to the planet
The first-order system of equations required by this computer program can be created from the second-
order system by the method of order reduction. With the following definitions,
y1 rx y2 ry y3 rz
y4 v x y5 v y y6 v z
where vx , v y , vz are the velocity vector components of the spacecraft, the first-order system of
differential equations is given by
y1 v x y2 v y y3 v z
rx
y4 s a x m a x p a x srp
r3
r
y5 s y3 a y m a y p a y srp
r
r
y6 s z3 a z m a z p a z srp
r
In these equations, s is the gravitational constant of the sun, ax p , a y p and az p are the x, y and z
gravitational contributions of the planets, ax m , a y m and az m are the x, y and z gravitational
contributions of the moon, and ax srp , a y srp and az srp are the x, y and z gravitational contributions due to
solar radiation pressure.
page 13
To avoid numerical problems, use is made of Richard Battin’s f q function given by
3 3qk qk2
f qk qk 3
1 1 qk
where
r T r 2sk
qk
sTk sk
In these equations, s k is the vector from the primary body to the secondary body, k is the gravitational
constant of the secondary body and dk r sk , where r is the position vector of the spacecraft relative
to the primary body. The derivation of the f q functions is described in Section 8.4 of “An
Introduction to the Mathematics and Methods of Astrodynamics, Revised Edition”, by Richard H.
Battin, AIAA Education Series, 1999.
We can define a solar radiation constant for any spacecraft as a function of its size, mass and surface
reflective properties according to the equation:
A
Csrp Ps a 2
m
where
reflectivity constant
Ps solar radiation pressure constant
a astronomical unit
A surface area normal to the incident radiation
m mass of the spacecraft
The reflectivity constant is a dimensionless number between 0 and 2. For a perfectly absorbent body
1 , for a perfectly reflective body 2 , and for a translucent body 1 . For example, the
reflectivity constant for an aluminum surface is approximately 1.96.
The value of the solar radiation pressure on a perfectly absorbing spacecraft surface at a distance of one
Astronomical Unit from the Sun is
G Newton
Ps 1
c meters 2
page 14
where G1 is the solar flux at a distance of one Astronomical Unit in watts per square meter, and c is the
speed of light in meters per second. The values of the solar flux and speed of light used during a
simulation are defined by the user in the constants and models data file.
The acceleration vector of the spacecraft due to solar radiation pressure is given by:
rsc s
a srp csrp 3
rsc s
where
rsc = geocentric, inertial position vector of the spacecraft
re s = geocentric, inertial position vector of the sun
rsc s rsc res
During the geocentric integration process, the software must determine if the spacecraft is in Earth
shadow or sunlight. Obviously, there can be no solar radiation perturbation during Earth eclipse of the
spacecraft orbit. The software makes use of a shadow parameter to determine eclipse conditions. This
parameter is defined by the following expression:
rsc res
sign(rsc res )
res
where rsc is the geocentric, inertial position vector of the spacecraft and re s is the geocentric, inertial
position vector of the sun relative to the spacecraft.
The critical values of the shadow parameter for the penumbra (subscript p) and umbra part (subscript u)
of the shadow are given by:
p rsc sin p
u rsc sin u
p p
u u
They are the angles between the geocentric anti-sun vector and the vector to a spacecraft at the time of
shadow entrance or exit.
re
sin 1
rsc
page 15
rs re rs re
p sin 1 u sin 1
res res
where
re radius of the Earth
rs radius of the sun
re s distance from the Earth to the sun
If the condition u p is true, the spacecraft is in the penumbra part of the Earth’s shadow, and if
the inequality 0 u is true, the spacecraft is in the umbra part of the shadow. If the absolute value
of the shadow parameter is larger than the penumbra value, the spacecraft is in full sunlight. The
shadow calculations used in this computer program also assume the Earth’s atmosphere increases the
radius of the Earth by two percent.
This section describes the transformation of coordinates between the Earth mean equator and equinox
2000 (EME2000) and lunar mean equator and IAU node of epoch coordinate systems. This
transformation is used to compute the B-plane coordinates and classical orbital elements at encounter.
The following diagram illustrates the orientation of the lunar mean equator and IAU node of epoch
coordinate frame.
Figure 2. Lunar mean equator and IAU node of epoch coordinate system
page 16
A unit vector in the direction of the pole of the moon can be determined from
cos p cos p
pˆ Moon sin p cos p
sin p
where p and p are the right ascension and declination of the lunar pole. The right ascension and
declination of the lunar pole in the EME2000 coordinate system are given by the following expressions
where T is the time in Julian centuries given by T JD 2451545.0 / 36525 and JD is the Dynamical
Barycentric Time (TDB) Julian Date.
E1 125.045 0.0529921d
E 2 250.089 0.1059842d
E 3 260.008 13.0120009d
E 4 176.625 13.3407154d
E 6 311.589 26.4057084d
E 7 134.963 13.0649930d
E10 15.134 0.1589763d
E13 25.053 12.9590088d
where d JD 2451545 is the number of days since January 1.5, 2000. These equations are given in
“Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2009”,
Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011.
The unit vector in the x-axis direction of this selenocentric coordinate system is given by
xˆ zˆ pˆ Moon
where zˆ 0 0 1 . The unit vector in the y-axis direction can be determined using
T
yˆ pˆ Moon xˆ
page 17
Finally, the components of the matrix that transforms coordinates from the EME2000 system to the
moon-centered (selenocentric) mean equator and IAU node of epoch system are as follows:
M xˆ yˆ pˆ Moon
T
Closest approach is determined during the numerical integration of the spacecraft’s geocentric equations
of motion by finding the time at which the spacecraft’s flight path angle relative to the Moon is
essentially zero. This mission constraint is computed as follows
rv
sin 1 0
r v
where r and v are the Moon-centered (selenocentric) position and velocity vectors, respectively. Both
orbital events are predicted using a Runge-Kutta-Fehlberg (RKF7(8)) integrator embedded with a one-
dimensional form of Brent’s root-finding method.
The trajectory conditions at a user-defined selenocentric distance are determined during the numerical
integration of the spacecraft’s geocentric equations of motion by finding the time at which the difference
between the selenocentric distance and the user-defined value is essentially zero. This mission
constraint is computed as follows
r rsc ruser 0
where rsc is the selenocentric position vector of the spacecraft and ruser is the user-defined value of the
selenocentric distance.
For this program option, the software simply integrates the geocentric equations of motion from the
initial to the user-defined final time.
The truncation error tolerance for the variable step size numerical method implemented in the
pprop_lunar software is “hard-wired” to a value of 1.0d-15. The root-finding tolerance in the
software is hard-wired to a value of 1.0d-8.
The B-plane
The derivation of B-plane coordinates is described in the classic JPL reports, “A Method of Describing
Miss Distances for Lunar and Interplanetary Trajectories” and “Some Orbital Elements Useful in Space
Trajectory Calculations”, both by William Kizner. The following diagram illustrates the fundamental
geometry of the B-plane coordinate system.
page 18
The arrival asymptote unit vector Ŝ is given by
cos cos
Sˆ cos sin
sin
where and are the declination and right ascension of the asymptote of the incoming hyperbola at
lunar encounter.
The following computational steps summarize the calculation of the B-plane vector from a selenocentric
position vector r and velocity vector v evaluated at closest approach to the Moon.
radius rate
r r v r
semiparameter
p h2
semimajor axis
r
a
2 r v2
page 19
orbital eccentricity
e 1 p a
true anomaly
pr rh
cos sin
er e
B-plane magnitude
B pa
fundamental vectors
r v rr
zˆ
h
S vector
a b
S pˆ qˆ
a b
2 2
a b2
2
B vector
b2 ab
B pˆ qˆ
a 2 b2 a 2 b2
T vector
S , S ,0
2 2 T
T
y x
S x2 S y2
R vector
R S T SzTy , SzTx , S xTy S yTx
T
page 20
Algorithm and Modeling Resources
(2) “Earth-Moon Trajectories”, JPL Technical Report No. 32-503, May 1, 1964.
(3) “Three-Dimensional Lunar Trajectories”, V. A. Egorov, Mechanics of Space Flight Series, Israel
Program for Scientific Translations, Jerusalem 1969.
(4) “Circumlunar Trajectory Calculations”, MIT Instrumentation Laboratory Report R-353, April 1962.
(5) “Optimal Low Thrust Trajectories to the Moon”, John T. Betts and Sven O. Erb, SIAM Journal on
Applied Dynamical Systems, Vol. 2, No. 2, pp. 144-170, 2003.
(6) “Integrated Algorithm for Lunar Transfer Trajectories Using a Pseudostate Technique”, R. V.
Ramanan, AIAA Journal of Guidance, Control and Dynamics, Vol. 25, No. 5, September-October 2002,
pp. 946-952.
(7) “Nonimpact Lunar Transfer Trajectories Using the Pseudostate Technique”, R. V. Ramanan and V.
Adimurthy, AIAA Journal of Guidance, Control and Dynamics, Vol. 28, No. 2, March-April 2005, pp.
217-225.
(8) “Injection Conditions for Lunar Trajectories”, R. Kolenkiewicz and W. Putney, NASA TM X-55390,
November 1965.
(9) “Coplanar Three-Body Trans-Earth Lunar Trajectory Simulation Methodology”, H. Ikawa, AIAA
88-0381, AIAA 26th Aerospace Sciences Meeting, Reno, Nevada, January 11-14, 1988.
(10) “Lunar Constants and Models Document”, JPL D-32296, September 23, 2005.
(11) NOVAS (Naval Observatory Vector Astrometry Subroutines) software package, version 3.1, U.S.
Naval Observatory, March 2011.
(13) “The Planetary and Lunar Ephemeris DE 421”, W. M. Folkner, J. G. Williams, D. H. Boggs, JPL
IOM 343R-08-003, 31-March-2008.
(14) “Report of the IAU/IAG Working Group on Cartographic Coordinates and Rotational Elements of
the Planets and Satellites: 2009”, Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011.
(16) W. Kizner, “A Method of Describing Miss Distances for Lunar and Interplanetary Trajectories”,
Publication 674, Jet Propulsion Laboratory, August 1, 1959.
(17) R. H. Battin, An Introduction to the Mathematics and Methods of Astrodynamics, AIAA, 1987.
page 21
APPENDIX A
Contents of the Simulation Summary and Data Files
This appendix is a brief summary of the information contained in the simulation summary screen display
and the data files produced by the pprop_lunar computer program. It is possible to “redirect” the
screen output to a simple text file with a DOS command similar to
pprop_lunar pprop_lunar.in >pprop_lunar.txt
UTC Julian Date = Julian Date of trajectory event on UTC time scale
TDB Julian Date = Julian Date of trajectory event on TDB time scale
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
vmag (kps) = scalar magnitude of the spacecraft’s velocity vector in kilometers per
second
page 22
v-infinity = magnitude of incoming v-infinity vector at the Moon in kilometers/second
selenocentric flight path angle = flight path angle relative to the Moon in degrees
right ascension = right ascension of the Moon at the final event in degrees
propagation duration = trajectory time from the initial conditions to the final user-
defined event in both hours and days
The geocentric and selenocentric flight conditions data files contain the following information:
vsc-x (km/sec) = x-component of the spacecraft’s velocity vector in kilometers per second
vsc-y (km/sec) = y-component of the spacecraft’s velocity vector in kilometers per second
vsc-z (km/sec) = z-component of the spacecraft’s velocity vector in kilometers per second
vsc-mag (km/sec) = scalar magnitude of the spacecraft’s velocity vector in kilometers per
second
The geocentric flight conditions data file also includes the geocentric position vector (in kilometers) and
the declination and right ascension of the Moon (both in degrees) in the data columns labeled rmoon-x
(km), rmoon-y (km), rmoon-z (km), decl_moon (deg) and rasc_moon (deg).
In addition to their use in the MATLAB plotting scripts, the flight conditions data in these files can be
plotted by other computer programs. The following are two typical plots created with version 9 of
Grapher (www.goldensoftware.com).
page 23
This first plot illustrates the behavior of the geocentric velocity as a function of mission elapsed time.
The next plot illustrates the behavior of the selenocentric inclination as a function of mission elapsed
time. Notice that the plot begins at the selenocentric distance specified by the user in the input data file.
page 24
Program lprop
This document is the user’s manual for a Windows compatible Fortran computer program called
lprop.exe that can be used to numerically propagate the moon-centered or selenocentric motion of a
spacecraft in orbit around the moon. The software integrates the Cartesian equations of motion using a
variable step size Runge-Kutta-Fehlberg 7(8) numerical method. The software implementation includes
several JPL SPICE utility routines and the JPL DE421 ephemeris
Program Execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
lprop llo_50x50.in
If the software is executed without an input file on the command line, the computer program will display
the following information screen and file name prompt:
The user should respond to this prompt with the name of a compatible input data file including the
filename extension.
The screen output created by the lprop computer program can be re-directed to a text file with a
command line similar to
lprop llo_50x50.in >llo_50x50.txt
To create a DOS command window in Windows 7, select start, then All Programs, then Accessories
and finally Command Prompt. The size, font and other characteristics of the screen can be controlled
by the user with the c:\ icon in the upper left corner of the window. To log into the subdirectory created
during the installation of the Fortran executable and support files, type root:\ and then cd subdirectory
from the DOS command line where root is the name of the root directory, usually c:, and subdirectory is
the name of the subdirectory created by the user.
The lprop software is “data-driven” by a user-created text file. This text file should be simple ASCII
format with no special characters.
The following is a typical input file used by this computer program. In the following discussion the
actual input file contents are in courier font and all explanations are in times italic font. This example
propagates the motion of a spacecraft in a polar lunar orbit at 100 kilometer altitude.
Each data item within an input file is preceded by one or more lines of annotation text. Do not delete
any of these annotation lines or increase or decrease the number of lines reserved for each comment.
page 1
However, you may change them to reflect your own explanation. The annotation line also includes the
correct units and when appropriate, the valid range of the input. ASCII text input is not case sensitive
but must be spelled correctly.
The first five lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with five and only five initial text lines.
***********************************
data file for program lprop.exe
propagation of selenocentric orbits
llo_50x50.in - May 19, 2012
***********************************
The first inputs to the program define the initial calendar date and time for the simulation. The
calendar date should be input in the format three character calendar month, two digit calendar day and
four digit calendar year. The initial time should be input in the format hh:mm:ss followed by a three
character SPICE compatible time system abbreviation. Typical time systems are utc (universal
coordinate time), tdb (barycentric dynamical time), etc.
******************
INITIAL CONDITIONS
******************
epoch
-----
Oct 01 2020 00:00:00 tdb
The next six inputs are the initial classical orbital elements for the simulation. The angular elements
should be provided in the moon_j2000 coordinate system. The orientation of this coordinate system is
defined in the Technical discussion section later in this document. Please note the units for each orbital
element and the appropriate data range.
semimajor axis (kilometers)
---------------------------
1838.0
right ascension of the ascending node (0 degrees <= RAAN <= 360 degrees)
------------------------------------------------------------------------
0.0
*********************
orbital perturbations
*********************
The next two integer inputs define the order (zonals) and degree (tesserals) of the lunar gravity model to
use during the simulation.
The next two integer inputs allow the user to include the point-mass gravity perturbations of the sun and
earth during the simulation.
include solar point-mass gravity (1 = yes, 0 = no)
--------------------------------------------------
1
This next numerical input defines the truncation error tolerance for the Runge-Kutta-Fehlberg
numerical method used to integrate the equations of motion. A smaller value improves the numerical
method at the expense of longer run times. A value between 1.0d-10 and 1.0d-15 is recommended.
********************
algorithm parameters
********************
The next two text inputs define the names of the lunar gravity model file to use and the name of the
output file created by the software.
name of gravity model data file
-------------------------------
lp150q_unnorm.dat
The final program input specifies the step size of the data file created by the software.
data file step size (minutes)
-----------------------------
60.0d0
The lprop software also requires a simple data file named constants.dat. This file allows the user
to define fundamental utility and astrodynamic data values for the simulation. The following illustrates
page 3
the contents of a typical data file. The data items are self-explanatory. However, please note the proper
units for each data value.
********************************************
utility and astrodynamic constants data file
********************************************
The last data item is the name of the SPICE formatted leap seconds data file. The current version of this
data file can be downloaded at http://naif.jpl.nasa.gov/naif/.
The following is the program output for the data file example described earlier. It summarizes the initial
and final conditions for this orbit propagation.
===============================================
program lprop - selenocentric orbit propagation
===============================================
------------------------------------------
initial time and conditions
(lunar mean equator and IAU node of J2000)
------------------------------------------
------------------------------------------
final time and conditions
(lunar mean equator and IAU node of J2000)
------------------------------------------
UTC epoch = simulation calendar date and UTC time (yyyy mm dd hh:mm:ss.sss)
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
page 5
vmag (km/sec) = scalar magnitude of the spacecraft’s velocity vector in kilometers per
second
The lprop software will also create a comma separated variable (csv) data file with the filename
specified by the user in the simulation definition input data file. This simple text file contains the
following information;
vsc-x (kps) = inertial x-component of the selenocentric velocity vector in kilometers per
second
vsc-y (kps) = inertial y-component of the selenocentric velocity vector in kilometers per
second
vsc-z (kps) = inertial z-component of the selenocentric velocity vector in kilometers per
second
vmag (kps) = magnitude of the selenocentric velocity vector in kilometers per second
Please note that the periapsis and apoapsis altitudes are with respect to a spherical moon.
This section provides several graphic images which illustrate the long-term behavior of important orbital
conditions. The first two images depict the orbital evolution of the eccentricity and inclination.
page 6
The next two plots illustrate the long-term evolution of the periapsis and apoapsis altitudes.
The final two images are plots of the selenocentric position and velocity magnitudes.
page 7
Technical discussion
This section describes the numerical methods implemented in the lprop computer program. It
summarizes several lunar coordinate systems, the non-spherical lunar gravity model, and the orbital
equations of selenocentric motion.
The following figure illustrates the orientation of this coordinate system relative to the Earth’s mean
equator and north pole of J2000 (EME2000). The x-axis or Q-vector is formed from the cross product
of the Earth’s mean pole of J2000 and the Moon’s north pole relative to EME2000.
In general, the x-axis is called the IAU node of epoch. For this scientific simulation, we will set or
“freeze” the epoch to J2000 (January 1.5, 2000) and call this frame the “moon_j2000” system.
page 8
Figure 1. Moon mean equator and IAU node of epoch coordinate system
According to “Report of the IAU/IAG Working Group on Cartographic Coordinates and Rotational
Elements: 2010”, the transformation matrix from the Earth mean equator and equinox of J2000
(EME2000) coordinate system to the moon-centered, body-fixed lunar principal axis (PA) system is
given by the following (3-1-3) rotation sequence;
M EME 2000 Rz Rx Rz
PA
In this equation, is the angle along the ICRF (International Celestial Reference Frame) equator, from
the ICRF x-axis to the ascending node of the lunar equator, is the inclination of the lunar equator to
the ICRF equator, and is the angle along the lunar equator from the node to the lunar prime meridian.
These three Euler angles represent the numerically integrated physical librations of the Moon.
The principal axis frame is aligned with the three maximum moments of inertia of the Moon. The
LP150Q lunar gravity model was developed using this frame.
The relationship between these angles and the classical IAU (International Astronomical Union)
orientation angles is
90
90
W
The transformation from the moon_j2000 to the lunar PA system is given by the following matrix
multiplication
N moon _ j 2000 M EME 2000 Pmoon _ j 2000
PA PA EME 2000
page 9
The numerical components of the constant moon_j2000-to-EME2000 transformation matrix are as
follows;
For accurate orbital analysis, the lunar libration angles can be obtained from a lunar ephemeris. The JPL
Developmental Ephemeris DE421 is considered the best currently available lunar ephemeris.
Chebyshev polynomial representations of the Euler angles and their rates in the PA system are included
in the DE421 ephemeris file which is available from http://ssd.jpl.nasa.gov.
The following is the source code listing for a Fortran subroutine that evaluates the DE421 ephemeris file
and computes this coordinate transformation.
c moon_j2000-to-moon_pa transformation
c matrix using DE421.bin binary ephemeris
c input
c output
c ************************************
dimension tmatrix(3, 3)
data tmatrix2
& / 0.998496505205088d0,
& -5.481540926807404d-2,
& 0.0d0,
& 4.993572939853833d-2,
& 0.909610125238044d0,
& 0.412451018902688d0,
& -2.260867140418499d-2,
& -0.411830900942612d0,
& 0.910979778593430d0 /
icent = 0
itarg = 15
phi = sv(1)
theta = sv(2)
page 10
psi = sv(3)
end
In this subroutine, jpleph is a subroutine that evaluates the binary ephemeris file, matran is a
subroutine that performs a sequence of ordered rotations, and matxmat is a Fortran subroutine that
multiplies two matrices. The source code for the jpleph subroutine is provided by JPL as are routines
for creating a binary DE421 ephemeris file from the ASCII source data. It also includes routines that
open and reads the binary file.
The lprop software calculates the satellite’s acceleration due to the moon’s non-spherical gravity field
with a vector equation derived from the gradient of the potential function expressed as
ag r , t r , t
This acceleration vector is a combination of pure two-body or point mass gravity acceleration and the
gravitational acceleration due to higher order nonspherical terms in the moon’s geopotential.
The software uses a spherical harmonic representation of the moon’s geopotential function given by
n R
n n
R
r, , C Pn0 u Pnm u Snm sin m Cnm cos m
0
n
r r n 1 r r n 1 m1 r
where is the selenocentric latitude of the satellite, is the selenocentric east longitude of the satellite
and r r x 2 y 2 z 2 is the geocentric distance of the satellite. In this expression the S’s and C’s
are harmonic coefficients of the geopotential, and the P’s are associated Legendre polynomials of degree
n and order m with argument u sin .
In terms of the moon’s geopotential , the inertial rectangular cartesian components of the satellite’s
acceleration vector are as follows:
page 11
1 z 1
x x 2 y
r r r 2 x 2 y 2 x y 2
1 z 1
y y 2 x
r r r 2 x 2 y 2 x y 2
1 x2 y2
z z
r r r 2
The three partial derivatives of the geopotential with respect to r, , are given by
1 N R
n
r r r n 2 r m 0
N R
n n
r n2 r
C
m 0
m
n cos m Snm sin m Pnm1 sin m tan Pnm sin
N R
n n
r n2 r
mS
m 0
m
n cos m Cnm sin m Pnm sin
where
R radius of the moon
r selenocentric distance of the satellite
S , C harmonic coefficients
m
n
m
n
z
selenocentric declination of the satellite sin 1
r
longitude of the satellite pm
y
right ascension of the satellite tan 1
x
pm right ascension of selenocentric prime meridian
In the lprop software, right ascension is measure positive east of the vernal equinox, longitude is
measured positive east of the lunar prime meridian, and declination is positive above the moon’s equator
and negative below.
For m 0 the coefficients are called zonal terms, when m n the coefficients are sectorial terms, and
for n m 0 the coefficients are called tesseral terms.
The Legendre polynomials with argument sin are computed using recursion relationships given by:
page 12
1
Pn0 sin 2n 1 sin Pn01 sin n 1 Pn02 sin
n
Pn sin 2n 1 cos Pnn11 sin ,
n
m 0, m n
Pnm sin Pnm2 sin 2n 1 cos Pnm11 sin , m 0, m n
The lprop zipped file contains an unnormalized 70 by 70 version of the LP150Q gravity model data
file. The software can also read and process user-defined gravity model files in the correct format.
These gravity model data files are simple fixed-format, space delimited ASCII data files. The following
is a portion of a typical gravity model data file. In this file, column one is the degree index, column two
is the model order index, and columns three and four are the corresponding un-normalized gravity
coefficients (zonals and tesserals, respectively).
2 0 -2.032610275331e-004 +0.000000000000e+000
3 0 -8.474531095709e-006 +0.000000000000e+000
4 0 +9.642286350840e-006 +0.000000000000e+000
5 0 -7.330068349584e-007 +0.000000000000e+000
6 0 +1.357414571103e-005 +0.000000000000e+000
7 0 +2.174024283964e-005 +0.000000000000e+000
8 0 +9.563704527335e-006 +0.000000000000e+000
9 0 -1.544103258131e-005 +0.000000000000e+000
10 0 -4.275709406172e-006 +0.000000000000e+000
11 0 -4.605691861384e-006 +0.000000000000e+000
12 0 -9.434608127000e-006 +0.000000000000e+000
13 0 +1.343987395589e-006 +0.000000000000e+000
14 0 +1.757181057884e-006 +0.000000000000e+000
15 0 -5.414822625081e-007 +0.000000000000e+000
16 0 +1.829333227080e-006 +0.000000000000e+000
17 0 -6.142233531520e-006 +0.000000000000e+000
18 0 -2.268490144731e-006 +0.000000000000e+000
Gravity model coefficients are often published in normalized form. The relationship between
normalized Cl ,m , Sl ,m and un-normalized gravity coefficients Cl ,m , Sl ,m is given by the following
expression:
l m ! Cl ,m
12
Cl ,m 1
Sl ,m 2 m 0 2l 1 l m ! Sl ,m
Selenocentric acceleration due to the point-mass gravity of the sun and earth
r r
a s r, t s s sc 3 m s 3
r rm s
s sc
where
s gravitational constant of the sun
rs sc position vector from the sun to the spacecraft
rm s position vector from the moon to the sun
The selenocentric acceleration contribution of the earth represented by a point mass is given by
r r
ae r, t e esc 3 me 3
r rme
esc
where
e gravitational constant of the earth
resc position vector from the earth to the spacecraft
rme position vector from the moon to the earth
The first-order system of equations required by this computer program can be created from the second-
order system by the method of order reduction. With the following definitions,
y1 rx y2 ry y3 rz
y4 v x y5 v y y6 v z
where vx , v y , vz are the velocity vector components of the spacecraft, the first-order system of
differential equations is given by
y1 vx y2 v y y3 vz
rx
y 4 m a x e a x s
r3
r
y5 m y3 a y e a y s
r
r
y6 m z3 a z e a z s
r
page 14
In these equations, m is the gravitational constant of the moon, rx , ry and rz are the x, y and z
components of the spacecraft’s selenocentric position vector, ax e , a y e and az e are the x, y and z
gravitational contributions of the earth, and ax s , a y s and az s are the x, y and z gravitational
contributions of the sun. Also, r rx2 ry2 rx2 is the selenocentric radius.
To avoid numerical problems, use is made of Professor Richard Battin’s f q function given by
3 3qk qk2
f qk qk 3
1 1 qk
where
r T r 2sk
qk
sTk sk
n
k
r r f qk s k
k 1 d k3
In these equations, s k is the vector from the primary body to the secondary body, k is the gravitational
constant of the secondary body and dk r sk , where r is the position vector of the spacecraft relative
to the primary body. The derivation of the f q functions is described in Section 8.4 of “An
Introduction to the Mathematics and Methods of Astrodynamics, Revised Edition”, by Richard H.
Battin, AIAA Education Series, 1999.
page 15
Algorithm resources
(1) “Lunar Constants and Models Document”, JPL D-32296, September 23, 2005.
(3) “The Planetary and Lunar Ephemeris DE 421”, W. M. Folkner, J. G. Williams, D. H. Boggs, JPL
IOM 343R-08-003, 31-March-2008.
(4) “Report of the IAU/IAG Working Group on Cartographic Coordinates and Rotational Elements of
the Planets and Satellites: 2009”, Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011.
(5) “IERS Conventions (2003)”, IERS Technical Note 32, November 2003.
(6) R. H. Battin, An Introduction to the Mathematics and Methods of Astrodynamics, AIAA, 1987.
page 16
Orbital Mechanics with MATLAB
Most of the information in this section was extracted from JPL D-32296, “Lunar Constants and Models
Document” which is available at ssd.jpl.nasa.gov/dat/lunar_cmd_2005_jpl_d32296.pdf. Another useful
reference is “Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements:
2009”, Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011.
The following figure illustrates the geometry of the EME2000 coordinate system. The origin of this ECI
inertial coordinate system is the geocenter and the fundamental plane is the Earth’s mean equator. The
z-axis of this system is normal to the Earth’s mean equator at epoch J2000, the x-axis is parallel to the
vernal equinox of the Earth’s mean orbit at epoch J2000, and the y-axis completes the right-handed
coordinate system. The epoch J2000 is the Julian Date 2451545.0 which corresponds to January 1,
2000, 12 hours Terrestrial Time (TT).
Figure 1. Earth mean equator and equinox of J2000 (EME2000) coordinate system
The following figure illustrates the orientation of the lunar mean equator and IAU node of epoch
coordinate system relative to the Earth’s mean equator and north pole of J2000. The x-axis or Q-vector
is formed from the cross product of the Earth’s mean pole of J2000 and the Moon’s north pole relative
to EME2000. The x-axis is aligned with the IAU node of epoch.
page 1
Orbital Mechanics with MATLAB
Figure 2. Moon mean equator and IAU node of epoch coordinate system
The following two equations describe the time evolution of the right ascension and declination of the
moon’s mean pole, in degrees, with respect to the Earth mean equator and equinox of J2000 (EME2000)
coordinate system.
The equation for the prime meridian of the Moon, in degrees, with respect to the IAU node vector is
given by the following expression
In these equations, T is the time in Julian centuries given by T JD 2451545.0 / 36525 and JD is the
Barycentric Dynamical Time (TDB) Julian Date.
page 2
Orbital Mechanics with MATLAB
E1 125.045 0.0529921d
E 2 250.089 0.1059842d
E 3 260.008 13.0120009d
E 4 176.625 13.3407154d
E 5 357.529 0.9856003d
E 6 311.589 26.4057084d
E 7 134.963 13.0649930d
E8 276.617 0.3287146d
E 9 34.226 1.7484877d
E10 15.134 0.1589763d
E11 119.743 0.0036096d
E12 239.961 0.1643573d
E13 25.053 12.9590088d
where d JD 2451545 is the number of days since January 1.5, 2000. These equations can also be
found in “Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements:
2009”, Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011.
A unit vector in the direction of the pole of the moon can be determined from
cos p cos p
pˆ Moon sin p cos p
sin p
The unit vector in the x-axis direction of this selenocentric coordinate system is given by
xˆ zˆ pˆ Moon
where zˆ 0 0 1 . The unit vector in the y-axis direction can be determined using
T
yˆ pˆ Moon xˆ
Finally, the components of the matrix that transforms coordinates from the EME2000 system to the
moon-centered (selenocentric) mean equator and IAU node of epoch system are as follows:
xˆ
M yˆ
pˆ Moon
page 3
Orbital Mechanics with MATLAB
This MATLAB function computes the orientation angles of the moon with respect to EME2000. It
implements the polynomial equations described above.
% input
% output
This MATLAB function computes the matrix which transforms coordinates between the Earth mean
equator and equinox of J2000 (EME2000) and lunar mean equator and IAU node of epoch coordinate
systems. It implements the equations described above.
% input
% output
This MATLAB function computes lunar libration angles and rates using information available on
modern JPL binary ephemeris files. Binary ephemeris files for Windows compatible computers can be
downloaded from the Celestial and Orbital Mechanics web site located at www.cdeagle.com.
page 4
Orbital Mechanics with MATLAB
% input
% output
This software suite includes a MATLAB script named demo_llib that demonstrates how to interact
with this function. The following is a summary of the results computed by this script.
program demo_llib
This MATLAB function determines a matrix that can be used to transform coordinates from the lunar
mean equator and IAU node of J2000 (which we’ll call the moon_j2000 system) to the lunar principal
axes (PA) system. The principal axis frame is aligned with the three maximum moments of inertia of
the Moon.
% transformation matrix from lunar mean equator and IAU node of j2000
% to the lunar principal axes system using JPL binary ephemeris
% input
% output
This MATLAB function determines a matrix that can be used to transform coordinates from the lunar
mean equator and IAU node of J2000 (which we’ll call the moon_j2000 system) to the lunar principal
axes (PA) system. The principal axis frame is aligned with the three maximum moments of inertia of
the Moon.
% transformation matrix from lunar mean equator and IAU node of j2000
% to the lunar principal axes system using JPL approximate equations
% input
% output
According to “Report of the IAU Working Group on Cartographic Coordinates and Rotational
Elements: 2009”, Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011, the
transformation matrix from the Earth mean equator and equinox of J2000 (EME2000) coordinate system
to the moon-centered, body-fixed lunar principal axis (PA) system is given by the following (3-1-3)
rotation sequence;
M EME 2000 Rz Rx Rz
PA
In this equation, is the angle along the International Celestial Reference Frame (ICRF) equator, from
the ICRF x-axis to the ascending node of the lunar equator, is the inclination of the lunar equator to
the ICRF equator, and is the angle along the lunar equator from the node to the lunar prime meridian.
These three Euler angles represent the numerically integrated physical librations of the Moon.
The relationship between these angles and the classical IAU orientation angles is
90
90
W
The transformation from the moon_j2000 system to the PA system is given by the following matrix
multiplication;
page 6
Orbital Mechanics with MATLAB
Approximate lunar pole right ascension, declination and prime meridian in the PA system
Page 7 of the JPL document also provides the following “tweaks” to the orientation of the moon in order
to approximate the orientation in the PA system.
This MATLAB function determines a matrix that can be used to transform coordinates from the lunar
Mean Earth/polar axis (ME) to the lunar principal axes (PA) system. The principal axis frame is aligned
with the three maximum moments of inertia of the Moon.
page 7
Orbital Mechanics with MATLAB
% output
According to JPL D-32296, “Lunar Constants and Models Document” and the IAU 2000 resolutions, the
constant transformation matrix from the lunar Mean Earth/polar axis (ME) system to the lunar Principal
axis (PA) system is given by the following (1-2-3) rotation sequence;
This software suite includes a MATLAB script named demo_moon that demonstrates how to interact
with several of these coordinate transformation functions. The following is a summary of the results
computed by this script.
program demo_moon
page 8
Orbital Mechanics with MATLAB
moon_pa1 function
moon_pa2 function
page 9
A Computer Program for Parametric Analysis of Minimum TLI Delta-V,
Two-Body Lunar Transfer Trajectories
This document is the user’s guide for a Windows-compatible computer program called tli_sweep
that can be used to perform a parametric analysis of two-body lunar transfer trajectories. The software
assumes that trans-lunar injection (TLI) occurs impulsively from a circular Earth park orbit. The
software solves for the minimum TLI delta-v using a two-body Lambert solution for the transfer
trajectory from the Earth park orbit to the center of the moon.
This computer program uses a nonlinear programming (NLP) method to solve this classic trajectory
optimization problem. The lunar coordinates required by the software are computed using the JPL
DE421 ephemeris. The software creates a simple comma-separated-variable (CSV) summary text file
of the analysis results. The tli_sweep computer program was created using Intel Visual Fortran.
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
tli_sweep tli_sweep1.in
If the software is executed without an input file on the command line, the computer program will
display the following prompt:
At this point the user should input the name of a valid input file, including the filename extension.
The tli_sweep computer program is “data-driven” by a simple text file created by the user. This
section describes a typical input data file. In the following discussion the actual input file contents are
in courier font and all explanations are in times italic font.
Each data item within an input file is preceded by one or more lines of annotation text. Do not delete
any of these annotation lines or increase or decrease the number of lines reserved for each comment.
However, you may change them to reflect your own explanation. The annotation line also includes the
correct units and when appropriate, the valid range of the input.
The first four lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with four and only four initial text lines.
*****************************************
* data file for tli_sweep
* tli_sweep1.in December 7, 2010
*****************************************
The first input defines the initial calendar date of the TLI analysis sweep. Be sure to include all four
digits of the calendar year.
page 1
initial calendar date (month, day, year)
1, 1, 2008
The next input specifies the type of TLI maneuver. Please see the Technical Discussion later in this
document for an explanation of the maneuver type.
type of TLI maneuver (1 = ascending, 2 = descending)
2
The next two inputs define the value of the altitude and orbital inclination of the circular park orbit.
park orbit altitude (kilometers)
185.32
The fixed duration of the lunar transfer trajectory is set by this next input.
transfer time (hours)
84.0
The total simulation duration and time step size of the parametric sweep are specified using these next
two inputs. Both inputs should be input in days.
simulation duration (days)
90
The final input is the name of the summary data file created by the software.
name of summary data file
tli_sweep1.txt
Program example
The following printout illustrates the first eight days of the ASCII data file created by the software for
this example input file.
time (days) , delta-v (mps) , RAAN (deg) , tanom (deg) , C3 (km/sec)**2 , rasc moon (deg) , decl moon (deg)
0.0000000000000000D+00, 0.3154237240720148D+04, 0.2939772016817301D+03, 0.1241527540037006D+03, -.1619347313399913D+01, 0.2353049454982873D+03, -.2488171235979486D+02,
0.2500000000000000D+00, 0.3154077426068113D+04, 0.3000799866902164D+03, 0.1214387300464090D+03, -.1622846333371825D+01, 0.2385132825880984D+03, -.2552261158134712D+02,
0.5000000000000000D+00, 0.3153890952209858D+04, 0.3061889945772383D+03, 0.1187801338655062D+03, -.1626928971784480D+01, 0.2417618530514432D+03, -.2609405035352827D+02,
0.7500000000000000D+00, 0.3153679431620233D+04, 0.3122710527657329D+03, 0.1162024672537953D+03, -.1631559896441956D+01, 0.2450488903609971D+03, -.2659310551528822D+02,
0.1000000000000000D+01, 0.3153444525558491D+04, 0.3182758729576013D+03, 0.1137453509300226D+03, -.1636702705910395D+01, 0.2483720379854596D+03, -.2701699195180769D+02,
0.1250000000000000D+01, 0.3153187930027161D+04, 0.3241262028642868D+03, 0.1114712491685794D+03, -.1642320237905594D+01, 0.2517283625844008D+03, -.2736310665059587D+02,
0.1500000000000000D+01, 0.3152911361859615D+04, 0.3297034826366919D+03, 0.1094782143465262D+03, -.1648374874428853D+01, 0.2551143838418896D+03, -.2762907362402288D+02,
0.1750000000000000D+01, 0.3152616545046504D+04, 0.3348338458801500D+03, 0.1079124649300287D+03, -.1654828842266355D+01, 0.2585261218453762D+03, -.2781278819289479D+02,
0.2000000000000000D+01, 0.3152305197412984D+04, 0.3392972086352405D+03, 0.1069608598057150D+03, -.1661644505026914D+01, 0.2619591619652265D+03, -.2791245900400300D+02,
0.2250000000000000D+01, 0.3151979017759757D+04, 0.3429003769708635D+03, 0.1067873398303938D+03, -.1668784645288156D+01, 0.2654087361133375D+03, -.2792664612751861D+02,
0.2500000000000000D+01, 0.3151639673580780D+04, 0.3455968165197433D+03, 0.1074283675462962D+03, -.1676212733913204D+01, 0.2688698181513981D+03, -.2785429366273458D+02,
0.2750000000000000D+01, 0.3151288789469656D+04, 0.3475177067495920D+03, 0.1087658938800532D+03, -.1683893184181315D+01, 0.2723372301933363D+03, -.2769475547739188D+02,
0.3000000000000000D+01, 0.3150927936324485D+04, 0.3488704162092085D+03, 0.1106162621042927D+03, -.1691791588334610D+01, 0.2758057557171905D+03, -.2744781300836680D+02,
0.3250000000000000D+01, 0.3150558621457198D+04, 0.3498382419822936D+03, 0.1128177906783877D+03, -.1699874934197638D+01, 0.2792702548681340D+03, -.2711368443875289D+02,
0.3500000000000000D+01, 0.3150182279708502D+04, 0.3505504709568317D+03, 0.1152566771647722D+03, -.1708111799594761D+01, 0.2827257771628555D+03, -.2669302500655103D+02,
0.3750000000000000D+01, 0.3149800265662989D+04, 0.3510909865971357D+03, 0.1178592115299426D+03, -.1716472523023526D+01, 0.2861676670176645D+03, -.2618691865482936D+02,
0.4000000000000000D+01, 0.3149413847050604D+04, 0.3515133002950020D+03, 0.1205784436033404D+03, -.1724929347457319D+01, 0.2895916580914668D+03, -.2559686166249513D+02,
0.4250000000000000D+01, 0.3149024199410908D+04, 0.3518519700036982D+03, 0.1233840989068707D+03, -.1733456537228435D+01, 0.2929939532895729D+03, -.2492473926297592D+02,
0.4500000000000000D+01, 0.3148632402085117D+04, 0.3521298466278018D+03, 0.1262561822160166D+03, -.1742030465349785D+01, 0.2963712883133450D+03, -.2417279653808047D+02,
0.4750000000000000D+01, 0.3148239435587899D+04, 0.3523624513587097D+03, 0.1291811196193405D+03, -.1750629670752318D+01, 0.2997209777483139D+03, -.2334360505064286D+02,
0.5000000000000000D+01, 0.3147846180396259D+04, 0.3525606115052031D+03, 0.1321494372260798D+03, -.1759234884416429D+01, 0.3030409437480232D+03, -.2244002674920664D+02,
0.5250000000000000D+01, 0.3147453417177175D+04, 0.3527320718492223D+03, 0.1351543444661071D+03, -.1767829024014162D+01, 0.3063297283000082D+03, -.2146517664916018D+02,
0.5500000000000000D+01, 0.3147061828458590D+04, 0.3528825017890921D+03, 0.1381908506647593D+03, -.1776397156961792D+01, 0.3095864907902939D+03, -.2042238568410906D+02,
0.5750000000000000D+01, 0.3146672001730351D+04, 0.3530161403078042D+03, 0.1412552017287281D+03, -.1784926432211819D+01, 0.3128109930821022D+03, -.1931516495063971D+02,
0.6000000000000000D+01, 0.3146284433943244D+04, 0.3531362191294632D+03, 0.1443445087274235D+03, -.1793405981271192D+01, 0.3160035745914986D+03, -.1814717236230353D+02,
0.6250000000000000D+01, 0.3145899537354936D+04, 0.3532452468659792D+03, 0.1474565070193246D+03, -.1801826790181380D+01, 0.3191651198996198D+03, -.1692218250649683D+02,
0.6500000000000000D+01, 0.3145517646652878D+04, 0.3533452040424814D+03, 0.1505893856722551D+03, -.1810181543166877D+01, 0.3222970213255037D+03, -.1564406027924430D+02,
0.6750000000000000D+01, 0.3145139027264779D+04, 0.3534376797381462D+03, 0.1537416721218106D+03, -.1818464440542982D+01, 0.3254011386402415D+03, -.1431673867134131D+02,
0.7000000000000000D+01, 0.3144763884749192D+04, 0.3535239692053073D+03, 0.1569121526508003D+03, -.1826670993115741D+01, 0.3284797577771587D+03, -.1294420090356834D+02,
0.7250000000000000D+01, 0.3144392375140826D+04, 0.3536051449308609D+03, 0.1600998103836742D+03, -.1834797795469655D+01, 0.3315355500241936D+03, -.1153046696289316D+02,
0.7500000000000000D+01, 0.3144024616108828D+04, 0.3536821093321296D+03, 0.1633037836067529D+03, -.1842842281748659D+01, 0.3345715328057993D+03, -.1007958447612396D+02,
0.7750000000000000D+01, 0.3143660698770940D+04, 0.3537556345821970D+03, 0.1665233375564573D+03, -.1850802467263307D+01, 0.3375910327960111D+03, -.8595623769932406D+01,
0.8000000000000000D+01, 0.3143300699993345D+04, 0.3538263933265177D+03, 0.1697578347264995D+03, -.1858676679101450D+01, 0.3405976517664502D+03, -.7082676902271969D+01,
page 2
A guide to the items captured in this data file is as follows;
RAAN (deg) = park orbit right ascension of the ascending node in degrees
tanom (deg) = park orbit true anomaly of the TLI maneuver in degrees
rasc moon (deg) = geocentric right ascension of the moon in degrees at arrival
Please note that all angular coordinates are measured with respect to the Earth mean equator and
equinox of J2000 (EME2000) coordinate system.
This next section contains plots of the behavior of the TLI characteristics for a descending node
transfer for a period of three months at a step size of 0.25 days. The initial calendar date is January 1,
2008 at 0 hours Barycentric Dynamical Time (TDB), and the fixed transfer time from TLI until lunar
encounter is 84 hours.
The first plot shows the variation of the magnitude of the TLI impulsive delta-v in meters per second
as a function of the elapsed time since January 1, 2008 in days.
page 3
This next plot illustrates the variation of the RAAN of the circular park orbit as a function of the TLI
calendar date.
This plot illustrates the behavior of the true anomaly of the impulsive TLI maneuver on the circular
park orbit.
page 4
This next plot shows the geocentric declination of the moon at the encounter time.
This final plot illustrates the specific orbital energy of the transfer trajectory.
page 5
Technical Discussion
y t
z
u t
consisting of the state variables y and the control variables u for any time t. In this discussion
vectors are denoted in bold.
The system dynamics are defined by a vector system of ordinary differential equations called the state
equations that can be represented as follows:
dy
y f y t , u t , p, t
dt
The initial dynamic variables at time t0 are defined by ψ0 ψ y t0 , u t0 , t0 and the terminal
conditions at the final time t f are defined by ψ f ψ y t f , u t f , t f . These conditions are called
the boundary values of the trajectory problem. The problem may also be subject to path constraints of
the form g y t , u t , t 0 .
The basic nonlinear programming problem (NLP) is to determine the control vector history and
problem parameters that minimize the scalar performance index or objective function given by
J y t0 , t0 , y t f , t f , p
During the two-body trajectory optimization, the main control variable is the park orbit true anomaly at
the time of the TLI maneuver. The objective function or performance index is the scalar magnitude of
the TLI delta-v vector. The final boundary conditions are the components of the moon’s geocentric
inertial position vector at encounter.
For each calendar date of the parametric sweep, the initial true anomaly guess for the location of the
TLI impulsive maneuver is set to zero. During the numerical optimization, the true anomaly is
bounded according to
360 360
page 6
Park orbit RAAN
For a given TLI calendar date, there are two possible locations on the initial park orbit at which to
perform the propulsive maneuver. One opportunity occurs during the ascending part of the park orbit
and the other during the descending motion. The park orbit RAAN p at these two locations can be
determined from spherical trigonometry relationships involving the park orbit inclination and the
geocentric right ascension and declination of the moon at encounter.
In this application, the park orbit RAAN is held fixed during the numerical optimization. The RAAN
option used is selected by the user.
ascending maneuver
tan m
p 180 m sin 1
tan i
p
descending maneuver
tan m
p m sin 1
tan i
p
where
m right ascension of the moon at encounter
m declination of the moon at encounter
i p park orbit inclination
Lambert’s problem is concerned with the determination of an orbit that passes between two positions
within a specified time-of-flight. This classic astrodynamic problem is also known as the orbital two-
point boundary value problem (TPBVP).
The time to traverse a trajectory depends only upon the length of the semimajor axis a of the transfer
trajectory, the sum ri rf of the distances of the initial and final positions relative to a central body,
and the length c of the chord joining these two positions. This relationship can be stated as follows:
tof tof ri rf , c, a
a3
t t0 E e sin E
we can write
page 7
a3
t E E0 e sin E sin E0
where E is the eccentric anomaly associated with radius r, E0 is the eccentric anomaly at r0 , and t 0
when r r0 .
At this point we need to introduce the following trigonometric sun and difference identities:
a
sin sin 2sin cos
2 2
a
cos cos 2sin sin
2 2
a
cos cos 2 cos cos
2 2
If we let E and E0 and substitute the first trig identity into the second equation above, we
have the following equation:
a3 E E0 E E0
t E E0 2sin e cos
2 2
E E0 E E0
e cos cos sin sin
2 2 2 2
a3
t 2sin cos
2 2
r a 1 e cos E
x a cos E e
y a sin E 1 e 2
page 8
r r0 c r r0 c s
cos 1 1 1
2a 2a 2a a
r r0 c r r0 c sc
sin 1 1 1
2a 2a 2a a
This part of the derivation makes use of the following three relationships:
r r0
cos cos 1
2 2 2
E E0 E E0
2
sin sin sin 1 e cos
2 2 2 2
x x0 y y0 c
2 2 2 2
sin sin
2 2 2a 2a 2a
s sc
sin sin
2 2a 2 2a
and several additional substitutions, we have the time-of-flight form of Lambert’s theorem
a3
t sin sin
A discussion about the angles and can be found in “Geometrical Interpretation of the Angles
and in Lambert’s Problem” by J. E. Prussing, AIAA Journal of Guidance and Control, Volume 2,
Number 5, Sept.-Oct. 1979, pages 442-443.
The algorithm used in this computer program is based on the method described in “A Procedure for the
Solution of Lambert’s Orbital Boundary-Value Problem” by R. H. Gooding, Celestial Mechanics and
Dynamical Astronomy 48: 145-165, 1990. This iterative solution is valid for elliptic, parabolic and
hyperbolic transfer orbits which may be either posigrade or retrograde, and involve one or more
revolutions about the central body.
page 9
References and Bibliography
“Circumlunar Trajectory Calculations”, MIT Instrumentation Laboratory Report R-353, April 1962.
“Optimal Low Thrust Trajectories to the Moon”, John T. Betts and Sven O. Erb, SIAM Journal on
Applied Dynamical Systems, Vol. 2, No. 2, pp. 144-170, 2003.
“Nonimpact Lunar Transfer Trajectories Using the Pseudostate Technique”, R. V. Ramanan and V.
Adimurthy, AIAA Journal of Guidance, Control and Dynamics, Vol. 28, No. 2, March-April 2005, pp.
217-225.
“Injection Conditions for Lunar Trajectories”, R. Kolenkiewicz and W. Putney, NASA TM X-55390,
November 1965.
“Coplanar Three-Body Trans-Earth Lunar Trajectory Simulation Methodology”, H. Ikawa, AIAA 88-
0381, AIAA 26th Aerospace Sciences Meeting, Reno, Nevada, January 11-14, 1988.
page 10
A Computer Program for Trans-Lunar Trajectory Optimization
This document is the user’s guide for a Windows-compatible computer program called tlto.exe that
can be used to design and optimize lunar missions from Earth park orbit to B-plane encounter at the
moon. The software assumes that trans-lunar injection (TLI) occurs impulsively from a circular Earth
park orbit. The B-plane coordinates and final orbital elements are expressed in a moon-centered
(selenocentric) mean lunar equator and IAU node of epoch coordinate system.
The first part of the software solves for the minimum TLI impulsive delta-v using a two-body Lambert
solution for the transfer trajectory from the Earth park orbit to the center of the moon. The second part
of the computer program implements a simple shooting method that attempts to minimize the impulsive
TLI delta-v while numerically integrating the spacecraft equations of motion and targeting to
components of the B-plane. In the shooting algorithm, the spacecraft motion model includes the Earth’s
non-spherical gravity effect and the point-mass perturbations of the sun and moon. The B-plane targets
are enforced using the combination of user-defined periapsis radius and orbital inclination of the arrival
hyperbola at the moon.
The program inputs and major computational steps implemented in this software are as follows:
Software Inputs
Step 2: Using output from Step 1 as initial conditions, optimize the numerically
integrated spacecraft motion problem with B-plane targets
Output
TLI delta-v vector and transfer time
Classical orbital elements of geocentric transfer trajectory
Selenocentric orbital elements of the encounter hyperbola
B-plane coordinates
This computer program was written and compiled using Intel Visual Fortran. The lunar coordinates
required by the software are computed using the JPL DE421 ephemeris.
page 1
Program execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
tlto tlto1.in
If the software is executed without an input file on the command line, the computer program will display
the following information screen and file name prompt:
************************************
* program tlto *
* *
* trans-lunar trajectory *
* optimization *
* *
* April 22, 2013 *
************************************
At this point the user should input the name of a valid input file, including the filename extension.
To create a DOS command window in Windows 7, select start, then All Programs, then Accessories
and finally Command Prompt. The size, font and other characteristics of the screen can be controlled
by the user with the c:\ icon in the upper left corner of the window. To log into the subdirectory created
during the installation of the Fortran executable and support files, type root:\ and then cd subdirectory
from the DOS command line where root is the name of the root directory, usually c:, and subdirectory is
the name of the subdirectory created by the user.
The tlto computer program is “data-driven” by a simple text file created by the user. This section
describes a typical input data file. In the following discussion the actual input file contents are in
courier font and all explanations are in times italic font. Each data item within an input file is
preceded by one or more lines of annotation text. Do not delete any of these annotation lines or increase
or decrease the number of lines reserved for each comment. However, you may change them to reflect
your own explanation. The annotation line also includes the correct units and when appropriate, the
valid range of the input.
The first five lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with five and only five initial text lines.
**************************************
* input file for program tlto
* tlto1.in – December 4, 2010
* polar lunar orbit at 100 km altitude
**************************************
page 2
The software allows the user to specify an initial guess for the TLI calendar date and lower and upper
bounds on the actual date found during both the two-body and numerically integrated TLI delta-v
optimization processes. For any guess for the TLI time tTLI and user-defined lower and upper bounds
tl and tu , the actual TLI time t is constrained as follows:
The first five inputs define the initial guesses for the TLI calendar date and the lower and upper bounds,
respectively. Be sure to include all four digits of the calendar year. The first set of bounds is used
during the two-body optimization, and the second set is used during the numerical integration and B-
plane targeting.
The TLI calendar date is a control variable in the NLP formulation and must always have a lower and
upper bound. For a fixed TLI calendar date, input small values (e.g., plus and minus 1.0e-8) for the
bounds.
initial guess for TLI calendar date (month, day, year)
9,15,2008
lower bound for TLI calendar date search (two-body optimization; hours)
0.0
upper bound for TLI calendar date search (two-body optimization; hours)
+24.0
lower bound for TLI calendar date search (integrated optimization; hours)
-12.0
upper bound for TLI calendar date search (integrated optimization; hours)
+12.0
The next input is the user’s initial guess for the TLI-to-B-plane transfer time, in hours.
initial guess for transfer time (hours)
110.0
The next two numbers define the fixed values for park orbit altitude and orbital inclination. The altitude
ius measured with respect to a spherical Earth model.
***********************************
circular park orbit characteristics
***********************************
altitude (kilometers)
185.32
This next integer input defines the type of TLI maneuver to perform. The software uses this indicator to
compute the park orbit RAAN.
type of TLI maneuver
(1 = ascending, 2 = descending)
2
This next integer input defines the type of targeting algorithm to use.
page 3
*****************************
type of final orbit targeting
-----------------------------
1 = periapsis radius and inclination
2 = user-defined b-plane coordinates
************************************
1
The next two inputs define the periapsis radius and orbital inclination to use during the numerically
integrated solution. These coordinates refer to the selenocentric hyperbola. The orbital inclination
should be specified in the mean lunar equator and IAU node of epoch coordinate system.
------------------------------------------
final lunar orbit characteristics
(mean lunar equator and IAU node of epoch)
------------------------------------------
For targeting option 2, the software allows the user to input B-plane targets directly using the following
two program inputs.
------------------------------------------
user-defined b-plane targets
(mean lunar equator and IAU node of epoch)
------------------------------------------
The next series of inputs define the types of perturbations to include during the numerical integration of
the spacecraft’s equations of motion. The first text input is the name of the Earth gravity model data file
to use. Items 2 and 3 allow the user to specify the order and degree (up to 70) of the Earth gravity
model in the equations of motion, and items 4 and 5 specify options to include the point mass gravity of
the moon and sun.
************************
trajectory perturbations
************************
page 4
The next two inputs are algorithm control parameters. The first input is the truncation error tolerance
for the Runge-Kutta-Felhberg integrator and determines how well the equations of orbital motion are
solved. The second input is the root-finding tolerance and it determines how accurately close approach
to the moon is predicted.
****************************
algorithm control parameters
****************************
root-finding tolerance
1.0d-8
The final two inputs specify the name of the solution disk file and the time step at which the data is
created and written to this file.
***************************
output file characteristics
***************************
The following is the solution created by the computer program for this example. The output is
organized by the following major sections:
First pass
Targeting pass
The first output section summarizes the optimized two-body Lambert solution. The solution is presented
in the Earth mean equator of J2000 coordinate system (EME2000). The trajectory characteristics are
given before and after the impulsive TLI maneuver. The event time is provided in both Universal
Coordinated Time (UTC) and Barycentric Dynamical Time (TDB).
page 5
======================================
two-body lunar trajectory optimization
======================================
descending transfer
page 6
deltav-x 2721.42782925067 meters/second
deltav-y -1391.40979772003 meters/second
deltav-z -679.977617407291 meters/second
The components of the unit thrust vector of the TLI impulsive maneuver are displayed in both the Earth-
centered-inertial (ECI) and radial, tangential and normal (RTN) coordinate systems.
This section of the program output is created after the B-plane targeting problem has been solved. It
includes a summary of the solution, the TLI delta-v vector and magnitude, the final B-plane coordinates
and the orbital elements and state vector of the incoming hyperbola.
=======================
optimal n-body solution
=======================
descending transfer
page 7
sma (km) eccentricity inclination (deg) argper (deg)
0.656345630000D+04 0.716042246482D-16 0.285000000000D+02 0.000000000000D+00
page 8
time and conditions at lunar closest approach
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
----------------------------------------------------
coordinates of the moon at closest approach
(geocentric Earth mean equator and equinox of J2000)
----------------------------------------------------
page 9
vx (kps) vy (kps) vz (kps) vmag (kps)
-.880138031538D+00 0.553045427398D+00 0.224951785729D+00 0.106353444008D+01
The tlto software suite also includes an interactive MATLAB script called lplot.m that can be used
to create three-dimensional geocentric and selenocentric graphics of the solution. The graphics data is
displayed at the user-defined step size provided in the input file. A plot step size of ten minutes is
recommended. However, for zoomed plots of either the geocentric or selenocentric trajectory, smaller
plot step sizes will create “smoother” trajectory displays.
Important note!!
You must delete the first or “header” line of the tlto solution file in order for the lplot script to work.
This script uses the MATLAB csvread function to read the data file which can only contain comma-
separated-variable (CSV) numerical data. The lplot script will also create color Postscript graphic
disk files with a TIFF preview using MATLAB statements similar to
print -depsc -tiff -r300 tlto1.eps
The following is a plot of the geocentric transfer trajectory for this example. Please note that the
coordinates are displayed in the units of Earth radii (ER). The asterisk symbol is the position of the
moon at the moment of trans-lunar injection and the park orbit trace is red. The interactive graphic
features of MATLAB will allow the user to rotate and “zoom” the displays in and out. These
capabilities allow the user to interactively find the “best” viewpoint as well as verify the basic orbital
geometry of the geocentric and selenocentric trajectories.
Geocentric Transfer Trajectory
50
40
30
Z coordinate (ER)
20
10
-10
-20
-30
0 -60
10
20 -40
30 -20
40
0
X coordinate (ER)
Y coordinate (ER)
page 10
This next plot is a “zoomed” display of the first plot closer to the Earth. The initial park orbit is
displayed in red, the transfer trajectory is blue, and an inertial, Earth-centered coordinate system is on
the plot. The x-axis of this system is red, the y-axis green and the z-axis blue. The location on the park
orbit at which TLI occurs is marked with a small dot symbol.
This plot illustrates the geocentric trajectory of the spacecraft in the vicinity of the moon. In this
display, the location of the spacecraft when it enters the sphere-of-influence of the moon is marked with
a blue asterisk. The spacecraft trajectory at closest approach to the moon is the small blue dot and the
location of the moon at closest approach is the green asterisk.
-10
page 11
The following is a plot of the selenocentric hyperbola within the moon’s sphere-of-influence. The
coordinate units are lunar radii (LR). The entry into the SOI is marked with an asterisk. In this
MATLAB script the radius of the moon’s SOI is “hardwired” to a value of 64,000 kilometers.
Selenocentric Trajectory
15
10
Z coordinate (MR)
-5
-10
-15
-20
20 -30
10 -20
0
-10
-10
-20 0
Y coordinate (MR)
X coordinate (MR)
The final plot is a “zoomed” display of the previous plot. This display is labeled with a selenocentric,
inertial coordinate system. The x-axis is red, the y-axis green and the z-axis blue. The small red dot is
periapsis of the approach hyperbola.
page 12
Verification of the solution
After the n-body optimization finishes, the software will verify the solution by numerically integrating
the equations of motion using a Runge-Kutta-Fehlberg 7(8) numerical method. The integration starts
with the position and velocity vector of the trans-lunar transfer orbit immediately after the TLI
impulsive maneuver and propagates to closest approach to the moon predicted by the software.
===================================
verification of the n-body solution
===================================
page 13
vx (kps) vy (kps) vz (kps) vmag (kps)
0.130967216081D+01 -.862213632161D+00 -.189576660132D+01 0.246020009815D+01
Technical discussion
This section provides additional details about the numerical algorithms used in this computer program.
The computational methods discussed here include solving the two body Lambert problem, the method
used for propagating the spacecraft’s geocentric trajectory, the algorithm used for targeting to the B-
plane, and the geocentric-to-selenocentric coordinate transformation.
y t
z
u t
consisting of the state variables y and the control variables u for any time t. In this discussion vectors
are denoted in bold.
The system dynamics are defined by a vector system of ordinary differential equations called the state
equations that can be represented as follows:
dy
y f y t , u t , p, t
dt
The initial dynamic variables at time t0 are defined by ψ0 ψ y t0 , u t0 , t0 and the terminal
conditions at the final time t f are defined by ψ f ψ y t f , u t f , t f . These conditions are called the
boundary values of the trajectory problem.
page 14
For any mission time t there are also simple bounds on the state variables
yl y t yu
the control variables
ul u t uu
pl p t pu
The basic nonlinear programming problem (NLP is to determine the control vector history and problem
parameters that minimize the scalar performance index or objective function given by
J y t0 , t0 , y t f , t f , p
During the two-body trajectory optimization, the control variables are the TLI calendar date and the true
anomaly of the TLI maneuver. For the numerical integration optimization, the control variables consist
of the TLI calendar date, the RAAN of the park orbit, the true anomaly of the TLI maneuver, and the
Cartesian components of the TLI delta-v vector.
For both types of optimization, the objective function or performance index is the scalar magnitude of
the TLI impulsive delta-v.
In addition to the bounds on the TLI calendar date mentioned earlier, the true anomaly during the two-
body optimization is bounded according to
180 180
During the second part of the trajectory optimization, the RAAN and true anomaly bounds are
TB 30 TB 30
TB 30 TB 30
where TB and TB are the RAAN and true anomaly found during the two-body optimization. The
bounds on the components of the TLI delta-v are given by
v 0.1 v v x , y ,z v 0.1 v
The final boundary conditions are the B-plane coordinates of the incoming selenocentric hyperbola.
page 15
Solving the two body Lambert problem
Lambert’s problem is concerned with the determination of an orbit that passes between two positions
within a specified time-of-flight. This classic astrodynamic problem is also known as the orbital two-
point boundary value problem (TPBVP).
The time to traverse a trajectory depends only upon the length of the semimajor axis a of the transfer
trajectory, the sum ri rf of the distances of the initial and final positions relative to a central body, and
the length c of the chord joining these two positions. This relationship can be stated as follows:
tof tof ri rf , c, a
a3
t t0 E e sin E
we can write
a3
t E E0 e sin E sin E0
where E is the eccentric anomaly associated with radius r, E0 is the eccentric anomaly at r0 , and t 0
when r r0 .
At this point we need to introduce the following trigonometric sun and difference identities:
a
sin sin 2sin cos
2 2
a
cos cos 2sin sin
2 2
a
cos cos 2 cos cos
2 2
If we let E and E0 and substitute the first trig identity into the second equation above, we have
the following equation:
a3 E E0 E E0
t E E0 2sin e cos
2 2
page 16
E E0
e cos cos
2 2
E E0
sin sin
2 2
a3
t 2sin cos
2 2
r a 1 e cos E
x a cos E e
y a sin E 1 e 2
r r0 c r r0 c s
cos 1 1 1
2a 2a 2a a
r r0 c r r0 c sc
sin 1 1 1
2a 2a 2a a
This part of the derivation makes use of the following three relationships:
r r0
cos cos 1
2 2 2
E E0 E E0
2
sin sin sin 1 e cos
2 2 2 2
x x0 y y0 c
2 2 2 2
sin sin
2 2 2a 2a 2a
s sc
sin sin
2 2a 2 2a
and several additional substitutions, we have the time-of-flight form of Lambert’s theorem
page 17
a3
t sin sin
A discussion about the angles and can be found in “Geometrical Interpretation of the Angles
and in Lambert’s Problem” by J. E. Prussing, AIAA Journal of Guidance and Control, Volume 2,
Number 5, Sept.-Oct. 1979, pages 442-443.
The algorithm used in this computer program is based on the method described in “A Procedure for the
Solution of Lambert’s Orbital Boundary-Value Problem” by R. H. Gooding, Celestial Mechanics and
Dynamical Astronomy 48: 145-165, 1990. This iterative solution is valid for elliptic, parabolic and
hyperbolic transfer orbits which may be either posigrade or retrograde, and involve one or more
revolutions about the central body.
The spacecraft’s orbital motion is modeled with respect to the Earth mean equator and equinox of J2000
(EME2000) coordinate system. The following figure illustrates the geometry of the EME2000
coordinate system. The origin of this Earth-centered-inertial (ECI) inertial coordinate system is the
geocenter and the fundamental plane is the Earth’s mean equator. The z-axis of this system is normal to
the Earth’s mean equator at epoch J2000, the x-axis is parallel to the vernal equinox of the Earth’s mean
orbit at epoch J2000, and the y-axis completes the right-handed coordinate system. The epoch J2000 is
the Julian Date 2451545.0 which corresponds to January 1, 2000, 12 hours Terrestrial Time (TT).
This part of the trajectory analysis implements a special perturbation technique which numerically
integrates the vector system of second-order, nonlinear differential equations of motion of a spacecraft
given by
a r , v , t r r , r , t ag r am r , t as r , t
page 18
where
t dynamical time
r inertial position vector of the spacecraft
v inertial velocity vector of the spacecraft
a g acceleration due to the Earth's gravity
am acceleration due to the Moon
as acceleration due to the Sun
This computer program uses a spherical harmonic representation of the Earth’s geopotential function
given by
n R
n n
R
r, , Cn0 Pn0 u Pnm u Snm sin m Cnm cos m
r r n 1 r r n 1 m1 r
where is the geocentric latitude of the spacecraft, is the geocentric east longitude of the spacecraft
and r r x 2 y 2 z 2 is the geocentric distance of the spacecraft. In this expression the S’s and C’s
are unnormalized harmonic coefficients of the geopotential, and the P’s are associated Legendre
polynomials of degree n and order m with argument u sin .
The software calculates the spacecraft’s acceleration due to the Earth’s gravity field with a vector
equation derived from the gradient of the potential function expressed as
a g r, t r, t
This acceleration vector is a combination of pure two-body or point mass gravity acceleration and the
gravitational acceleration due to higher order nonspherical terms in the Earth’s geopotential. In terms of
the Earth’s geopotential , the inertial rectangular cartesian components of the spacecraft’s acceleration
vector are as follows:
1 z 1
x x 2 y
r r r 2 x 2 y 2 x y 2
1 z 1
y y 2 x
r r r x y
2 2 2
x y 2
1 x2 y2
z z
r r r 2
The three partial derivatives of the geopotential with respect to r, , are given by
1 N R
n
r r r n 2 r m 0
N R
n n
r n 2 r
C
m 0
m
n cos m Snm sin m Pnm1 sin m tan Pnm sin
page 19
N R
n n
r n 2 r
mS
m 0
m
n cos m Cnm sin m Pnm sin
where
R radius of the Earth
r geocentric distance of the spacecraft
Snm , Cnm harmonic coefficients
geocentric latitude of the spacecraft sin 1 z r
longitude of the spacecraft g
right ascension of the spacecraft tan 1 y x
g right ascension of Greenwich
Right ascension is measure positive east of the vernal equinox, longitude is measured positive east of
Greenwich, and latitude is positive above the Earth’s equator and negative below.
For m 0 , the coefficients are called zonal terms, when m n the coefficients are sectorial terms, and
for n m 0 the coefficients are called tesseral terms.
The Legendre polynomials with argument sin are computed using recursion relationships given by:
1
Pn0 sin 2n 1 sin Pn01 sin n 1 Pn02 sin
n
Pnn sin 2n 1 cos Pnn11 sin , m 0, m n
and Pi j 0 for j i .
page 20
r r
am r , t m mb 3 em 3
r rem
m b
where
m gravitational constant of the moon
rmb position vector from the moon to the satellite
rem position vector from the Earth to the moon
r r
a s r , t s s b 3 e s 3
r res
s b
where
s gravitational constant of the sun
rs b position vector from the sun to the satellite
re s position vector from the Earth to the sun
3 3qk qk2
f qk qk 3
1 1 qk
where
r T r 2sk
qk
sTk sk
n
k
r r f qk s k
k 1 d k3
In these equations, s k is the vector from the primary body to the secondary body, k is the gravitational
constant of the secondary body and dk r sk , where r is the position vector of the spacecraft relative
to the primary body. The derivation of the f q functions is described in Section 8.4 of “An
Introduction to the Mathematics and Methods of Astrodynamics, Revised Edition”, by Richard H.
Battin, AIAA Education Series, 1999.
In this computer program the heliocentric coordinates of the sun and moon are based on the JPL
Development Ephemeris DE421. These coordinates are provided in the Earth mean equator and
equinox of J2000 coordinate system (EME2000). The name of this binary date file is de421.bin, and
it must reside in the same directory as the tlto.exe computer program.
page 21
Park orbit RAAN
For a given TLI injection time, there are two possible locations on the initial park orbit at which to
perform the propulsive maneuver. One opportunity occurs during the ascending part of the park orbit
and the other during the descending motion. The park orbit RAAN p at these two locations can be
determined from spherical trigonometry relationships involving the park orbit inclination and the right
ascension and declination of the moon at encounter.
where
m right ascension of the moon at encounter
m declination of the moon at encounter
i p park orbit inclination
B-plane targeting
The derivation of B-plane coordinates is described in the classic JPL reports, “A Method of Describing
Miss Distances for Lunar and Interplanetary Trajectories” and “Some Orbital Elements Useful in Space
Trajectory Calculations”, both by William Kizner. The following diagram illustrates the fundamental
geometry of the B-plane coordinate system.
page 22
The software solves the B-plane targeting problem by minimizing the delta-v vector at the TLI while
satisfying two nonlinear equality constraint equations. These constraint equations are the differences
between components of the required B-plane and the B-plane components predicted by the software.
Given the user-defined closest approach radius rca and orbital inclination i, and the incoming v-infinity
magnitude v and the right ascension and declination of the incoming asymptote vector at the
moment of closest approach, the following series of equations can be used to determine the required B-
plane target components:
B T bt cos
B R bt sin
where
2 rca 2
bt 2
rca2 rca 1
v rca v2
and
cos i
cos sin 1 cos2 tan 1 sin ,cos
cos
sin sˆ zˆ sx2 s 2y
zˆ 0 0 1
T
cos cos
Sˆ cos sin
sin
where and are the declination and right ascension of the asymptote of the incoming hyperbola.
Important note!!
This technique only works for lunar orbit inclinations that satisfy
i
If this inequality is not satisfied, the software will print the following error message
b-plane targeting error!!
|inclination| must be > |asymptote declination|
page 23
It will also display the actual declination of the asymptote and stop. The user should then edit the input
file, include a valid orbital inclination and restart the simulation.
The following computational steps summarize the calculation of the predicted B-plane vector from a
moon-centered position vector r and velocity vector v at closest approach.
radius rate r r v r
semiparameter p h2
r
semimajor axis a
r v2
2
orbital eccentricity e 1 p a
pr rh
true anomaly cos sin tan 1 sin ,cos
er e
B-plane magnitude B pa
fundamental vectors
r v rr
zˆ pˆ cos rˆ sin zˆ qˆ sin rˆ cos zˆ
h
a b
S vector S pˆ qˆ
a b2 2
a b2
2
b2 ab
B vector B pˆ qˆ
a b
2 2
a b2
2
S , S ,0
2 2 T
T
y x
T vector
S x2 S y2
For this targeting option, the equality constraints enforced by the nonlinear programming algorithm are
page 24
rp rca 0
cos i hˆ z 0
where rp and i are the user-defined periapsis radius and selenocentric orbital inclination, respectively.
In the second equation hˆ is the z-component of the spacecraft’s unit angular momentum vector at
z
closest approach to the moon.
For both types of targeting techniques, closest approach is determined during the numerical integration
of the spacecraft equations of motion by finding the time since TLI at which the selenocentric flight path
angle is zero. This mission constraint is computed as follows
rv
sin 0
r v
where r and v are the spacecraft’s moon-centered position and velocity vectors, respectively.
This section describes the transformation of coordinates between the Earth mean equator and equinox
2000 (EME2000) and lunar mean equator and IAU node of epoch coordinate systems. This
transformation is used to compute the B-plane coordinates at encounter.
The following diagram illustrates the orientation of the lunar mean equator and IAU node of epoch
coordinate frame.
A unit vector in the direction of the pole of the moon can be determined from
page 25
cos p cos p
pˆ Moon sin p cos p
sin p
where p and p are the right ascension and declination of the lunar pole.
The right ascension and declination of the lunar pole in the EME2000 coordinate system are given by
the following expressions
where T is the time in Julian centuries given by T JD 2451545.0 / 36525 and JD is the Dynamical
Barycentric Time (TDB) Julian Date.
E1 125.045 0.0529921d
E 2 250.089 0.1059842d
E 3 260.008 13.0120009d
E 4 176.625 13.3407154d
E 6 311.589 26.4057084d
E 7 134.963 13.0649930d
E10 15.134 0.1589763d
E13 25.053 12.9590088d
where d JD 2451545 is the number of days since January 1.5, 2000. These equations are given in
“Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2009”,
Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011.
The unit vector in the x-axis direction of this selenocentric coordinate system is given by
xˆ zˆ pˆ Moon
where zˆ 0 0 1 . The unit vector in the y-axis direction can be determined using
T
page 26
yˆ pˆ Moon xˆ
Finally, the components of the matrix that transforms coordinates from the EME2000 system to the
moon-centered (selenocentric) mean equator and IAU node of epoch system are as follows:
M xˆ yˆ pˆ Moon
T
Time systems
This section is a brief explanation of the time scales used in this computer program.
Coordinated Universal Time (UTC) is the time scale available from broadcast time signals. It is a
compromise between the highly stable atomic time and the irregular earth rotation. UTC is the
international basis of civil and scientific time.
Terrestrial Time, TT
Terrestrial Time is the time scale that would be kept by an ideal clock on the geoid - approximately, sea
level on the surface of the Earth. Since its unit of time is the SI (atomic) second, TT is independent of
the variable rotation of the Earth. TT is meant to be a smooth and continuous “coordinate” time scale
independent of Earth rotation. In practice TT is derived from International Atomic Time (TAI), a time
scale kept by real clocks on the Earth's surface, by the relation TT = TAI + 32s.184. It is the time scale
now used for the precise calculation of future astronomical events observable from Earth.
page 27
TDB TT 0.001657sin 628.3076T 6.2401
0.000022sin 575.3385T 4.2970
0.000014sin 1256.6152T 6.1969
0.000005sin 606.9777T 4.0212
0.000005sin 52.9691T 0.4444
0.000002sin 21.3299T 5.5431
0.000010T sin 628.3076T 4.2490
In this equation, the coefficients are in seconds, the angular arguments are in radians, and T is the
number of Julian centuries of TT from J2000; T = (Julian Date(TT) – 2451545.0) / 36525.
page 28
Algorithm resources
“Circumlunar Trajectory Calculations”, MIT Instrumentation Laboratory Report R-353, April 1962.
“Optimal Low Thrust Trajectories to the Moon”, John T. Betts and Sven O. Erb, SIAM Journal on
Applied Dynamical Systems, Vol. 2, No. 2, pp. 144-170, 2003.
“Integrated Algorithm for Lunar Transfer Trajectories Using a Pseudostate Technique”, R. V. Ramanan,
AIAA Journal of Guidance, Control and Dynamics, Vol. 25, No. 5, September-October 2002, pp. 946-
952.
“Nonimpact Lunar Transfer Trajectories Using the Pseudostate Technique”, R. V. Ramanan and V.
Adimurthy, AIAA Journal of Guidance, Control and Dynamics, Vol. 28, No. 2, March-April 2005, pp.
217-225.
“Injection Conditions for Lunar Trajectories”, R. Kolenkiewicz and W. Putney, NASA TM X-55390,
November 1965.
“Coplanar Three-Body Trans-Earth Lunar Trajectory Simulation Methodology”, H. Ikawa, AIAA 88-
0381, AIAA 26th Aerospace Sciences Meeting, Reno, Nevada, January 11-14, 1988.
“Lunar Constants and Models Document”, JPL D-32296, September 23, 2005.
page 29
APPENDIX A
Contents of the Simulation Summary and CSV Files
This appendix is a brief summary of the information contained in the simulation summary screen
displays and the CSV data files produced by the tlto software.
transfer time = total time from the TLI maneuver to closest approach at the moon
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
vmag (km/sec) = scalar magnitude of the spacecraft’s velocity vector in kilometers per
second
page 30
theta = orientation of the b-plane vector
page 31
ecc-geo = geocentric orbital eccentricity of the spacecraft(non-dimensional)
raan-geo (deg) = geocentric right ascension of the ascending node of the spacecraft in
degrees
raan-sel (deg) = selocentric right ascension of the ascending node of the spacecraft in
degrees
The geocentric coordinates of the spacecraft and the TLI delta-v components are with respect to the
Earth mean equator and equinox of J2000 (EME2000) coordinate system. The selenocentric coordinates
are with respect to the mean lunar equator and IAU node of epoch coordinate system.
page 32
A MATLAB Script for Trans-Lunar Trajectory Optimization
This document is the user’s guide for a MATLAB script named tlto_matlab that can be used to
design preliminary lunar missions from Earth park orbit to B-plane encounter at the moon. The software
assumes trans-lunar injection (TLI) occurs impulsively from a circular Earth park orbit. The B-plane
coordinates used for targeting the final conditions at the moon are expressed in a moon-centered
(selenocentric) mean equator and IAU node of epoch coordinate system. The results from this scientific
simulation can be used as an initial guess for a finite-burn trajectory optimization program.
The first part of this MATLAB script solves for the minimum TLI delta-v using a two-body Lambert
solution for the transfer trajectory from the Earth park orbit to the center of the moon. The second part
of the script implements a shooting method that attempts to minimize the TLI delta-v while numerically
integrating the spacecraft’s n-body equations of motion and targeting to user-defined constraints.
In the shooting algorithm, the spacecraft motion model includes the Earth’s non-spherical gravity effect
and the point-mass perturbations of the sun and moon. The B-plane targets are enforced via a user-
defined periapsis radius and orbital inclination of the arrival hyperbola relative to the moon.
The program inputs and major computational steps implemented in this script are as follows:
Software Inputs
Step 2: Using output from Step 1 as initial conditions, optimize the numerically
integrated spacecraft motion problem with B-plane targets
Output
TLI delta-v vector and transfer time
Classical orbital elements of geocentric transfer trajectory
Selenocentric orbital elements of the encounter hyperbola
B-plane coordinates
This MATLAB script uses the SNOPT nonlinear programming (NLP) method for both optimization
tasks required for the lunar transfer problem implemented in this script. The solar and lunar coordinates
required by this script are computed using the JPL DE421 ephemeris.
page 1
The tlto_matlab script uses routines from the MICE software suite to read and evaluate the JPL
binary ephemeris file. Platform-specific MICE mex files, support functions and the binary ephemeris
file (de421.bsp) are available at naif.jpl.nasa.gov/naif/toolkit_MATLAB.html. MICE is a MATLAB
implementation of the SPICE library created by JPL.
MATLAB versions of SNOPT for several computer platforms can be found at Professor Philip Gill’s
web site which is located at http://scicomp.ucsd.edu/~peg/. Professor Gill’s web site also includes a
PDF version of the SNOPT software user’s guide.
The tlto_matlab MATLAB script is “data-driven” by a simple text file created by the user. This
section describes a typical input data file. In the following discussion the actual input file contents are in
courier font and all explanations are in times italic font.
Each data item within an input file is preceded by one or more lines of annotation text. Do not delete
any of these annotation lines or increase or decrease the number of lines reserved for each comment.
However, you may change them to reflect your own explanation. The annotation line also includes the
correct units and when appropriate, the valid range of the input.
The first four lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with four and only four initial text lines.
******************************
* input file for tlto_matlab
* tlto1.in - February 11, 2013
******************************
The software allows the user to specify an initial guess for the TLI calendar date and lower and upper
bounds on the actual date found during both the two-body and numerically integrated TLI delta-v
optimization processes. For any guess for the TLI time tTLI and user-defined lower and upper bounds
tl and tu , the actual TLI time t is constrained as follows:
The first five inputs define the initial guesses for the TLI calendar date and the lower and upper bounds,
respectively. Be sure to include all four digits of the calendar year. The first set of bounds is used
during the two-body optimization, and the second set is used during the numerical integration and b-
plane targeting.
The TLI calendar date is a control variable in the NLP formulation and must always have a lower and
upper bound. For a fixed TLI calendar date, input small values (e.g., plus and minus 1.0e-8) for the
bounds.
initial guess for TLI calendar date (month, day, year)
9,15,2008
lower bound for TLI calendar date search (two-body optimization; hours)
0.0
page 2
upper bound for TLI calendar date search (two-body optimization; hours)
+24.0
lower bound for TLI calendar date search (b-plane optimization; hours)
-12.0
upper bound for TLI calendar date search (b-plane optimization; hours)
+12.0
The next input is the user’s initial guess for the TLI-to-B-plane transfer time, in hours.
initial guess for transfer time (hours)
110.0
The next two numbers define the fixed values for park orbit altitude and orbital inclination.
***********************************
circular park orbit characteristics
***********************************
altitude (kilometers)
185.32
This next integer input defines the type of TLI maneuver to perform. The script uses this indicator to
compute the park orbit RAAN.
type of TLI maneuver
(1 = ascending, 2 = descending)
2
The next two inputs define the periapsis radius and orbital inclination to use during the numerically
integrated n-body solution. These coordinates refer to the selenocentric hyperbola. The orbital
inclination should be specified in the lunar mean equator and IAU node of epoch coordinate system.
******************************************
final lunar orbit characteristics
(lunar mean equator and IAU node of epoch)
******************************************
This next integer input defines the type of targeting algorithm to use. The b-plane algorithm is
recommended with the orbital elements algorithm a backup in case the software has trouble establishing
a hyperbolic orbit encounter during the shooting calculations.
type of targeting
(1 = b-plane, 2 = orbital elements, 3 = user-defined b-plane targets)
1
page 3
For option 3, the software allows the user to input b-plane targets directly using the following two
program inputs.
user-defined b dot r target (kilometers)
6000.0
The last set of inputs defines the types of perturbations to include during the numerical integration of the
spacecraft’s motion. The first input is the name of the Earth gravity model data file and the next two
integers define the order and degree of the model. The last two integers determine if the simulation
includes the point mass gravity of the moon and sun.
************************
trajectory perturbations
************************
The prompt for the name of the simulation definition input date file is similar to the following;
The file type defaults to names with a *.in filename extension. However, you can select any
tlto_matlab compatible ASCII data file by selecting the Files of type: field or by typing the name of
the file directly in the File name: field.
page 4
Program example and trajectory graphics
The following is the solution created by the tlto_matlab script for this example. The output is
organized by the following major sections:
First pass
1. two body Lambert solution
2. TLI delta-v vector and magnitude
Targeting pass
1. pre-TLI and post-TLI flight conditions
2. TLI delta-v vector and magnitude
3. time and conditions at lunar closest approach
4. classical orbital elements of the lunar transfer trajectory
The first output section summarizes the optimized two-body Lambert solution. The solution is presented
in the Earth mean equator of J2000 coordinate system (EME2000). The trajectory characteristics are
given before and after the impulsive TLI maneuver.
===============================================
minimum TLI delta-v (two-body Lambert solution)
===============================================
page 5
TDB Julian Date 2454725.06117188
This section of the program output is created after the B-plane targeting problem has been solved. It
includes a summary of the solution, the TLI delta-v vector and magnitude, the final B-plane coordinates
and the orbital elements, state vector and flight path angle of the encounter hyperbola.
=======================
optimal n-body solution
=======================
page 6
TLI TDB time 13:28:05.251
c3 -2.08104039 kilometer^2/second^2
Appendix A contains a brief summary of the numerical information provided by this script.
After the n-body optimization finishes, the software will verify the solution by numerically integrating
the equations of motion using a Runge-Kutta-Fehlberg 7(8) numerical method. The integration starts
with the position and velocity vector of the trans-lunar transfer orbit immediately after the TLI
impulsive maneuver and propagates to closest approach to the moon predicted by the software.
===============================
verification of n-body solution
===============================
page 8
calendar date 19-Sep-2008
The important results from solving this orbital initial value problem (IVP) are the selenocentric periapsis
radius and orbital inclination, and the flight path angle. For a valid solution, the periapsis radius and
orbital inclination should be very close to the user-defined values and the selenocentric flight path angle
at closest approach should be very near zero.
The tlto_matlab script can also create graphic displays of the geocentric transfer orbit and the
selenocentric hyperbola within the sphere-of-influence of the moon. This section describes the user
interaction with this software option and also provides typical graphic displays.
After the software has computed the trajectory solution, it will display the following graphics menu:
page 9
graphics menu
<4> none
If the user elects option 1, 2 or 3, the script will request the plot duration with this next menu:
plot duration menu
This menu option allows the user to create graphics from trans-lunar injection until either the time of
closest approach to the moon or a simulation duration defined by the user.
For the second plot duration option, the software will ask for this input with the following request:
please input the simulation duration (hours)
?
Finally, the MATLAB script will request the plot step size with
please input the plot step size (minutes)
?
A plot step size of ten minutes is recommended. However, for zoomed plots of either the geocentric or
selenocentric trajectory, smaller plot step sizes will create “smoother” displays. The following is a plot
of the geocentric transfer trajectory for this example. The coordinates are displayed in the units of Earth
radii (ER). The asterisk symbol is the position of the moon at the moment of trans-lunar injection and
the moon’s orbit is marked with a small blue dot symbol at 24 hour intervals. The park orbit trace is red.
page 10
The interactive graphic features of MATLAB will allow the user to rotate and “zoom” the displays in
and out. These capabilities allow the user to interactively find the “best” viewpoint as well as verify the
basic orbital geometry of the geocentric and selenocentric trajectories.
Selenocentric Trajectory
This next plot is a “zoomed” display of the first plot closer to the Earth. The initial park orbit is
displayed in red, the transfer trajectory is blue, and an inertial, Earth-centered coordinate system is on
the plot. The x-axis of this system is red, the y-axis green and the z-axis blue. The location on the park
orbit at which TLI occurs is marked with a small dot symbol.
30
20
The following is a plot of the selenocentric hyperbola within the moon’s sphere-of-influence. The
coordinate units are lunar radii (LR). The entry into the SOI is marked with an asterisk. In this
MATLAB script the radius of the moon’s SOI is “hardwired” to a value of 64,000 kilometers.
10
-10
-20 The final plot is a “zoomed” display of the previous plot. This display is labeled with a selenocentric,
inertial coordinate system. The x-axis is red, the y-axis green and the z-axis blue. The small red dot is
periapsis of the approach hyperbola.
page 11
-30
The tlto_matlab MATLAB script can also create these types of graphic displays for the optimized
two-body solution.
Finally, the main script will create color postscript graphic disk files (with TIFF preview) of these
images. These images are created with source code similar to
Technical Discussion
This section provides additional details about the numerical algorithms used in this computer program.
The computational methods discussed here include solving the two body Lambert problem, the method
used for propagating the spacecraft’s geocentric trajectory, the algorithm used for targeting to the B-
plane, and the geocentric-to-selenocentric coordinate transformation. A brief discussion of trajectory
optimization is also provided along with the MATLAB source code for the two-body optimization.
Lambert’s problem is concerned with the determination of an orbit that passes between two positions
within a specified time-of-flight. This classic astrodynamic problem is also known as the orbital two-
point boundary value problem (TPBVP).
The time to traverse a trajectory depends only upon the length of the semimajor axis a of the transfer
trajectory, the sum ri rf of the distances of the initial and final positions relative to a central body, and
the length c of the chord joining these two positions. This relationship can be stated as follows:
tof tof ri rf , c, a
a3
t t0 E e sin E
page 12
we can write
a3
t E E0 e sin E sin E0
where E is the eccentric anomaly associated with radius r, E0 is the eccentric anomaly at r0 , and t 0
when r r0 .
At this point we need to introduce the following trigonometric sun and difference identities:
a
sin sin 2sin cos
2 2
a
cos cos 2sin sin
2 2
a
cos cos 2 cos cos
2 2
If we let E and E0 and substitute the first trig identity into the second equation above, we have
the following equation:
a3 E E0 E E0
t E E0 2sin e cos
2 2
E E0
e cos cos
2 2
E E0
sin sin
2 2
a3
t 2sin cos
2 2
r a 1 e cos E
x a cos E e
y a sin E 1 e 2
page 13
r r0 c r r0 c s
cos 1 1 1
2a 2a 2a a
r r0 c r r0 c sc
sin 1 1 1
2a 2a 2a a
This part of the derivation makes use of the following three relationships:
r r0
cos cos 1
2 2 2
E E0 E E0
2
sin sin sin 1 e cos
2 2 2 2
x x0 y y0 c
2 2 2 2
sin sin
2 2 2a 2a 2a
s sc
sin sin
2 2a 2 2a
and several additional substitutions, we have the time-of-flight form of Lambert’s theorem
a3
t sin sin
A discussion about the angles and can be found in “Geometrical Interpretation of the Angles
and in Lambert’s Problem” by J. E. Prussing, AIAA Journal of Guidance and Control, Volume 2,
Number 5, Sept.-Oct. 1979, pages 442-443.
The algorithm used in this MATLAB script is based on the method described in “A Procedure for the
Solution of Lambert’s Orbital Boundary-Value Problem” by R. H. Gooding, Celestial Mechanics and
Dynamical Astronomy 48: 145-165, 1990. This iterative solution is valid for elliptic, parabolic and
hyperbolic transfer orbits which may be either posigrade or retrograde, and involve one or more
revolutions about the central body.
The spacecraft’s orbital motion is modeled with respect to the Earth mean equator and equinox of J2000
(EME2000) coordinate system. The following figure illustrates the geometry of the EME2000
coordinate system. The origin of this Earth-centered-inertial (ECI) inertial coordinate system is the
geocenter and the fundamental plane is the Earth’s mean equator. The z-axis of this system is normal to
the Earth’s mean equator at epoch J2000, the x-axis is parallel to the vernal equinox of the Earth’s mean
orbit at epoch J2000, and the y-axis completes the right-handed coordinate system. The epoch J2000 is
the Julian Date 2451545.0 which corresponds to January 1, 2000, 12 hours Terrestrial Time (TT).
page 14
Figure 1. Earth mean equator and equinox of J2000 coordinate system
The trajectory analysis implements a special perturbation technique which numerically integrates the
vector system of second-order, nonlinear differential equations of motion of a spacecraft given by
a r , v , t r r , r , t ag r am r , t as r , t
where
t dynamical time
r inertial position vector of the spacecraft
v inertial velocity vector of the spacecraft
a g acceleration due to the Earth's gravity
am acceleration due to the Moon
as acceleration due to the Sun
This computer program uses a spherical harmonic representation of the Earth’s geopotential function
given by
0R 0 n R m
n n
where is the geocentric latitude of the spacecraft, is the geocentric east longitude of the spacecraft
and r r x 2 y 2 z 2 is the geocentric distance of the spacecraft. In this expression the S’s and C’s
are unnormalized harmonic coefficients of the geopotential, and the P’s are associated Legendre
polynomials of degree n and order m with argument u sin .
page 15
The software calculates the spacecraft’s acceleration due to the Earth’s gravity field with a vector
equation derived from the gradient of the potential function expressed as
a g r, t r, t
This acceleration vector is a combination of pure two-body or point mass gravity acceleration and the
gravitational acceleration due to higher order nonspherical terms in the Earth’s geopotential. In terms of
the Earth’s geopotential , the inertial rectangular cartesian components of the spacecraft’s acceleration
vector are as follows:
1 z 1
x x 2 y
r r r 2 x 2 y 2 x y 2
1 z 1
y y 2 x
r r r 2 x 2 y 2 x y 2
1 x2 y2
z z
r r r 2
The three partial derivatives of the geopotential with respect to r, , are given by
1 N R
n
r r r n 2 r m 0
N R
n n
r n2 r
C
m 0
m
n cos m Snm sin m Pnm1 sin m tan Pnm sin
N R
n n
r n2 r
mS
m 0
m
n cos m Cnm sin m Pnm sin
where
R radius of the Earth
r geocentric distance of the spacecraft
Snm , Cnm harmonic coefficients
geocentric latitude of the spacecraft sin 1 z r
longitude of the spacecraft g
right ascension of the spacecraft tan 1 y x
g right ascension of Greenwich
Right ascension is measure positive east of the vernal equinox, longitude is measured positive east of
Greenwich, and latitude is positive above the Earth’s equator and negative below.
page 16
For m 0 , the coefficients are called zonal terms, when m n the coefficients are sectorial terms, and
for n m 0 the coefficients are called tesseral terms.
The Legendre polynomials with argument sin are computed using recursion relationships given by:
1
Pn0 sin 2n 1 sin Pn01 sin n 1 Pn02 sin
n
Pnn sin 2n 1 cos Pnn11 sin , m 0, m n
and Pi j 0 for j i .
The tlto_matlab zipped file contains an un-normalized 18 by 18 version of the EGM96 gravity
model data file. The software can also read and process user-defined gravity model files in the correct
format. These gravity model data files are simple fixed-format, space delimited ASCII data files. The
following is a portion of a typical gravity model data file. In this file, column one is the degree index,
column two is the model order index, and columns three and four are the corresponding un-normalized
gravity coefficients (zonals and tesserals, respectively).
2 0 -1.08262668355E-003 0.00000000000E+000
3 0 2.53265648533E-006 0.00000000000E+000
4 0 1.61962159137E-006 0.00000000000E+000
5 0 2.27296082869E-007 0.00000000000E+000
6 0 -5.40681239107E-007 0.00000000000E+000
7 0 3.52359908418E-007 0.00000000000E+000
8 0 2.04799466985E-007 0.00000000000E+000
9 0 1.20616967365E-007 0.00000000000E+000
10 0 2.41145438626E-007 0.00000000000E+000
11 0 -2.44402148325E-007 0.00000000000E+000
12 0 1.88626318279E-007 0.00000000000E+000
13 0 2.19788001661E-007 0.00000000000E+000
14 0 -1.30744533118E-007 0.00000000000E+000
Gravity model coefficients are often published in normalized form. The relationship between
normalized Cl ,m , Sl ,m and un-normalized gravity coefficients Cl ,m , Sl ,m is given by the following
expression:
page 17
l m ! Cl ,m
12
Cl ,m 1
Sl ,m 2 m 0 2l 1 l m ! Sl ,m
r r
am r , t m m b 3 e m 3
r rem
m b
where
m gravitational constant of the moon
rmb position vector from the moon to the satellite
rem position vector from the Earth to the moon
r r
a s r , t s s b 3 e s 3
r res
s b
where
s gravitational constant of the sun
rs b position vector from the sun to the satellite
re s position vector from the Earth to the sun
3 3qk qk2
f qk qk 3
1 1 qk
where
r T r 2sk
qk
sTk sk
n
k
r r f qk s k
k 1 d k3
page 18
In these equations, s k is the vector from the primary body to the secondary body, k is the gravitational
constant of the secondary body and dk r sk , where r is the position vector of the spacecraft relative
to the primary body.
The derivation of the f q functions is described in Section 8.4 of “An Introduction to the Mathematics
and Methods of Astrodynamics, Revised Edition”, by Richard H. Battin, AIAA Education Series, 1999.
In this computer program the heliocentric coordinates of the sun and moon are based on the JPL
Development Ephemeris DE421. These coordinates are evaluated in the Earth mean equator and
equinox of J2000 coordinate system (EME2000). The default name of this binary date file is
de421.bsp, and it must reside in the same directory as the tlto_matlab script. The name of the
source ephemeris can be changed by editing the ephname = 'de421.bsp'; source code in the main
MATLAB script.
For a given TLI injection time, there are two possible locations on the initial park orbit at which to
perform the propulsive maneuver. One opportunity occurs during the ascending part of the park orbit
and the other during the descending motion. The park orbit RAAN p at these two locations can be
determined from spherical trigonometry relationships involving the park orbit inclination and the right
ascension and declination of the moon at encounter.
ascending
tan m
p 180 m sin 1
tan i
p
Descending
tan m
p m sin 1
tan i
p
where m right ascension of the moon at encounter , m declination of the moon at encounter , and
i p park orbit inclination . These opportunities are valid whenever m i p .
For this targeting option, the equality constraints enforced by the SNOPT nonlinear programming
algorithm are
rp rca 0
cos i hˆ z 0
where rp and i are the user-defined periapsis radius and selenocentric orbital inclination, respectively,
and hˆ z is the z-component of the unit angular momentum vector at closest approach to the moon.
page 19
B-plane targeting
The derivation of B-plane coordinates is described in the classic JPL reports, “A Method of Describing
Miss Distances for Lunar and Interplanetary Trajectories” and “Some Orbital Elements Useful in Space
Trajectory Calculations”, both by William Kizner. The following diagram illustrates the fundamental
geometry of the B-plane coordinate system.
The software solves the B-plane targeting problem by minimizing the TLI delta-v vector while
satisfying two nonlinear equality constraint equations. These constraint equations are the differences
between components of the required B-plane and the B-plane components predicted by the software.
Given the user-defined closest approach radius rca and orbital inclination i, and the incoming v-infinity
magnitude v and the right ascension and declination of the incoming asymptote vector at the
moment of closest approach, the following series of equations can be used to determine the required B-
plane target components:
B T bt cos
B R bt sin
where
2 rca 2
bt 2
rca2 rca 1
v rca v2
and
cos i
cos sin 1 cos2
cos
page 20
sin sˆ zˆ sx2 s 2y
zˆ 0 0 1
T
cos cos
Sˆ cos sin
sin
where and are the declination and right ascension of the asymptote of the incoming hyperbola.
Important note!!
This technique only works for lunar orbit inclinations that satisfy
i
If this inequality is not satisfied, the software will print the following error message
It will also display the actual declination of the asymptote and stop. The user should then edit the input
file, include a valid orbital inclination and restart the simulation.
The following computational steps summarize the calculation of the predicted B-plane vector from a
moon-centered position vector r and velocity vector v at closest approach.
radius rate r r v r
semiparameter p h2
r
semimajor axis a
r v2
2
orbital eccentricity e 1 p a
pr rh
true anomaly cos sin tan 1 sin ,cos
er e
page 21
B-plane magnitude B pa
fundamental vectors
r v rr
zˆ pˆ cos rˆ sin zˆ qˆ sin rˆ cos zˆ
h
a b
S vector S pˆ qˆ
a 2 b2 a 2 b2
b2 ab
B vector B pˆ qˆ
a b
2 2
a b2
2
S , S ,0
2 2 T
T
y x
T vector
S x2 S y2
The mission elapsed time at which the spacecraft reaches closest approach to the moon is predicted
using the event prediction capability of the MATLAB ode45 algorithm. During the numerical
integration of the spacecraft’s geocentric equations of motion, the ode45 numerical method searches for
the time at which the sine of the flight path angle with respect to the moon is nearly zero.
This constraint corresponds to closest approach to the moon. The predicted B-plane coordinates are
based on the selenocentric flight conditions at closest approach. Close approach is predicted with the
following mission constraint
rv
sin
rv
where r and v are the moon-centered position and velocity vectors, respectively.
The following is the MATLAB source code that determines the time and trajectory conditions at closest
approach to the moon.
[t, ysol, tevent, yevent, ie] = ode45(@tlto_eqm, [0 tend], [ri vi], options);
page 22
Note that the numerical values for RelTol and AbsTol determine how well the algorithm integrates the
equations of motion and predicts closest approach.
The following is the MATLAB source code which calculates the sine of the flight path angle relative to
the moon.
% required by tlto_matlab.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global jdtdb_tli
isterminal = 1;
direction = [];
This section describes the transformation of coordinates between the Earth mean equator and equinox
2000 (EME2000) and lunar mean equator and IAU node of epoch coordinate systems. This
transformation is used to compute the B-plane coordinates at encounter.
This figure illustrates the orientation of the lunar mean equator and IAU node of epoch coordinate
system relative to the Earth’s mean equator and north pole of J2000. The x-axis or Q-vector is formed
from the cross product of the Earth’s mean pole of J2000 and the Moon’s north pole relative to
EME2000. The x-axis is aligned with the IAU node of epoch.
page 23
Figure 2. Moon mean equator and IAU node of epoch coordinate system
A unit vector in the direction of the pole of the moon can be determined from
cos p cos p
pˆ Moon sin p cos p
sin p
The right ascension and declination of the lunar pole in the EME2000 coordinate system are given by
the following expressions
where T is the time in Julian centuries given by T JD 2451545.0 / 36525 and JD is the Barycentric
Dynamical Time (TDB) Julian Date.
page 24
E1 125.045 0.0529921d
E 2 250.089 0.1059842d
E 3 260.008 13.0120009d
E 4 176.625 13.3407154d
E 6 311.589 26.4057084d
E 7 134.963 13.0649930d
E10 15.134 0.1589763d
E13 25.053 12.9590088d
where d JD 2451545 is the number of days since January 1.5, 2000. These equations are given in
“Report of the IAU/IAG Working Group on Cartographic Coordinates and Rotational Elements of the
Planets and Satellites: 2000”, Celestial Mechanics and Dynamical Astronomy, 82: 83-110, 2002.
The unit vector in the x-axis direction of this selenocentric coordinate system is given by
xˆ zˆ pˆ Moon
where zˆ 0 0 1 . The unit vector in the y-axis direction can be determined using
T
yˆ pˆ Moon xˆ
Finally, the components of the matrix that transforms coordinates from the EME2000 system to the
moon-centered (selenocentric) mean equator and equinox of 2000 system are as follows:
M xˆ yˆ pˆ Moon
T
y t
z
u t
consisting of the state variables y and the control variables u for any time t. In this discussion vectors
are denoted in bold.
The system dynamics are defined by a vector system of ordinary differential equations called the state
equations that can be represented as follows:
dy
y f y t , u t , p, t
dt
page 25
The initial dynamic variables at time t0 are defined by ψ0 ψ y t0 , u t0 , t0 and the terminal
conditions at the final time t f are defined by ψ f ψ y t f , u t f , t f . These conditions are called the
boundary values of the trajectory problem.
For any mission time t there are also simple bounds on the state variables
yl y t yu
the control variables
ul u t u u
pl p t pu
The basic nonlinear programming problem (NLP is to determine the control vector history and problem
parameters that minimize the scalar performance index or objective function given by
J y t0 , t0 , y t f , t f , p
During the two-body trajectory optimization, the control variables are the TLI Julian date and the true
anomaly of the TLI maneuver. For the n-body numerical integration optimization, the control variables
consist of the TLI Julian date, the RAAN of the park orbit, the true anomaly of the TLI maneuver, and
the Cartesian components of the TLI delta-v vector.
For both types of optimization, the objective function or performance index is the scalar magnitude of
the TLI delta-v.
In addition to the bounds on the TLI calendar date mentioned earlier, the true anomaly during the two-
body optimization is bounded according to
180 180
During the second part of the trajectory optimization, the RAAN and true anomaly bounds are
TB 30 TB 30
TB 30 TB 30
page 26
where TB and TB are the RAAN and true anomaly found during the two-body optimization. The
bounds on the individual components of the TLI delta-v are given by
v 0.1 v v x , y ,z v 0.1 v
where v is the scalar magnitude of the two-body TLI delta-v vector. The final boundary conditions
are the B-plane coordinates of the incoming selenocentric hyperbola.
The following MATLAB source code illustrates typical interaction with the SNOPT nonlinear
programming function. This code provides initial guesses (xg) and lower and upper bounds (xlwr and
xupr) for the control variables and the objective function (flow and fupp). This implementation will
also read a SNOPT specs file named tlto_specs.txt.
% required by tlto_matlab.m
% control variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
oev1 = oev;
% initial guesses
xg(1) = 0.0d0;
xg(2) = 0.0d0;
xg = xg';
% delta-tli bounds
xlwr(1) = tli_lwr1;
xupr(1) = tli_upr1;
xlwr(2) = -pi;
xupr(2) = +pi;
xlwr = xlwr';
xupr = xupr';
page 27
flow(1) = 0.0d0;
fupp(1) = +Inf;
% find optimum
snscreen off;
snspec('tlto_specs.txt');
[x, f, inform, xmul, fmul] = snopt(xg, xlwr, xupr, flow, fupp, 'tlto_func_snopt');
revmax = 0;
sv1(1:3) = ri;
sv1(4:6) = vi;
sv2(1:3) = svmoon(1:3);
sv2(4:6) = svmoon(4:6);
rto = ri;
The following is the MATLAB source code for the tlto_func_snopt objective function. This
function evaluates the current value of the TLI Julian date and park orbit true anomaly of the maneuver,
solves the two-body form of Lambert’s equation, and calculates the scalar value of the TLI impulsive
delta-v maneuver.
% required by tlto_matlab.m
% input
% control variable
% output
page 28
% Orbital Mechanics with MATLAB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
rmoon = svmoon(1:3);
vmoon = svmoon(4:6);
if (itli_type == 1)
oev1(5) = raan1;
else
oev1(5) = raan2;
end
oev1(6) = x(2);
revmax = 0;
sv1(1:3) = ri;
sv1(4:6) = vi;
sv2(1:3) = rmoon;
sv2(4:6) = vmoon;
page 29
[vito, vfto] = glambert(emu, sv1, sv2, tof, revmax);
for i = 1:1:3
end
f(1) = norm(dv_tli);
% no derivatives
g = [];
page 30
Algorithm resources
“Circumlunar Trajectory Calculations”, MIT Instrumentation Laboratory Report R-353, April 1962.
“Optimal Low Thrust Trajectories to the Moon”, John T. Betts and Sven O. Erb, SIAM Journal on
Applied Dynamical Systems, Vol. 2, No. 2, pp. 144-170, 2003.
“Integrated Algorithm for Lunar Transfer Trajectories Using a Pseudostate Technique”, R. V. Ramanan,
AIAA Journal of Guidance, Control and Dynamics, Vol. 25, No. 5, September-October 2002, pp. 946-
952.
“Nonimpact Lunar Transfer Trajectories Using the Pseudostate Technique”, R. V. Ramanan and V.
Adimurthy, AIAA Journal of Guidance, Control and Dynamics, Vol. 28, No. 2, March-April 2005, pp.
217-225.
“Injection Conditions for Lunar Trajectories”, R. Kolenkiewicz and W. Putney, NASA TM X-55390,
November 1965.
“Coplanar Three-Body Trans-Earth Lunar Trajectory Simulation Methodology”, H. Ikawa, AIAA 88-
0381, AIAA 26th Aerospace Sciences Meeting, Reno, Nevada, January 11-14, 1988.
“Lunar Constants and Models Document”, JPL D-32296, September 23, 2005.
page 31
APPENDIX A
Contents of the Simulation Summary
This appendix is a brief summary of the information contained in the simulation summary screen
displays produced by the tlto_matlab software.
transfer time = total time from the TLI maneuver to closest approach at the moon
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
c3 = twice the specific orbital energy in kilometers squared per second squared
vmag (km/sec) = scalar magnitude of the spacecraft’s velocity vector in kilometers per
second
page 32
b dot t = dot product of the b-vector and t-vector in kilometers
The geocentric coordinates of the spacecraft and the TLI delta-v components are with respect to the
Earth mean equator and equinox of J2000 (EME2000) coordinate system. The selenocentric coordinates
are with respect to the mean lunar equator and IAU node of epoch coordinate system.
The declination and right ascension of the moon at closest approach are with respect to the EME2000
coordinate system.
page 33
APPENDIX B
Time Systems
This appendix is a brief explanation of the time scales used in this MATLAB script.
Coordinated Universal Time (UTC) is the time scale available from broadcast time signals. It is a
compromise between the highly stable atomic time and the irregular earth rotation. UTC is the
international basis of civil and scientific time.
Terrestrial Time, TT
Terrestrial Time is the time scale that would be kept by an ideal clock on the geoid - approximately, sea
level on the surface of the Earth. Since its unit of time is the SI (atomic) second, TT is independent of
the variable rotation of the Earth. TT is meant to be a smooth and continuous “coordinate” time scale
independent of Earth rotation. In practice TT is derived from International Atomic Time (TAI), a time
scale kept by real clocks on the Earth's surface, by the relation TT = TAI + 32s.184. It is the time scale
now used for the precise calculation of future astronomical events observable from Earth.
In this equation, the coefficients are in seconds, the angular arguments are in radians, and T is the
number of Julian centuries of TT from J2000; T = (Julian Date(TT) – 2451545.0) / 36525.
page 34
Leap seconds calculation
The difference between International Atomic Time (TAI) and Universal Coordinated Time (UTC) is the
number of current leap seconds. International Atomic Time (TAI, Temps Atomique International) is a
physical time scale with the unit of the SI (System International) second and derived from a statistical
timescale based on a large number of atomic clocks. Coordinated Universal Time (UTC) is the time
scale available from broadcast time signals. It is a compromise between the highly stable atomic time
and the irregular earth rotation. UTC is the international basis of civil and scientific time.
The calculation of leap seconds in this MATLAB script is performed by a function that reads a simple
ASCII data file and evaluates the current value of leap seconds. The leap second function must be
initialized by including the following statements in the main script.
readleap;
The readleap MATLAB function reads the contents of the following simple comma-separated-
variable (csv) two column data file. The name of this file is tai-utc.dat.
2441317.5, 10.0
2441499.5, 11.0
2441683.5, 12.0
2442048.5, 13.0
2442413.5, 14.0
2442778.5, 15.0
2443144.5, 16.0
2443509.5, 17.0
2443874.5, 18.0
2444239.5, 19.0
2444786.5, 20.0
2445151.5, 21.0
2445516.5, 22.0
2446247.5, 23.0
2447161.5, 24.0
2447892.5, 25.0
2448257.5, 26.0
2448804.5, 27.0
2449169.5, 28.0
2449534.5, 29.0
2450083.5, 30.0
2450630.5, 31.0
2451179.5, 32.0
2453736.5, 33.0
2454832.5, 34.0
The first column of this data file is the Julian date, on the UTC time scale, at which the leap second
became valid. The second column is the leap second value, in seconds.
Note that this data is passed between the leap second MATLAB functions by way of a global statement.
The MATLAB function that actually reads and evaluates the current value of leap seconds has the
following syntax and single argument.
page 35
function leapsecond = findleap(jdate)
% input
% output
The leap seconds data file should be updated whenever the International Earth Rotation and Reference
Systems Service (IERS) announces a new leap second.
Time conversion
The fundamental time argument for the ephemeris function used in this MATLAB script is “ephemeris”
time. As implemented here, we assume this time argument to be Barycentric Dynamic Time (TDB). To
report the time of important trajectory events in Universal Coordinated Time (UTC) or civil time, we
need an algorithm to make this time conversion.
The following is the MATLAB source code for a function which iteratively performs this calculation
using Brent’s root-finding method.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global jdsaved
jdsaved = jdtdb;
% convergence tolerance
rtol = 1.0d-8;
x1 = jdsaved - 0.1;
x2 = jdsaved + 0.1;
page 36
[xroot, froot] = brent ('jdfunc', x1, x2, rtol);
jdutc = xroot;
end
This function calls the following MATLAB objective function during the calculations.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global jdsaved
tai_utc = findleap(jdin);
end
Notice that this function requires the findleap function which calculates the number of leap seconds
for the current UTC Julian date value. The jdfunc function is computing the difference between the
TDB Julian date input by the user and the value computed by the utc2tdb MATLAB function. The
algorithm has converged whenever this value is less than or equal to the user-defined tolerance rtol.
page 37
Program tlto_ocs
Finite-burn Trans-lunar Trajectory Optimization
This document is the user’s manual for a Fortran computer program called tlto_ocs that uses the
Sparse Optimization Suite distributed by Applied Mathematical Analysis to solve the classic finite-burn,
trans-lunar injection (TLI) trajectory optimization problem. The software attempts to maximize the
spacecraft mass at the end of the TLI propulsive maneuver while targeting to a user-defined periapsis
radius and orbital inclination relative to the moon. Since the TLI is a continuous thrust maneuver,
maximizing the spacecraft mass is equivalent to minimizing the propellant required.
single, continuous thrust propulsive maneuver followed by a coast to lunar close approach
combination of modified equinoctial and cartesian equations of motion
valid for circular and elliptical park orbits
Earth J 2 gravity model and sun and moon point-mass gravity
JPL DE421 lunar and solar ephemeris
B-plane coordinates at lunar close approach
The Sparse Optimization Suite is a direct transcription method that can be used to solve a variety of
trajectory optimization problems using the following combination of numerical methods:
Additional information about the mathematical techniques and numerical methods used in the Sparse
Optimization Suite can be found in the book, “Practical Methods for Optimal Control and Estimation
Using Nonlinear Programming” by John. T. Betts, SIAM, 2010.
The tlto_ocs software consists of Fortran routines that perform the following tasks;
set algorithm control parameters and call the transcription/optimal control subroutine
define the problem structure and perform initialization related to scaling, lower and upper
bounds, initial conditions, etc.
compute the right-hand-side differential equations
evaluate any point and path constraints
display the optimal solution results and create an output file
The Sparse Optimization Suite will use this information to automatically transcribe the user’s problem
and perform the optimization. The tlto_ocs software allows the user to select the type of initial guess,
collocation method and other important algorithm control parameters.
page 1
Program execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
tlto_ocs tlto1.in
If the software is executed without an input file on the command line, the computer program will display
the following information screen and file name prompt:
************************************
* program tlto_ocs *
* *
* finite-burn lunar trajectory *
* optimization *
* *
* March 17, 2011 *
************************************
The user should respond to this prompt with the name of a compatible input data file including the
filename extension.
The tlto_ocs computer program is “data-driven” by a simple user-created text file. The following is a
typical input or “simulation definition” file used by the software. In this discussion the actual input file
contents are in courier font and all explanations are in times italic font. Each data item within an
input file is preceded by one or more lines of annotation text. Do not delete any of these annotation
lines or increase or decrease the number of lines reserved for each comment. However, you may change
them to reflect your own explanation. The annotation line also includes the correct units and when
appropriate, the valid range of the input. ASCII text input is not case sensitive but must be spelled
correctly. Please note that the fundamental time argument in this simulation is Barycentric Dynamical
Time (TDB) which is the time argument of the DE421 ephemeris. Furthermore, the fundamental
coordinate system is the Earth mean equator and equinox of J2000 (EME2000).
The first six lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with six and only six initial text lines.
*************************************************
** finite-burn translunar trajectory optimization
** two phase, 3-body geocentric motion
** input file for tlto_ocs
** tlto1.in – August 7, 2012
*************************************************
The software allows the user to specify an initial guess for the calendar date and time of the TLI
maneuver and lower and upper bounds on the actual date found during the optimization process. For
any guess for maneuver time tTLI and user-defined lower and upper bounds tl and tu , the TLI
maneuver time t is constrained as follows:
page 2
tTLI tl t tTLI tu
For a fixed maneuver time, the lower and upper bounds should be set to zero.
The user inputs for the initial calendar date, TDB time, and search boundary are as follows:
initial calendar date (month, day, year)
10, 13, 2008
The next three inputs define the initial spacecraft mass, the thrust magnitude and specific impulse of the
propulsion system, respectively.
initial spacecraft mass (kilograms)
1000.0
The type of propulsion initial guess is determined by the next integer input.
********************************
type of propulsive initial guess
********************************
1 = thrust duration
2 = delta-v
-------------------
2
For option 1, the next input is the user’s initial guess for the magnitude of the maneuver delta-v.
initial guess for delta-v (meters/second)
3150.0
For option 2, the next three inputs are the user’s initial guess for the thrust duration and lower and
upper bounds for this duration.
initial guess for thrust duration (seconds)
3000.0
The next series of inputs define the characteristics of the initial park orbit. The angular orbital elements
should be with respect to the EME2000 system.
page 3
******************
initial park orbit
******************
This next integer input allows the user to define the type of initial park orbit constraints to use during
the simulation. Option 1 will constrain all elements of the park orbit except the true longitude to the
values input by the user. Option 2 will constrain the semimajor axis, eccentricity and orbital
inclination. The RAAN and true longitude will be bounded.
*****************************
park orbit constraint options
*****************************
1 = constrain all initial orbital elements except true longitude
2 = constrained a, e, i; bounded raan & true longitude
------------------------------------------------------
2
The next set of inputs defines the user’s initial guess for the lunar transfer time, along with a lower and
upper bound for the transfer time. The transfer time here refers to the time from burnout of the
propulsive maneuver to the entrance to the lunar sphere-of-influence (SOI).
transfer time initial guess (hours)
96.0
The next two inputs define the periapsis radius and orbital inclination of the lunar trajectory relative to
the moon. The inclination should be specified relative to the mean lunar equator.
------------------------------------------
final lunar orbit characteristics
(lunar mean equator and IAU node of epoch)
------------------------------------------
page 4
The next three inputs define the types of perturbations to include during the numerical solution of the
spacecraft’s equations of motion. The solar and lunar perturbations are modeled as point-mass bodies.
************************
trajectory perturbations
************************
The next program input is the user-defined radius of the lunar sphere-of-influence (SOI) used by the
software during the trajectory optimization. Typical values for this parameter are between 64,000 and
20,000 kilometers.
------------------------------------------------
radius of lunar sphere-of-influence (kilometers)
------------------------------------------------
25000.0
This next input defines the type of initial guess to use. Please see the technical discussion section for
information about how the first option is modeled. Option 2 requires either a binary restart file created
from a previous run using either initial guess option 1 or an updated binary restart file. This feature is
described in the next two sections.
********************************
* initial guess/restart option *
********************************
1 = numerical integration
2 = binary data file
---------------------
1
If the user elects to use a binary data file (option 2 above) for the initial guess, the following text input
specifies the name of the file to use.
name of initial guess/restart input data file
tlto1.rsbin
The following input can be used to create or update an initial guess binary file. The creation or update
process uses the filename defined above. For initial guess option 1, the software will create a binary
restart file. For initial guess option 2, an input of yes to this item will update the binary file used to
initialize the simulation.
******************************
* binary restart file option *
******************************
This next input specifies the type of comma-delimited or comma-separated-variable (CSV) solution data
file to create. Option 1 will create a solution file at each collocation point or node determined by the
page 5
Sparse Optimization Suite. Options 2 and 3 allow the user to specify either the number of nodes or time
step size used to create the data file.
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = OC-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
1
For options 2 or 3, this next input defines either the number of data points or the time step size of the
data output in the solution file.
number of user-defined nodes or print step size in solution data file
1
The name of the solution data file is defined in this next line. Please consult Appendix A for a
description of the information written to this file.
name of solution output file
tlto1.csv
The next series of program inputs are algorithm control options and parameters for the Sparse
Optimization Suite. The first input is an integer that specifies the type of collocation method to use
during the solution process. For most simulations, the trapezoidal method is recommended.
********************************
* algorithm control parameters *
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
The next integer defines the number of initial grid points to use in the collocation modeling of the
propulsive maneuver (phase 1) and the lunar coast phase (phase 2).
number of grid points in phase 1 (TLI thrust maneuver)
10
The next input defines the relative error in the objective function. A value of 1.0d-5 is recommended.
relative error in the objective function (performance index)
1.0d-5
The next input defines the relative error in the solution of the differential equations. A value of 1.0d-7 is
recommended.
relative error in the solution of the differential equations
1.0d-7
The next input is an integer that defines the maximum number of mesh refinement iterations.
page 6
maximum number of mesh refinement iterations
20
The next input is an integer that defines the maximum number of function evaluations.
maximum number of function evaluations
50000
The next input is an integer that defines the maximum number of algorithm iterations.
maximum number of algorithm iterations
5000
The level of output from the NLP algorithm is controlled with the following integer input. Additional
information about these algorithm items can be found in the Sparse Optimization Suite user’s manual.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
1
The level of output from the optimal control algorithm is controlled with the following integer input.
Please note that option 4 will create lots of information.
**********************
optimal control output
----------------------
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
The level of output from the differential equations algorithm is controlled with the following integer
input. Please note that option 5 will create lots of information.
****************************
differential equation output
----------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
1
The level of output can be further controlled by the user with this final text input. This program option
sets the value of the SOCOUT character variable described in the Sparse Optimization Suite user’s
manual. To ignore this special output control, input the simple character string no.
*******************
user-defined output
-------------------
page 7
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
The last series of inputs allow the reading and writing of configuration input files. The user should
create a configuration file before attempting to read one. These configuration files are simple text files
which can be edited external to the tlto_ocs software. Please consult Appendix E.
***************************************
* optimal control configuration options
***************************************
The following is the program output created by the tlto_ocs scientific simulation for this example.
This display summarizes the characteristics of the optimized TLI maneuver and the orbital transfer
conditions before and after the propulsive maneuver. It also displays the conditions at the lunar SOI, the
closest approach to the moon, and the corresponding B-plane characteristics. The delta-v magnitude is
determined from a cubic spline integration of the thrust acceleration evaluated at the grid points
determined by the Sparse Optimization Suite.
----------------
program tlto_ocs
----------------
------------------------------------------------------
park orbit initial conditions
(geocentric - Earth mean equator and equinox of J2000)
------------------------------------------------------
page 8
rx (km) ry (km) rz (km) rmag (km)
-.475930402705D+04 -.337158742648D+04 -.300978517350D+04 0.656333630000D+04
------------------------------------------------------
time and conditions at end of TLI finite burn
(geocentric - Earth mean equator and equinox of J2000)
------------------------------------------------------
------------------------------------------------------
time and conditions at beginning of trans-lunar coast
(geocentric - Earth mean equator and equinox of J2000)
------------------------------------------------------
------------------------------------------------------
time and conditions at lunar sphere-of-influence
(geocentric - Earth mean equator and equinox of J2000)
------------------------------------------------------
page 9
calendar date October 16, 2008
------------------------------------------------------
time and conditions at lunar sphere-of-influence
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
------------------------------------------------------
time and conditions at lunar closest approach
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
page 10
------------------------------------------------------
b-plane coordinates of incoming hyperbola
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
------------------------------------------------------
coordinates of the moon at closest approach
(geocentric - Earth mean equator and equinox of J2000)
------------------------------------------------------
The following plots illustrate the behavior of the pitch, yaw, right ascension and declination angles
during the propulsive maneuver.
page 11
These next two plots illustrate the behavior of the individual components of the RTN and ECI unit thrust
vector during the maneuver.
The final two plots display the orbital evolution of the semimajor axis, eccentricity, RAAN and orbital
inclination during the propulsive maneuver.
page 12
The tlto_ocs software will create three comma-separated-variable (csv) output files. The first file is
named parkorb.csv and contains the geocentric, EME 2000 state vector of the park orbit prior to the
orbital maneuver. The second file contains the state vectors and orbital elements of the geocentric
transfer orbit with the name specified by the user in the main input data file. The third file is named
soiorb.csv and contains the state vector of the selenocentric orbit at the lunar sphere-of-influence.
This software package also includes a MATLAB script called lplot.m that can be used to create
trajectory graphic displays using these three data files. The interactive graphic features of MATLAB
allow the user to rotate and zoom the displays. These capabilities allow the user to interactively find the
best viewpoint as well as verify basic orbital geometry of the geocentric and selenocentric trajectories.
The lplot MATLAB script will also create two color encapsulated postscript (eps) files (with TIFF
preview) of the screen images and save them to disk with the names tlto_ocs1.eps and
tlto_ocs2.eps. These file names can be changed by editing the lplot script. The user can also
change the perspective by editing the view command on lines 273 and 363 of the script. The lplot
script and support functions were created with version 7.10 of MATLAB.
Important note!!
You must delete the first or “header” line of the user-defined solution file in order for the lplot script
to work properly. This script uses the MATLAB csvread function to read the data file which can only
contain comma-separated-variable numerical data.
The following is the transfer trajectory from burnout of the TLI maneuver to the lunar SOI for this
example. The park orbit trajectory is red, the lunar transfer is blue and the moon’s orbit is green. The
location of the moon at the time of the TLI maneuver is marked with a green asterisk. The coordinates
are in the units of Earth radius (ER). This display is also labeled with a geocentric, inertial coordinate
system. The x-axis of this system is red, the y-axis is green and the z-axis is blue.
page 13
The following is a “zoomed” plot of the park orbit and initial portion of the lunar transfer trajectory.
The following is a plot of the selenocentric hyperbola within the user-defined lunar sphere-of-influence
(SOI). The coordinate units are lunar radii (MR). The entry into the SOI is marked with an asterisk and
the location of the periapsis or lunar closest approach is marked with a red dot. This display is labeled
with a selenocentric, inertial coordinate system (lunar mean equator and IAU node of epoch). The x-
axis is red, the y-axis is green and the z-axis is blue.
page 14
Verification of the Optimal Control Solution
The optimal control solution determined by the software can be verified by numerically integrating the
orbital equations of motion with the computed initial park orbit conditions and the optimal control
solution. This is equivalent to solving an initial value problem (IVP) that uses the optimal unit thrust
vector solution. This part of the tlto_ocs computer program uses a Runge-Kutta-Fehlberg 7(8)
variable step size method to integrate the orbital equations of motion.
The following is the program output of the final solution computed using this explicit numerical
integration method.
========================================
verification of optimal control solution
========================================
------------------------------------------------------
time and conditions at end of TLI finite burn
(geocentric - Earth mean equator and equinox of J2000)
------------------------------------------------------
page 15
raan (deg) true anomaly (deg) arglat (deg) period (hrs)
0.287146402598D+03 0.184559496421D+02 0.321620525978D+03 0.226432269197D+03
------------------------------------------------------
time and conditions at lunar sphere-of-influence
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
------------------------------------------------------
time and conditions at lunar closest approach
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
page 16
------------------------------------------------------
b-plane coordinates of incoming hyperbola
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
This section describes the algorithms used in tlto_ocs to create an initial guess for the software. The
software attempts to obtain problem feasibility before trying to solve the optimal control problem. If the
software cannot get feasible, the user will have to provide a better initial guess.
The software allows the user to input either a delta-v magnitude or thrust duration initial guess. For a
delta-v initial guess, the software estimates the thrust duration using the rocket equation. The user
should also provide lower and upper bounds for the total thrust duration. These three inputs should be in
units of seconds.
For trans-lunar injection from circular and near-circular orbits, the delta-v magnitude can be estimated
from A Computer Program for Preliminary Trans-Lunar Mission Analysis described in Appendix D.
This algorithm calculates the impulsive delta-v required to perform the TLI maneuver. The lguess
computer program described in Appendix D will also provide a park orbit right ascension of the
ascending node (RAAN) and the park orbit true anomaly at the TLI impulse.
For the numerical integration initial guess option, the software models the maneuver using tangential
thrusting. For this case, the unit thrust vector in the modified equinoctial frame at all times is simply
uT 0 1 0 . Please note that this type of steering method creates a coplanar initial guess that
T
An estimate of the thrust duration can be determined from the following expression:
I sp m p g m pVex
td
F F
The propellant mass required for a given V is a function of the initial mass of the spacecraft and the
exhaust velocity as follows:
V
m p mi 1 e Vex
page 17
In these equations
mi initial mass
m p propellant mass
Vex exhaust velocity g I sp
I sp specific impulse
V impulsive velocity increment
F thrust
g acceleration of gravity
Since a finite burn maneuver will require a thrust duration longer than this impulsive estimate, the user
can increase this value by about 10% and use it for the initial guess required by tlto_ocs.
The initial guess for the Sparse Optimization Suite is created by numerically integrating the modified
equinoctial equations of motion for the user-defined initial guess or rocket equation calculation for the
orbital maneuver time.
Binary restart data files can also be used to initialize a tlto_ocs simulation. A typical scenario is
This techniques works well provided the two simulations are not dramatically different. Sometimes it is
necessary to make successive small changes in the mission definition and run multiples simulations to
eventually reach the final desired solution.
Problem Setup
This section describes several methods that can be used to create an initial guess for tlto_ocs. The
Sparse Optimization Suite attempts to obtain problem feasibility before trying to solve the optimal
control problem. If the optimal control algorithm cannot find a feasible solution, the software will print
warnings and the user will have to provide a better initial guess.
The software allows the user to select one of the following initial orbit constraint options:
1) constrain all initial orbital elements except the true longitude
2) constrain semimajor axis, eccentricity and inclination; bounded RAAN and true longitude
page 18
i
h 2 k 2 tan
2
where i is the user-defined park orbit inclination. Furthermore, the semiparameter is constrained to the
initial value according to
pL pU pi
If the park orbit is circular, the software enforces the following two constraints:
f 0 g 0
f 2 g2 e
For program option 1, both lower and upper bounds for the h and k modified equinoctial elements are set
equal to the initial elements as follows:
hL hU hi
k L kU ki
360 Li 360
and for option 2, the RAAN of the initial park orbit is bounded according to
i 30 i 30
The spacecraft mass at the initial time is constrained to the user-defined initial value.
In optimal control terminology, these constraints or boundary conditions are called point functions.
The objective function or performance index J for this simulation is the mass of the spacecraft at
burnout of the lunar injection stage. This is simply
J mf
page 19
The value of the maxmin indicator in the code tells the software whether the user is minimizing or
maximizing the performance index. Since this simulation involves a single continuous maneuver, this is
equivalent to minimizing the required propellant mass.
During the TLI propulsive maneuver, the scalar magnitude of the components of the unit thrust vector at
any time during the maneuver is constrained as follows:
At the user-defined sphere-of-influence of the Moon, the point function enforced by the software is
given by
rSOI p rSOI 0
where rSOI p is the predicted SOI radius and rSOI is the scalar value defined by the user.
For user-defined periapsis radius and orbital inclination targets at the moon, the following point
functions or equality constraints are enforced
rp rca 0
cos i hˆ z 0
where rp and i are the user-defined periapsis radius and selenocentric orbital inclination of the encounter
hyperbola, respectively. In the second equation, hˆ z is the z-component of the predicted unit angular
momentum vector. These orbital elements are determined from the spacecraft’s state vector at closest
approach to the moon. The orbital inclination point function is expressed in the lunar mean equator and
IAU node of epoch coordinate system.
The elapsed time from the lunar SOI until closest approach to the moon is determined by an algorithm
that includes Brent’s one-dimensional root-finder embedded within a Runge-Kutta-Fehlberg 7(8)
numerical integration method. This technique searches for the time at which the selenocentric flight
path angle of the spacecraft is zero. This mission constraint is computed as follows
r v
sin 1
r v
where r and v are the selenocentric position and velocity vectors, respectively.
page 20
The RKF78 method numerically solves the following system of six first-order, nonlinear differential
equations of orbital motion
y1 vx y2 v y y2 vz
rx 3 J 2m reqm 5rz2
2
y4 m 3 1 1 2 a s x aex
r 2 r 2 r
ry 3 J 2m req2 m 5rz2
y5 m 3 1 1 2 a s y ae y
r 2 r 2 r
rz 3 J 2m reqm 5rz2
2
y6 m 3 1 3 2 a s z a ez
r 2 r 2 r
In these equations, m and reqm are the gravitational constant and equatorial radius of the moon,
respectively and J 2m is the non-dimensional oblateness gravity coefficient. The coefficient used by this
computer program corresponds to the GLGM-1 value of 2.037448533865259d-4. The additional
terms in the equations of motion, asx , as y , asz and aex , aey , aez represent the EME2000 ECI components of
the point-mass gravitational acceleration due to the sun and Earth, respectively.
Technical Discussion
This section summarizes the algorithms implemented in the tlto_ocs software. It includes a summary
of the equations of motion used during the TLI propulsive maneuver phase and the geocentric coast to
lunar encounter phase.
The spacecraft’s orbital motion is modeled with respect to the Earth mean equator and equinox of J2000
(EME2000) coordinate system. The following figure illustrates the geometry of the EME2000
coordinate system. The origin of this Earth-centered-inertial (ECI) inertial coordinate system is the
geocenter and the fundamental plane is the Earth’s mean equator. The z-axis of this system is normal to
the Earth’s mean equator at epoch J2000, the x-axis is parallel to the vernal equinox of the Earth’s mean
orbit at epoch J2000, and the y-axis completes the right-handed coordinate system. The epoch J2000 is
the Julian Date 2451545.0 which corresponds to January 1, 2000, 12 hours Terrestrial Time (TT).
Terrestrial Time (TT) is the time scale that would be kept by an ideal clock on the geoid -
approximately, sea level on the surface of the Earth. Since its unit of time is the SI (atomic) second, TT
is independent of the variable rotation of the Earth. TT is meant to be a smooth and continuous
“coordinate” time scale independent of Earth rotation. In practice TT is derived from International
Atomic Time (TAI), a time scale kept by real clocks on the Earth's surface
Barycentric Dynamical Time (TDB) is the time scale that would be kept by an ideal clock, free of
gravitational fields, co-moving with the solar system barycenter. It is always within 2 milliseconds of
TT, the difference caused by relativistic effects. TDB is the time scale now used for investigations of
the dynamics of solar system bodies.
page 21
Modified equinoctial equations of motion (phase 1 – TLI propulsive maneuver)
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These equations
exhibit no singularity for zero eccentricity and orbital inclinations equal to 0 and 90 degrees. However,
two components of the orbital element set are singular for an orbital inclination of 180 degrees.
The relationship between direct modified equinoctial and classical orbital elements is defined by the
following definitions
p a 1 e2 f e cos
k tan i 2 sin L
where
p semiparameter
a semimajor axis
e orbital eccentricity
i orbital inclination
argument of periapsis
right ascension of the ascending node
true anomaly
L true longitude
page 22
The relationship between classical and modified equinoctial orbital elements is:
p
semimajor axis a
1 f 2 g2
orbital eccentricity e f 2 g2
The mathematical relationships between an inertial state vector and the corresponding modified
equinoctial elements are summarized as follows:
position vector
r
s 2 cos L cos L 2hk sin L
2
r 2 sin L sin L 2hk cos L
r 2
s
2r
h sin L k cos L
s2
velocity vector
1
2 sin L 2 sin L 2hk cos L g 2 f h k 2 g
s p
1
v 2 cos L 2
cos L 2 hk sin L f 2 gh k 2
f
s p
2
h cos L k sin L f h gk
s2 p
where
2 h2 k 2 s2 1 h2 k 2
p
r w 1 f cos L g sin L
w
page 23
The system of first-order modified equinoctial equations of orbital motion are given by
dp 2 p p
p t
dt w
df p g
f r sin L w 1 cos L f t h sin L k cos L n
dt w w
dg p f n
g r cos L w 1 sin L g t h sin L k cos L
dt w w
dh p s2n
h cos L
dt 2w
dk p s 2n
k sin L
dt 2w
2
dL w 1 p
L p h sin L k cos L n
dt p w
where r , t , n are non-two-body perturbations in the radial, tangential and normal directions,
respectively. For a lunar spacecraft, the radial direction is along the geocentric radius vector of the
spacecraft measured positive in a direction away from the gravitational center, the tangential direction is
perpendicular to this radius vector measured positive in the direction of orbital motion, and the normal
direction is positive along the angular momentum vector of the spacecraft’s orbit.
The equations of orbital motion can also be expressed in vector form as follows:
dy
y A y P b
dt
where
T
w
2
b 0 0 0 0 0 p
p
and
page 24
2p p
0 0
w
w 1 cos L f
p p 1 p g
sin L h sin L k cos L
w w
w 1 sin L g
p p 1 p f
cos L h sin L k cos L
w w
A
2
0 0
p s cos L
2w
p s 2 sin L
0 0
2w
p 1
0 0 h sin L k cos L
w
P r ˆi r t ˆit n ˆin
where ˆir , ˆit and ˆin are unit vectors in the radial, tangential and normal directions. These unit vectors can
be computed from the inertial position vector r and velocity vector v according to
ˆi r ˆi r v ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
For unperturbed two-body motion, P 0 and the first five equations of motion are simply
p f g h k 0 . Therefore, for two-body motion these modified equinoctial orbital elements are
constant. The true longitude is often called the fast variable of this orbital element set.
g g N ˆi N gr ˆir
where
ˆi
eˆ N eˆ TN ˆi r ˆi r
eˆ ˆi ˆi
N
eˆ N T
N r r
and
eˆ N 0 0 1
T
page 25
In these equations the north direction component is indicated by subscript N and the radial direction
component is subscript r.
cos
k
4
Re '
gN
r2
Pk J k
k 2 r
k
4
R
gr 2 k 1 e Pk J k
r k 2 r
where
gravitational constant
r geocentric distance of the spacecraft
Re equatorial radius of the Earth
geocentric latitude
J k zonal gravity coefficient
Pk k th order Legendre polynomial
For a zonal only Earth gravity model, the east component is identically zero.
J2
n
r4
1 h 2
k
2 2
The general vector equation for secondary body point-mass perturbations such as the Moon, Sun or
planets is given by
page 26
n
d j sj
t j 3 3
j 1 d j sj
In this equation, s j is the vector from the primary body to the secondary body j, j is the gravitational
constant of the secondary body and d j r s j , where r is the position vector of the spacecraft relative
to the primary body.
The perturbation due to secondary bodies in the modified equinoctial coordinate system is given by
aTB QT t , where Q ˆi r ˆit ˆin .
This part of the trajectory analysis implements a special perturbation technique which numerically
solves the vector system of second-order, nonlinear differential equations of motion of a spacecraft
using the method of order reduction. The second-order equations of motion are given by
a r , v , t r r , r , t a g r a s r , t am r , t
where
t dynamical time
r inertial position vector of the spacecraft v inertial velocity vector of the spacecraft
a g acceleration due to the Earth's gravity as acceleration due to the Sun
am acceleration due to the Moon
After order reduction, the system of six first-order differential equations is defined by
y1 vx y4 y2 v y y5 y2 vz y6
rx 3 J 2 req 5rz2
2
ry 3 J 2 req2 5rz2
y5 3 1 1 2 am y as y aTy
r 2 r 2 r
rz 3 J 2 req 5rz2
2
Propulsive thrust
page 27
T
aT uˆ T t
m t
T
where T is the thrust magnitude, m is the spacecraft mass and uˆ T uTr uTt uTn is the unit pointing
thrust vector expressed in the spacecraft-centered radial-tangential-normal coordinate system.
The components of this unit vector are the control variables for this problem.
dm T
m
dt g I sp
where g is the acceleration of gravity and I sp is the specific impulse of the propulsive system. The
product g I sp is also called the exhaust velocity.
The spacecraft mass at any mission elapsed time t is given by m t msci mt where msci is the initial
mass of the spacecraft.
The components of the unit thrust vector can also be defined in terms of the in-plane pitch angle and
the out-of-plane yaw angle as follows:
Finally, the pitch and yaw angles can be determined from the components of the unit thrust vector
according to
sin 1 uTr tan 1 uTn , uTt
The pitch angle is positive above the “local horizontal” and the yaw angle is positive in the direction of
the angular momentum vector.
The relationship between a unit thrust vector in the ECI coordinate system uˆ TECI and the corresponding
unit thrust vector in the modified equinoctial system uˆ TMEE is given by
uˆ TECI ˆir ˆi
t
ˆi uˆ
n TMEE
where
ˆi r rˆ ˆi r v hˆ ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
page 28
This relationship can also be expressed as
rˆ
x hˆ rˆ x
hˆ x
uˆ TECI Q uˆ TMEE rˆy
hˆ rˆ y
ˆh uˆ
y TMEE
rˆz hˆ rˆ z
hˆ z
In these equations, r is the inertial position vector and v is the inertial velocity vector of the spacecraft.
In the tlto_ocs computer program, the components of the inertial unit thrust vector are defined in
terms of the right ascension and the declination angle as follows:
Finally, the right ascension and declination angles can be determined from the components of the ECI
unit thrust vector according to
The derivation of B-plane coordinates is described in the classic JPL reports, “A Method of Describing
Miss Distances for Lunar and Interplanetary Trajectories” and “Some Orbital Elements Useful in Space
Trajectory Calculations”, both by William Kizner. The following diagram illustrates the fundamental
geometry of the B-plane coordinate system.
page 29
The arrival asymptote unit vector Ŝ is given by
cos cos
Sˆ cos sin
sin
where and are the declination and right ascension of the asymptote of the incoming hyperbola.
The following computational steps summarize the calculation of the B-plane vector from a moon-
centered position vector r and velocity vector v at closest approach.
radius rate r r v r
semiparameter p h2
r
semimajor axis a
r v2
2
orbital eccentricity e 1 p a
pr rh
true anomaly cos sin tan 1 sin ,cos
er e
B-plane magnitude B pa
fundamental vectors
r v rr
zˆ pˆ cos rˆ sin zˆ qˆ sin rˆ cos zˆ
h
a b
S vector S pˆ qˆ
a b2 2
a b2
2
b2 ab
B vector B pˆ qˆ
a 2 b2 a 2 b2
S , S ,0
2 2 T
T
y x
T vector
S x2 S y2
page 30
R S T SzTy , SzTx , S xTy S yTx
T
R vector
This section describes the transformation of coordinates between the Earth mean equator and equinox of
J2000 (EME2000) and lunar mean equator and IAU node of epoch coordinate systems. This
transformation is used to compute the selenocentric orbital inclination and B-plane coordinates at lunar
encounter.
The following diagram illustrates the orientation of the lunar mean equator and IAU node of epoch
coordinate frame.
A unit vector in the direction of the pole of the moon can be determined from
cos p cos p
pˆ Moon sin p cos p
sin p
The right ascension and declination of the lunar pole in the EME2000 coordinate system are given by
the following expressions
page 31
P 66.5392 0.0130T 1.5419cos E1 0.0239cos E 2
0.0278cos E 3 0.0068cos E 4 0.0029cos E 6
0.0009cos E 7 0.0008cos E10 0.0009cos E13
where T is the time in Julian centuries given by T JD 2451545.0 / 36525 and JD is the TDB Julian
Date.
E1 125.045 0.0529921d
E 2 250.089 0.1059842d
E 3 260.008 13.0120009d
E 4 176.625 13.3407154d
E 6 311.589 26.4057084d
E 7 134.963 13.0649930d
E10 15.134 0.1589763d
E13 25.053 12.9590088d
where d JD 2451545 is the number of days since January 1.5, 2000. These equations are given in
“Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2009”,
Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011.
The unit vector in the x-axis direction of this selenocentric coordinate system is given by
xˆ zˆ pˆ Moon
where zˆ 0 0 1 . The unit vector in the y-axis direction can be determined using
T
yˆ pˆ Moon xˆ
Finally, the components of the matrix that transforms coordinates from the EME2000 system to the
moon-centered (selenocentric) mean equator and IAU node of epoch system are as follows:
xˆ
M yˆ
pˆ Moon
Circularization delta-v
The impulsive delta-v required to circularize the spacecraft’s trajectory at closest approach to the moon
can be computed from
page 32
m
v v p v p vlc
rp
where v p is the velocity of the incoming hyperbola at periapsis, rp is the periapsis radius at closest
approach, and m is the gravitational constant of the moon. For capture into an elliptical orbit at the
moon, the impulsive delta-v is determined using
2 m m
v v p
rp a
The range of orbital inclinations possible at closest approach to the moon is a function of the declination
of the incoming hyperbola. This range is governed by the following constraint
i
where i is the selenocentric inclination of the final lunar orbit and is the selenocentric declination of
the incoming hyperbola.
page 33
Algorithm Resources
“Circumlunar Trajectory Calculations”, MIT Instrumentation Laboratory Report R-353, April 1962.
“Optimal Low Thrust Trajectories to the Moon”, John T. Betts and Sven O. Erb, SIAM Journal on
Applied Dynamical Systems, Vol. 2, No. 2, pp. 144-170, 2003.
“Integrated Algorithm for Lunar Transfer Trajectories Using a Pseudostate Technique”, R. V. Ramanan,
AIAA Journal of Guidance, Control and Dynamics, Vol. 25, No. 5, September-October 2002, pp. 946-
952.
“Nonimpact Lunar Transfer Trajectories Using the Pseudostate Technique”, R. V. Ramanan and V.
Adimurthy, AIAA Journal of Guidance, Control and Dynamics, Vol. 28, No. 2, March-April 2005, pp.
217-225.
“Injection Conditions for Lunar Trajectories”, R. Kolenkiewicz and W. Putney, NASA TM X-55390,
November 1965.
“Coplanar Three-Body Trans-Earth Lunar Trajectory Simulation Methodology”, H. Ikawa, AIAA 88-
0381, AIAA 26th Aerospace Sciences Meeting, Reno, Nevada, January 11-14, 1988.
“Lunar Constants and Models Document”, JPL D-32296, September 23, 2005.
page 34
APPENDIX A
Contents of the Simulation Summary and CSV Files
This appendix is a brief summary of the information contained in the simulation summary screen
displays and CSV data file produced by the tlto_ocs software.
The user-defined comma-separated-variable disk file is created by the odeprt subroutine and contains
the following information:
page 35
vmag (km/sec) = scalar velocity vector in kilometers per second
page 36
APPENDIX B
Fortran Functions and Subroutines
This appendix is a brief summary of the major Fortran functions and subroutines included in the
tlto_ocs computer program.
linput.for - read and echo a line of text from an input file subroutine
oderhs.for - subroutine that evaluates the equations of motion and any algebraic
equations
readfpn.for - read and echo floating point number from input file subroutine
page 37
rkf78cn.for - evaluate RKF78 integration coefficients subroutine
page 38
APPENDIX C
Example Fortran Subroutine
This appendix contains a Fortran 77 routine that illustrates typical programming conventions used in the
tlto_ocs software. This subroutine is the point function routine required by the software.
c ************************************
include 'socscom1.inc'
iferr = 0
c -------------------------------------------------------
c phase 1 - TLI propulsive maneuver
c load modified equinoctial elements into local variables
c -------------------------------------------------------
pmee = y(1)
fmee = y(2)
gmee = y(3)
hmee = y(4)
xkmee = y(5)
xlmee = y(6)
else
c ------------------------------------------------
c phase 2 - coast to lunar SOI
page 39
c load cartesian state vector into local variables
c ------------------------------------------------
reci(1) = y(1)
reci(2) = y(2)
reci(3) = y(3)
veci(1) = y(4)
veci(2) = y(5)
veci(3) = y(6)
end if
xmass = y(7)
c *********************************************************************
c compute point functions for state vector continuity at phase boundary
c *********************************************************************
c ------------------------------------
c "working" eci state vector at the
c end of the TLI propulsive maneuver
c ------------------------------------
do i = 1, 3
ptf(i) = reci(i)
ptf(i + 3) = veci(i)
end do
end if
c -----------------------------------
c "working" eci state vector at the
c beginning of the coast to lunar SOI
c -----------------------------------
do i = 1, 3
ptf(i) = reci(i)
ptf(i + 3) = veci(i)
end do
end if
c ******************************************
c compute mission constraint point functions
page 40
c ******************************************
if (iphase .eq. 1 .and. ioev1 .eq. 2 .and. iphend .eq. -1) then
c -----------------------------------------------------
c park orbit inclination and raan prior to TLI maneuver
c -----------------------------------------------------
c cosine(inclination)
hmag = vecmag(hv)
c RAAN (radians)
ptf(2) = oev(5)
end if
c ---------------------------------
c selenocentric mission constraints
c ---------------------------------
do i = 1, 3
rtmp(i) = reci(i) - rmoon(i)
c -------------------------------------
c selenocentric distance point function
c -------------------------------------
ptf(1) = vecmag(rm2sc)
c ---------------------------------
c find closest approach to the moon
c ---------------------------------
page 41
call findca(xjdate, rm2sc, vm2sc, icaerr)
iferr = 1
return
end if
ptf(2) = vecmag(rca)
c ---------------------------------------
c cos(orbital inclination) point function
c ---------------------------------------
hmag = vecmag(hv)
end if
return
end
page 42
APPENDIX D
This appendix describes a Fortran computer program called lguess that can be used to perform a
preliminary performance assessment of trans-lunar trajectories. The software can also be used to create
an initial guess for the tlto_ocs computer program. This algorithm assumes that trans-lunar injection
(TLI) occurs impulsively from a circular Earth park orbit. The software solves for the minimum TLI
delta-v using a two-body Lambert solution for the transfer trajectory from the Earth park orbit to the
center of the moon.
The program inputs, major computational step and outputs for this implementation are as follows:
Software Inputs
This computer program uses the BOBYQA algorithm written by M.J.D. Powell to solve this classic
trajectory optimization problem. The lunar coordinates required by the software are computed using the
JPL DE421 ephemeris. The source code for the lguess computer program was created using the Intel
Visual Fortran compiler, version 11.1.
The lguess computer program is “data-driven” by a simple text file created by the user. This section
describes a typical input data file. In the following discussion the actual input file contents are in
courier font and all explanations are in times italic font.
Each data item within an input file is preceded by one or more lines of annotation text. Do not delete
any of these annotation lines or increase or decrease the number of lines reserved for each comment.
However, you may change them to reflect your own explanation. The annotation line also includes the
correct units and when appropriate, the valid range of the input.
The first four lines of any input file are reserved for user comments. These lines are ignored by the
software. However the input file must begin with four and only four initial text lines.
page 43
*******************************
* input file for program lguess
* lguess1.in – December 7, 2010
*******************************
The software allows the user to specify an initial guess for the TLI calendar date and lower and upper
bounds on the actual date found during both the two-body TLI delta-v optimization process. For any
guess for the TLI time tTLI and user-defined lower and upper bounds tl and tu , the actual TLI time t
is constrained as follows:
tTLI tl t tTLI tu
The first five inputs define the user-defined TLI calendar date and the lower and upper bounds,
respectively. Be sure to include all four digits of the calendar year.
IMPORTANT: The TLI calendar date is a control variable in the NLP formulation and must always
have a lower and upper bound.
TLI calendar date (month, day, year)
9,15,2008
The next input is the user-defined number for the TLI-to-lunar encounter transfer time, in hours.
TLI-to-lunar encounter transfer time (hours)
110.0
The next two numbers define the fixed values for the park orbit altitude and orbital inclination.
***********************************
circular park orbit characteristics
***********************************
altitude (kilometers)
185.32
This next integer input defines the type of TLI maneuver to perform. The software uses this indicator to
compute the park orbit RAAN. Please see the Technical Discussion later in this document for
information about how the park orbit RAAN is determined.
type of TLI maneuver
(1 = ascending, 2 = descending)
2
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
lguess lguess1.in
page 44
If the software is executed without an input file on the command line, the lguess computer program
will display the following prompt:
At this point the user should input the name of a valid input file, including the filename extension.
Program example
The following is the solution created by the computer program for this example. The results are
presented in the Earth mean equator and equinox of J2000 coordinate system (EME2000). The
trajectory characteristics are given before and after the impulsive TLI maneuver. The geocentric orbital
elements and the state vectors of the spacecraft and the moon at encounter are also displayed.
program lguess
DE421 ephemeris
page 45
(geocentric EME2000 coordinates)
--------------------------------
page 46
rx (km) ry (km) rz (km) rmag (km)
0.183855964261D+06 0.278989583980D+06 0.156328383523D+06 0.368885845565D+06
The final two items of the program output are the geocentric right ascension and declination of the moon
at encounter, in the EME2000 system.
The specific orbital energy displayed by the software is calculated using the expression E v 2 2 r .
TDB is the barycentric dynamic time which is the fundamental time argument for the JPL lunar
ephemeris used by the code.
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
page 47
Technical Discussion
This section describes several of the algorithms implemented in the lguess computer program.
y t
z
u t
consisting of the state variables y and the control variables u for any time t. In this discussion vectors
are denoted in bold.
The system dynamics are defined by a vector system of ordinary differential equations called the state
equations that can be represented as follows:
dy
y f y t , u t , p, t
dt
The initial dynamic variables at time t0 are defined by ψ0 ψ y t0 , u t0 , t0 and the terminal
conditions at the final time t f are defined by ψ f ψ y t f , u t f , t f . These conditions are called the
boundary values of the trajectory problem. The problem may also be subject to path constraints of the
form g y t , u t , t 0 .
The basic nonlinear programming problem (NLP) is to determine the control vector history and problem
parameters that minimize the scalar performance index or objective function given by
J y t0 , t0 , y t f , t f , p
During the two-body trajectory optimization, the control variables are the TLI calendar date and the true
anomaly of the TLI maneuver. The objective function or performance index is the scalar magnitude of
the TLI delta-v vector.
In addition to the bounds on the TLI calendar date mentioned earlier, the true anomaly during the two-
body optimization is bounded according to
180 180
The final boundary conditions are the components of the moon’s inertial position vector at encounter.
page 48
Solving the two body Lambert problem
Lambert’s problem is concerned with the determination of an orbit that passes between two positions
within a specified time-of-flight. This classic astrodynamic problem is also known as the orbital two-
point boundary value problem (TPBVP).
The time to traverse a trajectory depends only upon the length of the semimajor axis a of the transfer
trajectory, the sum ri rf of the distances of the initial and final positions relative to a central body, and
the length c of the chord joining these two positions. This relationship can be stated as follows:
tof tof ri rf , c, a
a3
t t0 E e sin E
we can write
a3
t E E0 e sin E sin E0
where E is the eccentric anomaly associated with radius r, E0 is the eccentric anomaly at r0 , and t 0
when r r0 .
At this point we need to introduce the following trigonometric sun and difference identities:
a
sin sin 2sin cos
2 2
a
cos cos 2sin sin
2 2
a
cos cos 2 cos cos
2 2
If we let E and E0 and substitute the first trig identity into the second equation above, we have
the following equation:
a3 E E0 E E0
t E E0 2sin e cos
2 2
page 49
E E0
e cos cos
2 2
E E0
sin sin
2 2
a3
t 2sin cos
2 2
r a 1 e cos E
x a cos E e
y a sin E 1 e 2
r r0 c r r0 c s
cos 1 1 1
2a 2a 2a a
r r0 c r r0 c sc
sin 1 1 1
2a 2a 2a a
This part of the derivation makes use of the following three relationships:
r r0
cos cos 1
2 2 2
E E0 E E0
2
sin sin sin 1 e cos
2 2 2 2
x x0 y y0 c
2 2 2 2
sin sin
2 2 2a 2a 2a
s sc
sin sin
2 2a 2 2a
and several additional substitutions, we have the time-of-flight form of Lambert’s theorem
page 50
a3
t sin sin
A discussion about the angles and can be found in “Geometrical Interpretation of the Angles
and in Lambert’s Problem” by J. E. Prussing, AIAA Journal of Guidance and Control, Volume 2,
Number 5, Sept.-Oct. 1979, pages 442-443.
The algorithm used in this computer program is based on the method described in “A Procedure for the
Solution of Lambert’s Orbital Boundary-Value Problem” by R. H. Gooding, Celestial Mechanics and
Dynamical Astronomy 48: 145-165, 1990. This iterative solution is valid for elliptic, parabolic and
hyperbolic transfer orbits which may be either posigrade or retrograde, and involve one or more
revolutions about the central body.
For a given TLI calendar date, there are two possible locations on the initial park orbit at which to
perform the propulsive maneuver. One opportunity occurs during the ascending part of the park orbit
and the other during the descending motion. The park orbit RAAN p at these two locations can be
determined from spherical trigonometry relationships involving the park orbit inclination and the
geocentric right ascension and declination of the moon at encounter. The equations implemented in this
computer program are as follows:
ascending
tan m
p 180 m sin 1
tan i
p
descending
tan m
p m sin 1
tan i
p
where
Additional information about these equations can be found in Appendix A of the journal reference,
“Integrated Algorithm for Lunar Transfer Trajectories Using a Pseudostate Technique”, R. V. Ramanan,
AIAA Journal of Guidance, Control and Dynamics, Vol. 25, No. 5, September-October 2002, pp. 946-
952.
page 51
APPENDIX E
Typical Sparse Optimization Suite Configuration File
The tlto_ocs computer progran can read and use a user-defined configuration file. A description of
each element in this file can be found in the INSOCX routine in section 6.2, Subprograms for Optimal
Control, and the INSNLP routine in Section 2.2, Subprograms for Optimization of the Sparse
Optimization Suite user’s manual. Please note that the tlto_ocs software can read and use a subset of
the information in this file. For example, a subset configuration file might contain only the following
information;
ODETOL=0.1D-06
INSNLP:IOFLAG=5
SOCOUT=I4K4
The following is a typical “full version” configuration file created during the execution of the
tlto_ocs software.
AEQTOL=0.1000000000000000D-02
DTAUX=0.0000000000000000D+00
OBJCTL=0.1000000000000000D-04
ODETOL=0.1000000011686097D-06
PGDCTL=0.1000000000000000D-02
PRTMSD=0.1490116119384766D-07
PRTMXD=0.1000000000000000D-02
PRTSFD=0.1000000000000000D-04
QDRTOL=0.1000000000000000D-02
RESTOL=0.1000000000000000D-04
SMLTOL=0.1490116119384766D-10
TOLJSD=0.1000000000000000D-05
TOLM5A=0.1490116119384766D-07
TOLM5R=0.1490116119384766D-07
IDSCPH=0
IDSCND=0
IDSCVR=0
IDSCFN=0
IDTSFD=-1
IPFAUX=0
IPFSFD=0
IPRSFD=1
IPGRD=0
IPNLP=10
IPODE=0
IPUAUX=0
IPUOCP=6
IRSTRT=2
ISCALE=0
ISFHES=41
ISFINP=42
ISFRST=43
ISFSCL=44
ITSWCH=2
M5DTYP=0
MITODE=20
MTSWCH=-1
MXDATA=0
MXPARM=10
MXPCON=20
MXSTAT=20
MXTERM=50
NPTAUX=100
NSSWCH=-1
SOCOUT=A0B0C0D0E0F0G0H0I0J2K0L0M0N0O0P0Q0R0S1T0U0V0W0X0Y0Z0
SPRTHS=SPARSE
NLPALG=SNLPMN
NLPOMR=M
page 52
KEYDPL=.lueiLUE
RHSTMP=RHSTMPLT
RSTFIL=tlto1.rsbin
SCLFIL=scalewgt.fil
INSNLP:ALFLWR=0.0000000000000000D+00
INSNLP:ALFUPR=0.1000000000000000D+01
INSNLP:CONTOL=0.1490116119384766D-07
INSNLP:EPSRLF=0.1490116119384766D-07
INSNLP:OBJTOL=0.9999999747378752D-05
INSNLP:PGDTOL=0.1000000000000000D-04
INSNLP:SLPTOL=0.9000000000000000D+00
INSNLP:SFZTOL=0.1000000000000000D-01
INSNLP:TOLFIL=0.2000000000000000D+01
INSNLP:TOLKTC=0.1110953834938985D+26
INSNLP:TOLPVT=0.1000000000000000D-02
INSNLP:IHESHN=0
INSNLP:IOFLAG=5
INSNLP:IOFLIN=-1
INSNLP:IOFMFR=0
INSNLP:IOFPAT=0
INSNLP:IOFSHR=0
INSNLP:IOFSRC=0
INSNLP:IPUDRF=0
INSNLP:IPUFZF=0
INSNLP:IPUMF1=11
INSNLP:IPUMF2=12
INSNLP:IPUMF3=13
INSNLP:IPUMF4=14
INSNLP:IPUMF5=15
INSNLP:IPUMF6=16
INSNLP:IPUMF7=17
INSNLP:IPUNLP=6
INSNLP:IPUSTF=0
INSNLP:IRELAX=1
INSNLP:ITDRQP=-1
INSNLP:ITFZQP=-1
INSNLP:IT1MAX=20
INSNLP:JACPRM=0
INSNLP:LYNFNC=0
INSNLP:LYNOUT=0
INSNLP:LYNPLT=0
INSNLP:LYNPNT=101
INSNLP:LYNVAR=0
INSNLP:MAXLYN=5
INSNLP:MAXNFE=50000
INSNLP:MNSAME=2
INSNLP:NEWTON=0
INSNLP:NITMAX=1000
INSNLP:NITMIN=0
INSNLP:NORMAL=0
INSNLP:ALGOPT=FM
INSNLP:KTOPTN=SMALL
INSNLP:QPOPTN=SPARSE
INSNLP:BIGCON=-0.1000000000000000D+01
INSNLP:FEATOL=0.1000000000000000D-01
INSNLP:PMULWR=0.1000000000000000D+00
INSNLP:PTHTOL=0.1000000000000000D+02
INSNLP:RHOLWR=0.1000000000000000D+03
INSNLP:IMAXMU=10
INSNLP:MUCALC=3
INSNLP:MXQPIT=1
page 53