Computer Methods For Aerospace Trajectory Optimization
Computer Methods For Aerospace Trajectory Optimization
Computer Methods For Aerospace Trajectory Optimization
AEROSPACE TRAJECTORY
OPTIMIZATION
Written by Columbus David Eagle Jr.
August 2020
Table of Contents
Introduction …………………………………………………………………………………..…..3
page 1
Appendices
A – Trajectory Modeling and Targeting in the Modified Equinoctial Orbital Elements System ……...391
page 2
Introduction
This document describes the implementation of Fortran computer programs for solving practical
problems in aerospace trajectory optimization. All programs are written in Fortran and utilize the
Sparse Optimization Suite (SOS) software distributed by Applied Mathematical Analysis (AMA).
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
• collocation and implicit integration
• adaptive mesh refinement
• sparse nonlinear programming
The CMATO 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
SOS will use this information to automatically transcribe the user’s optimal control problem and perform
the optimization using a sparse nonlinear programming (NLP) method.
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, and these documents.
John T. Betts and Paul D. Frank. A Sparse Nonlinear Optimization Algorithm. Journal of Optimization
Theory and Applications, 82(3):519–541, September 1994.
John T. Betts and William P. Huffman. Application of Sparse Nonlinear Programming to Trajectory
Optimization. AIAA Journal of Guidance, Control, and Dynamics, 15(1):198–206, January–February
1992.
John T. Betts and William P. Huffman. Path Constrained Trajectory Optimization Using Sparse
Sequential Quadratic Programming, AIAA Journal of Guidance, Control, and Dynamics, 16(1):59–68,
January–February 1993.
I sincerely thank Dr. John Betts for sharing his experience and expertise in engineering optimization.
page 3
CMATO 1 – Single Maneuver, Finite-Burn Trajectory Optimization
This CMATO application is a Fortran computer program named oneburn_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve an Earth orbit transfer
trajectory optimization problem. The software models the trajectory as a single, finite-burn propulsive
maneuver followed by a user-defined, time-bounded final coast phase. This computer program attempts
to maximize the final spacecraft mass. Since this simulation involves a single continuous maneuver, this
is equivalent to minimizing the required propellant mass.
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 oneburn_sos 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 optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The oneburn_sos software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 4
Input file format and contents
The oneburn_sos software is “data-driven” by a text file created by the user. This text file should be
simple ASCII format with no special characters.
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.
The following is a typical input file used by this computer program. In the following discussion the
actual input file contents are in bold courier font and all explanations are in times font. This example
attempts to optimize the maneuver required to transfer a spacecraft from a circular low Earth orbit
(LEO) to a typical elliptical geosynchronous transfer orbit (GTO).
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.
************************************************
** earth-orbit trajectory optimization
** single finite-burn maneuver with final coast
** program oneburn_sos
** leo2gto.in – February 20, 2012
************************************************
The first three numerical inputs define the initial mass prior to the propulsive maneuver, and the thrust
magnitude and specific impulse of the upper stage or spacecraft propulsion system.
initial spacecraft mass (kilograms)
10000.0
thrust magnitude (newtons)
99200.0
This next integer input defines the type of initial guess for the propulsive maneuver.
********************************
type of propulsive initial guess
********************************
1 = thrust duration
2 = delta-v
-------------------
2
The next two numeric inputs define either the user’s initial guess for the delta-v magnitude or the
maneuver duration and should be consistent with the previous input.
initial guess for delta-v (meters/second)
2800.0
page 5
The next two inputs define the lower and upper bounds for the thrust duration. These inputs are required
for either type of propulsive initial guess.
lower bound for thrust duration (seconds)
0.01
The next section of the input data file defines the characteristics of a final coast phase that follows the
propulsive maneuver. These three inputs define an initial guess for the coast duration as well as lower
and upper bounds on the coast duration.
**************
coast maneuver
**************
The next six inputs define the classical orbital elements of the initial park orbit. These elements are
defined with respect to an Earth-centered-inertial (ECI) coordinate system.
*****************
* INITIAL ORBIT *
*****************
This next integer input allows the user to define the type of initial orbit constraints to use during the
simulation.
********************************
initial orbit constraint options
********************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all initial orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
3
page 6
The next six inputs define the classical orbital elements of the final mission orbit. These elements are
defined with respect to an Earth-centered-inertial (ECI) coordinate system.
***************
* FINAL ORBIT *
***************
This next integer input allows the user to define the type of final orbit constraints to use during the
simulation.
******************************
final orbit constraint options
******************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all final orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
1
This integer input specifies the type of gravity model to use during the simulation. Option 2 will use a
J 2 gravity model in the spacecraft equations of motion.
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate gravity model
------------------------
2
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 options *
*************************
1 = numerical integration
2 = binary data file
---------------------
1
page 7
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 binary initial guess data file
leo2gto.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 solution data file to create.
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
2
For options 2 or 3, this 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
100
The name of the comma-separated-variable solution data file is defined in this next line.
name of solution output file
leo2gto.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 input defines the relative error in the objective function.
relative error in the objective function (performance index)
1.0d-5
page 8
This input defines the relative error in the solution of the differential equations.
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.
maximum number of mesh refinement iterations
20
This 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
10000
The level of output from the Sparse Optimization Suite NLP algorithm is controlled with the following
integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
The level of output from the Sparse Optimization Suite optimal control algorithm is controlled with the
following integer input. Please note that option 4 will create lots of numerical information.
**********************
optimal control output
----------------------
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
The level of output from the Sparse Optimization Suite differential equations algorithm is controlled
with the following integer input. Please note that option 5 will create lots of numerical information.
****************************
differential equation output
----------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
1
page 9
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
-------------------
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 oneburn_sos software. Please consult Appendix J – Typical
Sparse Optimization Suite Configuration File, for more information about this type of file.
***************************************
* optimal control configuration options
***************************************
The following is the optimal control solution for this example. This simulation used variable attitude
steering during the propulsive maneuver, and a final bounded coast. The output includes the time and
orbital characteristics at the beginning and end of the propulsive maneuver. This example optimizes the
maneuver required to transfer from a circular low Earth orbit (LEO) to a typical elliptical
geosynchronous transfer orbit (GTO).
program oneburn_sos
===================
------------------------
beginning of finite burn
------------------------
page 10
vx (kps) vy (kps) vz (kps) vmag (kps)
0.772230207356D+01 -.501755544829D+00 0.920593794451D+00 0.779315089527D+01
------------------
end of finite burn
------------------
The following program output is the final spacecraft mass, the propellant mass consumed, the actual
thrust duration for the maneuver, and the accumulated delta-v.
final mass 5280.17375040397 kilograms
The delta-v magnitude is determined using a cubic spline integration of the thrust acceleration data at
each collocation node or user-defined step size.
This section of the numerical results summarizes the time and orbital conditions at the beginning and
end of the final coast.
---------------------------
beginning of coast maneuver
---------------------------
mission elapsed time 00:03:29.965
---------------------
end of coast maneuver
---------------------
page 11
raan (deg) true anomaly (deg) arglat (deg) period (min)
0.360000000000D+03 0.160144835450D+02 0.286014483545D+03 0.630817851038D+03
The optimal control solution determined by the Sparse Optimization Suite can be verified by
numerically integrating the orbital equations of motion with the SOS-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 from the SOS solution. This part of the oneburn_sos
computer program uses a Runge-Kutta-Fehlberg 7(8) variable step size method to integrate the orbital
equations of motion using the optimal controls.
The following is a display of the final solution computed using this explicit numerical integration
method.
========================================
verification of optimal control solution
========================================
------------------
end of finite burn
------------------
page 12
raan (deg) true anomaly (deg) arglat (deg) period (min)
0.359999999997D+03 0.160144833255D+02 0.286014483551D+03 0.630817851180D+03
In additional to the user-defined solution output file, the oneburn_sos program will create two
comma-separated-variable data files named orbits.csv and maneuver.csv. The first file contains
position vectors of the initial and final orbits normalized with respect to the radius of the Earth. The
second data file contains trajectory conditions starting at ignition and ending at burnout of the propulsive
maneuver.
The following plots illustrate the evolution of the inertial right ascension, declination and pitch and yaw
angles during this finite-burn maneuver.
The next two plots illustrate the evolution of the semimajor axis and orbital eccentricity of the transfer
orbit during this finite-burn maneuver.
page 13
The final two plots illustrate the behavior of the radial, tangential and radial components of the unit
thrust vector, and the accumulated delta-v during the propulsive maneuver.
The following is a 3-D graphics display of the initial (red trace) and final orbits (blue trace). The
coordinates are shown in the units of Earth radii (ER).
page 14
Creating an initial guess
The software allows the user to input either a delta-v or thrust duration initial guess. For a delta-v initial
guess, the software estimates the thrust duration using the rocket equation. For either type of initial
guess, the user should also provide lower and upper bounds for the total thrust duration.
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 (or final) mass of the spacecraft
and the exhaust velocity as follows
− V
VV
m p = mi 1 − e Vex
= m f e ex − 1
In these equations
mi = initial mass m f = final 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
page 15
The software requires an initial guess for the thrust duration. The user should also provide lower and
upper bounds for the total thrust duration. All inputs should be in seconds. If the Sparse Optimization
Suite cannot find a feasible solution, try increasing the guess for thrust duration.
The software uses tangential steering to generate an initial guess for the trajectory. For tangential
thrusting, the unit thrust vector in the modified equinoctial frame is simply uT = 0 1 0 . Please
T
note this type of steering creates a coplanar initial guess. It works best when the initial and final orbits
are nearly coplanar.
The dynamic variables at each grid point of the initial guess are determined by setting the initial guess
option INIT(1) = 6 with INIT(2) = 2 within the odeinp subroutine for this aerospace trajectory
optimization problem. These program options create an initial guess from the numerical integration of
the equations of motion coded in the oderhs subroutine. The INIT(1) = 6 program option tells the
Sparse Optimization Suite to construct an initial guess by solving an initial value problem (IVP) with a
linear control approximation. The INIT(2) = 2 program option tells the program to use the Dormand-
Prince variable step size numerical method to solve the initial value problem.
Binary restart data files can also be used to initialize a oneburn_sos simulation. A typical scenario is
This technique works provided the two simulations are not dramatically different. Sometimes it may be
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 of the document provides details about the oneburn_sos software implementation. It
defines such things as point and path constraints (boundary conditions), bounds on the dynamic
variables, and the performance index or objective function.
The software allows the user to select one of the following initial orbit constraint options
i
h 2 + k 2 = tan
2
page 16
where i is the initial orbit inclination.
If the initial orbit is circular, the computer program enforces the two equality constraints
f = 0 and g = 0 .
Otherwise, for an elliptical initial orbit, the single equality constraint f 2 + g 2 = e is enforced, where e
is the initial orbit eccentricity.
For program option 2, both lower and upper bounds for all modified equinoctial elements are set equal
to the initial modified equinoctial orbital elements as follows
pL = pU = pi f L = fU = f i g L = gU = g i
hL = hU = hi k L = kU = ki
In optimal control terminology, these derived 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 or termination of the propulsive maneuver. This is simply J = m f .
The value of the maxmin indicator in the Sparse Optimization Suite algorithm tells the software whether
the user wants to minimize or maximize the performance index. The spacecraft mass at the initial time
is fixed to the user-defined initial value.
For a variable steering trajectory, the scalar magnitude of the components of the unit thrust vector at any
time during the simulation is constrained as follows
The software allows the user to select one of the following final orbit constraint options
1) constrain semimajor axis, eccentricity and inclination
2) constrain all final orbital elements
3) option 2 with unconstrained true longitude
i
h 2 + k 2 = tan
2
page 17
where i is the mission orbit inclination.
If the final orbit is circular, the code enforces the following two equality constraint f = 0 and g = 0 .
Otherwise, for an elliptical mission orbit, the single equality constraint f 2 + g 2 = e is enforced, where
e is the park orbit eccentricity.
For program option 2, both lower and upper bounds for all modified equinoctial elements are set equal
to the user-defined final modified equinoctial orbital elements as follows
pL = pU = pi f L = fU = f i g L = gU = g i
hL = hU = hi k L = kU = ki
The following lower and upper bounds are applied to the spacecraft mass and the modified equinoctial
dynamic variables during the orbital transfer.
0.05msci msc 1.05msci 100 p f p 0.8 pi
−1 f +1 − 1 g +1 − 1 h +1 − 1 k +1
where msci is the initial spacecraft mass. Finally, the three components of the unit thrust vector are
constrained as follows
−1.1 ur +1.1 − 1.1 ut +1.1 − 1.1 un +1.1
Technical discussion
In this computer program, the orbital motion of the spacecraft is modeled in the modified equinoctial
orbital elements coordinate system. Please consult Appendix A – Trajectory Modeling and Targeting in
the Modified Equinoctial Orbital Elements System for a definition of these orbital elements along with
the equations of motion and other useful information about this system.
Propulsive Thrust
page 18
The propellant mass flow rate is determined from m = dm dt = T 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 − m t where
msci is the initial mass of the spacecraft and m is the propellant flow rate.
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
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 ( )
Both steering angles are defined with respect to a local-vertical, local-horizontal (LVLH) system located
at the spacecraft. The in-plane pitch angle is positive above the “local horizontal” and the out-of-plane
yaw angle is positive in the direction of the angular momentum vector. The inverse tangent calculation
in the second equation is a four-quadrant operation.
The oneburn_sos software provides the steering angles and the components of the unit thrust vector in
both the inertial and modified equinoctial coordinate systems. Please consult Appendix G – Aerospace
Trajectory Coordinates and Time Systems which summarizes the inertial and classical orbital elements-
to/from-modified equinoctial coordinate relationships and transformations.
In the this 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
(
= tan −1 uT ECI y
, uTECI
x
) (
= sin −1 uT ECI z
)
where the calculation for right ascension is again a four-quadrant inverse tangent operation.
This section illustrates the orbit transfer for a single maneuver non-coplanar LEO-to-LEO example. For
this example, all the orbital elements except true longitude for both the initial and final orbits are fixed.
The main portion of the simulation definition file for this example is as follows
************************************************
** earth-orbit trajectory optimization
** single finite-burn maneuver with final coast
** program oneburn_sos
** leo2leo.in - February 21, 2012
************************************************
********************************
type of propulsive initial guess
********************************
1 = thrust duration
2 = delta-v
-------------------
2
**************
coast maneuver
**************
*****************
* INITIAL ORBIT *
*****************
********************************
initial orbit constraint options
********************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all initial orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
3
***************
* FINAL ORBIT *
***************
page 20
orbital eccentricity (non-dimensional)
0.0d0
******************************
final orbit constraint options
******************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all final orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
3
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate gravity model
------------------------
2
*************************
* initial guess options *
*************************
1 = numerical integration
2 = binary data file
---------------------
1
******************************
* binary restart file option *
******************************
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
1
********************************
* algorithm control parameters *
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
page 21
1
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
**********************
optimal control output
----------------------
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
****************************
differential equation output
----------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
1
The following is the 3-D graphics display for this example. The initial orbit trace is blue, the final orbit
is red and the transfer maneuver trace is black.
page 22
Here are the numerical results created by the oneburn_sos computer program for this example.
program oneburn_sos
===================
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
page 23
rx (km) ry (km) rz (km) rmag (km)
0.609955227473D+04 0.276472241466D+04 0.645646678312D+03 0.672793338370D+04
---------------------------
beginning of coast maneuver
---------------------------
---------------------
end of coast maneuver
---------------------
========================================
verification of optimal control solution
========================================
------------------
end of finite burn
------------------
page 24
propellant mass 5837.83929128308 kilograms
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the oneburn_sos software.
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 25
final mass = final spacecraft mass in kilograms
The delta-v magnitude is determined using a cubic spline integration of the thrust acceleration data at
each collocation node or user-defined step size.
The user-defined comma-separated-variable (csv) disk file is created by the odeprt Fortran subroutine
and contains the following information.
time (sec) = simulation time since ignition in seconds
page 26
rx (km) = x-component of the spacecraft’s position vector in kilometers
rasc (deg) = inertial right ascension of the unit thrust vector in degrees
yaw (deg) = out-of-plane yaw angle of the unit thrust vector in degrees
pitch (deg) = in-plane pitch angle of the unit thrust vector in degrees
rp1-x (er) = x-component of the initial orbit position vector in earth radii
rp1-y (er) = y-component of the initial orbit position vector in earth radii
rp1-z (er) = z-component of the initial orbit position vector in earth radii
rp2-x (er) = x-component of the final orbit position vector in earth radii
rp2-y (er) = y-component of the final orbit position vector in earth radii
rp2-z (er) = z-component of the final orbit position vector in earth radii
“Direct Trajectory Optimization Using Nonlinear Programming and Collocation”, C. R. Hargraves and
S. W. Paris, AIAA Journal of Guidance, Control and Dynamics, Vol. 10, No. 4, July-August, 1987, pp.
338-342.
“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.
page 27
CMATO 2 – Two Maneuver, Finite-Burn Trajectory Optimization
This CMATO application is a Fortran computer program named twoburn_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the classic orbit
transfer trajectory optimization problem. The software models the trajectory as a three phase mission in
the sequence burn-coast-burn. The two burns are simulated as constant-thrust, finite-burn propulsive
maneuvers. This computer program attempts to maximize the spacecraft mass at the end of the final
propulsive maneuver.
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:
• collocation and implicit integration
• adaptive mesh refinement
• sparse nonlinear programming
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 twoburn_sos 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 optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The twoburn_sos software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 28
Input file format and contents
The twoburn_sos software is “data-driven” by a user-created text file. 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 font. This example attempts to optimize the maneuvers
required to transfer a spacecraft from a near circular low Earth orbit (LEO) to a typical geosynchronous
Earth orbit (GEO).
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.
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.
****************************************
** two maneuver, finite-burn earth-orbit
** trajectory optimization
** program twoburn_sos
** leo2geo.in - April 15, 2012
****************************************
The first input is the initial mass of the entire spacecraft in kilograms.
initial spacecraft mass (kilograms)
15000.0
This next integer input defines the type of initial guess for the propulsive maneuver.
********************************
type of propulsive initial guess
********************************
1 = thrust duration
2 = delta-v magnitude
---------------------
2
The next four inputs define the thrust magnitude and the specific impulse of the upper stage or
spacecraft propulsion system, and the user’s initial guess for either the delta-v or thrust duration for the
first maneuver.
-------------------------
first propulsive maneuver
-------------------------
thrust magnitude (newtons)
25000.0
page 29
The next four inputs define the thrust magnitude and the specific impulse of the upper stage or
spacecraft propulsion system, and the user’s initial guess for either the delta-v or thrust duration for the
second maneuver.
--------------------------
second propulsive maneuver
--------------------------
The next three inputs define the user’s initial guess for the duration of the coast phase along with a lower
and upper bound for the coast duration.
-----------
coast phase
-----------
The next six inputs define the classical orbital elements of the initial park orbit. These elements are
defined with respect to an Earth-centered-inertial (ECI) coordinate system.
*****************
* INITIAL ORBIT *
*****************
page 30
This next integer input allows the user to define the type of initial orbit constraints to use during the
simulation. Please see the “Problem setup” section later in this document for information about this
program option.
********************************
initial orbit constraint options
********************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all initial orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
1
The next six inputs define the classical orbital elements of the final mission orbit. These elements are
also defined with respect to an Earth-centered-inertial (ECI) coordinate system.
***************
* FINAL ORBIT *
***************
This next integer input allows the user to define the type of final orbit constraints to use during the
simulation. Please see the “Problem setup” section later in this document for information about this
program option.
******************************
final orbit constraint options
******************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all final orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
3
This integer input specifies the type of gravity model to use during the simulation. Option 2 will use a
J 2 gravity model in the spacecraft equations of motion.
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate gravity model
------------------------
2
page 31
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 options *
*************************
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 binary initial guess data file
leo2geo.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 solution data file to create.
**********************************************
* 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 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
25
The name of the comma-separated-variable solution data file is defined in this next line.
name of solution output file
leo2geo.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 *
********************************
page 32
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
The next input defines the relative error in the objective function.
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.
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.
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
10000
The next input is an integer that defines the maximum number of algorithm iterations.
maximum number of algorithm iterations
10000
The level of output from the Sparse Optimization Suite NLP algorithm is controlled with the following
integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
The level of output from the Sparse Optimization Suite 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 Sparse Optimization Suite differential equations algorithm is controlled
with the following integer input. Please note that option 5 will create lots of information.
page 33
****************************
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
-------------------
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 twoburn_sos software. Please consult Appendix J – Sparse
Optimization Suite Configuration File.
***************************************
* optimal control configuration options
***************************************
The following is the twoburn_sos solution for this example. The output includes the time and orbital
characteristics at the beginning and end of each mission phase.
program twoburn_sos
===================
--------------------------------------
beginning of first propulsive maneuver
--------------------------------------
page 34
sma (km) eccentricity inclination (deg) argper (deg)
0.656314000000D+04 0.150000000004D-01 0.285000000000D+02 0.179196327908D+03
--------------------------------
end of first propulsive maneuver
--------------------------------
The following program output is the spacecraft mass, the propellant mass consumed, the actual thrust
duration for the maneuver, and the accumulated delta-v for the first maneuver.
spacecraft mass 7870.53129355029 kilograms
This section of the numeric results summarizes the time and orbital conditions at the beginning and end
of the transfer orbit coast.
------------------------
beginning of coast phase
------------------------
------------------
end of coast phase
------------------
page 35
mission elapsed time 05:07:30.284
---------------------------------------
beginning of second propulsive maneuver
---------------------------------------
---------------------------------
end of second propulsive maneuver
---------------------------------
The following program output is the propellant mass consumed, the actual thrust duration for the
maneuver, and the accumulated delta-v for the second maneuver.
propellant mass 3119.75087432484 kilograms
After the simulation is complete, the software will display a simulation summary.
page 36
SIMULATION SUMMARY
------------------
The following two plots illustrate the evolution of the pitch and yaw steering angles during the first and
second finite-burn maneuver.
The next pair of plots illustrate the behavior of the semimajor axis and orbital eccentricity during the
first and second maneuvers.
page 37
The next pair of plots illustrate the behavior of the orbital inclination and right ascension of the
ascending node (RAAN) during the first and second maneuvers.
The following two plots illustrate the evolution of the geocentric radius and velocity during the each
finite-burn maneuver.
The twoburn_sos computer program will also create three output files named orbit1.csv,
orbit2.csv and orbit3.csv. This file contains the Earth-centered inertial position vectors of the
park, transfer and final mission orbit. The twoburn_sos software package includes a MATLAB script
named oplot.m that can be used to create trajectory graphic displays using these 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 three-
dimensional geometry of the orbital transfer.
The following is the graphics display for this example. The initial orbit trace is red, the transfer orbit is
blue and the final mission orbit is black. The dimensions are Earth radii (ER) and the plot is labeled
with an ECI coordinate system where green is the x-axis, red is the y-axis and blue is the z-axis.
page 38
Solid propellant upper stage
Suppose the first maneuver of the orbit transfer is performed with a solid propellant stage. This type of
propulsion has a fixed thrust duration. The propellant in the upper stage is designed to provide a delta-v
slightly higher than the required first maneuver delta-v to account for performance dispersions. To
implement this “fixed delta-v” simulation in the SOS software, the thrust duration of the first maneuver
is constrained and no longer determined by the software.
The following two plots illustrate the pitch and yaw behavior for both maneuvers for the previous
simulation example. The only change to the simulation was constraining the first thrust duration to 1150
seconds. In the original simulation, the duration was 1118 seconds. The longer thrust duration produces
an “excess” delta-v of 100 meters/second.
page 39
Verification of the optimal control solution
The optimal control solution determined by the Sparse Optimization Suite software can be verified by
numerically integrating the orbital equations of motion with the optimal control solution and the initial
park orbit conditions determined by the software. This is equivalent to solving an initial value problem
(IVP) that uses the optimal unit thrust vector solution.
This part of the twoburn_sos computer program uses a Runge-Kutta-Fehlberg 7(8) variable step size
method to integrate the orbital equations of motion.
The following is a display of the final solution computed using this explicit numerical integration
method.
========================================
verification of optimal control solution
========================================
-------------------
final mission orbit
-------------------
The software allows the user to input either a delta-v or thrust duration initial guess. For a delta-v initial
guess, the software estimates the thrust duration using the rocket equation. 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 (or final) mass of the spacecraft
and the exhaust velocity as follows
page 40
− V
VV
m p = mi 1 − e Vex = m f e ex − 1
In these equations
mi = initial mass
m f = final 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
For the thrust duration initial guess option, the software requires an initial guess for the thrust duration
for each propulsive maneuver. All these inputs should be in seconds. If the twoburn_sos computer
program cannot find a feasible solution, try increasing the guess for thrust duration.
The software uses a tangential thrusting steering method to generate an initial guess for the optimal
trajectory. For tangential thrusting, 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.
T
The dynamic variables and control variables at each grid point are determined by the Sparse
Optimization Suite by setting the initial guess option INIT(1) = 6 with INIT(2) = 4. These
program options create an initial guess from the numerical integration of the equations programmed in
the oderhs subroutine. The number and location of the initial collocation nodes are determined from
the variable step-size numerical integration.
Problem setup
This section provides additional details about the software implementation. It explains such things as
point and path constraints, the performance index and the numerical technique used to create an initial
guess for the software.
The software allows the user to select one of the following initial orbit constraint options:
i
For option 1, the initial orbit inclination is constrained by enforcing h 2 + k 2 = tan where i is the
2
park orbit inclination.
page 41
If the park orbit is circular, the software enforces the following two equality constraints
f = 0 and g = 0
f 2 + g2 = e
For program option 2, both lower and upper bounds for all modified equinoctial elements are set equal
to the initial modified equinoctial orbital elements as follows:
pL = pU = pi f L = fU = f i
g L = gU = gi hL = hU = hi
k L = kU = ki
In optimal control terminology, these derived 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 or termination of the propulsive maneuver. This is simply J = m f .
The value of the maxmin indicator in the Sparse Optimization Suite algorithm tells the software whether
the user is minimizing or maximizing the performance index. The spacecraft mass at the initial time is
fixed to the user-defined initial value.
For the variable steering program option, the scalar magnitude of the components of the unit thrust
vector at any time during the simulation is constrained as follows:
The software allows the user to select one of the following final orbit constraint options:
1) constrain semimajor axis, eccentricity and inclination
2) constrain all final orbital elements
3) option 2 with unconstrained true longitude
page 42
For option 1, the final orbital inclination is constrained by enforcing h 2 + k 2 = tan ( i 2 ) where i is the
user-defined mission orbit inclination.
If the final orbit is circular, the software enforces the following two equality constraints
f = 0 and g = 0
f 2 + g2 = e
For program option 2, both lower and upper bounds for all modified equinoctial elements are set equal
to the user-defined final modified equinoctial orbital elements according to
pL = pU = pi f L = fU = f i
g L = gU = gi hL = hU = hi
k L = kU = ki
The following lower and upper bounds are applied to the spacecraft mass and the modified equinoctial
dynamic variables during the orbital transfer.
−1 f +1 − 1 g +1
−1 h +1 − 1 k +1
Finally, the three components of the unit thrust vector are constrained as
Technical discussion
In this computer program, the orbital motion of the spacecraft is modeled in the modified equinoctial
orbital elements coordinate system. Please consult Appendix A – Trajectory Modeling and Targeting in
the Modified Equinoctial Orbital Elements System for a definition of these orbital elements along with
the equations of motion in this system.
page 43
Propulsive Thrust
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 − m t where msci is the initial
mass of the spacecraft and m is the propellant flow rate.
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 )
Both steering angles are defined with respect to a local-vertical, local-horizontal (LVLH) system located
at the spacecraft. The in-plane pitch angle is positive above the “local horizontal” and the out-of-plane
yaw angle is positive in the direction of the angular momentum vector. The inverse tangent calculation
in the second equation is a four-quadrant operation.
The twoburn_sos software provides the steering angles and the components of the unit thrust vector in
both the inertial and modified equinoctial coordinate systems.
This section illustrates the twoburn_sos solution and trajectory graphics for a variable attitude,
medium-thrust LEO-to-ISS (International Space Station) orbit transfer. For this example, impulsive
delta-v guesses were determined using software that calculates an impulsive Hohmann transfer solution
for this problem.
The following is the first part of the input data file for this example.
page 44
****************************************
** two maneuver, finite-burn earth-orbit
** trajectory optimization
** program twoburn_sos
** leo2iss.in - April 16, 2012
****************************************
*****************************************
type of propulsive maneuver initial guess
*****************************************
1 = thrust duration
2 = delta-v magnitude
---------------------
2
-------------------------
first propulsive maneuver
-------------------------
--------------------------
second propulsive maneuver
--------------------------
thrust magnitude (newtons)
10000.0
-----------
coast phase
-----------
*****************
* INITIAL ORBIT *
*****************
page 45
argument of perigee (degrees)
0.0
********************************
initial orbit constraint options
********************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all initial orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
1
***************
* FINAL ORBIT *
***************
******************************
final orbit constraint options
******************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all final orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
3
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate gravity model
------------------------
2
The following are plots of the steering and trajectory characteristics for this example.
page 46
page 47
Here’s the main program output and verification for this example.
program twoburn_sos
===================
--------------------------------------
beginning of first propulsive maneuver
--------------------------------------
--------------------------------
end of first propulsive maneuver
--------------------------------
page 48
thrust duration 923.358576595192 seconds
15.3893096099199 minutes
------------------------
beginning of coast phase
------------------------
------------------
end of coast phase
------------------
---------------------------------------
beginning of second propulsive maneuver
---------------------------------------
---------------------------------
end of second propulsive maneuver
---------------------------------
page 49
rx (km) ry (km) rz (km) rmag (km)
0.326840206482D+04 -.508989721860D+04 -.294590599076D+04 0.672814000000D+04
SIMULATION SUMMARY
------------------
========================================
verification of optimal control solution
========================================
-------------------
final mission orbit
-------------------
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the twoburn_sos software.
page 50
sma (km) = semimajor axis in kilometers
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
The delta-v magnitude is determined using a cubic spline integration of the thrust acceleration data at
each collocation node.
The comma-separated-variable disk file is created by the odeprt subroutine and contains the following
information
time (sec) = mission elapsed time in seconds
page 51
period (min) = orbital period in minutes
“Survey of Numerical Methods for Trajectory Optimization”, John T. Betts, AIAA Journal of Guidance,
Control and Dynamics, Vol. 21, No. 2, March-April 1998, pp. 193-207.
“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.
page 52
CMATO 3 – Low-Thrust LEO-to-GEO Trajectory Optimization
This CMATO application is a Fortran computer program named leo2geo_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the continuous, single-
maneuver, finite-burn low Earth orbit (LEO) to geosynchronous Earth orbit (GEO) orbit transfer
optimization problem. The software attempts to maximize the final spacecraft mass. Since this
simulation involves a single propulsive maneuver, this is equivalent to minimizing the propellant mass
required for the orbital maneuver.
The SOS software 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:
• collocation and implicit integration
• adaptive mesh refinement
• sparse nonlinear programming
Additional information about the mathematical techniques and numerical methods used in the AMA_OC
software can be found in the book, Practical Methods for Optimal Control and Estimation Using
Nonlinear Programming by John. T. Betts, SIAM, 2010.
The leo2geo_sos 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 SOS software will use this information to automatically transcribe the user’s optimal control
problem and perform the optimization using a sparse nonlinear programming (NLP) method. The
leo2geo_sos software allows the user to select the type of initial guess, collocation method, and other
important algorithm control parameters.
page 53
Input file format and contents
The leo2geo_sos software is “data-driven” by a user-created text file. 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
font.
The following is a typical input file used by the leo2geo_sos computer program. This is a classic
LEO-to-GEO example taken from the paper, “Minimum-Time Low-Thrust Rendezvous and Transfer
Using Epoch Mean Longitude Formulation”, Jean A. Kechichian, Journal of Guidance, Control, and
Dynamics, Vol. 22, No. 3, May-June 1999. For this example, the initial true longitude is free. However,
the SOS solution includes the effect of propellant mass depletion due to thrusting while the example in
the technical paper assumes constant mass and therefore constant thrust acceleration. This example also
includes the effect of the Earth’s J 2 gravity term.
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.
***********************************************
** earth orbit trajectory optimization with SOS
** single phase continous-thrust maneuver
** program leo2geo - leo-to-geo orbit transfer
** j. kechichian example - leo2geo_jk.in
***********************************************
The first three program inputs are the initial spacecraft mass, thrust magnitude and specific impulse.
initial spacecraft mass (kilograms)
1000.0
The next six numerical inputs are the classical orbital elements of the initial orbit.
*****************
* INITIAL ORBIT *
*****************
The following input determines if the software will constrain or free the initial true longitude.
constrain initial true longitude (1 = yes, 2 = no)
2
The following five inputs are the user-defined classical orbital elements of the final orbit.
***************
* FINAL ORBIT *
***************
The next integer input defines the type of final orbit point constraints. Please see the “Problem setup”
section for additional information about this program item.
*****************************************
* type of final orbit point constraints *
-----------------------------------------
1 = modified equinoctial orbital elements (semimajor axis, ecc = 0, inc = 0)
2 = eci components of final state vector (hx, hy, hz, |r|, sin(gamma))
3 = all components of final classical orbital elements
------------------------------------------------------
2
The next program input tells the software what type of gravity model to use during the simulation.
Option 2 will include the oblateness gravity coefficient ( J 2 ) in the equations of motion.
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = j2 gravity model
--------------------
2
The next integer input defines the type of initial guess used to estimate the transfer time. Please see the
“initial guess” part of “Problem setup” section for additional information about this program item.
*******************************************
* type of initial guess for transfer time *
-------------------------------------------
1 = numerical integration (coplanar orbits)
2 = Edelbaum algorithm (non-coplanar orbits)
3 = user-defined
page 55
----------------
2
The following data item is the user’s initial guess for the transfer time, in hours. This input corresponds
to option 3 of the previous item.
********************************************************
* user-defined initial guess for transfer time (hours) *
********************************************************
4
The next integer input defines the type of initial guess to use for the simulation Please see the “Initial
guess” part of “Problem setup” section for additional information about this program item.
********************************
* initial guess/restart option *
********************************
1 = linear guess with tangential thrusting
2 = numerical integration with Edelbaum steering
3 = binary data file
---------------------
2
This next line contains the name of the binary data file used for the initial guess when the user selects
the binary data file option.
name of initial guess/restart input data file
leo2geo_jk.rsbin
The next two program inputs determine if a binary file is updated or created and the name of this file.
******************************************
* restart and solution data file options *
******************************************
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 SOS.
Options 2 and 3 allow the user to specify either the number of nodes or time step size of the data file.
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-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
50
The name of the solution data file is defined in this next line.
page 56
name of solution output file
leo2geo_jk.csv
The next series of program inputs are algorithm control options and parameters for the SOS software.
The first input is an integer that specifies the type of collocation method to use during the solution
process.
********************************
* algorithm control parameters *
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
4 = Runge-Kutta 4-stage
------------------------
1
The next input is an integer that defines the number of grid points to use for the initial guess.
number of grid points
100
The next input defines the relative error in the objective function.
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.
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.
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
500000
The next input is an integer that defines the maximum number of algorithm iterations.
maximum number of algorithm iterations
1000
The level of output from the SOS NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
page 57
The level of output from the SOS 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 SOS 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 SOS user’s manual. To ignore this
special output control, input the simple character string no.
*******************
user-defined output
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
Here is the numerical information computed by the leo2geo_sos computer program for this example.
===================
program leo2geo_ocs
===================
------------------------
beginning of finite burn
------------------------
page 58
sma (km) eccentricity inclination (deg) argper (deg)
0.700000000000D+04 0.615067684519D-16 0.285000000000D+02 0.000000000000D+00
------------------
end of finite burn
------------------
This first plot is a view of the transfer trajectory from a north pole viewpoint looking down on the
equatorial plane. The unit of each trajectory coordinate is Earth radii (ER).
page 59
The following are typical optimal control and orbital element plots for this example. The first two plots
illustrate the behavior of the pitch and yaw angles, and the components of the RTN unit thrust vector.
The next two plots illustrate the behavior of the semimajor axis and orbital eccentricity during the
continuous thrust orbit transfer.
The final two plots show the behavior of the orbital inclination and the linear variation of the spacecraft
mass.
page 60
The leo2geo_sos software will create a comma-separated-variable (csv) output file. This file contains
the state vector, orbital elements, and steering angles during the transfer trajectory. The software will
also display a summary of the final solution and a numerical verification of the optimal control solution.
The optimal control solution can be verified by numerically integrating the SOS-computed initial
conditions and optimal control solution for the unit thrust vector to the final time determined by the
Sparse Optimization Suite. This software uses a Runge-Kutta-Fehlberg 7(8) variable step size method to
integrate the orbital equations of motion.
The following is a typical display of the final solution and errors computed using the explicit numerical
integration method. The errors are the differences between the spacecraft’s final orbital elements and
the user-defined final orbit.
-------------------
program leo2geo_sos
-------------------
------------------------
beginning of finite burn
------------------------
page 61
0.360000000000D+03 0.105863244282D+03 0.105863244282D+03 0.971419368695D+02
------------------
end of finite burn
------------------
--------------------------------------------
integrated solution with sos optimal control
--------------------------------------------
eccentricity -3.837974172564255E-008
The solution to this classic orbit transfer problem requires a good initial guess for the transfer time along
with a reasonable guess for the dynamic variables during the orbit transfer.
The leo2geo_sos software implements three options for specifying the transfer time initial guess. The
first technique simply integrates the coplanar transfer orbit trajectory using tangential thrusting until the
final orbit radius is reached. The second method uses Edelbaum’s algorithm. The first method is best
for coplanar orbit transfers and the second method should be used for non-coplanar orbit transfers. The
third initial guess option is a user-specified transfer time.
For the first technique, the unit thrust vector for tangential steering during the numerical integration is
simply uT = ( 0 1 0 ) .
T
page 62
The Edelbaum algorithm is described in Chapter 14 of the book Orbital Mechanics by V. Chobotov and
the technical paper, “The Reformulation of Edelbaum's Low-thrust Transfer Problem Using Optimal
Control Theory” by J. A. Kechichian, AIAA-92-4576-CP. The original Edelbaum algorithm is
described in “Propulsion Requirements for Controllable Satellites”, ARS Journal, Aug. 1961, pp. 1079-
1089. This algorithm is valid for total inclination changes i given by 0 i 114.6 and assumes that
the thrust acceleration magnitude and spacecraft mass are both constant during the orbit transfer.
The initial thrust vector yaw angle 0 is given by the following expression
sin i
tan 0 = 2
V0
− cos i
Vf 2
where the speed on the initial circular orbit is V0 = r0 and the speed on the final circular orbit is
V f = rf . In these equations r0 = re + h0 is the geocentric radius of the initial orbit, rf = re + h f is the
geocentric radius of the final orbit, re is the radius of the Earth and is the gravitational constant of the
Earth. The initial altitude is h0 and the final altitude is h f .
The total velocity change required for a low-thrust orbit transfer is given by
V0 sin 0
V = V0 cos 0 −
tan i + 0
2
The total transfer time is given by t = V f where f is the thrust acceleration. This is the transfer time
used for the Edelbaum initial guess option in the leo2geo_sos software.
The initial guess for the dynamic variables is created by numerically integrating the equations of motion
from the initial conditions to each individual grid point. For better algorithm performance, the initial
grid points used by the leo2geo_sos software are equally distributed in true longitude instead of time.
This technique will group more grid points around perigee of the elliptical transfer orbit.
The dynamical equations of motion with true longitude L as the independent variable can be determined
from the following two expressions:
dz dL
z= = f (z)
dL dt
−1
dz dL 1
= f (z) = f (z)
dL dt L
page 63
The true longitudes of the grid points are computed from
( k − 1)
( M − 1) ( f
Lk = Li + L − Li ) k = 1, ,M
where Li and L f are the initial and final values of true longitude, and M is the number of user-specified
grid points.
During the creation of dynamic variables by numerical integration, the components of the unit thrust
vector are defined in terms of the in-plane pitch angle and the out-of-plane yaw angle as follows
According to the Edelbaum algorithm, the time evolution of the yaw angle is given by the following
expression
V0 sin 0
( t ) = tan −1
V0 cos 0 − f t
Problem setup
This section provides additional details about the leo2geo_sos software implementation.
The objective function or performance index J for this simulation is the mass of the spacecraft when it
reaches the final orbit and thrust has terminated. This is simply J = m f .
The value of the maxmin indicator in SOS tells the software whether the user is minimizing or
maximizing the performance index. The spacecraft mass at the initial time is fixed to the initial value
provided by the user.
At any point during the transfer trajectory, the scalar magnitude of the components of the unit thrust
vector is constrained as follows:
This formulation avoids problems that may occur when using thrust steering angles as control variables.
The software allows the use to either fix or free the initial true longitude. For an unconstrained initial
true longitude, the true longitude bounds are 0 L 2 . Otherwise, the initial true longitude is fixed to
the value L = ( + + )i .
page 64
Mission constraint “matching” at the final orbit
The leo2geo_sos software implements three techniques for “targeting” the final mission orbit. The
correct option to use depends on the characteristics of the final mission orbit.
For final orbits that are circular and equatorial, the set of final constraints are specified in terms of the
final modified equinoctial elements or dynamic variables according to
p = pf f f = g f = hf = k f = 0
The f subscript indicates values on the user-specified final orbit. This set of constraints or boundary
conditions follows from the orbital element definitions
p = a (1 − e 2 ) f = e cos ( + ) g = e sin ( + )
These boundary conditions are enforced using lower and upper bounds on the dynamic variables at the
final time.
For final orbits that may be near-circular and/or inclined, the final mission constraints are enforced using
point functions. This set of point functions is given by
hx = hx f hy = hy f hz = hz f r = rf sin = sin f
where hx , h y , hz are the inertial components of the angular momentum vector, r is the geocentric radius
and is the flight path angle. As noted previously, the f subscript indicates mission values on the user-
specified final orbit.
A third program option allows the user to constrain a classical orbital element set consisting of the
semimajor axis, orbital eccentricity and inclination using point functions. This set of mission constraints
is
a = af e = ef i = if
The following lower and upper bounds are applied to the spacecraft mass and the modified equinoctial
dynamic variables during the orbital transfer.
0.05msci msc 1.05msci 1.1 p f p 0.9 pi
−1 f +1 − 1 g +1 − 1 h +1
−1 k +1 0 L 200 2
where msci is the initial spacecraft mass, and pi is the semi-parameter of the initial orbit and p f is the
semi-parameter of the final orbit. The upper bound on true longitude L allows for a maximum of 200
complete orbits during the transfer.
page 65
Finally, the components of the unit thrust vector are constrained as follows:
−1.1 ur +1.1 − 1.1 ut +1.1 − 1.1 un +1.1
Technical discussion
In this computer program, the orbital motion of the spacecraft is modeled in the modified equinoctial
orbital elements coordinate system. Please consult Appendix A – Trajectory Modeling and Targeting in
the Modified Equinoctial Orbital Elements System for a definition of these orbital elements along with
the equations of motion in this system.
T
aT = uˆ T
m
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.
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. This differential equation and the modified equinoctial
differential equations are included in the right-hand-side subroutine required by SOS. The spacecraft
mass at any mission elapsed time t is given by m ( t ) = msci − m t 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
The pitch and yaw angles can be determined from the components of the unit thrust vector according to
= sin −1 ( uT
r
) = tan −1 ( uT , uT
n t
)
The pitch angle is positive above the “local horizontal” and the yaw angle is positive in the direction of
the angular momentum vector of the transfer orbit.
page 66
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the leo2geo_sos software.
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
The delta-v is determined using a cubic spline integration of the thrust acceleration data at each
collocation node.
“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.
“Direct Trajectory Optimization Using Nonlinear Programming and Collocation”, C. R. Hargraves and
S. W. Paris, AIAA Journal of Guidance, Control and Dynamics, Vol. 10, No. 4, July-August, 1987, pp.
338-342.
“Survey of Numerical Methods for Trajectory Optimization”, John T. Betts, AIAA Journal of Guidance,
Control and Dynamics, Vol. 21, No. 2, March-April 1998.
page 68
CAMTO 4 – Finite-Burn, Earth Orbit Rendezvous Trajectory Optimization
This CMATO application is a Fortran computer program named rendezvous_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the classic Earth orbit
rendezvous trajectory optimization problem. The software models the trajectory as a mission consisting
of one or more maneuvers separated by coasting periods. The propulsive phases are simulated as
variable thrust, finite-burn propulsive maneuvers. This computer program attempts to maximize the
spacecraft mass at the end of the propulsive maneuvers.
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 rendezvous_sos 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 optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The rendezvous_sos software allows the user to select the type of initial guess, collocation method,
and other important algorithm control parameters.
page 69
Input file format and contents
The rendezvous_sos software is “data-driven” by a user-created text file. 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 font. This example attempts to optimize the maneuvers
required to perform a rendezvous between a spacecraft in a circular low Earth orbit (LEO) and a second
spacecraft in a typical medium altitude Earth orbit (MEO).
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.
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 earth-orbit rendezvous
** trajectory optimization
** program rendezvous_sos
** leo2meo_10k.in - April 10, 2012
*************************************
The first input is an integer that tells the simulation what type of trajectory to model.
trajectory type (1 = flyby, 2 = rendezvous)
2
The next three inputs define an initial guess, lower bound and upper bound for the total simulation
duration in minutes. Identical values for the lower and upper bounds will create a fixed time mission.
initial guess for total simulation duration (minutes)
85.0
The next input is the initial mass of the entire spacecraft in kilograms.
initial spacecraft mass (kilograms)
8000.0
This next integer input defines the type of initial guess for the propulsive maneuver.
********************************
type of propulsive initial guess
********************************
1 = thrust duration
2 = delta-v magnitude
---------------------
2
page 70
The next four inputs define the thrust magnitude and the specific impulse of the upper stage or
spacecraft propulsion system, and the user’s initial guess for either the delta-v or thrust duration for the
first maneuver.
-------------------------
first propulsive maneuver
-------------------------
thrust magnitude (newtons)
10000.0
The next six inputs define the classical orbital elements of the initial park orbit. These elements are
defined with respect to an Earth-centered-inertial (ECI) coordinate system.
*****************
* INITIAL ORBIT *
*****************
The next six inputs define the classical orbital elements of the final mission orbit. These elements are
defined with respect to an Earth-centered-inertial (ECI) coordinate system.
***************
* FINAL ORBIT *
***************
page 71
right ascension of the ascending node (degrees)
55.0
This integer input specifies the type of gravity model to use during the simulation. Option 2 will use a
J 2 gravity model in the spacecraft equations of motion.
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate gravity model
------------------------
2
This next input defines the type of initial guess to use. Please see the Creating an initial guess 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 options *
*************************
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 binary initial guess data file
leo2meo_10k.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 solution data file to create.
**********************************************
* 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 input defines either the number of data points or the time step size of the data
output in the solution file.
page 72
number of user-defined nodes or print step size in solution data file
25
The name of the comma-separated-variable solution data file is defined in this next line.
name of solution output file
leo2heo_10k.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 input defines the relative error in the objective function.
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.
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.
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
10000
The next input is an integer that defines the maximum number of algorithm iterations.
maximum number of algorithm iterations
10000
The level of output from the NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
page 73
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 Sparse Optimization Suite 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
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
The last series of user 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 rendezvous_sos software. Please consult Appendix J – Sparse
Optimization Suite Configuration File for additional information about these files.
***************************************
* optimal control configuration options
***************************************
page 74
Optimal control solution
The following is the optimal control solution for this example. The output includes the time and orbital
characteristics at the beginning and end of each mission phase.
program rendezvous_sos
======================
rendezvous trajectory
---------------------------
beginning of maneuver phase
---------------------------
---------------------
end of maneuver phase
---------------------
The following program output is the spacecraft mass, the propellant mass consumed, the actual thrust
duration for all the maneuvers, and the accumulated delta-v for the mission.
spacecraft mass 3339.96227073119 kilograms
page 75
propellant mass 4660.03772926881 kilograms
This section of the numeric results summarizes the time and orbital conditions at the beginning and end
of the transfer orbit coast.
------------------------
beginning of coast phase
------------------------
------------------
end of coast phase
------------------
After the simulation is complete, the software will display a simulation summary like the following
SIMULATION SUMMARY
==================
page 76
The rendezvous_sos computer program will also create an output file named orbits.csv. This file
contains the Earth-centered inertial (ECI) position and velocity vectors of the park orbit and final
mission orbit.
The following is the graphics display for this example. The initial orbit trace is red, the final orbit is
blue and the transfer orbit is black. The dimensions are Earth radii (ER) and the plot is labeled with an
ECI coordinate system where green is the x-axis, red is the y-axis and blue is the z-axis.
The following two plots illustrate the evolution of the pitch and yaw steering angles and the throttle
setting during the two propulsive maneuvers determined by the software.
page 77
The next two plots illustrate the behavior of the inertial right ascension and declination, and the
accumulated delta-v and throttle setting during the simulation.
The final pair of plots illustrate the behavior of the semimajor axis, eccentricity, inclination, and the
right ascension of the ascending node (RAAN) during the simulation.
The optimal control solution determined by the Sparse Optimization Suite can be verified by
numerically integrating the orbital equations of motion with the OC-computed 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 rendezvous_sos computer program uses a Runge-Kutta-Fehlberg 7(8)
variable step size method to integrate the orbital equations of motion.
The following is a display of the final solution computed using this explicit numerical integration
method.
page 78
verification of optimal control solution
========================================
The software allows the user to input either a delta-v or thrust duration initial guess. For a delta-v initial
guess, the software estimates the thrust duration using the rocket equation. 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 (or final) mass of the spacecraft
and the exhaust velocity as follows
− V
VV
m p = mi 1 − e Vex = m f e ex − 1
In these equations
mi = initial mass
m f = final 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
page 79
The software uses a tangential thrusting steering method to generate an initial guess for the optimal
trajectory. For tangential thrusting, the unit thrust vector in the modified equinoctial frame is simply
uT = 0 1 0 .
T
The dynamic variables and control variables at each grid point are determined by the Sparse
Optimization Suite by setting the initial guess option INIT(1) = 6 with INIT(2) = 2. These
program options create an initial guess from the numerical integration of the equations programmed in
the oderhs subroutine. The number and location of the initial collocation nodes are determined from
the variable step-size numerical integration. The INIT(2) = 2 option tells the program to use a
Dormand-Prince numerical integration method. Please note this algorithm creates a coplanar initial
guess.
If the software cannot find a feasible solution, try increasing the guess for the thrust duration or the
value for the magnitude of the delta-v.
Binary restart data files can also be used to initialize a rendezvous_sos simulation. A typical
scenario is
This technique works well provided the two simulations are not dramatically different. Sometimes it
may be 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 provides additional details about the software implementation. It explains such things as
point and path constraints, the performance index and the numerical technique used to create an initial
guess for the software.
For this two-point boundary value problem (TPBVP), both lower and upper bounds for all modified
equinoctial elements are set equal to the user-defined initial modified equinoctial orbital elements as
follows
pL = pU = pi f L = fU = f i
g L = gU = gi hL = hU = hi
k L = kU = ki LL = LU = Li
In Sparse Optimization Suite terminology, these constraints or boundary conditions are called point
functions.
page 80
Performance index – maximize final spacecraft mass
The objective function or performance index J for this simulation is the mass of the spacecraft at the end
of the mission. This is simply J = m f .
The value of the maxmin indicator tells the software whether the user is minimizing or maximizing the
performance index. The spacecraft mass at the initial time is fixed to the user-defined initial value.
For variable attitude steering, the scalar magnitude of the components of the unit thrust vector at any
time during the simulation is constrained as follows:
The final mission constraints enforced by the software are determined by the trajectory type. For the
flyby trajectory option, the final orbit position vector is constrained to the values corresponding to the
user-defined final orbit. The rendezvous trajectory option adds the final three components of the inertial
velocity vector to this constraint set.
The following lower and upper bounds are applied to the spacecraft mass and the modified equinoctial
dynamic variables during the orbital transfer.
−1 f +1 − 1 g +1
−1 h +1 − 1 k +1
For variable attitude steering, the three components of the unit thrust vector are constrained as follows:
−1.1 ur +1.1
−1.1 ut +1.1
−1.1 un +1.1
Technical Discussion
In this computer program, the orbital motion of the spacecraft is modeled in the modified equinoctial
orbital elements coordinate system. Please consult Appendix A – Trajectory Modeling and Targeting in
the Modified Equinoctial Orbital Elements System for a definition of these orbital elements along with
the equations of motion in this system.
page 81
Propulsive Thrust
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 ) = msc − m t where msc is the initial mass of the spacecraft and m is the propellant flow
i i
rate.
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
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 ( )
Both steering angles are defined with respect to a local-vertical, local-horizontal (LVLH) system located
at the spacecraft. The in-plane pitch angle is positive above the “local horizontal” and the out-of-plane
yaw angle is positive in the direction of the angular momentum vector. The inverse tangent calculation
in the second equation is a four-quadrant operation. Please consult Appendix G – Aerospace Trajectory
Coordinates and Time Systems for additional information.
The rendezvous_sos software provides the steering angles and the components of the unit thrust
vector in both the inertial and modified equinoctial coordinate systems. The following section
summarizes the inertial-to/from-modified equinoctial coordinate transformations and the calculation of
the inertial unit thrust vector in terms of right ascension and declination angles.
In this computer program, the components of the inertial unit thrust vector are defined in terms of the
right ascension and the declination angle as follows
page 82
Finally, the right ascension and declination angles can be determined from the components of the ECI
This section summarizes a flyby mission from LEO to MEO. This example starts and ends at the same
orbits as the previous example. However, the propulsive thrust is 5000 Newtons and the total simulation
time is fixed to 100 minutes. Furthermore, since this is a flyby trajectory, the orbit transfer only matches
the three components of the position vector of the final mission orbit at the final time.
Here is the initial part of the simulation definition input file for this example.
*************************************
** finite-burn earth-orbit rendezvous
** trajectory optimization
** program rendezvous_sos
** leo2meo_flyby.in - April 10, 2012
*************************************
*****************************************
type of propulsive maneuver initial guess
*****************************************
1 = thrust duration
2 = delta-v magnitude
---------------------
2
-------------------
propulsive maneuver
-------------------
page 83
The program output for this example is next.
program rendezvous_sos
======================
flyby trajectory
---------------------------
beginning of maneuver phase
---------------------------
---------------------
end of maneuver phase
---------------------
------------------------
beginning of coast phase
------------------------
page 84
------------------
end of coast phase
------------------
SIMULATION SUMMARY
==================
Here are plots of the behavior of the control variables and throttle setting for this example.
page 85
Contents of the simulation summary and csv files
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the rendezvous_sos software.
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
page 86
vmag (km/sec) = scalar magnitude of the spacecraft’s velocity vector in kilometers per
second
The accumulated delta-v is determined using a cubic spline integration of the thrust acceleration data at
each collocation node.
The comma-separated-variable disk file is created by the odeprt subroutine and contains the following
information.
time (sec) = simulation time since ignition in seconds
page 87
rx (km) = x-component of the spacecraft’s position vector in kilometers
rp1-x (er) = x-component of the initial orbit position vector in earth radii
rp1-y (er) = y-component of the initial orbit position vector in earth radii
rp1-z (er) = z-component of the initial orbit position vector in earth radii
rp2-x (er) = x-component of the final orbit position vector in earth radii
rp2-y (er) = y-component of the final orbit position vector in earth radii
rp2-z (er) = z-component of the final orbit position vector in earth radii
An Introduction to the Mathematics and Methods of Astrodynamics, Richard H. Battin, AIAA Education
Series, 1987.
“Survey of Numerical Methods for Trajectory Optimization”, John T. Betts, AIAA Journal of Guidance,
Control and Dynamics, Vol. 21, No. 2, March-April 1998, pp. 193-207.
“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 Maneuvers of Orbital Transfer Vehicles”, John M. Hanson, Ph.D. Thesis, University of
Michigan, Department of Aerospace Engineering, 1983.
page 88
CMATO 5 – Atmospheric Reentry Trajectory Optimization
This CAMTO application is a Fortran computer program named reentry_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the atmospheric reentry
trajectory optimization problem. The trajectory is modeled as a single phase with user-defined initial
and final boundary conditions. This computer attempts to maximize either the crossrange or downrange
distance. The type of optimization is selected by the user.
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 reentry_sos 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 optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The reentry_sos software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 89
Input file format and contents
The reentry_sos software is “data-driven” by a user-created text file. 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 font.
This data file defines a Space Shuttle maximum cross range reentry trajectory simulation with a
maximum heat rate path constraint. For this example, the Terminal Area Energy Management (TAEM)
conditions are fixed. Furthermore, all flight conditions except flight path angle at the Entry Interface
(EI) are also fixed. The flight path angle at the Entry Interface is bounded according to −10 −0.5
and the software selects the best flight path angle for maximum cross range subject to the heat rate path
constraint. The bank angle is constrained according to −89 +1 which forces the vehicle to bank
left while maximizing the cross-range.
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.
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.
*******************************************
atmospheric reentry trajectory optimization
simulation definition data file
April 23, 2012
STS maximum crossrange w/ qdot constraint
*******************************************
The first program input is an integer that defines the type of mission to simulate.
*******************
* simulation type *
*******************
1 = maximize downrange distance
2 = maximize crossrange distance
---------------------------------
2
This section allows the user to define the vehicle weight, aerodynamic reference area and the nose radius
used in the aero-heating calculations.
***************************************************
* vehicle weight and aerodynamics characteristics *
***************************************************
page 90
The following series of data items are reserved for user-defined initial conditions. To fix one or more
initial conditions, the user should input identical lower and upper bounds. To free or un-constrain one or
more initial states set the lower and/or upper bounds to 1.0d99. Please note the units and valid data
range for each item.
****************************************
* initial flight conditions and bounds *
****************************************
NOTE 1: set upper and lower bounds to
the initial value to constrain or
"fix" a flight condition.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
initial flight path angle (-90 <= fpa <= +90; degrees)
-1.0
upper bound for initial flight path angle (-90 <= fpa <= +90; degrees)
-0.5
lower bound for initial flight path angle (-90 <= fpa <= +90; degrees)
-10.0
upper bound for initial flight azimuth (0 <= azimuth <= 360; degrees)
90.0
lower bound for initial flight azimuth (0 <= azimuth <= 360; degrees)
90.0
upper bound for initial declination (-90 <= declination <= +90; degrees)
0.0
page 91
lower bound for initial declination (-90 <= declination <= +90; degrees)
0.0
upper bound for initial east longitude (0 <= longitude <= 360; degrees)
0.0
lower bound for initial east longitude (0 <= longitude <= 360; degrees)
0.0
The following series of data items allow the user to define the final flight conditions. To fix one or more
conditions, the user should input identical lower and upper bounds. To free or un-constrain one or more
final states set the lower and/or upper bounds to 1.0d99. Again, please note the units and valid data
range for each item.
**************************************
* final flight conditions and bounds *
**************************************
NOTE 1: set upper and lower bounds
to the final value to constrain or
"fix" a flight condition.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
final flight path angle (-90 <= fpa <= +90; degrees)
-5.0
upper bound for final flight path angle (-90 <= fpa <= +90; degrees)
-5.0
lower bound for final flight path angle (-90 <= fpa <= +90; degrees)
-5.0
page 92
upper bound for final flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
lower bound for final flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
upper bound for final declination (-90 <= declination <= +90; degrees)
1.0d99
lower bound for final declination (-90 <= declination <= +90; degrees)
1.0d99
upper bound for final east longitude (0 <= longitude <= 360; degrees)
1.0d99
lower bound for final east longitude (0 <= longitude <= 360; degrees)
1.0d99
The next series of data inputs define lower and upper bounds on the state variables during the mission
phase. To free or un-constrain one or more states set the lower and/or upper bounds to 1.0d99.
****************************************************************
* upper and lower bounds on the flight conditions during phase *
****************************************************************
NOTE: set bound to 1.0d99 to ignore
-----------------------------------
upper bound for flight path angle (-90 <= fpa <= +90; degrees)
+1.0
lower bound for flight path angle (-90 <= fpa <= +90; degrees)
-89.0
upper bound for flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
lower bound for flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
upper bound for declination (-90 <= declination <= +90; degrees)
+89.0
lower bound for declination (-90 <= declination <= +90; degrees)
-89.0
upper bound for east longitude (0 <= longitude <= 360; degrees)
1.0d99
page 93
lower bound for east longitude (0 <= longitude <= 360; degrees)
1.0d99
This section of the input file defines the user’s initial guess and bounds for the control variables. To free
or un-constrain one or more control variables set the lower and/or upper bounds to 1.0d99.
**************************************
* initial flight controls and bounds *
**************************************
NOTE 1: set upper and lower bounds
to the initial value to constrain
or "fix" a flight control.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
This section of the input file defines the final guesses and bounds for the control variables. To free one
or more control variables set the lower and/or upper bounds to 1.0d99.
************************************
* final flight controls and bounds *
************************************
NOTE 1: set upper and lower bounds
to the final value to constrain
or "fix" a flight control.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
page 94
This section of the input file defines the bounds for the control variables during the mission phase. To
free or un-constrain one or more control variables, set the lower and/or upper bounds to 1.0d99.
**************************************************************
* upper and lower bounds on the flight controls during phase *
**************************************************************
NOTE: set bound to 1.0d99 to ignore
-----------------------------------
This next section allows the user to define and enforce one or more path constraints during the reentry
phase. These constraints are enforced at all points along the reentry trajectory. The user should be
careful not to enforce constraints that are inconsistent with either the initial and/or final boundary
conditions
**********************
* flight constraints *
**********************
dynamic pressure upper bound constraint value (pounds per square foot)
250.0d0
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 options *
*************************
1 = numerical integration
2 = binary data file
---------------------
1
page 95
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 data file to use.
name of binary initial guess data file
sts_cr.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 solution data file to create.
******************************************
type of comma-delimited solution data file
******************************************
1 = SOS-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
1
For options 2 or 3, this 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
10.0
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.
*********************************
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
reentry trajectory.
number of initial guess grid points to use
25
The name of the comma-separated-variable solution data file is defined in this next line.
name of solution output file
sts_cr.csv
The next series of program inputs are user-defined algorithm control options and parameters for the
Sparse Optimization Suite.
page 96
****************************
algorithm control parameters
****************************
The next input defines the relative error in the solution of the differential equations.
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.
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
100000
The next input is an integer that defines the maximum number of algorithm iterations.
maximum number of algorithm iterations
10000
The level of output from the NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
***************************
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
The level of output from the Sparse Optimization Suite 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
page 97
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
-------------------
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 reentry_sos software. Please consult Appendix J – Sparse
Optimization Suite Configuration File for additional information about these files.
***************************************
* optimal control configuration options
***************************************
The software also requires a simple ascii data file named tutility.dat that defines the fundamental
constants to use during the simulation. The following is the companion data file for this example. If the
user provides a value of zero for the Earth’s rotation rate, the simulation results will be with respect to a
non-rotating Earth.
**************************
simulation environment and
planet/utility constants
**************************
page 98
atmospheric surface density (slugs/feet**3)
0.0023765d0
The user’s input for j2 controls the type of gravity model used during the simulation.
maximize crossrange
The following are trajectory characteristics plots created from the user-defined summary file. The first
two plots illustrate the behavior of the flight controls and the flight path and azimuth angles during the
atmospheric reentry.
page 99
This next two plots summarize the altitude and velocity of the vehicle, and the heat rate and heat load as
a function of time since the entry interface (EI).
The final two plots illustrate the behavior of the crossrange, downrange, latitude and longitude of the
vehicle during the reentry.
page 100
Verification of the optimal control solution
The optimal control solution determined by the software can be verified by numerically integrating the
flight path equations of motion with the optimal control solution and the initial entry interface conditions
determined by the SOS software. This is equivalent to solving an initial value problem (IVP) that uses
the optimal control angle-of-attack and bank angle solution.
The following is a display of the final solution computed using this explicit numerical integration
method.
========================================
verification of optimal control solution
========================================
The reentry_sos computer program creates a linear initial guess for the flight parameters and
controls. It does this using the initial and final values for the flight path coordinates, angle of attack and
bank angles provided by the user. The number of grid points in this initial guess is also provided by the
user in the simulation definition data file.
Problem setup
This section provides additional details about the reentry_sos software implementation. It explains
such things as path constraints and the performance index options.
Performance index
For the maximum cross-range and downrange program options, the performance index is set equal to
the predicted cross-range or downrange angles at the end of the simulation. These items are computed
as final point constraints in the odepf subroutine required by the Sparse Optimization Suite.
The cross-range angle is determined from the following expression which can be derived from spherical
trigonometry relationships.
sin = − sin 1 sin 2 cos 1 cos − cos 1 cos 1 sin + sin 1 cos 2 sin 1
page 101
sin = − cos 1 sin 2 cos 1 cos + sin 1 cos 1 sin + cos 1 cos 2 sin 1
where
1 = geocentric declination of the initial point
1 = flight azimuth at the initial point
2 = geocentric declination of the final point
= 2 − 1
Path constraints
This section summarizes how the software computes the heat rate and load factor trajectory path
constraints.
Heat rate
q qmax
Load factor
n nmax
where nmax is the user-defined value of the maximum load factor. The instantaneous load factor is
determined using the following expression
L2 + D 2
n=
W
where L is the lift force, D is the drag force and W is the vehicle weight.
Technical discussion
This scientific simulation models the re-entry trajectory using flight path equations of motion. The
equations of motion in this system are summarized in Appendix B – Trajectory Modeling in the Flight
Path System. This appendix also includes important transformations between Earth-centered-inertial
(ECI) and flight path coordinates. The geodetic coordinates used in this simulation can be found in
Appendix G – Aerospace Trajectory Coordinates and Time Systems.
page 102
Aerodynamic characteristics
The aerodynamic model implemented in this software is a simple curve fit of the lift and drag
coefficients of the Space Shuttle as a function of angle-of-attack. The lift and drag coefficients for this
vehicle model are
CL = CL0 + CL1
The current value of the heat rate is computed using Chapman’s stagnation point heat rate equation
according to
3.15
dq 17,600 V BTU
q= = 2
dt RN V0 0 ft − sec
where
RN = nose radius (feet)
q ( t ) dt .
t2
The heat load at any mission elapsed time is determined from qL =
t1
Atmosphere model
This section summarizes the optimal control solution for a typical maximum downrange example. In
this simulation, the initial altitude is 260,000 feet and the initial speed is 20,600 feet/second. The bank
angle was bounded according to −89 +89 and the heat rate mission constraint was 80 BTU/ft2-
second. The vehicle aerodynamics and mass properties are the same as the previous example.
maximize downrange
========================================
verification of optimal control solution
========================================
The following are graphic displays of the important control and trajectory characteristics for this
maximum downrange example.
page 104
As expected, there is little change in the bank and azimuth angles during the reentry.
As expected, there is little change in both the cross-range distance and latitude during the mission.
page 105
This final plot illustrates the fact that after satisfying the heat rate mission constraint, the vehicle wants
to fly at maximum lift-to-drag (L/D) for this maximum downrange mission.
This section is a summary of the information contained in the CSV data file produced by the
reentry_sos software. The user-defined, comma-separated-variable disk file is created by the
odeprt Fortran subroutine and contains the following information.
page 106
drag coefficient = drag coefficient (non-dimensional)
velocity rate (fps/s) = rate of change of velocity in feet per second per second
fpa rate (dps) = rate of change of flight path angle in degrees per second
azimuth rate (dps) = rate of change of azimuth angle in degrees per second
The accumulated heat load is determined from a cubic spline integration of the heat rate at all
collocation nodes of the converged, optimized trajectory. The rate of change of the flight variables is
determined from the flight path equations of motion.
Hypersonic and Planetary Flight Mechanics, N. X. Vinh, R. D. Culp, and A. Busemann, University of
Michigan Press, 1980.
“Solving the Optimal Control Problem Using a Nonlinear Programming Technique Part 3: Optimal
Shuttle Reentry Trajectories”, K. Zondervan, T. Bauer, J. Betts and W. Huffman, AIAA 84-2039.
“Optimum Skip Trajectories Over a Rotating Planetary Atmosphere”, N. X. Vinh, IAF-98-A.1.03, 49th
International Astronautical Congress, Sept 28-Oct 2, 1998.
“Asymptotic Analysis of Quasi-Equilibrium Glide in Lifting Entry Flight”, Ping Lu, AIAA 2005-6128,
AIAA Atmospheric Flight Mechanics Conference and Exhibit, 15-18 August 2005.
page 107
CMATO 6 – Aero-assist Trajectory Optimization
This CMATO application is a Fortran computer program named aeroassist_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the aero-assist
trajectory optimization problem. The trajectory is modeled as a single phase with several types of user-
defined initial and final boundary conditions. The software attempts to maximize the speed of the
vehicle at atmospheric exit or maximize the orbital plane change during the atmospheric phase of the
mission. The type of optimization is selected by the user.
The Sparse Optimization Suite software 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 software can be found in the book, Practical Methods for Optimal Control and
Estimation Using Nonlinear Programming by John. T. Betts, SIAM, 2010.
The aeroassist_sos 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 software will use this information to automatically transcribe the user’s
problem and perform the optimization using a sparse nonlinear programming method.
The software allows the user to select the type of collocation method and other important algorithm
control parameters.
page 108
Input file format and contents
The aeroassist_sos software is “data-driven” by a user-created text file. 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 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.
The following data file defines a simulation that maximizes the speed at atmospheric exit while
enforcing a heat rate path constraint. The simulation starts in a geosynchronous equatorial orbit (GEO)
and finishes in an elliptical low Earth orbit (LEO) with a final orbital inclination of 28.5 degrees. The
heat-rate path constraint enforces a value <= 600 BTU/foot2-second.
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.
********************************************************
aeroassist trajectory optimization
simulation definition data file ==> geo2leo_max_speed.in
geo-to-leo w/ plane change and aeroheating constraints
maximize speed at atmospheric exit - June 9, 2011
********************************************************
The first program input is an integer that defines the type of entry interface conditions to use. Please
consult the “Problem setup” section later in this document for an explanation of these three program
options.
***********************
initial conditions type
***********************
1 = user input of flight path coordinates at entry interface
2 = derived from deorbit maneuver; fixed entry conditions
3 = derived from deorbit maneuver; bounded entry conditions
------------------------------------------------------------
3
The next program input is an integer that defines the type of mission to simulate. Please note that
program option 0 (no optimization) will solve the two-point boundary value problem (TPBVP).
***************
simulation type
***************
0 = no optimization
1 = maximize final speed
2 = maximize inclination change
--------------------------------
1
This section allows the user to define the vehicle weight, aerodynamic reference area, the nose radius
used in the aero-heating calculations, and other vehicle aerodynamic properties.
***********************************************
vehicle weight and aerodynamics characteristics
page 109
***********************************************
The next set of inputs defines the conditions at the deorbit point in the initial circular orbit. The calendar
date and universal time are required in order to transform coordinates.
******************
deorbit conditions
******************
The following series of data items are reserved for the initial conditions at the entry interface (EI) or
point of atmospheric entry. To constrain one or more initial conditions, the user should input identical
lower and upper bounds. To free or un-constrain one or more initial states, set the lower and/or upper
bounds to 1.0d99. Please note the units and valid data range for each item.
*************************************************
flight conditions and bounds at atmospheric entry
*************************************************
NOTE 1: set upper and lower bounds to
the initial value to constrain or
"fix" a flight condition.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
page 110
upper bound for initial time (seconds)
0.0
initial flight path angle (-90 <= fpa <= +90; degrees)
-4.0
upper bound for initial flight path angle (-90 <= fpa <= +90; degrees)
-0.5
lower bound for initial flight path angle (-90 <= fpa <= +90; degrees)
-10.0
upper bound for initial flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
lower bound for initial flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
upper bound for initial declination (-90 <= declination <= +90; degrees)
1.0d99
lower bound for initial declination (-90 <= declination <= +90; degrees)
1.0d99
upper bound for initial east longitude (0 <= longitude <= 360; degrees)
0.0
lower bound for initial east longitude (0 <= longitude <= 360; degrees)
0.0
The following series of data items allow the user to define the flight conditions at atmospheric exit. To
constrain one or more conditions, the user should input identical lower and upper bounds. To free or un-
constrain one or more final states, set the lower and/or upper bounds to 1.0d99. Please note the units
and valid data range for each item.
page 111
************************************************
flight conditions and bounds at atmospheric exit
************************************************
NOTE 1: set upper and lower bounds
to the final value to constrain or
"fix" a flight condition.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
final flight path angle (-90 <= fpa <= +90; degrees)
1.25
upper bound for final flight path angle (-90 <= fpa <= +90; degrees)
+20.0
lower bound for final flight path angle (-90 <= fpa <= +90; degrees)
-20.0
upper bound for final flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
lower bound for final flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
upper bound for final declination (-90 <= declination <= +90; degrees)
1.0d99
lower bound for final declination (-90 <= declination <= +90; degrees)
1.0d99
page 112
upper bound for final east longitude (0 <= longitude <= 360; degrees)
1.0d99
lower bound for final east longitude (0 <= longitude <= 360; degrees)
1.0d99
The next series of data inputs define lower and upper bounds on the state variables during the aero-assist
phase. To free or un-constrain one or more states, set the lower and/or upper bounds to 1.0d99.
************************************************************
upper and lower bounds on the flight conditions during phase
************************************************************
NOTE: set bound to 1.0d99 to ignore
-----------------------------------
upper bound for flight path angle (-90 <= fpa <= +90; degrees)
+20.0
lower bound for flight path angle (-90 <= fpa <= +90; degrees)
-20.0
upper bound for flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
lower bound for flight azimuth (0 <= azimuth <= 360; degrees)
1.0d99
upper bound for declination (-90 <= declination <= +90; degrees)
1.0d99
lower bound for declination (-90 <= declination <= +90; degrees)
1.0d99
upper bound for east longitude (0 <= longitude <= 360; degrees)
1.0d99
lower bound for east longitude (0 <= longitude <= 360; degrees)
1.0d99
This section of the input file defines the initial guesses and bounds for the control variables. To free or
un-constrain one or more control variables, set the lower and/or upper bounds to 1.0d99.
**********************************
initial flight controls and bounds
**********************************
NOTE 1: set upper and lower bounds
to the initial value to constrain
or "fix" a flight control.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
page 113
upper bound for initial normalized lift coefficient
+2.0
This section of the input file defines the final guesses and bounds for the control variables. To free one
or more control variables, set the lower and/or upper bounds to 1.0d99.
********************************
final flight controls and bounds
********************************
NOTE 1: set upper and lower bounds
to the final value to constrain
or "fix" a flight control.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
This section of the input file defines the bounds for the control variables during the aero-assist phase.
To free or un-constrain one or more control variables, set the lower and/or upper bounds to 1.0d99.
**********************************************************
upper and lower bounds on the flight controls during phase
**********************************************************
NOTE: set bound to 1.0d99 to ignore
-----------------------------------
page 114
This next section allows the user to define and enforce one or more point and path constraints during the
atmospheric phase. Path constraints are enforced at all points along the trajectory and point constraints
are enforced at atmospheric exit only. The user should be careful not to enforce constraints that are
inconsistent with either the initial and/or final boundary conditions. For example, while maximizing the
final orbital inclination do not enforce an orbital inclination point constraint.
******************
flight constraints
******************
dynamic pressure upper bound constraint value (pounds per square foot)
700.0d0
The type of trajectory initial guess or restart is specified by the next integer input. Program option 1 will
use a simple linear initial guess created from the initial and final values provided by the user. Option 2
will read and use a binary file to initialize the simulation. Be sure to create a binary file first.
****************************
initial guess/restart option
****************************
1 = linear guess
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 binary restart file
geo2leo_max_speed.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 options 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 115
Sparse Optimization Suite. Options 2 and 3 allow the user to specify either the number of nodes (option
2) or time step size of the data file (option 3).
******************************************
type of comma-delimited solution data file
******************************************
1 = SOS-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 (option 2) or the time step size
of the data output in the solution file (option 3).
number of user-defined nodes or print step size in solution data file
10.0
The software also creates a comma-separated-variable (csv) ASCII data file that contains the optimal
control solution and many other flight parameters. The name of this output file is specified in the next
line of information.
name of solution output file
geo2leo_max_speed.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.
*********************************
discretization/collocation method
*********************************
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
The next input defines the relative error in the solution of the differential equations.
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.
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
100000
The next input is an integer that defines the maximum number of algorithm iterations.
page 116
maximum number of algorithm iterations
10000
The level of output from the NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
***************************
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
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 software
user’s manual. To ignore this special output control, input the simple character string no.
*******************
user-defined output
-------------------
input no to ignore
*******************
a0b0c0d0e0f0g0h0i0j1k0l0m0n0o0p0q0r0
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 aeroassist_sos software. Please consult Appendix J – Sparse
Optimization Suite Configuration File for information about this file.
***************************************
* optimal control configuration options
***************************************
page 117
read an optimal control configuration file (yes or no)
no
The aeroassist_sos software also requires a user-created ASCII data file named tutility.dat
that defines the fundamental constants that will be used during the simulation. The following is the
companion data file for this example. If the user provides a value of zero for the Earth’s rotation rate,
the simulation results will be with respect to a non-rotating, spherical Earth.
**************************
simulation environment and
planet/utility constants
**************************
The user’s input for j2, j3 and j4 control the type of gravity model used during the simulation.
After the aeroassist_sos scientific simulation has converged, it will display a summary of the initial
conditions and the optimized trajectory. It also provides a summary of the relative flight path
coordinates and the aerodynamic characteristics of the vehicle. The classical orbital elements at
atmospheric exit are determined from the inertial state vector which is computed using the relative flight
path coordinates at exit.
page 118
program aeroassist_sos
======================
page 119
orbital elements and state vector at atmospheric entry
------------------------------------------------------
aerodynamic characteristics
---------------------------
page 120
The following are plots created from the trajectory summary file. The first plot shows the behavior of
the normalized lift coefficient and bank angle during the atmospheric pass. The second plot summarizes
the altitude and relative velocity of the vehicle as a function of time since the entry interface (EI).
The plot on the left illustrates the behavior of the relative flight path and azimuth angles during the aero-
assist pass through the atmosphere. The plot on the right shows the behavior of the orbital eccentricity
and inclination during the atmospheric phase of the mission.
The last plot illustrates the behavior of the heat rate and heat load during the atmospheric portion of the
trajectory. It confirms that the solution has satisfied the maximum heat-rate path constraint.
page 121
Problem setup
This section provides additional details about the Sparse Optimization Suite implementation. It briefly
explains such things as initial conditions, path constraints and the performance index options.
The aeroassist_sos computer program includes three options for specifying initial conditions at the
entry interface (EI). This section summarizes these options and describes how the user invokes each.
For this option, all Earth relative coordinates at the entry interface are defined by the user. The user can
provide initial guesses and lower and upper bounds for these coordinates in the flight conditions
and bounds at atmospheric entry part of the input data file.
For this program option, the software uses the flight path angle and entry altitude provided in the input
data file to constrain the entry altitude and inertial flight path angle. The software then uses the deorbit
algorithm described in Appendix E – Impulsive De-orbit from Earth Orbit to compute the Earth relative
flight path angle, speed and other flight path coordinates at the entry interface. This option is valid for
initial circular orbits.
For this program option, the software will use the entry altitude provided in the input data file to
constrain the entry altitude. The flight path angle provided in the data file is used for an inertial flight
path angle initial guess. During the trajectory optimization, the software will change the inertial flight
path angle between the lower and upper bounds provided by the user (the inertial flight path angle is
treated as a problem parameter). The software then uses the deorbit algorithm described later in this
section to compute the Earth relative flight path angle, speed and other coordinates at the entry interface.
This option is valid for initial circular orbits.
page 122
For the second and third initial conditions options, the aeroassist_sos computer program calculates
the single impulsive maneuver required to establish an entry interface altitude and flight path angle
relative to the user-defined initial circular orbit. The algorithm uses a tangential, impulsive delta-v
applied opposite to the velocity vector to establish the deorbit trajectory. The entry altitude and flight
path angle initial guesses are provided by the user.
Performance index
This section describes the two types of trajectory optimization performed by the aeroassist_sos
software.
The performance index for this type of optimization is simply J = v f where v f is the relative speed of
the vehicle as it exits from the atmosphere. For this program option, the optimization indicator is set to
maxmin = +1. This option minimizes the energy loss during the aero-assist maneuver.
The performance index for this program option is given by J = cos ( hz h ) where hz is the z-
−1
component of the ECI angular momentum vector and h is the angular momentum magnitude of the
vehicle at exit from the atmosphere at the user-defined altitude. For this program option, the
optimization indicator is also set to maxmin = +1.
This section summarizes how the software computes the heat rate and dynamic pressure path
constraints, and the orbital inclination point constraint.
dynamic pressure
To enforce this path constraint, the software ensures that q qmax where qmax is the user-defined value
of the maximum dynamic pressure. The dynamic pressure at any simulation time is given by
1 2
q= v
2
where is the atmospheric density and v is the relative speed at the current flight condition.
heat rate
To enforce this path constraint, the software ensures that Q Qmax where qmax is the user-defined value
of the maximum heat-rate. The heat rate at any simulation time is computed from Chapman’s stagnation
point equation given by
3.15
dQ 17,600 V BTU
Q= = 2
dt RN V0 0 ft − sec
page 123
where
orbital inclination
A final orbital inclination point constraint is enforced as cos i = hz h where hz is the z-component of the
angular momentum vector and h is the angular momentum magnitude at the atmospheric exit. In this
equation, i is the user-defined final orbit inclination.
Technical discussion
Trajectory mechanics in this computer program are modeled in the flight path coordinate system. The
equations of motion are described in Appendix B – Trajectory Modeling in the Flight Path System along
with coordinate transformations for converting Earth-centered-inertial (ECI) to and from Earth-centered-
fixed (ECF) coordinates. Appendix B also includes a summary of the aerodynamic characteristics of
aero-assist vehicles
In the aeroassist_ocs computer program, the vehicle aerodynamics are modeled using a parabolic
drag polar ( n = 2 ) . The normalized lift coefficient is given by = CL CL where CL is the lift
coefficient at any simulation conditions and CL is the lift coefficient corresponding to maximum L D .
In this computer program, the control variables are the normalized lift coefficient and bank angle.
This section presents graphics and a simulation summary for an aero-assist trajectory that maximizes the
orbital inclination change. The mission starts in a 500 nautical mile circular Earth orbit with an initial
orbital inclination equal to 5 degrees. The speed at atmospheric exit is constrained to be greater than or
equal to 15,000 feet per second.
For this type of trajectory optimization make sure the orbital inclination at the atmospheric exit is not
constrained by using the following statement in the input file
enforce an orbital inclination constraint (yes or no)
no
The following are plots of the important trajectory parameters for this example.
page 124
The following is the aeroassist_sos program output for this example.
program aeroassist_sos
======================
page 125
rx (ft) ry (ft) rz (ft) rmag (ft)
0.207531855633D+08 0.119362626872D+08 0.104428766999D+07 0.239637145430D+08
page 126
calendar date January 1, 2001
aerodynamic characteristics
---------------------------
This section is a summary of the information contained in the CSV data file produced by the
aeroassist_sos software. The comma-separated-variable disk file is created by the odeprt Fortran
subroutine and contains the following information:
time (min) = simulation time since entry interface in minutes
page 127
drag force (lbf) = drag force in pounds
velocity rate (fps/s) = rate of change of velocity in feet per second per second
fpa rate (dps) = rate of change of flight path angle in degrees per second
azimuth rate (dps) = rate of change of azimuth angle in degrees per second
The accumulated heat load is determined from a cubic spline integration of the heat rate of the optimized
solution at all collocation nodes. The rate of change of the flight variables is determined from the
equations of motion.
“Minimum-Fuel Aero-assisted Coplanar Orbit Transfer Using Lift Modulation”, Kenneth D. Mease and
Nguyen X. Vinh, AIAA Journal of Guidance, Control and Dynamics, Vol. 8. No. 1, Jan.-Feb. 1985.
“Variational Solutions for the Heat-Rate-Limited Aero-assisted Orbital Transfer Problem”, Hans
Seywald, AIAA Journal of Guidance, Control and Dynamics, Vol. 19, No. 3, May-June, 1996, pp. 686-
692.
“Fuel-Optimal Trajectories of Aero-assisted Orbital Transfer with Plane Change”, D. S. Naidu, IEEE
Transactions on Aerospace and Electronic Systems, Vol. 27, No. 2, March 1991, pp. 361-368.
Hypersonic and Planetary Flight Mechanics, N. X. Vinh, R. D. Culp, and A. Busemann, University of
Michigan Press, 1980.
“A Survey of Aero-assisted Orbit Transfer”, G. D. Walberg, AIAA Journal of Spacecraft and Rockets,
Vol. 22, No. 1, Jan-Feb 1985, pp. 3-18.
“Optimal Aero-assisted Return From High Earth Orbit With Plane Change”, Nguyen X. Vinh and John
M. Hanson, Acta Astronautica, Vol. 12, No. 1, 1985.
page 128
CMATO 7 – Finite-Burn De-orbit Trajectory Optimization
This CMATO application is a Fortran computer program named deorbit_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the de-orbit trajectory
optimization problem. The software models the trajectory as a single, finite-burn propulsive maneuver
followed by a user-defined, time-bounded final coast phase. This computer attempts to maximize the
final spacecraft mass. Since this simulation involves a single continuous maneuver, this is equivalent to
minimizing the required propellant mass.
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.
• collocation and implicit integration
• adaptive mesh refinement
• sparse nonlinear programming
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 deorbit_sos 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 optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The deorbit_sos software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 129
Input file format and contents
The deorbit_sos software is “data-driven” by a user-created text file. This text file should be simple
ASCII format with no special characters.
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.
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 font. This example
attempts to optimize the maneuver required to de-orbit a spacecraft from a circular Earth orbit (LEO) to
typical user-defined entry interface (EI) conditions.
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.
************************************************
** de-orbit trajectory optimization
** single finite-burn maneuver with final coast
** program deorbit_sos
** cleo2ei.in - May 11, 2012
************************************************
The first two inputs define the calendar date and Universal Coordinated Time (UTC) of the de-orbit
maneuver. Please be sure to provide all four digits of the calendar year.
maneuver calendar date (month, day, year)
-----------------------------------------
3, 18, 2010
The next three inputs define the initial mass prior to the propulsive maneuver, and the thrust magnitude
and specific impulse of the upper stage or spacecraft propulsion system.
initial spacecraft mass (kilograms)
8000.0
This next integer input defines the type of initial guess for the propulsive maneuver.
************************************
* type of propulsive initial guess *
************************************
1 = thrust duration
2 = delta-v
-----------
2
page 130
The next two numeric inputs define either the user’s initial guess for the delta-v magnitude or the
maneuver duration and should be consistent with the previous input.
initial guess for delta-v (meters/second)
150.0
The next two inputs define the lower and upper bounds for the thrust duration. These inputs are required
for either type of propulsive initial guess.
lower bound for thrust duration (seconds)
10.0
The next section of the input data file lets the user define the characteristics of a final coast phase that
follows the propulsive maneuver. These three inputs define an initial guess for the coast duration as
well as lower and upper bounds on the coast duration. All inputs are in minutes.
******************
* coast maneuver *
******************
The next six inputs define the classical orbital elements of the initial park orbit. These elements are
defined with respect to an Earth-centered-inertial (ECI) coordinate system.
*****************
* INITIAL ORBIT *
*****************
This next integer input allows the user to define the type of initial orbit constraints to use during the
simulation.
page 131
************************************
* initial orbit constraint options *
************************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all initial orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
3
The next series of inputs define the entry interface (EI) mission constraints. These elements are defined
with respect to the relative coordinate system. Please note the proper units for each mission constraint.
To disregard a mission constraint, input the value 1.0d99 for that constraint.
*********************************************************
* entry interface constraints (set to 1.0d99 to ignore) *
*********************************************************
This integer input specifies the type of gravity model to use during the simulation. Option 2 will use a
J 2 gravity model in the spacecraft equations of motion.
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate gravity model
------------------------
2
This next input specifies the type of solution data file to create.
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
2
For options 2 or 3, this 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
100
page 132
The name of the comma-separated-variable solution data file is defined in this next line.
name of solution output file
cleo2ei.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 user input defines the relative error in the objective function.
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.
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.
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
10000
The level of output from the Sparse Optimization Suite NLP algorithm is controlled with the following
integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
The level of output from the Sparse Optimization Suite optimal control algorithm is controlled with the
following integer input. Please note that option 4 will create lots of information.
page 133
**********************
optimal control output
----------------------
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
The level of output from the Sparse Optimization Suite 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
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
The following is the optimal control solution for this example. The output includes the time and orbital
characteristics at the beginning and end of the propulsive maneuver. This example optimizes the finite-
burn maneuver required to transfer from a circular low Earth orbit (LEO) to an entry interface defined
by a relative flight path angle, geodetic altitude and latitude, and a geographic east longitude.
program deorbit_sos
===================
initial epoch
-------------
------------------------
beginning of finite burn
------------------------
page 134
raan (deg) true anomaly (deg) arglat (deg) period (min)
0.220000000000D+03 0.199001209386D+03 0.199001209386D+03 0.946163624135D+02
------------------
end of finite burn
------------------
The following program output is the final spacecraft mass, the propellant mass consumed, the actual
thrust duration for the maneuver, and the accumulated delta-v.
final mass 7636.46768849416 kilograms
The delta-v magnitude is determined using a cubic spline integration of the thrust acceleration data at
each collocation node or user-defined step size.
This section of the numeric results summarizes the time and orbital conditions at the beginning and end
of the final coast.
---------------------------
beginning of coast maneuver
---------------------------
---------------------
end of coast maneuver
---------------------
page 135
raan (deg) true anomaly (deg) arglat (deg) period (min)
0.220038827173D+03 0.299159749780D+03 0.329907442753D+03 0.895621721271D+02
This final section of the numerical results summarizes both the relative and inertial flight conditions at
the entry interface.
relative flight path coordinates at entry interface
---------------------------------------------------
The optimal control solution determined by the Sparse Optimization Suite can be verified by
numerically integrating the orbital equations of motion with the SOS-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 deorbit_sos computer program uses
a Runge-Kutta-Fehlberg 7(8) variable step size method to integrate the orbital equations of motion.
The following is a display of the final solution for the previous example computed using this explicit
numerical integration method.
========================================
verification of optimal control solution
========================================
page 136
rx (km) ry (km) rz (km) rmag (km)
-.210335480218D+03 0.629617719672D+04 -.269907170359D+04 0.685354480309D+04
In additional to the user-defined solution output file, the deorbit_sos computer program will create a
comma-separated-variable data file named maneuver.csv. This data file contains the information
described later in this document (Contents of the simulation summary and csv files) starting at ignition
and ending at termination of the propulsive maneuver.
The following are graphic displays of several important flight conditions for this example. The first two
images illustrate the behavior of the orbit-relative pitch and yaw angles, and the inertial right ascension
and declination angles of the unit thrust vector during the de-orbit maneuver.
page 137
These two plots summarize the relative and inertial flight path angles and velocities.
The next two plots illustrate the behavior of the semimajor axis, orbital eccentricity, orbital inclination,
and right ascension of the ascending node (RAAN) during the simulation.
page 138
Creating an initial guess
The software allows the user to input either a delta-v or thrust duration initial guess. For a delta-v initial
guess, the software estimates the thrust duration using the rocket equation. For either type of initial
guess, the user should also provide lower and upper bounds for the total thrust duration.
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 (or final) mass of the spacecraft
and the exhaust velocity as
− V
VV
m p = mi 1 − e Vex
= m f e ex − 1
In these equations
mi = initial mass
m f = final 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
The software uses a tangential thrusting steering method to generate an initial guess for the optimal
trajectory. For tangential thrusting opposite to the flight path, the unit thrust vector in the modified
equinoctial frame is simply uT = 0 −1 0 . Please note that this type of steering creates a coplanar
T
initial guess.
The dynamic variables at each grid point of the initial guess are determined by setting the initial guess
option INIT(1) = 6 with INIT(2) = 2 within the odeinp subroutine for this aerospace trajectory
optimization problem. These program options create an initial guess from the numerical integration of
the equations of motion coded in the oderhs subroutine. The INIT(1) = 6 program option tells the
Sparse Optimization Suite software to construct an initial guess by solving an initial value problem
(IVP) with a linear control approximation. The INIT(2) = 2 program option tells the program to use
the Dormand-Prince variable step size numerical method to solve the initial value problem.
An initial guess for the modified equinoctial orbital elements at the beginning of the final coast phase
are determined by numerically integrating the equations of motion using the initial orbital elements,
spacecraft mass, and propulsive characteristics provided by the user.
Algorithms for estimating the impulse de-orbit delta-v for both initial circular and elliptical orbits is
explained in Appendix E – Impulsive De-orbit from Earth Orbit.
page 139
Problem setup
This part of the user’s manual provides details about the software implementation within
deorbit_sos. It defines such things as point and path constraints (boundary conditions), bounds on
the dynamic variables, and the performance index or objective function.
The software allows the user to select one of the following initial orbit constraint options:
• constrain semimajor axis, eccentricity, and inclination
• constrain all initial orbital elements
• option 2 with unconstrained true longitude
For option 1, the initial orbit inclination is constrained by enforcing h 2 + k 2 = tan ( i 2 ) where i is the
initial orbit inclination provided by the user.
If the initial orbit is circular, the software enforces the following two equality constraints.
f = 0 and g = 0
Otherwise, for an elliptical initial orbit, the single equality constraint f 2 + g 2 = e is enforced, where e
is the initial orbit eccentricity.
For program option 2, both lower and upper bounds for all modified equinoctial elements are set equal
to the initial modified equinoctial orbital elements according to
pL = pU = pi f L = fU = f i
g L = gU = gi hL = hU = hi
k L = kU = ki
Option 3 is identical to option 2 with the initial true longitude unbounded. In optimal control
terminology, these derived 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 or termination of the propulsive maneuver. This is simply J = m f . The value of the maxmin
indicator in the Sparse Optimization Suite algorithm tells the software whether the user is minimizing or
maximizing the performance index. The spacecraft mass at the initial time is fixed to the user-defined
initial value.
page 140
For a variable steering trajectory, the scalar magnitude of the components of the unit thrust vector at any
time during the simulation is constrained as uT = uT2r + uT2t + uT2n = 1 .
The entry interface mission constraints are relative flight path coordinates defined with respect to a
rotating Earth. They are calculated from the inertial spacecraft coordinates at the entry interface using
the algorithm described in Appendix B – Trajectory Modeling in the Flight Path System.
h p − hu = 0 → geodetic altitude
p − u = 0 → geodetic latitude
p − u = 0 → east longitude
p − u = 0 → relative azimuth
v p − vu = 0 → relative velocity
where the p subscript refers to values predicted by the software and the u subscript are the values
defined by the user.
The following lower and upper bounds are applied to the spacecraft mass and the modified equinoctial
dynamic variables during the orbital transfer.
0.05msci msc 1.05msci 100 p f p 0.8 pi
−1 f +1 − 1 g +1
−1 h +1 − 1 k +1
Finally, the three components of the unit thrust vector are constrained as follows
−1.1 ur +1.1 − 1.1 ut +1.1 − 1.1 un +1.1
Technical discussion
In this computer program, the orbital motion of the spacecraft is modeled in the modified equinoctial
orbital elements coordinate system. Please refer to Appendix A – Trajectory Modeling and Targeting in
the Modified Equinoctial Orbital Elements System for a definition of these orbital elements along with
the equations of motion. An algorithm for converting from geocentric declination and radius to geodetic
altitude and latitude is described in Appendix G – Aerospace Trajectory Coordinates and Time Systems.
page 141
Propulsive Thrust
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 ) = msc − m t where msc is the initial mass of the spacecraft and m is the propellant flow
i i
rate.
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
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 )
Both steering angles are defined with respect to a local-vertical, local-horizontal (LVLH) system located
at the spacecraft. The in-plane pitch angle is positive above the “local horizontal” and the out-of-plane
yaw angle is positive in the direction of the angular momentum vector. The inverse tangent calculation
in the second equation is a four-quadrant operation.
This section illustrates the characteristics for a typical de-orbit from a highly elliptical Earth orbit
(HEO). For this example, the entry interface constraints consist of the geodetic altitude and relative
flight path angle. An estimate for the delta-v required for this example and the coast time were
determined using the algorithm described in Appendix E – Impulsive De-orbit from Earth Orbit.
The main portion of the simulation definition file for this example is as follows:
************************************************
** de-orbit trajectory optimization
** single finite-burn maneuver with final coast
** program deorbit_sos
** heo2ei.in - May 10, 2012
************************************************
page 142
maneuver calendar date (month, day, year)
-----------------------------------------
3, 18, 2010
************************************
* type of propulsive initial guess *
************************************
1 = thrust duration
2 = delta-v
-----------
2
******************
* coast maneuver *
******************
*****************
* INITIAL ORBIT *
*****************
************************************
* initial orbit constraint options *
************************************
page 143
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all initial orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
3
*********************************************************
* entry interface constraints (set to 1.0d99 to ignore) *
*********************************************************
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate gravity model
------------------------
2
initial epoch
-------------
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
page 144
mission elapsed time 00:02:25.905
---------------------------
beginning of coast maneuver
---------------------------
---------------------
end of coast maneuver
---------------------
page 145
azimuth 92.4904131009538 degrees
page 146
flight path angle -1.91929803838563 degrees
Here are plots of the control behavior and evolution of several important trajectory characteristics.
These two plots illustrate the behavior of the relative and inertial flight path angle and velocity.
page 147
Contents of the simulation summary and csv files
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the deorbit_sos software.
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 148
The delta-v magnitude is determined using a cubic spline integration of the thrust acceleration data at
each collocation node or user-defined step size.
The user-defined comma-separated-variable (csv) disk files is created by the odeprt subroutine and
contains the following information:
time (sec) = mission elapsed time in seconds
page 149
rmag (km) = magnitude of spacecraft’s position vector in kilometers
rasc (deg) = inertial right ascension of the unit thrust vector in degrees
yaw (deg) = out-of-plane yaw angle of the unit thrust vector in degrees
pitch (deg) = in-plane pitch angle of the unit thrust vector in degrees
Hypersonic and Planetary Entry Flight Mechanics, Vinh, Busemann and Culp, The University of
Michigan Press, 1980.
“Survey of Numerical Methods for Trajectory Optimization”, John T. Betts, AIAA Journal of Guidance,
Control and Dynamics, Vol. 21, No. 2, March-April 1998.
“Nearly Circular Transfer Trajectories for Descending Satellites”, George M. Low, NASA Technical
Report R-3, 1959.
“Optimum Deboost Altitude for Specified Atmospheric Entry Angle”, Jerome M. Baker, Bruce E.
Baxter, and Paul D. Arthur, AIAA Journal, Vol. 1, No. 7, July 1963.
“Deboost from Circular Orbits”, A. H. Milstead, The Journal of the Astronautical Sciences, Vol. XIII,
No. 4, pp. 170-171, July-August, 1966.
“Geometric Theory of Optimum Disorbit Problems”, A. Busemann and N. X. Vinh, NASA CR-750,
April 1967.
“Autonomous Optimal Deorbit Targeting”, Donald J. Jezewski, AAS 91-136, AAS/AIAA Spaceflight
Mechanics Meeting, February 11-13, 1991.
page 150
CMATO 8 – Lunar Ascent Trajectory Optimization
This CMATO application is a Fortran computer program named lascent_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the single-stage, finite-
burn lunar ascent trajectory optimization problem. The trajectory is modeled with a user-defined
vertical rise phase, pitch-over phase, and initial and final boundary conditions for an ascent-to-orbit
phase. This computer program attempts to maximize the final mass placed into lunar orbit or minimize
the time to ascend to the final orbit. The lunar mission orbit can be circular or elliptical.
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 lascent_sos 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 using a sparse nonlinear programming method.
The software allows the user to select the type of initial guess, collocation method and other important
algorithm control parameters.
page 151
Input file format and contents
The lascent_sos software is “data-driven” by a user-created simulation definition text file. 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 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.
This data file defines a typical maximum payload simulation with throttling enabled and a circular final
mission orbit with an inclination constraint. For this simulation, the initial azimuth is bounded so that
the software can determine the correct azimuth after the pitch-over maneuver.
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.
**********************************
** lunar launch vehicle simulation
** lv1.in
** November 15, 2005
** maximize payload to orbit
**********************************
The first input is an integer that defines the type of simulation. Option 2 is equivalent to a full throttle or
constant thrust simulation.
type of trajectory optimization
*******************************
1 = maximize final mass
2 = minimize flight time
------------------------
1
The next three inputs allow the user to specify the duration of the vertical rise and pitch-over maneuvers
along with the total pitch angle.
vertical rise time (seconds)
10
The next two inputs define the propulsion characteristics for the scientific simulation. Here the user can
specify the maximum thrust and specific impulse.
**************************
propulsion characteristics
**************************
page 152
specific impulse (seconds)
350.0
The initial vehicle mass and a guess for the final mass are defined by the next two data inputs.
****************************
vehicle mass characteristics
****************************
The following series of data items are reserved for user-defined initial conditions. To fix one or more
initial conditions, the user should input identical lower and upper bounds. To free or un-constrain one or
more initial states, set the lower and/or upper bounds to 1.0d99. Please note the units and valid data
range for each item.
************************************
initial flight conditions and bounds
************************************
NOTE 1: set upper and lower bounds to
the initial value to constrain or
"fix" the flight azimuth.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
upper bound for initial flight azimuth (0 <= azimuth <= 360; degrees)
360.0
lower bound for initial flight azimuth (0 <= azimuth <= 360; degrees)
0.0
initial selenocentric latitude (-90 <= latitude <= + 90; degrees)
20.0
The following series of data items allow the user to define the final flight conditions. To fix one or more
conditions, the user should input identical lower and upper bounds. To free or un-constrain one or more
final states set the lower and/or upper bounds to 1.0d99. Again, please note the units and valid data
range for each item.
****************************************************
initial guess for final flight conditions and bounds
****************************************************
NOTE 1: set upper and lower bounds
to the final value to constrain or
"fix" a flight condition.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
page 153
lower bound for final time (seconds)
1.0d99
final flight path angle (-90 <= fpa <= +90; degrees)
0.0
upper bound for final flight path angle (-90 <= fpa <= +90; degrees)
+90.0
lower bound for final flight path angle (-90 <= fpa <= +90; degrees)
-90.0
upper bound for final flight azimuth (0 <= azimuth <= 360; degrees)
360.0
lower bound for final flight azimuth (0 <= azimuth <= 360; degrees)
0.0
upper bound for final declination (-90 <= declination <= +90; degrees)
+90.0
lower bound for final declination (-90 <= declination <= +90; degrees)
-90.0
upper bound for final east longitude (0 <= longitude <= 360; degrees)
360.0
lower bound for final east longitude (0 <= longitude <= 360; degrees)
0.0
The next series of data inputs define lower and upper bounds on the state variables during the ascent-to-
orbit flight phase. To free or un-constrain one or more states, set the lower and/or upper bounds to the
value 1.0d99.
*************************************************************
upper and lower bounds on the flight conditions during ascent
*************************************************************
NOTE: set bound to 1.0d99 to ignore
page 154
-----------------------------------
upper bound for flight path angle (-90 <= fpa <= +90; degrees)
+90.0
lower bound for flight path angle (-90 <= fpa <= +90; degrees)
-90.0
upper bound for flight azimuth (0 <= azimuth <= 360; degrees)
360.0
lower bound for flight azimuth (0 <= azimuth <= 360; degrees)
0.0
upper bound for declination (-90 <= declination <= +90; degrees)
+90.0
lower bound for declination (-90 <= declination <= +90; degrees)
-90.0
upper bound for east longitude (0 <= longitude <= 360; degrees)
360.0
lower bound for east longitude (0 <= longitude <= 360; degrees)
0.0
This next section of the input file defines the initial guesses and bounds for the control variables. To
free or un-constrain one or more control variables set the lower and/or upper bounds to 1.0d99.
**********************************
initial flight controls and bounds
**********************************
NOTE 1: set upper and lower bounds
to the initial value to constrain
or "fix" a flight control.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
page 155
lower bound for initial bank angle (degrees)
-90.0
This section of the input file defines the final guesses and bounds for the control variables. To free one
or more control variables set the lower and/or upper bounds to 1.0d99.
********************************
final flight controls and bounds
********************************
NOTE 1: set upper and lower bounds
to the final value to constrain
or "fix" a flight control.
NOTE 2: set bound to 1.0d99 to ignore
-------------------------------------
This section of the input file defines the lower and upper bounds for the control variables during the
ascent-to-orbit phase. To free or un-constrain one or more control variables, set the lower and/or upper
bounds to 1.0d99.
**********************************************************
upper and lower bounds on the flight controls during phase
**********************************************************
NOTE: set bound to 1.0d99 to ignore
-----------------------------------
These next three inputs allow the user to specify the final orbit characteristics. Please note that an input
of 1.0d99 for the final orbital inclination will tell the SOS software to ignore the orbital inclination
constraint.
***********************
final orbit constraints
***********************
The software also creates a comma-separated-variable (csv) ascii data file that contains the optimal
control solution and other flight parameters. This next integer input specifies the type of solution data
file to create.
******************************************
type of comma-delimited solution data file
******************************************
1 = SOS-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.0
The name of this output file is specified in the next line of information. Additional information about
the contents of this file can be found in the Contents of the simulation summary csv file section later in
this document.
name of comma-delimited solution data file
lv1.csv
The next series of program inputs are algorithm control options and parameters for the software. 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.
*********************************
discretization/collocation method
*********************************
page 157
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 ascent
trajectory.
number of initial guess grid points to use
25
The next series of program inputs are algorithm control options and parameters for the Sparse
Optimization Suite.
****************************
algorithm control parameters
****************************
The next input defines the relative error in the solution of the differential equations.
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.
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
100000
The next input is an integer that defines the maximum number of algorithm iterations.
maximum number of algorithm iterations
10000
The level of output from the NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
***************************
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
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
page 158
**********************
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
The level of output from the differential equation 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
-------------------
input no to ignore
*******************
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
Prior to performing the trajectory optimization the software will display the conditions at the beginning
and end of the vertical rise, and the flight conditions at the end of the pitch-over maneuver. The
following is the lascent_sos numerical output for this example.
liftoff
-------
page 159
end of pitch-over
-----------------
After convergence, the software will display the flight path conditions immediately after the pitch-over
and the flight path conditions and classical orbital elements at mission orbit injection. The following is
the program output for this example.
program lascent_sos
--------------------
page 160
propellant mass 1551.04869893348 kilograms
The following are trajectory plots created from the user-defined summary file. The first plot illustrates
the behavior of the angle of attack and bank angle during the ascent trajectory. Notice the bank reversal
as the angle of attack passes through zero. This behavior is explained on page 1192 of “Advanced
Launch System Trajectory Optimization”, by P. Daniel Burkhart and David G. Hull, AAS 96-168. An
examination of the azimuthal differential equation given in the Technical discussion later in this
document will help explain this behavior.
The next plot on the left illustrates the behavior of the orbital eccentricity and inclination during the
ascent to the final circular mission orbit. The evolution of the relative flight path and azimuth angles is
shown by the graphics on the right. These angles are computed with respect to a rotating Moon.
page 161
This final plot illustrates how the throttle setting and accumulated delta-v change during the ascent from
the end of the pitch-over maneuver to injection into the final mission orbit.
The optimal solution determined by the Sparse Optimization Suite can be verified by numerically
integrating the spacecraft’s selenocentric equations of motion using the optimal control-computed initial
conditions and the optimal control angles and throttle setting determined by the algorithm. This
computer program uses a Runge-Kutta-Fehlberg 7(8) variable step size method to explicitly integrate the
flight path equations of motion.
The following is the program output summarizing the final flight path coordinates, classical orbital
elements and state vector computed using this explicit numerical integration method. The vehicle mass
and accumulated delta-v are computed by including the instantaneous propellant flow rate and thrust
acceleration in the first-order equations of motion.
********************************************
* verification of optimal control solution *
********************************************
page 162
final flight path coordinates
-----------------------------
The software creates a linear interpolation guess based on the flight conditions after the pitch-over
maneuver and the final flight conditions provided by the user. This is accomplished within the software
by setting init = 1. The Sparse Optimization Suite attempts to obtain problem feasibility before
trying to solve the optimal control problem.
If the software cannot find feasibility, the user will have to provide a better initial guess.
Problem setup
This section provides additional details about the Sparse Optimization Suite software implementation. It
briefly explains such things as point constraints and the performance index options. The lascent_sos
simulation consists of a propulsive vertical rise followed by a pitch-over maneuver and a final,
optimized ascent-to-orbit propulsive phase.
Performance index
The performance index for the maximize final mass option is the final spacecraft mass given by
J = m f = m ( t f ) where m f is the spacecraft mass at the final time.
For the minimize flight time program option, the performance index is J = t f where t f is the simulation
time at mission orbit injection.
The value of the maxmin indicator in the Sparse Optimization Suite algorithm tells the software whether
the user is minimizing or maximizing the performance index.
Path constraints
page 163
The inequality path constraints enforced by the software are based on the lower and upper bounds for
the dynamic variables provided by the user. For example,
L U L U
and so forth. The subscripts L and U correspond to lower and upper bounds provided by the user.
Point constraints
The number and type of point functions enforced by the software is a function of the orbital elements of
the final mission orbit. This section discusses the point constraints or final boundary conditions
implemented in the lascent_sos computer program.
Circular orbit
For a final circular mission orbit, the user provides the semimajor axis of this orbit. The software then
uses the following point constraints or boundary conditions to “target” a final circular orbit.
rf v f
rf = au vf = sin f = =0
au rf v f
If the user also specifies an orbital inclination for the final mission orbit, the software enforces the
following point constraint at the final time
sin i f =
h fz
=
(r f v f )z
= sin iu
hf rf v f
In these equations, the f subscript refers to mission characteristics computed by the software at the final
time and the u subscript refers to user-provide final or “target” orbital conditions.
Elliptical orbit
For a user-defined elliptical mission orbit, the software constrains the final specific orbital energy and
final angular momentum magnitude according to
2 2 rf v f ru vu
f = v 2f − = u = vu2 − hf = = hu =
rf ru rf v f ru vu
If the user also specifies an orbital inclination for the final mission orbit, the software enforces the
following point constraint
hf
sin i f = z =
(r f v f ) z = sin i
rf v f
u
hf
In these equations, the f subscript refers to mission characteristics computed by the software at the final
time and the u subscript refers to user-provided final orbital conditions. The user-defined position
vector ru and velocity vector v u are determined from the semimajor axis, orbital eccentricity and
inclination input by the user. All other angular orbital elements are set to 0 degrees.
page 164
Technical discussion
The first-order flight path equations of motion relative to a rotating, spherical Moon are
selenocentric radius
dr
r= = V sin
dt
selenographic longitude
d cos sin
= =V
dt r cos
selenocentric declination
d cos cos
= =V
dt r
speed
dV T cos
V= = − g sin + 2 r cos ( sin cos − sin cos cos )
dt m
flight path angle
d V T sin g cos
= = cos + cos − + 2 sin cos
dt r mV V
r
+ 2 cos ( cos sin sin + cos cos )
V
flight azimuth
d V T sin
= = tan sin cos + sin
dt r mV cos
r
+ 2 ( sin − cos cos tan ) + 2 sin cos sin
V cos
where
Please refer to Appendix B – Trajectory Modeling in the Flight Path System for additional properties and
relationships of the flight path coordinate system.
page 165
Vertical rise phase
During the vertical rise part of the trajectory, the software uses a subset of the full equations of motion.
This set of equations includes r , v, , with = = 0 . This is necessary to avoid singularities in the
flight path and azimuth differential equations during the trajectory evolution. Furthermore, during the
numerical integration of the vertical rise differential equations, = 0 , = 0 , = 90 , = 0 and the
throttle setting is equal to 1.
Pitch-over phase
During the pitch-over part of the trajectory, the software also uses a subset of the full equations of
motion. This set of equations includes r, v, , , with = 0 . This is necessary since azimuth is
poorly defined until the end of the pitch-over part of the ascent trajectory. Furthermore, during the
numerical integration of the pitch-over differential equations, = 0 , = 0 , = 90 , = 0 and the
throttle setting is equal to 1.
( )
The angle of attack during the pitch-over phase is determined from = 90 − + t − t p where is
the pitch rate, t is the time since launch and t p is the time since launch at which the pitch-over maneuver
begins. The constant pitch rate is determined from the pitch angle and pitch-over maneuver duration
provided by the user.
For a realistic and contiguous ascent trajectory, the launch vehicle should pitch over to the azimuth
direction determined by the ascent-to-final orbit optimization.
The cross-range angle is determined from the following expression which can be derived from spherical
trigonometry relationships.
sin = − sin 1 sin 2 cos 1 cos − cos 1 cos 1 sin + sin 1 cos 2 sin 1
where
page 166
1 = selenocentric declination of the initial point
1 = flight azimuth at the initial point
2 = selenocentric declination of the final point
= 2 − 1
The software uses the following expressions to calculate the selenocentric, inertial position and velocity
vectors of the spacecraft at the final time.
rx = r cos cos ry = r cos sin rz = r sin
The inertial speed can also be computed from the following expression
where all coordinates on the right-hand-side of these equations are relative to a rotating Moon.
This section summarizes the lascent_sos solution and trajectory graphics for a minimum time ascent
to an elliptical final mission orbit.
page 167
Since this is a minimum time solution, the throttle setting during the pitch-over to final mission injection
is always 100 percent.
page 168
relative velocity 2.45921128624421 meters/second
********************************************
* verification of optimal control solution *
********************************************
page 169
propellant mass 1474.26502350139 kilograms
This section is a summary of the information contained in the CSV data file produced by the
lascent_sos software. The comma-separated-variable disk file is created by the odeprt subroutine
and contains the following information:
time (seconds) = simulation time since launch in seconds
page 170
arg of periapsis (deg) = argument of periapsis in degrees
“Optimization of Thrust Direction Histories and Vehicle Parameters for Three-dimensional Ascent
Trajectories”, C. Tucker Battle and Robert G. Gottlieb, AIAA 64-663.
“Design and Evaluation of a 3-D Optimal Ascent Guidance Algorithm”, Anthony J. Calise, Nahum
Melamed and Seungjae Lee, AIAA 97-3707.
“Optimization of Launch Vehicle Ascent Trajectories with Path Constraints and Coast Arcs”, C. P. Gath
and A. J. Calise, AIAA Journal of Guidance, Control and Dynamics, Vol. 24, No. 2, March-April, 2001,
pp. 296-304.
“Advanced Launch System Trajectory Optimization Using Suboptimal Control”, Douglas A. Shaver and
David G. Hull, AIAA 90-3413.
“Solving the Optimal Control Problem Using a Nonlinear Programming Technique, Part 2: Optimal
Shuttle Ascent Trajectories”, T. Bauer, J. Betts, W. Huffman and K. Zondervan, AIAA 84-2038.
“Semi-Analytical Formulas for Launcher Performance Evaluation”, Emanuele Di Sotto and Paolo
Teofilatto, AIAA Journal of Guidance, Control and Dynamics, Vol. 25, No. 3, May-June, 2002, pp. 538-
545.
page 171
CAMTO 9 – Impulsive Trans-Lunar Trajectory Optimization
This CMATO application is a Fortran computer program named 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
The lunar coordinates required by the software are computed using the JPL DE421 ephemeris.
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
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
page 172
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
**************************************
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.
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 is 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)
page 173
2
This next integer input defines the type of targeting algorithm to use.
*****************************
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 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 174
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
****************************
truncation error tolerance
1.0d-12
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
***************************
Program example
The following is the solution created by the computer program for this example. The output is organized by the following
major sections
• First 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).
======================================
two-body lunar trajectory optimization
======================================
descending transfer
page 175
-------------------------------------------------
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 177
UTC time 09:54:55.649
----------------------------------------------------
coordinates of the moon at closest approach
(geocentric Earth mean equator and equinox of J2000)
----------------------------------------------------
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 179
----------------------------------------------------
Technical discussion
page 180
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
where p is a vector of problem parameters that is not time dependent.
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 ) uu
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
page 181
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 spacecraft’s orbital motion is modeled with respect to the Earth mean equator and equinox of J2000 (EME2000)
coordinate system. Please consult Appendix G – Aerospace Trajectory Coordinates and Time Systems for information about
this system. Numerical methods for solving Lambert’s problem can be found in Appendix I – Numerical Solutions of
Lambert’s Problem.
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.
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
page 182
B-plane targeting
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 y2 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. Please consult
Appendix D – B-Plane Geometry, Coordinates and Targeting for the definition of the B-plane coordinate system along with
pertinent equations.
Important note!!
If this inequality is not satisfied, the software will print the following error message
b-plane targeting error!!
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 relationship between orbital inclination i, B-plane angle and asymptote declination of an incoming or outgoing
hyperbola is given by cos i = cos cos . The following is a contour plot illustrating the achievable inclination as a
function of B-plane angle and declination.
page 183
Targeting to the selenocentric periapsis radius and orbital inclination
For this targeting option, the equality constraints enforced by the 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. In the second
equation hˆ is the z-component of the spacecraft’s unit angular momentum vector at closest approach to the moon.
z
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 is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the tlto software.
page 184
sma (km) = semimajor axis in kilometers
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 185
re2sc-x (km) = x-component of the spacecraft’s geocentric position vector in kilometers
raan-geo (deg) = geocentric right ascension of the ascending node of the spacecraft in
degrees
page 186
raan-sel (deg) = selenocentric 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. Additional
information about the selenocentric coordinate system implemented in this computer program can be
found in Appendix G – Aerospace Trajectory Coordinates and Time Systems.
“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.
“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 187
CMATO 10 – Finite-burn Trans-lunar Trajectory Optimization
This CMATO application is a Fortran computer program named tlto_sos that uses the Sparse
Optimization Suite (SOS) 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 for the maneuver.
The tlto_sos 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_sos software allows the user to select the type of initial guess, collocation method and other
important algorithm control parameters.
page 188
Input file format and contents
The tlto_sos 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 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) described in Appendix G – Aerospace
Trajectory Coordinates and Time Systems.
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_sos
** 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
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 flow this format.
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
page 189
specific impulse (seconds)
450.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 coordinate system.
******************
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
*****************************
page 190
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)
------------------------------------------
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.
page 191
********************************
* 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
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.
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
---------------------------------
page 192
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.
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
page 193
2 = terse
3 = standard
4 = interpretive
-----------------
1
The level of output from the differential equation 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
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
The last series of inputs allow the reading and writing of SOS 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_sos software. Please consult Appendix J – Sparse
Optimization Suite Configuration File for additional information about this file.
***************************************
* optimal control configuration options
***************************************
The following is the program output created by the tlto_sos 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.
page 194
----------------
program tlto_sos
----------------
------------------------------------------------------
park orbit initial conditions
(geocentric - Earth mean equator and equinox of J2000)
------------------------------------------------------
------------------------------------------------------
time and conditions at end of TLI finite burn
(geocentric - Earth mean equator and equinox of J2000)
------------------------------------------------------
page 195
------------------------------------------------------
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)
------------------------------------------------------
------------------------------------------------------
time and conditions at lunar sphere-of-influence
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
------------------------------------------------------
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)
------------------------------------------------------
page 197
declination 23.6270577371795 degrees
The following plots illustrate the behavior of the pitch, yaw, right ascension, and declination angles
during the propulsive maneuver.
These next two plots illustrate the behavior of the individual components of the radial-tangential-normal
(RTN) and Earth-centered-inertial (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 198
The tlto_sos 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.
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 199
The following is a “zoomed” plot of the park orbit and initial portion of the lunar transfer trajectory.
This final plot illustrates the selenocentric hyperbola trajectory 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.
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_sos computer program uses a Runge-Kutta-Fehlberg 7(8)
variable step size method to integrate the orbital equations of motion.
page 200
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)
------------------------------------------------------
------------------------------------------------------
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 201
TDB time 01:04:40.769
------------------------------------------------------
b-plane coordinates of incoming hyperbola
(selenocentric lunar mean equator & IAU node of epoch)
------------------------------------------------------
This section describes the algorithms used in tlto_sos 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 CAMTO 9 – Impulsive Trans-Lunar Trajectory Optimization which calculates the impulsive delta-v
required to perform a TLI maneuver. It will also provide an initial guess for the 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 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
page 202
The propellant mass required for a given V is a function of the initial mass of the spacecraft and the
exhaust velocity as
− V
m p = mi 1 − e Vex
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_sos.
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_sos simulation. A typical scenario is
This technique 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_sos. 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:
4) constrain all initial orbital elements except the true longitude
5) constrain semimajor axis, eccentricity and inclination; bounded RAAN and true longitude
page 203
For both options, the initial orbit inclination is constrained by enforcing
i
h 2 + k 2 = tan
2
where i is the user-defined park orbit inclination. Furthermore, the semi-parameter is constrained to the
initial value according to pL = pU = pi .
If the park orbit is circular, the software enforces the two constraints f = 0 and g = 0 .
Otherwise, for an elliptical park orbit, the single equality constraint f 2 + g 2 = e is enforced, where e is
the park orbit eccentricity.
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
hL = hU = hi k L = kU = ki
For both options, the initial true longitude is bounded according to −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 SOS 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 = m f .
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:
page 204
At the user-defined sphere-of-influence of the Moon, the point function enforced by the software is
given by rSOI − rSOI = 0 where rSOI is the predicted SOI radius and rSOI is the SOI radius defined by the
p p
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
In these equality constraints, 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 which is described in
Appendix G – Aerospace Trajectory Coordinates and Time Systems.
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
rv
= sin −1 = 0
r v
where r and v are the selenocentric position and velocity vectors, respectively.
Technical discussion
During Phase 1 – TLI propulsive maneuver, the spacecraft motion is modeled using modified
equinoctial equations of motion. Please refer to Appendix A – Trajectory Modeling and Targeting in the
Modified Equinoctial Orbital Elements System for the geometry and dynamics in this system. During
Phase 2 – coast to lunar closest approach, the spacecraft motion is modeled using cartesian equations of
motion. Appendix C – Cartesian Equations of Motion describes this system along with perturbations
due to Earth gravity, aerodynamic drag and other perturbations.
The spacecraft’s orbital motion is modeled with respect to the Earth mean equator and equinox of J2000
(EME2000) coordinate system. Please refer to Appendix G – Aerospace Trajectory Coordinates and
Time Systems.
Propulsive thrust
page 205
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 ) = msc − m t where msc is the initial mass of the spacecraft.
i i
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 ( uT r
) = tan −1 ( uT , uT )
n t
The pitch angle is positive above the “local horizontal” and the yaw angle is positive in the direction of
the angular momentum vector.
In the tlto_sos 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
(
= tan −1 uTECI y , uTECI x ) ( )
= sin −1 uTECI z
The B-plane
The geometry and fundamental equations of the B-plane system can be found in Appendix D – B-Plane
Geometry, Coordinates and Targeting.
Please consult Appendix G – Aerospace Trajectory Coordinates and Time Systems for the geometry and
transformation equations related to this system.
page 206
Circularization delta-v
The impulsive delta-v required to circularize the spacecraft’s trajectory at closest approach to the moon
can be computed from
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
2m 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.
The relationship between orbital inclination i, B-plane angle and asymptote declination of an
incoming or outgoing hyperbola is given by cos i = cos cos . The following is a contour plot
illustrating the achievable inclination as a function of B-plane angle and declination.
page 207
Contents of the simulation summary and csv files
This section is a summary of the information contained in the simulation summary screen displays and
CSV data file produced by the tlto_sos software.
The user-defined comma-separated-variable disk file is created by the odeprt subroutine and contains
the following information:
time (hrs) = time since ignition in hours
page 209
“Lunar Trajectories”, NASA TN D-866, August 1961.
“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.
page 210
CAMTO 11 – Ballistic Interplanetary Trajectory Optimization
This CMATO application is a Fortran computer program named ipto_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the classic one impulse
flyby and two-impulse rendezvous ballistic interplanetary trajectory optimization problems. The
software attempts to minimize the launch delta-v, the arrival delta-v or the total delta-v for the
interplanetary transfer. The type of trajectory optimization is specified by the user. The destination
celestial body can be a comet or asteroid.
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 ipto_sos 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 using a sparse nonlinear programming (NLP) method.
The ipto_sos software allows the user to select the type of collocation method and other important
algorithm control parameters.
page 211
Input file format and contents
The ipto_sos 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. This example is an Earth-to-Mars
ballistic rendezvous trajectory that minimizes the total delta-v for the mission. Please note for a flyby
trajectory input file (trajectory type = 1), the only valid optimization option is 1 = minimize
launch delta-v.
In the following discussion the actual input file contents are in courier font and all explanations are in
times font. Please note that the fundamental time argument in this computer program is Barycentric
Dynamical Time (TDB).
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.
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.
***********************************************************
** impulsive delta-v interplanetary trajectory optimization
** patched-conic heliocentric motion - ipto_sos
** Mars '03 - mars03.in
** May 6, 2011
***********************************************************
The first program input is an integer that defines the type of delta-v optimization. Please note that
option 4, no optimization simply solves the n-body, orbital two-point boundary value problem.
*******************
* simulation type *
*******************
1 = minimize launch delta-v
2 = minimize arrival delta-v
3 = minimize total delta-v
4 = no optimization
-----------------------------
3
The next input is an integer that tells the simulation what type of trajectory to model.
trajectory type (1 = flyby, 2 = rendezvous)
2
The next three inputs are the user’s initial guess for the launch calendar date. Be sure to include all four
digits of the calendar year.
launch calendar date initial guess (month, day, year)
6,1,2003
The software allows the user to specify an initial guess for the launch and arrival calendar dates and
lower and upper bounds on the actual dates found during the optimization process. For any guess for
page 212
launch time t L and user-defined launch time lower and upper bounds tl and tu , the launch time t is
constrained as follows:
tL − tl t tL + tu
Likewise, for any guess for arrival time t A and user-defined arrival time bounds tl and tu , the arrival
time t is constrained as follows:
t A − tl t t A + tu
For fixed launch and/or arrival times, the lower and upper bounds should be set to 0.
The next two inputs are the lower and upper bounds for the launch calendar date search interval. These
values should be input in days.
launch date search boundary (days)
-30, +30
The next program input is an integer that specifies the launch planet.
*****************
* launch planet *
*****************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
----------
3
The next set of inputs defines the user’s initial guess for the arrival calendar date, the search interval and
the arrival planet/comet/asteroid.
**************************
* arrival celestial body *
**************************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
0 = asteroid/comet
-------------------
4
The next series of inputs include the name and classical orbital elements of a comet or asteroid (arrival
celestial body = 0). Please note that the angular orbital elements must be specified with respect to a
page 213
heliocentric, Earth mean ecliptic and equinox of J2000 coordinate system. The calendar date of
perihelion passage should be with respect to the TDB time system. Please consult Appendix F –
Computing an Asteroid or Comet Ephemeris for additional information about this option.
*********************************************
* asteroid/comet classical orbital elements *
* (heliocentric, Earth mean ecliptic J2000) *
*********************************************
asteroid/comet name
Tempel 1
This next integer 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 Sparse Optimization Suite. Options 2 and 3 allow the user to specify either the
number of nodes (option 2) or time step size of the data file (option 3).
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-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 (option 2) or the time step size
of the data output in the solution file (option 3).
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. Information about the contents of this file
is provided later in this document.
name of solution output file
mars03.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 *
page 214
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
The next input defines the relative error in the objective function.
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.
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.
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
10000
The level of output from the NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
The level of output from the Sparse Optimization Suite 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
page 215
The level of output from the differential equation 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
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
The following is the program output created by the ipto_sos simulation for this example. The first
part of the solution display summarizes important information about the type of trajectory and the type
of optimization and the launch conditions. Please note the launch hyperbola coordinates are with respect
to the Earth mean equator and equinox of J2000 (EME2000) system. The second part of the display
summarizes the arrival conditions and characteristics of the planetary and heliocentric transfer orbits.
program ipto_sos
================
rendezvous trajectory
minimize total delta-v
DE421 ephemeris
DEPARTURE CONDITIONS
====================
page 216
declination -5.46005203692079 degrees
C3 8.79401178149709 (km/sec)**2
ARRIVAL CONDITIONS
==================
C3 7.30123202312836 (km/sec)**2
page 217
------------------------------------------
The simulation also provides the total delta-v for the mission along with the transfer time in days.
total delta-v 5667.54911276387 meters/second
The ipto_sos software will create two comma-separated-variable (csv) output files. The first file
contains the heliocentric, ecliptic state vector of the spacecraft and the second file (planets.csv)
contains the state vectors of the planet and the destination celestial body. These data files can be used to
create graphic displays of the trajectory.
The following is the transfer trajectory for this example. It is a view of the trajectory and planetary
orbits from the north pole of the ecliptic looking down on the ecliptic plane. The Earth’s orbit trace is
green and the orbit of Mars is blue. The transfer trajectory is red and the x-y scales are in astronomical
units. The small blue dot is the location of Mars at Earth departure.
page 218
Verification of the optimal control solution
The optimal control solution determined by the Sparse Optimization Suite can be verified by
numerically integrating the n-body orbital equations of motion with the SOS-computed initial departure
conditions and the optimal delta-v vectors. This is equivalent to solving an initial value problem (IVP)
that uses the optimal solution. This part of the ipto_sos computer program uses a Runge-Kutta-
Fehlberg 7(8) variable step size method to integrate the orbital equations of motion.
The following is a display of the final solution computed using this explicit numerical integration
method. This display includes the final heliocentric orbital elements of the spacecraft along with the
position and velocity “matching” errors.
========================================
verification of optimal control solution
========================================
An initial guess for the launch and arrival impulsive delta-v vectors can be determined from the solution
of the Lambert two-point boundary-value problem (TPBVP). Lambert’s Theorem states that 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. Please consult Appendix I – Numerical Solutions of Lambert’s
Problem for additional information about Lambert’s problem.
The Lambert solution that initializes the ipto_sos software uses the user’s initial guess for launch and
arrival dates. The dynamic variables at each grid point of the initial guess are determined by setting the
initial guess option INIT(1) = 6 with INIT(2) = 2 within the odeinp subroutine for this aerospace
trajectory optimization problem. These program options create an initial guess from the numerical
page 219
integration of the equations of motion coded in the oderhs subroutine. The INIT(1) = 6 program
option tells the Sparse Optimization Suite to construct an initial guess by solving an initial value
problem (IVP) with a linear control approximation. The INIT(2) = 2 program option tells the
software to use the Dormand-Prince variable step size numerical method to solve the initial value
problem.
The algorithm used in this computer program to solve the two-body Lambert problem 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.
Problem setup
This section provides additional details about the software implementation. For good scaling during the
optimization, the time unit used in all internal calculations is days, position is expressed in astronomical
units, and the unit for velocity and delta-v is astronomical units per day.
The software allows the user to specify an initial guess for the launch and arrival calendar dates and
bounds on the actual dates found during the optimization process. For any guess for launch time t L and
user-defined launch time search bound tL , the launch time t is constrained as follows:
t L − t L t t L + t L
Likewise, for any guess for arrival time t A and user-defined arrival time bound t A , the arrival time t is
constrained as follows:
t A − t A t t A + t A
For fixed launch and/or arrival times, the lower and upper bounds are set to 0.
The objective function or performance index J for this simulation is one of three possible delta-v’s. For
this classic trajectory optimization problem, this index is simply J = V where V is either the launch
delta-v, arrival delta-v or the total delta-v. The value of the maxmin indicator in the Sparse
Optimization Suite software tells the program whether the user is minimizing or maximizing the
performance index. The type of delta-v optimization is selected by the user.
For any launch time t L , the optimal solution for a rendezvous trajectory must satisfy the following state
vector boundary conditions (equality constraints) at launch:
rs / c ( t L ) − rp ( tL ) = 0
Vs / c ( t L ) − Vp ( t L ) + V ( t L ) = 0
page 220
where rs / c and Vs / c are the heliocentric, inertial position and velocity vectors of the spacecraft at the
launch time t L , rp and Vp are the heliocentric, inertial position and velocity vectors of the departure
planet at the launch time, and V is the impulsive heliocentric delta-v vector required at launch.
For any arrival time t A , the optimal solution for a rendezvous trajectory must satisfy the following state
vector boundary conditions at arrival:
rs / c ( t A ) − rp ( t A ) = 0
Vs / c ( t A ) − Vp ( t A ) + V ( t A ) = 0
where rs / c and Vs / c are the heliocentric, inertial position and velocity vectors of the spacecraft at the
arrival time t A , and rp and Vp are the heliocentric, inertial position and velocity vectors of the
destination planet at the arrival time, and V is the impulsive heliocentric delta-v vector required at
arrival.
This system of launch and arrival state vector equality constraints ensures a rendezvous mission. For a
flyby mission, the velocity vector point functions at arrival are not enforced.
The components of the departure and arrival impulsive delta-v’s are the optimization parameters used
by the Sparse Optimization Suite to solve this trajectory problem.
Technical discussion
The spacecraft motion is modeled using Cowell’s form of the heliocentric equations of motion. Please
consult Appendix C – Cartesian Equations of Motion for the numerical methods implemented in this
software.
The deltav’s required at launch and arrival are simply the differences between the velocity on the
optimal transfer trajectory and the heliocentric velocities of the two celestial objects. If we treat each
planet as a point mass and assume impulsive maneuvers, the planet-centered magnitude and direction of
the required maneuvers are given by the two vector equations:
page 221
The scalar magnitude of each maneuver is also called the “hyperbolic excess velocity” or V at launch
and arrival. The hyperbolic excess velocity is the speed of the spacecraft relative to each planet or
celestial body at an infinite distance from the planet. Furthermore, the energy or C 3 at launch or arrival
is equal to V2 for the respective maneuver. C 3 is also equal to twice the orbital energy per unit mass
(the specific orbital energy).
The orientation of the departure hyperbola is specified in terms of the right ascension and declination of
the outgoing asymptote. These coordinates can be calculated using the Cartesian components of the V
velocity vector.
( )
The right ascension of the asymptote is determined from = tan V y , Vz and the geocentric
−1
( )
declination of the asymptote is given by = 900 − cos −1 Vˆz where Vˆx , Vˆy and Vˆz are the x, y
and z components of the unit V vector. The right ascension is computed using a four-quadrant inverse
tangent function.
In this computer program the heliocentric planetary coordinates and therefore the V vectors are
computed in the Earth mean ecliptic and equinox of J2000 coordinate system. This coordinate system
along with useful transformations can be found in Appendix G – Aerospace Trajectory Coordinates and
Time Systems
This section summarizes typical trajectory characteristics of a ballistic flyby mission from Earth to the
comet Tempel 1. This simulation minimizes the magnitude of the launch delta-v at the Earth departure.
Please note for a flyby trajectory input file (trajectory type = 1), the only valid delta-v
optimization option is 1 = minimize launch delta-v.
*******************
* simulation type *
*******************
1 = minimize launch delta-v
2 = minimize arrival delta-v
3 = minimize total delta-v
4 = no optimization
-----------------------------
1
page 222
*****************
* launch planet *
*****************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
----------
3
**************************
* arrival celestial body *
**************************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
0 = asteroid/comet
-------------------
0
*********************************************
* asteroid/comet classical orbital elements *
* (heliocentric, Earth mean ecliptic J2000) *
*********************************************
asteroid/comet name
Tempel 1
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = OC-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
1
page 223
name of solution output file
tempel1.csv
********************************
* algorithm control parameters *
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
1
**********************
optimal control output
----------------------
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
****************************
differential equation output
----------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
1
*******************
user-defined output
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
Here’s the optimal solution for this example including the verification results.
program ipto_sos
================
page 224
flyby trajectory
DE421 ephemeris
DEPARTURE CONDITIONS
====================
C3 10.3600286763368 (km/sec)**2
ARRIVAL CONDITIONS
==================
page 225
heliocentric orbital elements and state vector of the planet/asteroid/comet
(Earth mean ecliptic and equinox of J2000)
------------------------------------------
========================================
verification of optimal control solution
========================================
Here’s the graphics display of the interplanetary transfer trajectory along with the planet and comet
heliocentric orbits. The transfer trajectory is red and the scales are in astronomical units. For this
example we can see that encounter with Tempel 1 occurs near perihelion of the comet’s orbit.
page 226
Contents of the simulation summary and csv files
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the ipto_sos software. All output except the coordinates of the launch
hyperbola is computed and displayed in a heliocentric, Earth mean ecliptic and equinox of J2000
coordinate system.
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
page 227
period (days) = orbital period in days
The comma-separated-variable disk file is created by the odeprt subroutine and contains the following
information:
time (days) = simulation time since launch in days
rp1-x (au) = x-component of the launch planet position vector in astronomical units
rp1-y (au) = y-component of the launch planet position vector in astronomical units
rp1-z (au) = z-component of the launch planet position vector in astronomical units
rp2-x (au) = x-component of the destination body position vector in astronomical units
rp2-y (au) = y-component of the destination body position vector in astronomical units
rp2-z (au) = z-component of the destination body position vector in astronomical units
“Update to Mars Coordinate Frame Definitions”, R. A. Mase, JPL IOM 312.B/015-99, 15 July 1999.
page 228
“The Planetary and Lunar Ephemeris DE 421”, W. M. Folkner, J. G. Williams, and D. H. Boggs, JPL
IOM 343R-08-003, 31 March 2008.
“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.
“Preliminary Mars Planetary Constants and Models for Mars Sample Return”, D. Lyons, JPL IOM
312/99.DTL-1, 20 January 1999.
“Interplanetary Mission Design Handbook, Volume 1, Part 2”, JPL Publication 82-43, September 15,
1983.
“An Introduction to the Mathematics and Methods of Astrodynamics, Revised Edition”, Richard H.
Battin, AIAA Education Series, 1999.
“A Procedure for the Solution of Lambert’s Orbital Boundary-Value Problem”, Robert H. Gooding,
Celestial Mechanics and Dynamical Astronomy 48: 145-165, 1990.
page 229
CMATO 12 – Earth-to-Mars End-to-End Mission Design
This CMATO application is a Fortran computer program named e2m_ftn that can be used to design and
optimize ballistic interplanetary missions from Earth park orbit to B-plane encounter at Mars. The
software assumes that interplanetary injection occurs impulsively from a circular Earth park orbit. The
B-plane coordinates are expressed in a Mars-centered (areocentric) mean equator and IAU node of
epoch coordinate system. The B-plane targets are enforced using either a combination of flight path
angle, periapsis radius and orbital inclination at a Mars-centered entry interface (EI) or individual B-
plane coordinates ( B T and B R ) of the arrival hyperbola. The type of targeting and the target values
are defined by the user.
The software includes two options for creating an initial guess for the simulation. The first option
allows the user to input the departure calendar date and time along with the C3, RLA and DLA “targets”
for the Earth departure hyperbola. The second initial guess option computes these initial target
conditions using an optimized two-body Lambert or “patched-conic” solution.
When the two-body Lambert initial guess option is selected, the first part of the e2m_ftn computer
program solves for the minimum delta-v using a patched-conic, two-body Lambert solution for the
transfer trajectory from Earth to Mars. The second part implements a simple shooting method that
attempts to optimize the characteristics of the geocentric injection hyperbola while numerically
integrating the spacecraft’s geocentric and heliocentric equations of motion and targeting to components
of the B-plane relative to Mars.
The spacecraft motion within the Earth’s sphere-of-influence (SOI) includes non-spherical Earth gravity,
the point-mass perturbation of the sun and moon, and optionally the point-mass perturbations of planets.
The heliocentric equations of motion include the point-mass gravity of the sun, moon, and all planets of
the solar system. The software also includes the option to include the effect of solar radiation pressure
in both the geocentric and heliocentric phases of the spacecraft’s orbital motion.
For the patched-conic initial guess option, the user can select one of the following delta-v optimization
options for the two-body solution of the interplanetary transfer trajectory:
• solve the two-body, patched-conic interplanetary Lambert problem for the energy C 3 ,
declination (DLA) and asymptote (RLA) of the outgoing or departure hyperbola (only performed
for the two-body Lambert initial guess)
• compute the orbital elements of the geocentric departure hyperbola and the components of the
interplanetary injection delta-v vector
• perform geocentric orbit propagation from perigee of the geocentric departure hyperbola to the
user-defined value of the Earth’s sphere-of-influence (SOI)
page 230
• perform an n-body heliocentric orbit propagation from the Earth’s SOI to either closest approach
or entry interface (EI) at Mars
• target to the user-defined B-plane coordinates while minimizing the magnitude of the hyperbolic
v-infinity at Earth departure (equivalent to minimizing the departure energy since C3 = V2 )
This computer program uses a nonlinear programming (NLP) algorithm included in the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve both the patched-conic
and numerically integrated trajectory optimization problems. The lunar, solar and planetary coordinates
required by the software are computed using the JPL DE421 ephemeris.
The e2m_ftn 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 data items. ASCII text input is not case sensitive but must be spelled correctly. In the
following discussion, the actual input file contents are in bold courier font and all explanations are in
times 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.
*******************************
** Earth-to-Mars interplanetary
** trajectory optimization
** Mars '03 example - mars03.in
** August 21, 2012
*******************************
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
--------------------------------------
e2m_cm.dat
The following is a typical user-defined constants and models data file named e2m_cm.dat. 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.
****************************************
* e2m_ftn constants and models data file
****************************************
page 231
solar flux at 1 AU (watts/meters**2)
------------------------------------
1366.1d0
The second program input is the difference between ephemeris time (Terrestrial Time) and Universal
Coordinated Time (UTC) in seconds.
ET-UTC (seconds)
----------------
64.132d0
The next program input is an integer that specifies the type of initial guess to use.
*********************
type of initial guess
*********************
1 = user-defined
2 = two-body Lambert
---------------------
1
The next series of data items are the user-defined values when using initial guess option 1. Please note
that the right ascension (RLA) and declination (DLA) of the departure hyperbola must be input relative
to the Earth mean equator and equinox of J2000 (EME2000) coordinate system.
**************************
user-defined initial guess
**************************
user-defined C3 (kilometers^2/second^2)
8.787
page 232
user-defined EME2000 DLA (degrees; -90 <= DLA <= +90)
-6.697
The next set of data items are used whenever the user has selected the two-body Lambert initial guess
program option.
This data item is an integer that defines the type of patched-conic trajectory optimization.
********************************
two-body Lambert simulation type
********************************
1 = minimize departure delta-v
2 = minimize arrival delta-v
3 = minimize total delta-v
---------------------------
1
The software allows the user to specify an initial guess for the departure and arrival calendar dates and a
search interval. For any guess for departure time t L and user-defined search interval t , the departure
time t is constrained as follows
t L − t t t L + t
Likewise, for any guess for arrival time t A and user-defined search interval, the arrival time t is
constrained as follows
t A − t t t A + t
For fixed departure and/or arrival times, the search interval should be set to 0.
The next input defines an initial guess for the departure calendar date. Please be sure to include all
digits of the calendar year.
departure calendar date initial guess (month, day, year)
6,1,2003
These two numbers define the lower and upper search interval for the departure calendar date.
departure date search boundary (days)
-30, +30
The next input defines an initial guess for the arrival calendar date.
arrival calendar date initial guess (month, day, year)
12,1,2003
These two numbers define the lower and upper search interval for the arrival calendar date.
arrival date search boundary (days)
-30, +30
The next two inputs define the altitude and orbital inclination of the circular park orbit.
*************************
geocentric phase modeling
*************************
page 233
Park orbit inclination (degrees)
28.5d0
The name of the ASCII data file containing the Earth gravity model data is specified in the next line.
Please see the Technical Discussion section later in this document for a description and format of the
data in this file.
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
The next integer input “toggles” the option to include planetary point-mass perturbations during the
geocentric phase of the targeting process.
include planetary point-mass perturbations (1 = yes, 0 = no)
1
This next integer specifies which injection opportunity is used by the software when calculating the
characteristics of the departure hyperbola.
injection opportunity (1 or 2)
1
The next input specifies the type of targeting at Mars performed by the e2m_ftn computer program.
Option 1 will target to user-defined components of the B-plane at closest approach to Mars, and option 2
will target to a Mars-centered hyperbola with a user-specified flight path angle, areocentric radius, and
orbital inclination.
************************
Mars encounter targeting
************************
type of targeting
(1 = B-plane, 2 = orbital elements)
2
The next two inputs are the user-defined B-plane components used with targeting option 1.
B dot T
10965.19767
B dot R
-6109.045096
The next three inputs define the flight path angle, radius, and the orbital inclination of the encounter
hyperbola at Mars. These flight conditions are used by targeting option 2. The radius is with respect to
a spherical Mars model and the orbital inclination is with respect to the mean equator of Mars.
areocentric flight path angle (degrees)
0.0
page 234
areocentric radius (kilometers)
5000.0
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 and SRP properties
**********************************
The last three inputs are algorithm control parameters that define the lower and upper bounds on the v-
infinity, right ascension, and declination of the geocentric departure hyperbola.
****************************
algorithm control parameters
****************************
Program example
The following is the solution created with this computer program for this example. The output is
organized by the following major sections
• two-body/patched-conic pass
1) two body Lambert solution (if initial guess option 2)
2) departure hyperbola orbital elements and state vector
3) heliocentric coordinates of Earth at departure and Mars at arrival
4) heliocentric coordinates of the spacecraft on the transfer trajectory
• targeting/optimization pass
1) optimized characteristics of the departure hyperbola
2) heliocentric coordinates of the spacecraft and Mars at encounter
3) geocentric and heliocentric coordinates of the spacecraft at the Earth SOI
page 235
The first output section summarizes the two-body Lambert solution. The solution is provided in the
heliocentric, Earth mean equator and equinox of J2000 (EME2000) coordinate system.
******************************
two-body Lambert initial guess
******************************
=========================
two-body Lambert solution
=========================
page 237
rx (km) ry (km) rz (km) rmag (km)
0.149989634184D+09 0.146777512084D+09 0.632696170860D+08 0.219188441443D+09
The following numerical output summarizes the orbital characteristics of the initial circular park orbit
and the departure hyperbola.
--------------------------------------------------
park orbit and departure hyperbola characteristics
(Earth mean equator and equinox of J2000)
--------------------------------------------------
park orbit
----------
page 238
departure hyperbola
-------------------
c3 8.78714081093365 km**2/sec**2
The following program output summarizes the flight conditions determined by the n-body, numerically
integrated optimal solution.
=======================
optimal n-body solution
=======================
--------------------------------------------------
park orbit and departure hyperbola characteristics
(Earth mean equator and equinox of J2000)
--------------------------------------------------
park orbit
----------
departure hyperbola
-------------------
c3 8.78410346610767 km**2/sec**2
The final program output summarizes both the geocentric and heliocentric spacecraft trajectory
characteristics at the Earth’s sphere-of-influence (SOI).
spacecraft geocentric coordinates at Earth SOI
(Earth mean equator and equinox of J2000)
-----------------------------------------
page 242
rx (km) ry (km) rz (km) rmag (km)
-.319320050194D+08 -.136203485017D+09 -.590719534469D+08 0.151856965462D+09
The e2m_ftn computer program will also create three comma-separated-variable (csv) data files. These
files summarize the geocentric (e2m_geo.csv), heliocentric (e2m_helio.csv) and areocentric
(e2m_areo.csv) trajectory characteristics of the spacecraft.
The following is a graphics display of the geocentric departure trajectory for this example for motion
within 30,000 kilometers of the Earth. Injection occurs at perigee of the departure hyperbola which is
denoted by the small red dot. The EME2000 x-axis (red), y-axis (green) and z-axis (blue) are also
shown on the Earth. The coordinates are displayed in Earth radii (ER).
The following is a screen display of the areocentric or Mars-centered trajectory within 50,000 kilometers
of Mars. Closest approach occurs at perigee of the approach hyperbola which is labeled with a small red
dot. The x-axis (red), y-axis (green) and z-axis (blue) are also shown relative to the mean equator of
Mars and the IAU node of epoch. The coordinates are displayed in Mars radii (MR).
page 243
Technical discussion
This section describes the algorithm used to determine the Earth-centered-inertial (ECI) state vector of a
departure hyperbola for interplanetary missions. In the discussion that follows, interplanetary injection
is assumed to occur impulsively at perigee of the departure hyperbola.
The departure trajectory for interplanetary missions can be defined using the specific (per unit mass)
orbital energy C 3 , and the right ascension (RLA) and declination (DLA) of the outgoing
asymptote. The perigee radius of the departure hyperbola is calculated from the user’s value for the
altitude of the circular park orbit and the radius of the Earth.
The following figure illustrates the geometry of interplanetary injection. In this diagram VhEARTH is the
heliocentric velocity vector of the Earth at departure, Vhs/c is the heliocentric velocity vector of the
spacecraft at departure, V is the geocentric v-infinity or excess velocity vector and Vl is the velocity
vector of the departure hyperbola at perigee.
From the velocity vector diagram, V = Vhs/c − VhEARTH . The heliocentric velocity vector of the spacecraft
at departure is determined from the two-body Lambert solution for the heliocentric transfer trajectory.
The heliocentric velocity vector of the Earth at departure is determined from a JPL ephemeris.
The two-body Lambert solution is used to initialize the n-body integrated solution by assuming the
orientation of the outgoing asymptote of the departure hyperbola can be determined from the
components of the geocentric V velocity vector.
page 244
The twice specific (per unit mass) orbital energy of the departure hyperbola is C3 = V2 . The right
ascension and declination of the departure asymptote can be determined from the components of
(
the v-infinity vector according to = tan −1 V y ,V x ) and ( )
= sin −1 V z V . The inverse tangent
used in the first equation is a four-quadrant calculation.
Since the right ascension of the outgoing asymptote is an inertial coordinate, it should not be called the
longitude of the asymptote. This terminology also applies to the right ascension of the ascending node.
This figure was extracted from page 2 of Interplanetary Mission Design Handbook, Volume 1, Part 2,
JPL Publication 82-43, September 15, 1983.
The orbital inclination is computed from the user-defined launch azimuth L (measured positive
clockwise from north) and launch site geocentric latitude L using this equation
The algorithm used to design the departure hyperbola is valid for geocentric orbit inclinations that
satisfy the following inequality constraint
i
If this inequality is not satisfied, the software will print the following error message
park orbit error!!
The code will also print the inclination of the park orbit, the declination of the departure hyperbola and
pause. The user can then change either the azimuth, launch site latitude or orbital inclination to satisfy
this constraint and restart the script.
page 245
cos cos
Sˆ = cos sin
sin
where
= right ascension of departure asymptote (RLA)
= declination of departure asymptote (DLA)
The T-axis direction of the B-plane coordinate system is determined from the following vector cross
product
Tˆ = Sˆ uˆ
z
The following cross product operation completes the B-plane coordinate system.
ˆ = Sˆ Tˆ
R
The B-plane angle is determined from the orbital inclination of the departure hyperbola i and the
declination of the outgoing asymptote according to
cos = cos i cos
hˆ = Tˆ sin − R
ˆ cos
The sine and cosine of the true anomaly at infinity are given by the next two equations
cos = − sin = 1 − cos2
rp V +
2
A unit vector in the direction of perigee of the departure hyperbola is determined from
( )
rˆ p = Sˆ cos − hˆ Sˆ sin
The scalar magnitude of the departure hyperbola perigee velocity can be determined from
2
Vp = + V2 = Vlc2 + V2
rp
page 246
where Vlc = rp is the local circular velocity.
Finally, the classical orbital elements of the departure hyperbola can be determined from the position
and velocity vectors at perigee. The impulsive injection delta-v vector and magnitude can be determined
from the velocity difference between the local circular velocity of the park orbit and the geocentric
velocity of the departure hyperbola each evaluated at the orbital location of the propulsive maneuver.
Capture maneuver
Typically, a retrograde propulsive maneuver is performed at periapsis to create an elliptical orbit about
Mars. At the next or any subsequent apoapsis, an efficient plane change maneuver can be performed to
establish the orbital inclination of the mission orbit. Finally, one or more propulsive maneuvers at
periapsis will establish a circular or elliptical mission orbit.
The velocity decrement required to establish an elliptical capture orbit of eccentricity e is given by
2 (1 + e ) 2 2 ra
v = v2 + − = v2 + −
rp rp rp rp ( ra + rp )
where rp and ra are the periapsis and apoapsis radii of the capture orbit.
For a circular capture orbit of radius r, the impulsive delta-v equation simplifies to
2 2
v = v2 + − = v2 + − vlc
r r r
If we set the partial derivative v ra = 0 from the elliptical orbit capture expression, we find a “best”
capture apoapsis radius and corresponding minimum delta-v according to
2 1− e
ra = v = v
v2 2
where e = ra − rp ra + rp is the orbital eccentricity of the elliptical capture orbit. Notice the optimum
apoapsis radius is dependent only on the incoming v-infinity and the planet’s gravity.
Likewise, the optimum capture periapsis radius and minimum capture delta-v is
2 1 − e 2 (1 + e )
rp = v = v2 + −
v2 1 + e rp rp
page 247
For a circular capture orbit, the optimum periapsis and apoapsis radii are identical and the minimum
delta-v is as follows
2 2
ra = rp = 2 v = v2 + −
v r r
The following two plots illustrate the behavior of capture delta-v as a function of the eccentricity of the
capture orbit. Each line of the graphs is labeled with a small circle to indicate the optimum radius and
impulsive capture delta-v. The v-infinity for this example is 2.8 kilometers meters/second.
In the graph on the left, we can see that the optimum apoapsis radius is independent of orbital
eccentricity.
The reduction in delta-v required for capture between a circular and elliptical orbit is given by
( )
( v ) = vlc 1 + e − 1 where vlc is the local circular velocity evaluated at the periapsis of the capture
orbit and e is the orbital eccentricity of the capture orbit. The following is a graph of the impulsive
delta-v reduction in meters/second as a function of the capture orbit periapsis radius and orbital
eccentricity.
page 248
As an exercise, see if you can derive the expression for the optimum circular orbit radius rc from
−1 2
2 1
v = − v2 + rc−2 + rc−3 2 = 0
rc rc 2
Hint: multiply the expression by rc3 2 , rearrange and square the result. Solve for rc .
Questions: are these equations and results valid as well for the Earth departure hyperbolic trajectory? Is
there a reasonable optimal circular orbit altitude that minimizes the interplanetary injection delta-v?
The spacecraft’s orbital motion is modeled with respect to the Earth mean equator and equinox of J2000
(EME2000) coordinate system described in Appendix C – Cartesian Equations of Motion.
The second-order, vector system of heliocentric equations of motion for point-mass gravity
perturbations such as the Moon or planets are given by
n
d s
r = − j 3j + 3j
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.
Following the geocentric formulation, use is again made of Professor Battin’s F ( q ) function given by
3 + 3qk + qk2
F ( qk ) = qk 3
(
1 + 1 + qk )
where
rT ( r − 2sk )
qk =
sTk sk
The heliocentric acceleration vector of the spacecraft due to solar radiation pressure is given by:
rsc
a srp = csrp 3
rsc
page 249
where rsc is the heliocentric position vector of the spacecraft. The equation for csrp is defined in the
previous geocentric trajectory propagation discussion.
The B-plane
A description of the B-plane geometry and important equations can be found in Appendix D – B-Plane
Geometry, Coordinates and Targeting.
The trajectory conditions at the boundary of the Earth’s sphere of influence are determined during the
numerical integration of the spacecraft’s geocentric equations of motion by finding the time at which the
difference between the geocentric distance and the user-defined value is essentially zero. This scalar
mission constraint is r = rsc p − rsoiu 0 where rsc p is the scalar magnitude of the predicted geocentric
position vector of the spacecraft and rsoiu is the user-defined value of the geocentric distance of the SOI
boundary.
Targeting to the Mars-centered flight path angle, periapsis radius and orbital inclination
The software solves the B-plane targeting problem by minimizing the magnitude of the hyperbolic
injection maneuver 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.
The predicted flight path angle is p = sin −1 ( r v r v ) where r and v are the Mars-centered position and
velocity vectors, respectively.
Both the geocentric SOI boundary and areocentric flight path angle are predicted using a Runge-Kutta-
Fehlberg (RKF7(8)) integrator embedded within a one-dimensional derivative-free form of Brent’s root-
finding method.
For this targeting option, the following series of equations can be used to determine the required B-plane
target vector
B T = bt cos B R = bt sin
where
2 ru
bt = cos u 2
+ ru2
v
In these equations, u is the user-defined flight path angle, and ru is the user-defined Mars-centered
radius at the entry interface. Note that a user-defined flight path angle equal to zero will predict closest
approach at Mars. Furthermore, for this case r will be equal to the periapsis radius of the incoming
areocentric hyperbola.
page 250
cos iu
cos = sin = − 1 − cos 2
cos
sin = sˆ zˆ = sx2 + s 2y
zˆ = 0 0 1
T
cos cos sx
ˆS =
cos sin = s y
sin s
z
where and are the declination and right ascension of the asymptote of the incoming hyperbola at
Mars.
The nonlinear equality mission constraints enforced by the nonlinear programming algorithm are
( B T ) p − ( B T )r 0 (B R ) p − ( B R )r 0
where the p subscript refers to coordinates predicted by the software and the r subscript denotes the
required B-plane coordinates defined previously.
Important note!!
This technique is valid for aerocentric orbit inclinations that satisfy the following inequality
i
If this requirement is not satisfied, the software will print the following error message
b-plane targeting error!!
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.
For this targeting option, the nonlinear equality constraints enforced by the nonlinear programming
algorithm are
( B T ) p − ( B T )u = 0 ( B R ) p − ( B R )u = 0
page 251
where the p subscript refers to coordinates predicted by the software and the u subscript denotes
coordinates provided by the user. The predicted B-plane coordinates are based on the Mars-centered
flight conditions at closest approach.
Please consult Appendix G – Aerospace Trajectory Coordinates and Time Systems which describes the
relationship between geocentric and areocentric coordinate systems.
This section contains typical graphic displays of important flight characteristics during the different
phases of the mission. The geocentric and heliocentric plots are relative to the EME2000 coordinate
system and the areocentric graphs are relative to the Mars mean equator and IAU node of epoch.
The first three plots are geocentric flight parameters as a function of time since the hyperbolic injection.
The data displays terminate at exit from the Earth’s sphere-of-influence (SOI).
page 252
These next two plots are heliocentric trajectory characteristics as a function of time since exit from the
Earth’s sphere-of-influence (SOI). The data terminates when the spacecraft is within two days of closest
approach to Mars.
The final two plots are Mars-centered trajectory characteristics as a function of time since exit from the
Earth’s SOI. The data display starts when the spacecraft is 600,000 kilometers from Mars and ends at
closest approach to Mars. The orbital inclination is relative to the mean equator of Mars.
The following is the e2m_ftn optimal n-body program output for a typical entry interface example.
For this example, the areocentric flight path angle is -2 degrees, the areocentric radius is 3500
kilometers, and the areocentric orbital inclination target is 45 degrees.
=======================
optimal n-body solution
=======================
--------------------------------------------------
park orbit and departure hyperbola characteristics
(Earth mean equator and equinox of J2000)
--------------------------------------------------
page 253
park orbit
----------
departure hyperbola
-------------------
c3 8.79578987310781 km**2/sec**2
page 254
UTC time 22:41:24.592
page 255
sma (au) eccentricity inclination (deg) argper (deg)
0.124418233994D+01 0.260193891025D+00 0.185282046360D+02 0.281382377649D+03
This section is a summary of the e2m_ftn program output for a simulation which exercised the user-
defined initial guess option. The used-defined conditions for this case are as follows.
**************************
user-defined initial guess
**************************
user-defined C3 (kilometers^2/second^2)
8.787
--------------------------------------------------
park orbit and departure hyperbola characteristics
(Earth mean equator and equinox of J2000)
--------------------------------------------------
park orbit
----------
page 256
departure hyperbola
-------------------
c3 8.78700000000000 km**2/sec**2
=======================
optimal n-body solution
=======================
--------------------------------------------------
park orbit and departure hyperbola characteristics
(Earth mean equator and equinox of J2000)
--------------------------------------------------
park orbit
----------
page 257
rx (km) ry (km) rz (km) rmag (km)
-.592542356145D+04 -.181753927773D+04 0.215984114297D+04 0.656346000000D+04
departure hyperbola
-------------------
c3 8.78410344274025 km**2/sec**2
page 258
vx (kps) vy (kps) vz (kps) vmag (kps)
0.220854505835D+01 -.407978431421D+01 -.172145511153D+01 0.494830466183D+01
page 259
calendar date June 8, 2003
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the e2m_ftn software.
UTC Julian Date = Julian Date of trajectory event on UTC time scale
TDB Julian Date = Julian Date of trajectory event on TDB time scale
page 260
inclination (deg) = orbital inclination in degrees
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
launch azimuth = launch azimuth in degrees measure positive clockwise from north
delta-v magnitude = scalar magnitude of the injection delta-v in meters per second
page 261
time (hrs) = simulation time since interplanetary injection in hours
raan-geo (deg) = geocentric right ascension of the ascending node of the spacecraft in
degrees
page 262
rs2m-y (au) = y-component of Mars heliocentric position vector in astronomical units
raan-heo (deg) = heliocentric right ascension of the ascending node of the spacecraft in
degrees
raan-areo (deg) = areocentric right ascension of the ascending node of the spacecraft in
degrees
page 263
The geocentric and heliocentric coordinates of the spacecraft are with respect to the Earth mean equator
and equinox of J2000 (EME2000) coordinate system. The areocentric coordinates of the spacecraft are
with respect to the areocentric (Mars-centered) mean equator and IAU node of epoch coordinate system.
“Update to Mars Coordinate Frame Definitions”, R. A. Mase, JPL IOM 312.B/015-99, 15 July 1999.
“The Planetary and Lunar Ephemeris DE 421”, W. M. Folkner, J. G. Williams, and D. H. Boggs, JPL
IOM 343R-08-003, 31 March 2008.
“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.
“Preliminary Mars Planetary Constants and Models for Mars Sample Return”, D. Lyons, JPL IOM
312/99.DTL-1, 20 January 1999.
“Interplanetary Mission Design Handbook, Volume 1, Part 2”, JPL Publication 82-43, September 15,
1983.
“An Introduction to the Mathematics and Methods of Astrodynamics, Revised Edition”, Richard H.
Battin, AIAA Education Series, 1999.
“A Procedure for the Solution of Lambert’s Orbital Boundary-Value Problem”, Robert H. Gooding,
Celestial Mechanics and Dynamical Astronomy 48: 145-165, 1990.
page 264
CMATO 13 – Interplanetary Gravity-Assist Trajectory Optimization
This CMATO application is a Fortran computer program named flyby_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the classic one impulse
flyby and two-impulse rendezvous, ballistic gravity-assist interplanetary trajectory optimization
problems. The software attempts to minimize the launch delta-v, the arrival delta-v or the total mission
delta-v. The type of trajectory optimization is specified by the user. The destination object for the
simulation can also be a comet or asteroid.
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 flyby_sos 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 using a sparse nonlinear programming (NLP) method. The flyby_sos
software allows the user to select the type of collocation method and other important algorithm control
parameters.
page 265
Input file format and contents
The flyby_sos computer program is “data-driven” by a simple text file created by the user. The
contents of this file include such things as initial guesses, the discretization method, and algorithm
control parameters. The following is a typical input file used by this computer program. This example
is an Earth-to-Mars trajectory with a gravity-assist from Venus. The performance index for this example
is the total delta-v for the mission. Please note for a flyby trajectory input file (trajectory type =
1), the only optimization option is 1 = minimize launch delta-v.
In the following discussion the actual input file contents are in courier font and all explanations are in
times font. Please note the fundamental time argument in this computer program is Barycentric
Dynamical Time (TDB).
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.
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.
********************************************************
** gravity-assist interplanetary trajectory optimization
** patched-conic heliocentric motion
** Earth-to-Venus-to-Mars - evm.in
** May 10, 2011
********************************************************
The first program input is an integer that defines the type of delta-v optimization. Please note that
option 4, no optimization simply solves the orbital two-point boundary value problem subject to the
user-defined flyby altitude constraint.
*******************
* simulation type *
*******************
1 = minimize launch delta-v
2 = minimize arrival delta-v
3 = minimize total delta-v
4 = no optimization
----------------------------------
3
The next input is an integer that tells the simulation what type of trajectory to model.
trajectory type (1 = flyby at destination, 2 = rendezvous)
2
The next three inputs are the user’s initial guess for the launch calendar date. Be sure to include all four
digits of the calendar year.
launch calendar date initial guess (month, day, year)
2,1,2009
The software allows the user to specify an initial guess for the launch, flyby and arrival calendar dates,
and lower and upper bounds on the actual launch, flyby and arrival calendar dates found during the
page 266
optimization process. For any guess for launch time t L and user-defined launch time lower and upper
bounds tl and tu , the launch time t is constrained as
tL − tl t tL + tu
Likewise, for any guess for arrival time t A and user-defined arrival time bounds tl and tu , the arrival
time t is constrained as follows
t A − tl t t A + tu
For fixed launch, flyby or arrival times, the lower and upper bounds are set to 0.
The next two inputs are the lower and upper bounds for the launch calendar date search interval. These
values should be input in days.
launch date search boundary (days)
-10, +10
The next three inputs are the user’s initial guess for the flyby calendar date. Be sure to include all four
digits of the calendar year.
flyby calendar date initial guess (month, day, year)
6,1,2009
The next two inputs are the lower and upper bounds for the flyby calendar date search interval. These
values should be input in days.
flyby date search boundary (days)
-60, +60
The next three inputs are the user’s initial guess for the arrival calendar date. Be sure to include all four
digits of the calendar year.
arrival calendar date initial guess (month, day, year)
1,17,2010
The next two inputs are the lower and upper bounds for the arrival calendar date search interval. These
values should be input in days.
arrival date search boundary (days)
-30, +30
The next two program inputs are integers that specify the launch and flyby planets.
*****************
* launch planet *
*****************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
----------
3
page 267
****************
* flyby planet *
****************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
----------
2
This next input defines the altitude constraint during the gravity assist. This altitude is with respect to a
spherical flyby planet.
***************************
flyby altitude (kilometers)
***************************
500.0
The next series of inputs include the name and classical orbital elements of a comet or asteroid (arrival
celestial body = 0). Please note that the angular orbital elements must be specified with respect to a
heliocentric, Earth mean ecliptic and equinox of J2000 coordinate system. The calendar date of
perihelion passage should be with respect to the TDB time system. Please consult Appendix F –
Computing an Asteroid or Comet Ephemeris for additional information.
***********************************
* asteroid/comet orbital elements *
* (heliocentric, ecliptic J2000) *
***********************************
asteroid/comet name
Tempel 1
page 268
orbital inclination (degrees)
10.5301
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
Sparse Optimization Suite. Options 2 and 3 allow the user to specify either the number of nodes (option
2) or time step size of the data file (option 3).
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-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 (option 2) or the time step size
of the data output in the solution file (option 3).
number of user-defined nodes or print step size in solution data file
0.1
The name of the solution data file is defined in this next line.
name of solution output file
evm.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 input defines the relative error in the objective function.
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.
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 269
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 level of output from the NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
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 equation 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
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
page 270
Optimal control solution
The flyby_sos computer program will create a comma-separated-variable (csv) solution file and a
screen display of important trajectory characteristics. The csv file contains the state vector and classical
orbital elements of the spacecraft’s heliocentric trajectory. The flyby_sos software will also create a
comma-separated-variable file named planets.csv. This file contains the heliocentric, ecliptic state
vectors of all three celestial bodies.
The following is the screen display created by the simulation for this example.
program flyby_sos
==================
rendezvous trajectory
LAUNCH CONDITIONS
=================
C3 29.6618701751123 (km/sec)**2
page 271
heliocentric orbital elements and state vector of the spacecraft
(Earth mean ecliptic and equinox of J2000)
------------------------------------------
FLYBY CONDITIONS
================
page 272
raan (deg) true anomaly (deg) arglat (deg) period (days)
0.3483870514D+03 0.3443052834D+03 0.3048482055D+03 0.4696213189D+03
ARRIVAL CONDITIONS
==================
C3 17.8261694438687 km**2/sec**2
The following is the heliocentric transfer trajectory for this example. It is an inertial view of the
trajectory and planetary orbits from the north pole of the ecliptic looking down on the ecliptic plane.
The transfer trajectory is black and the scales are in astronomical units.
page 273
Several trajectory characteristics for this mission are shown in the following plots. These plots illustrate
the effect of the gravity assist on the spacecraft’s heliocentric classical orbital elements.
page 274
This final plot illustrates the change in heliocentric speed produced by the flyby.
Problem setup
This section provides additional details about the software implementation. For good scaling, the time
unit used in all internal calculations is days, position is expressed in astronomical units, and the velocity
and delta-v units are astronomical units per day.
This classic trajectory optimization problem is formulated using two mission phases. The first phase is
the interplanetary trajectory from launch to the gravity assist at the flyby planet and the second phase is
the transfer trajectory from the gravity assist to arrival at the destination planet.
page 275
Launch, flyby and arrival time bounds
The software allows the user to specify an initial guess for the launch calendar date and the durations of
the first and second legs of the interplanetary transfer trajectory. The user can also provide lower and
upper bounds on the actual launch, flyby and arrival dates found during the optimization process.
For any guess for launch time t L and user-defined launch time lower and upper bounds tl and tu , the
launch time t is constrained as
tL − tl t tL + tu
Likewise, for any guess for flyby time tFB and user-defined bounds tl and tu , the flyby time t is
constrained as follows
tFB − tl t tFB + tu
Finally, for any guess for arrival time t A and user-defined arrival time bounds tl and tu , the arrival
time t is constrained as follows:
t A − tl t t A + tu
For fixed launch, flyby and/or arrival times, the lower and upper bounds are set to 0.
The objective function or performance index J for this simulation is one of three possible delta-v’s. For
this classic trajectory optimization problem, this index is simply J = V where V is either the launch
delta-v, arrival delta-v or the total delta-v. The value of the maxmin indicator tells the Sparse
Optimization Suite whether the user is minimizing or maximizing the performance index. The type of
delta-v optimization is selected by the user and the performance index is enforced at the end of phase 2.
For any launch time t L the optimal solution for a rendezvous trajectory must satisfy the following state
vector boundary conditions (equality constraints) at launch:
rs / c ( tL ) − rp ( tL ) = 0
v s / c ( tL ) − v p ( tL ) + v ( tL ) = 0
where rs / c and v s / c are the heliocentric, inertial position and velocity vectors of the spacecraft at the
launch time t L , rp and v p are the heliocentric, inertial position and velocity vectors of the departure
planet at the launch time, and v is the impulsive heliocentric delta-v vector required at launch. These
point constraints are enforced at the beginning of the first phase.
Point functions are required to enforce the v-infinity and altitude “match” at the flyby. These two scalar
equality constraints are given by
page 276
v − − v + = 0 h f b − ht = 0
where h fb is the actual flyby altitude and ht is the “targeted” or user-defined flyby altitude. The
components of the incoming v-infinity velocity vector v − are “saved” in parameters at the end of phase
1 and the outgoing v-infinity velocity vector v + and flyby altitude are computed at the beginning of
phase 2. These constraints are enforced at the beginning of phase 2 using point functions that consist of
the scalar difference between the v-infinity vectors and altitude.
Because the interplanetary transfer trajectory needs to be contiguous in time and heliocentric position,
the time and heliocentric position vector of the spacecraft must be “linked” across the flyby boundary.
This is accomplished using the linkst subroutine that is part of the Sparse Optimization Suite. This
linkage is enforced at the beginning of phase 2.
For any arrival time t A the optimal solution for a rendezvous trajectory must satisfy the following state
vector boundary conditions at arrival:
rs / c ( t A ) − rp ( t A ) = 0
v s / c ( t A ) − v p ( t A ) + v ( t A ) = 0
where rs / c and v s / c are the heliocentric, inertial position and velocity vectors of the spacecraft at the
arrival time t A , and rp and v p are the heliocentric, inertial position and velocity vectors of the
destination planet at the arrival time, and v is the impulsive heliocentric delta-v vector required at
arrival.. This system of launch and arrival state vector equality constraints ensures a rendezvous
mission. These point constraints are enforced at the end of phase 2. For a destination flyby mission, the
velocity vector point functions at arrival are not enforced.
The components of the launch and arrival impulsive delta-v’s are the control variables used by the
Sparse Optimization Suite to solve this trajectory problem.
An initial guess for the Sparse Optimization Suite is created by solving the Lambert two-point boundary-
value problem (TPBVP) for each leg of the interplanetary transfer trajectory using the launch calendar
date and transfer time initial guesses provided by the user. The computational steps which create the
initial guess for the spacecraft state, and the launch and arrival delta-v are as follows:
1) compute the state vector of the departure planet at the departure date initial guess
2) compute the state vector of the flyby planet at the flyby date initial guess
3) compute the state vector of the arrival planet at the arrival date initial guess
page 277
4) solve Lambert's problem for the departure-to-flyby leg and determine the initial velocity vector
of this leg
5) compute the launch delta-v vector from the launch planet’s velocity vector and the initial
velocity vector of the first leg of the transfer trajectory
6) solve Lambert's problem for the second heliocentric leg and determine the initial and final
velocity vectors of the second leg
7) compute the arrival delta-v vector from the arrival planet’s velocity vector and the final velocity
vector of the second leg of the transfer trajectory
8) estimate the flyby incoming v-infinity vector from the flyby planet’s velocity vector and the final
velocity vector of the first leg of the transfer trajectory
The heliocentric state vector at the end of each leg of the interplanetary cruise part of the mission is
computed using Sheppard’s two-body orbit propagation algorithm. The derivation of this algorithm is
described in “Universal Keplerian State Transition Matrix”, Celestial Mechanics, 35 (1985) 129-144.
This numerical method uses a combination of universal variables and continued fractions to analytically
propagate two-body orbits. Appendix I – Numerical Solutions of Lambert’s Problem contains additional
information about Lambert’s problem and its numerical solution.
The Lambert solution initializes the flyby_sos software using the operator’s initial guess for launch
and arrival dates. The dynamic variables at each grid point of the initial guess are determined by setting
the initial guess option INIT(1) = 6 with INIT(2) = 5 within the odeinp subroutine for this
aerospace trajectory optimization problem. These program options create an initial guess from the
numerical integration of the equations of motion coded in the oderhs subroutine. The INIT(1) = 6
program option tells the software to construct an initial guess by solving an initial value problem (IVP)
with a linear control approximation. The INIT(2) = 5 program option tells the software to use the
Dormand-Prince variable step size numerical method to solve the initial value problem.
The algorithm used in this computer program to solve the two-body Lambert problem 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.
Technical discussion
The V required at launch and arrival are simply the differences between the velocity on the transfer
trajectory determined by the solution of Lambert’s problem and the heliocentric velocities of the two
planets. If we treat each planet as a point mass and assume impulsive maneuvers, the planet-centered
magnitude and direction of the required maneuvers are given by the two vector equations:
page 278
VTL = heliocentric velocity vector of the transfer trajectory at launch
VTA = heliocentric velocity vector of the transfer trajectory at arrival
VPL = heliocentric velocity vector of the launch planet
VPA = heliocentric velocity vector of the arrival planet
The scalar magnitude of each maneuver is also called the “hyperbolic excess velocity” or V at launch
and arrival. The hyperbolic excess velocity is the speed of the spacecraft relative to each planet at an
infinite distance from the planet. Furthermore, the energy or C 3 at launch or arrival is equal to V2 for
the respective maneuver. C 3 is also equal to twice the specific (per unit mass) orbital energy.
The orientation of the departure hyperbola is specified in terms of the right ascension and declination of
the outgoing asymptote. These coordinates can be calculated using the individual components of the
V velocity vector. For example, the right ascension of the asymptote is determined from
= tan −1 ( Vy , Vz ) and the geocentric declination of the asymptote is given by = 900 − cos−1 ( Vˆz )
where Vˆx , Vˆy and Vˆz are the x, y and z components of the unit V vector. The right ascension is
computed using a four-quadrant inverse tangent function.
In this computer program the heliocentric planetary coordinates and therefore the V vectors are
computed in the Earth mean ecliptic and equinox of J2000 coordinate system. The geometry and
transformations relative to this system are given in Appendix G – Aerospace Trajectory Coordinates and
Time Systems.
Equations of motion
This computer program implements Cowell’s form of the equations of motion as described in Appendix
C – Cartesian Equations of Motion. All planetary perturbations except those due to the launch, flyby
and arrival planets are included in the equations of motion. The equations described here are coded in
the right-hand-side subroutine required by the Sparse Optimization Suite.
During a planetary flyby, the vector relationships between the incoming v-infinity vector v − , the
+
outgoing v-infinity vector v and the two legs of the heliocentric transfer orbit that “patch” at the center
of the flyby planet are as follows
V− = V f b − Vto1
V+ = Vto2 − V f b
where
V f b = heliocentric velocity vector of the flyby planet at the flyby date
Vto1 = heliocentric velocity vector of the first transfer orbit at the flyby date
Vto2 = heliocentric velocity vector of the second transfer orbit at the flyby date
page 279
The turn angle of the planet-centered trajectory during the flyby is determined from
1
= 2sin −1 = 2 − 180
1 + rp V2 /
where rp is the periapsis radius of the flyby hyperbola, V is the magnitude of the incoming v-infinity
vector, is the gravitational constant of the flyby planet and is the true anomaly at infinity.
The maximum turn angle possible during a gravity assist flyby occurs when the spacecraft just gazes the
planet’s surface. It is given by
1
max = 2sin −1
1 + re V /
2
The semimajor axis and orbital eccentricity of the flyby hyperbola are given by
rp rp V2
a = − / V − 2
= − / V + 2
e = −1/ cos = 1 − = 1+
a
The periapsis radius of the flyby hyperbola relative to a spherical planet is determined from the
expression rp = a (1 − e ) , and the flyby altitude is h = r − re where r is the planet-centered radius at the
flyby closest approach.
The heliocentric speed gained during the flyby and the heliocentric delta-v vector caused by the close
encounter can be determined from the following two equations
V = 2V / e
V = Vh− − Vh+
− +
In the second equation, Vh is the heliocentric velocity vector of the spacecraft prior to the flyby and Vh
is the heliocentric velocity vector after the flyby. The maximum heliocentric delta-v available from a
gravity assist corresponds to a flyby at the planet’s surface and is given by V = re . This value is
also equal to the “local circular velocity” at the flyby planet’s surface.
Important Note
The binary ephemeris file provided with this computer program was created for use on Windows
compatible computers. For other platforms, you will need to create or obtain binary files specific to that
system. Information and computer programs for creating these files can be found at the JPL solar
system FTP site located at ftp://ssd.jpl.nasa.gov/pub/eph/export/. This site provides ASCII data files and
Fortran computer programs for creating a binary file.
page 280
Example free return trajectory
The following is the graphics display for a typical Earth free return trajectory computed with the
flyby_sos software. It involves a flyby of Mars at an altitude of 15,000 kilometers.
*******************
* simulation type *
*******************
1 = minimize launch delta-v
2 = minimize arrival delta-v
3 = minimize total delta-v
4 = no optimization
--------------------
3
page 281
arrival search boundary (days)
-60, +60
*****************
* launch planet *
*****************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
----------
3
****************
* flyby planet *
****************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
----------
4
***************************
flyby altitude (kilometers)
***************************
15000.0
************************
* arrival celestial body
************************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
0 = asteroid/comet
-------------------
3
***********************************
* asteroid/comet orbital elements *
* (heliocentric, ecliptic J2000) *
***********************************
asteroid/comet name
Tempel 1
page 282
longitude of the ascending node (degrees)
68.9734
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
1
********************************
* algorithm control parameters *
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
**********************
optimal control output
----------------------
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
****************************
differential equation output
----------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
page 283
1
*******************
user-defined output
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j1k0l0m0n0o0p0q0r0
rendezvous trajectory
LAUNCH CONDITIONS
=================
C3 29.2235201190643 (km/sec)**2
page 284
rx (km) ry (km) rz (km) rmag (km)
0.1464529146D+09 0.3057466560D+08 -.1119756613D+04 0.1496103819D+09
FLYBY CONDITIONS
================
ARRIVAL CONDITIONS
==================
page 285
arrival delta-v 6200.25721740196 meters/second
C3 38.4431895619451 km**2/sec**2
This section summarizes the trajectory characteristics for a patched-conic, gravity-assist interplanetary
trajectory from the Earth to the asteroid (1627) Ivar. This example uses a single Earth gravity-assist
during the trajectory optimization. The initial guess for this trajectory was extracted from the technical
paper “The design of transfer trajectory for Ivar asteroid exploration mission”, by D. Qiao, H. Cui, and
P. Cui, Acta Astronautica, 65 (2009), pp. 1553-1560. Here are the heliocentric and flyby trajectories for
this example. The Earth’s orbit is green, the transfer trajectory trace is black and Ivar’s orbit is red.
page 286
If we plot the behavior of the spacecraft’s heliocentric trajectory, we can see how the gravity-assist
affects the trajectory geometry as shown by the following two plots. It is easy to visualize the
discontinuity in these elements at the gravity-assist event.
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the flyby_sos software. All output except the coordinates of the
launch hyperbola is computed and displayed in a heliocentric, Earth mean ecliptic and equinox of J2000
coordinate system.
page 287
argper (deg) = argument of perigee in degrees
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
maximum turn angle = the turn angle if the spacecraft grazed the flyby planet’s surface
in degrees
actual turn angle = actual turn angle produced by the flyby in degrees
true anomaly at infinity = true anomaly of the spacecraft at an infinite distance from
the flyby planet
flyby delta-vx = x-component of the heliocentric impulsive velocity vector due to the
flyby in kilometers/second
flyby delta-vy = y-component of the heliocentric impulsive velocity vector due to the
flyby in kilometers/second
flyby delta-vz = z-component of the heliocentric impulsive velocity vector due to the
flyby in kilometers/second
flyby delta-v = scalar magnitude of the heliocentric impulsive delta-v due to the flyby
in kilometers/second
maximum delta-v = the maximum possible heliocentric delta-v due to the flyby in
kilometers/second
page 288
arrival delta-vz = z-component of the impulsive velocity vector at arrival in
kilometers/second
The comma-separated-variable disk file is created by the SOS odeprt subroutine and contains the
following information.
time (days) = simulation time since launch in days
rp1-x (au) = x-component of the launch planet position vector in astronomical units
rp1-y (au) = y-component of the launch planet position vector in astronomical units
rp1-z (au) = z-component of the launch planet position vector in astronomical units
rp2-x (au) = x-component of the destination body position vector in astronomical units
rp2-y (au) = y-component of the destination body position vector in astronomical units
rp2-z (au) = z-component of the destination body position vector in astronomical units
“Interplanetary Mission Design Handbook, Volume 1, Part 2”, JPL Publication 82-43, September 15,
1983.
“Error Analysis of Multiple Planet Trajectories”, F. M. Sturms, Jr., JPL Space Programs Summary, No.
37-27, Vol. IV.
page 289
“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.
page 290
CMATO 14 – Low-Thrust Interplanetary Trajectory Optimization
This CMATO application is a Fortran computer program named ilt_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the low-thrust
interplanetary flyby and rendezvous trajectory optimization problems. The software attempts to either
maximize the final spacecraft mass or minimize the transfer time. The type of optimization is selected
by the user. The interplanetary trajectory is modeled as a patched-conic, n-body system.
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 ilt_sos 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 using a sparse nonlinear programming method. The software allows the
user to select the type of initial guess, collocation method and other important algorithm control
parameters.
page 291
Input file format and contents
The ilt_sos software is “data-driven” by a user-created text file. The following is a typical input file
used by this computer program. This example is a maximum payload Earth-to-Mars rendezvous
trajectory with an initial launch C 3 of 4.625 km2/sec2. 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 font. Please note that the fundamental time argument in this computer program is Barycentric
Dynamical Time (TDB). Furthermore, the fundamental coordinate system is the Earth mean ecliptic and
equinox of J2000.
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.
****************************************************
** low-thrust interplanetary trajectory optimization
** patched-conic, n-body heliocentric motion
** input file for ilt_sos - e2m1_max_payload.in
** Earth-to-Mars max payload – March 21, 2011
****************************************************
The first input is an integer that defines the type of trajectory optimization to simulate.
type of optimization (1 = maximum payload, 2 = minimum transfer time)
1
The next input is an integer that tells the software what type of trajectory to model.
trajectory type (1 = flyby, 2 = rendezvous)
2
The next input specifies what type of propulsion system to use during the simulation. Option 1 is a
constant thrust system and option 2 is a solar-electric propulsion (SEP) system.
propulsion type (1 = chemical, 2 = SEP)
1
The next input is the initial launch energy. This number is also called C3 which is twice the specific
(per unit mass) orbital energy.
launch energy ([km/sec]**2)
4.625d0
The next two inputs define the thrust and specific impulse for a constant thrust, chemical propulsion
system (propulsion type option 1).
thrust magnitude (newtons)
0.16831
page 292
specific impulse (seconds)
3070.0
The next series of inputs define the characteristics of a solar electric propulsion system (propulsion
option 2). Please see the technical discussion section later in this document for additional information
about these data items and coefficients.
solar array power at 1 AU (kw)
5.0
The lower and upper bounds for the throttle setting are defined by the next two user inputs.
lower bound for throttle setting (0 <= bound <= 1)
0.0
The software allows the user to specify an initial guess for the launch and arrival calendar dates and
lower and upper bounds on the actual dates found during the optimization process. For any guess for
launch time t L and user-defined launch time lower and upper bounds tl and tu , the launch time t is
constrained as follows
tL − tl t tL + tu
Likewise, for any guess for arrival time t A and user-defined arrival time bounds tl and tu , the arrival
time t is constrained as
t A − tl t t A + tu
For fixed launch and/or arrival times, the lower and upper bounds are set to 0.
The next three inputs are the user’s initial guess for the launch calendar date. Be sure to include all four
digits of the calendar year.
*********************
* LAUNCH CONDITIONS *
*********************
The next two inputs are the lower and upper bounds for the launch calendar date search interval. These
values should be input in days.
launch date search boundary (days)
-60, +60
page 293
The next program input is an integer that specifies the launch planet.
*****************
* launch planet *
*****************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
----------
3
The next set of inputs defines the user’s initial guess for the arrival calendar date, the arrival date search
interval and the arrival celestial body.
**********************
* ARRIVAL CONDITIONS *
**********************
**************************
* arrival celestial body *
**************************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
0 = asteroid/comet
-------------------
4
The next series of inputs include the name and classical orbital elements of a comet or asteroid (arrival
celestial body = 0). Please note that the angular orbital elements must be specified with respect to a
heliocentric, Earth mean ecliptic and equinox of J2000 coordinate system.
***********************************
* asteroid/comet orbital elements *
* (heliocentric, ecliptic J2000) *
***********************************
asteroid/comet name
Tempel 1
page 294
orbital eccentricity (nd)
0.517491
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 initial guess option 1 or an updated binary 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
e2m1_max_payload.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 options 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
Sparse Optimization Suite. Options 2 and 3 allow the user to specify either the number of nodes (option
2) or time step size of the data file (option 3).
**********************************************
* 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 (option 2) or the time step size
of the data output in the solution file (option 3).
page 295
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. A description of the information written to
this file is summarized later in this document.
name of solution output file
e2m1_max_payload.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 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.
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
10000
The level of output from the NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
page 296
2
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 equation 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
-------------------
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 ilt_sos software. Please consult Appendix J – Typical Sparse
Optimization Suite Configuration File for additional information about this type of file.
***************************************
* optimal control configuration options
***************************************
page 297
Optimal control solution
The ilt_sos software will create two comma-separated-variable (csv) output files. The first file
contains the heliocentric, ecliptic state vector of the spacecraft and has the name specified by the user in
the main input file. The second file (planets.csv) contains the state vectors of both celestial bodies.
Additional information about the contents of these two files can be found later in this chapter.
The software will also display a summary of the final solution and a numerical verification of the
solution. This information is explained later in this document in the section titled Verification of the
optimal control solution.
The following are typical transfer trajectory, optimal control and orbital element plots for this example.
The first plot is a view of the trajectory and planetary orbits from the north pole of the ecliptic looking
down on the ecliptic plane. The second plot illustrates the behavior of the pitch and yaw angles during
the orbit transfer. The other plots illustrate the evolution of the heliocentric orbital elements, spacecraft
mass, throttle setting and accumulated delta-v during the heliocentric orbital transfer.
It is interesting to note from these plots that although the simulation is initialized as a single phase, the
Sparse Optimization Suite determines a multiple maneuver solution. Furthermore, it does this without a
priori knowledge about the number of propulsive maneuvers or switching conditions.
The next three plots are plots that illustrate the behavior of the pitch and yaw angles, the semimajor axis,
eccentricity, orbital inclination and throttle setting during the low-thrust orbital transfer.
page 298
This plot illustrates how the mesh refinement feature of the Sparse Optimization Suite has distributed the
trajectory nodes of the optimal solution.
page 299
Verification of the optimal control solution
The optimal solution determined by the Sparse Optimization Suite can be verified by numerically
integrating the spacecraft’s heliocentric equations of motion using the optimal control computed initial
conditions and the optimal control determined by the software. This computer program uses a Runge-
Kutta-Fehlberg 7(8) variable step size method to explicitly integrate the orbital equations of motion.
The following is a typical display of the final solution and errors computed using the explicit numerical
integration method. The errors are the differences between the spacecraft’s final cartesian state vector
and the arrival celestial body’s ephemeris. The initial time is tzero and the final time is tfinal, both
measured in days relative to the user-specified launch date initial guess.
program ilt_sos
rendezvous trajectory
maximum payload
LAUNCH CONDITIONS
-----------------
page 300
right ascension 14.0052092520307 degrees
ARRIVAL CONDITIONS
------------------
page 301
rx (km) ry (km) rz (km) rmag (km)
-.2292623909D+09 -.7906671107D+08 0.3975347044D+07 0.2425460618D+09
An initial guess for the algorithm is created by numerically integrating the modified equinoctial
equations of motion for a user-defined orbital transfer time. During the interplanetary phase to an outer
planet, the algorithm assumes tangential thrusting such that the unit thrust vector in the modified
equinoctial frame at all times is simply uT = 0 1 0 . Please note that this approach creates a
T
coplanar initial guess. However, since the orbital inclinations of most solar system objects of interest
are relatively small, the software has little trouble finding a feasible trajectory and eventually an
optimized solution. This initial guess algorithm uses the launch date, arrival date, propulsive
characteristics and spacecraft mass provided by the user. For transfer to an inner planet, the unit thrust
vector is uT = 0 −1 0 . A throttle setting of one is used during the initial guess computations.
T
page 302
The dynamic variables and control variables at each grid point of the initial guess are determined by
setting the initial guess option INIT(1) = 6 with INIT(2) = 2 within the odeinp subroutine.
These program options create an initial guess from the numerical integration of the equations
programmed in the oderhs subroutine. The INIT(1) = 6 program option tells the Sparse
Optimization Suite to construct an initial guess by solving an initial value problem (IVP) with a linear
control approximation. The INIT(2) = 2 program option tells the algorithm to use the Dormand-
Prince variable step size numerical method to solve the initial value problem.
The following plot illustrates the location of typical trajectory grid points using this technique. This
initial guess consists of ten grid points. These grid points are located at the integration steps determined
by the Dormand-Prince algorithm.
Low-thrust Interplanetary Trajectory Analysis
Earth-to-Mars Maximum Final Mass
Mass = 1171.1 kg Thrust = 168.31 mN Isp = 3070 s
1.5 arrival
1
y coordinate (au)
0.5
-0.5
-1
launch
-1.5
-2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x coordinate (au)
To model an impulsive delta-v at launch, the initial guess algorithm assumes that this maneuver is
initially applied along the direction of the velocity vector of the departure planet. For outer planet
missions, this direction is along the direction of orbital motion. For inner planet missions, this vector is
aligned opposite to the direction of orbital motion.
The unit thrust vector of this maneuver in the heliocentric inertial coordinate system is uT = rp rp
where rp is the heliocentric inertial position vector of the departure planet at launch. Since the modified
equinoctial form of the unit thrust vector is the optimal control in this example, the SOS software will
change this unit pointing vector while searching for a solution.
An initial guess for the transfer time can be created by performing a one-dimensional minimization
while numerically integrating the equations of motion with tangential thrusting. This process determines
future close approach conditions between the spacecraft in its coplanar transfer orbit and the destination
celestial body. This computational process can be performed by a utility computer program that uses a
minimization algorithm with the following objective function
page 303
f ( t ) = r ( t ) = rp − rsc
where rp is the heliocentric position vector of the arrival body and rsc is the heliocentric position vector
of the spacecraft at any simulation time t. If the separation distance r is “close” enough (say 0.01 to
perhaps 0.1 AU), the trajectory time provides a good initial guess. The close approach algorithm also
uses the launch date, propulsive characteristics and spacecraft mass provided by the user. For
consistency, this software also uses the same planetary ephemeris as the ilt_sos computer program.
Problem setup
This section provides additional details about the software implementation. For good scaling, the time
unit used in all internal calculations is days, position is expressed in astronomical units and the velocity
unit is astronomical units per day.
The software allows the user to specify an initial guess for the launch and arrival calendar dates and
lower and upper bounds on the actual dates found during the optimization process. For any guess for
launch time t L and user-defined launch time lower and upper bounds tl and tu , the launch time t is
constrained as follows
tL − tl t tL + tu
Likewise, for any guess for arrival time t A and user-defined arrival time bounds tl and tu , the arrival
time t is constrained as follows:
t A − tl t t A + tu
For fixed launch and/or arrival times, the lower and upper bounds are set to 0.
Performance index
The objective function or performance index J for this simulation is either the final mass of the
spacecraft m f or the total transfer time t f . This is simply J = m f or J = t f .
The value of the maxmin indicator tells the SOS software whether the user is minimizing or maximizing
the performance index. The spacecraft mass at the initial time is fixed to the initial value. However, the
ilt_sos software can be easily modified to make the initial mass the performance index.
At any point during the interplanetary transfer trajectory, the scalar magnitude of the components of the
unit thrust vector is constrained as follows
This formulation avoids problems that may occur when using thrust steering angles as control variables.
page 304
Point functions – position and velocity vector “matching” at launch
For any launch time t L the optimal solution must satisfy the following state vector boundary conditions
(equality constraints) at launch
rs / c ( tL ) − rp ( tL ) = 0
v s / c ( tL ) − v p ( tL ) + v ( tL ) = 0
where rs / c and v s / c are the heliocentric, inertial position and velocity vectors of the spacecraft at the
launch time t L , rp and v p are the heliocentric, inertial position and velocity vectors of the departure
planet at the launch time, and v is the user-specified available impulsive delta-v vector at launch. This
delta-v might be provided by the launch vehicle or perhaps a high-thrust upper stage. The delta-v scalar
magnitude is equal to the square root of the launch specific orbital energy, also called C3L.
In this constraint formulation, the delta-v contribution is modeled as v = v uˆ T where u ˆ T is the unit
thrust vector in the heliocentric, inertial coordinate system. Since the optimal control for this problem is
the unit thrust vector in the modified equinoctial system, u ˆ T is computed from
uˆ T = ˆi r ˆi
t
ˆi uˆ
n mee
where uˆ mee is the unit thrust vector in the modified equinoctial coordinate system and
ˆi = r ˆi = r v ˆi = ˆi ˆi = ( r v ) r
rv rv r
r n t n r
r
For any arrival time t A the optimal solution must satisfy the following state vector boundary conditions
(BC) at arrival
rs / c ( t A ) − rp ( t A ) = 0
vs / c (tA ) − v p (tA ) = 0
where rs / c and v s / c are the heliocentric, inertial position and velocity vectors of the spacecraft at the
arrival time t A , and rp and v p are the heliocentric, inertial position and velocity vectors of the
destination planet at the arrival time. This system of launch and arrival state vector equality constraints
ensures a rendezvous mission. For a flyby mission, the velocity vector point functions at arrival are not
enforced by the software.
The following lower and upper bounds are applied to the spacecraft mass and the modified equinoctial
dynamic variables during the interplanetary orbital transfer.
page 305
0.05msci msc 1.05msci 0.5rp p 2ra
−1 f +1 − 1 g +1 − 1 h +1 − 1 k +1
where rp is the heliocentric periapsis radius of the initial orbit, ra is the apoapsis radius of the final
orbit, and msc is the initial spacecraft mass provided by the user. These two distances, in astronomical
i
units, are determined from the orbital elements of the departure and arrival bodies at the user’s initial
guess for the corresponding calendar dates. Since we may allow the Sparse Optimization Suite to
change the actual launch time during the optimization, the true longitude is unconstrained.
Finally, the throttle setting is bounded to user-defined lower and upper bounds according to L U
where these bounds are typically between 0 and 1.
The natural bounds for this trajectory formulation are ideal for numerical optimization.
Technical discussion
The motion of the spacecraft is modeled in the modified equinoctial orbital element system. Please
consult Appendix A – Trajectory Modeling and Targeting in the Modified Equinoctial Orbital Elements
System for the equations of motion and coordinate conversions.
Planetary ephemeris
The software models the planetary coordinates using the DE 421 model from JPL. This planetary
ephemeris provides position and velocity vectors relative to the Earth mean equator and equinox of
J2000 (EME2000). The ilt_sos software converts the DE 421 state vectors to the Earth mean ecliptic
system using the following transformation
T
1 -0.000000479966 0
S ec = 0.000000440360 0.917482137087 0.397776982902 S eq
-0.000000190919 -0.397776982902 0.917482137087
where S eq is the state vector in the Earth mean equatorial frame, and S ec is the state vector in the Earth
mean ecliptic frame.
Important Note
The binary ephemeris file provided with this computer program was created for use on Windows
compatible computers. For other platforms, you will need to create or obtain binary files specific to that
system. Information and computer programs for creating these files can be found at the JPL solar
system FTP site located at ftp://ssd.jpl.nasa.gov/pub/eph/export/. This site provides ASCII data files and
Fortran computer programs for creating a binary file. A program for testing the user’s ephemeris is also
provided along with documentation.
page 306
Asteroid and comet ephemeris
Please consult Appendix F – Computing an Asteroid or Comet Ephemeris for the numerical method used
in this software to compute small body ephemerides.
For the SEP option, the power available, in kilowatts, for the engine is computed from
a2 a3
P0 a1 + r + r 2
P= 2
r 1 + a4 r + a5r 2
where P0 is the power available at one astronomical unit (AU), r is the heliocentric distance of the
spacecraft, in astronomical units, and the ai ’s are coefficients provided by the user.
The propulsive thrust T and mass flow rate m are computed from the following polynomials which are
functions of the available power P.
T = c1 + c2 P + c3 P 2 + c4 P 3 + c5 P 4
m = d1 + d 2 P + d 3 P 2 + d 4 P 3 + d 5 P 4
The coefficients for each polynomial are provided by the user. In these equations, the fundamental unit
is milli-Newtons for thrust and milligrams for spacecraft mass. Finally, the software will also constrain
the input power to the electric engine to the user-defined lower and upper bounds according to
PL P PU
Launch characteristics
For interplanetary missions, the orientation of the departure hyperbola is specified in terms of the right
ascension and declination of the outgoing asymptote. These coordinates can be calculated using the
components of the initial spacecraft and departure planet heliocentric velocity vectors determined by the
Sparse Optimization Suite.
In this computer program, the heliocentric planetary coordinates and the transfer orbit velocity vectors
are computed in the Earth mean ecliptic and equinox of J2000 coordinate system. To determine the
orientation of the departure hyperbola in the EME2000 system, the initial heliocentric velocity vector
must be transformed to the equatorial frame.
1 -0.000000479966 0
V EQ = 0.000000440360 0.917482137087 0.397776982902 V EC
-0.000000190919 -0.397776982902 0.917482137087
page 307
where V EC
is the v-infinity velocity vector in the ecliptic frame, and V EQ
is the v-infinity velocity
vector in the equatorial frame. The ecliptic v-infinity velocity vector can be computed using
V EC = Vsc − Vdp
where Vsc is the heliocentric, ecliptic velocity vector of the spacecraft and Vdp is the velocity vector of
the departure planet, also in the ecliptic frame.
( )
The right ascension of the asymptote is determined from = tan Vy ,Vz and the geocentric
−1
( )
declination of the outgoing asymptote is given by = 900 − cos −1 Vˆz where Vˆz is the z-component of
the unit v-infinity velocity vector in the equatorial frame of reference. The right ascension is computed
using a four-quadrant inverse tangent function.
Please consult Appendix H – Impulsive Interplanetary Injection from a Circular Earth Orbit for
additional information and equations related to this aspect of interplanetary mission analysis.
This section contains graphics and a simulation summary for a typical Earth-to-Mars minimum transfer
time interplanetary rendezvous mission using chemical propulsion.
The following plots illustrate the behavior of the maneuver pitch and yaw angles, the heliocentric
semimajor axis, eccentricity, orbital inclination and accumulated delta-v during the interplanetary
transfer.
page 308
Here is the numerical output for this example using trapezoidal collocation.
program ilt_sos
rendezvous trajectory
LAUNCH CONDITIONS
-----------------
page 309
declination 10.6195596448380 degrees
ARRIVAL CONDITIONS
------------------
page 310
raan (deg) true anomaly (deg) arglat (deg) period (days)
0.4953748812D+02 0.1705051279D+03 0.9708754335D+02 0.6869134021D+03
This section contains graphics and a simulation summary for a maximum final mass, interplanetary
rendezvous mission from Earth to the comet Tempel 1 using solar electric propulsion.
page 311
The final plot illustrates the behavior of the available solar array power and the thrust acceleration
during the interplanetary transfer.
Here’s the program numerical output for this example using trapezoidal collocation.
program ilt_sos
rendezvous trajectory
maximum payload
LAUNCH CONDITIONS
-----------------
page 312
calendar date 11/04/2002
ARRIVAL CONDITIONS
------------------
page 313
rx (km) ry (km) rz (km) rmag (km)
0.2990939734D+09 -.1373302895D+09 -.6105302696D+08 0.3347301681D+09
page 314
thrust magnitude (newtons)
0.1
*********************
* LAUNCH CONDITIONS *
*********************
*****************
* launch planet *
*****************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
----------
3
**********************
* ARRIVAL CONDITIONS *
**********************
**************************
* arrival celestial body *
**************************
1 = Mercury
2 = Venus
3 = Earth
4 = Mars
5 = Jupiter
6 = Saturn
7 = Uranus
8 = Neptune
9 = Pluto
0 = asteroid/comet
page 315
-------------------
0
***********************************
* asteroid/comet orbital elements *
* (heliocentric, ecliptic J2000) *
***********************************
asteroid/comet name
Tempel 1
********************************
* initial guess/restart option *
********************************
1 = numerical integration
2 = binary data file
---------------------
1
****************************
* restart data file option *
****************************
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = OC-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
1
********************************
* algorithm control parameters *
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
page 316
relative error in the objective function (performance index)
1.0d-5
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
**********************
optimal control output
----------------------
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
****************************
differential equation output
----------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
1
*******************
user-defined output
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
***************************************
* optimal control configuration options
***************************************
page 317
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the ilt_sos software. All output is computed and displayed in a
heliocentric, Earth mean ecliptic and equinox of J2000 coordinate system.
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
The accumulated delta-v is computed from a cubic spline integration of the thrust acceleration at all grid
points determined by the software.
The comma-separated-variable disk file is created by the odeprt subroutine and contains the following
information.
time (days) = simulation time since launch in days
page 318
ry (au) = y-component of the spacecraft’s heliocentric position vector in astronomical
units
An Introduction to the Mathematics and Methods of Astrodynamics, Richard H. Battin, AIAA Education
Series, 1987.
“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.
page 319
“Interplanetary Mission Design Handbook, Volume 1, Part 2”, JPL Publication 82-43, September 15,
1983.
“Interplanetary Mission Analysis and Design”, Stephen Kemble, Praxis Publishing, 2006.
“Possibilities of Combining High- and Low-Thrust Engines in Flights to Mars”, G. G. Fedotov, Cosmic
Research, Vol. 39, No. 6, 2001, pp. 613-621.
“Rapid Solar Sail Rendezvous Missions to Asteroid 99942 Apophis”, Giovanni Mengali and Alessandro
A. Quarta, AIAA Journal of Spacecraft and Rockets, Vol. 46, No. 1, January-February 2009, pp. 134-
140.
“The Planetary and Lunar Ephemeris DE 421”, W. M. Folkner, J. G. Williams, D. H. Boggs, JPL IOM
343R-08-003, 31-March-2008.
page 320
CMATO 15 – Interplanetary Trajectory Correction Maneuver Optimization
This CMATO application is a Fortran computer program named itcm_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the classic one impulse
interplanetary trajectory correction maneuver (TCM) optimization problem. The software attempts to
minimize the scalar magnitude of the TCM delta-v vector for user-defined final orbit conditions at Mars.
The itcm_sos 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 optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The itcm_sos software allows the user to select the type of initial guess, collocation method, and other
important algorithm control parameters.
page 321
Input file format and contents
The itcm_sos 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. This example is an Earth-to-Mars
trajectory that begins at the Earth’s sphere-of-influence (SOI) and ends at hyperbolic encounter with
Mars. It can be found as e2m_tcm.in in the software distribution.
In the following discussion the actual input file contents are in courier font and all explanations are in
times 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.
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.
*********************************************
** interplanetary TCM trajectory optimization
** n-body heliocentric motion
** Earth-to-Mars data file - e2m_tcm.in
** May 8, 2012
*********************************************
The first program input is the Julian date, on the TDB time scale, at which to perform the TCM.
TDB julian date of TCM
2452799.264399034436792d0
The next six inputs are the components of the spacecraft’s heliocentric orbital elements prior to the
actual trajectory correction maneuver. These coordinates are defined relative to the Earth mean equator
and equinox of J2000 system (EME2000) at the time specified in the previous input.
**************************************************
heliocentric EME2000 orbital elements prior to TCM
**************************************************
The next three inputs are the user’s initial guess for the components of the TCM delta-v vector. These
values should be provided in the units of meters per second. If an initial guess is not available, the user
should input 0 for each component.
page 322
************************************************************
initial guess and bounds for heliocentric TCM delta-v vector
************************************************************
Lower and upper bounds for each component of the TCM delta-v vector are defined by the next two user
inputs. The units for these two numbers are also meters per second.
lower bound for TCM delta-v components (meters/second)
-100.0
The next integer input allows the user to specify the type of final orbit targeting at Mars.
*****************************
final orbit targeting options
*****************************
1 = user-defined flight path angle, radius and orbital inclination
2 = user-defined B-plane coordinates
3 = grazing flyby; user-defined b-plane angle
----------------------------------------------
1
The next set of inputs defines the desired characteristics of the encounter hyperbola at Mars. The orbital
inclination and B-plane coordinates are defined with respect to the Mars mean equator and IAU node of
epoch coordinate system.
***************************
final Mars-centered targets
***************************
The next two inputs set the root-finding and truncation error tolerances used by the numerical methods
that calculate the initial guess, predict the time of entrance into the Martian sphere-of-influence, and the
time of entry interface at Mars. Smaller values may help improve the solution of the corresponding
problem at the expense of longer computation times.
page 323
**********************************************
root-finding and integration algorithm control
**********************************************
root-finding tolerance
1.0d-8
The next input is the user-defined value for the radius of the sphere-of-influence of Mars.
-----------------------------------------------
radius of Mars sphere-of-influence (kilometers)
-----------------------------------------------
150000.0
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
Sparse Optimization Suite software. Options 2 and 3 allow the user to specify either the number of
nodes (option 2) or time step size of the data file (option 3).
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-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 (option 2) or the time step size
of the data output in the solution file (option 3).
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.
name of solution output file
e2m_tcm.csv
The next series of program inputs are algorithm control options and parameters for the software. The
first input is an integer that specifies the type of collocation method to use during the solution process.
For most simulations, the separated trapezoidal method is recommended.
********************************
* algorithm control parameters *
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
The next input defines the relative error in the objective function.
relative error in the objective function (performance index)
1.0d-5
page 324
The next input defines the relative error in the solution of the differential equations.
relative error in the solution of the differential equations
1.0d-7
This integer input defines the maximum number of mesh refinement iterations.
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
10000
The level of output from the NLP algorithm is controlled with the following integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
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 Sparse Optimization Suite 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.
page 325
*******************
user-defined output
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
The following is the program output created by the itcm_sos simulation for this example.
program itcm_sos
================
The itcm_sos software package also includes a MATLAB script named mplot.m that can be used to
create trajectory graphic displays using the soiorb.csv data file. 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 hyperbolic encounter
trajectory at Mars.
The following plot is a “zoomed” view of the encounter trajectory at Mars. This display is labeled with
a Mars centered, inertial coordinate system. The x-axis of this areocentric system is red, the y-axis
green and the z-axis blue. The small red dot is the location of the entry interface.
The optimal control solution determined by the Sparse Optimization Suite software can be verified by
numerically integrating the orbital equations of motion with the optimal control solution and the initial
heliocentric conditions provided by the user. This is equivalent to solving an initial value problem (IVP)
that uses the optimal impulsive thrust vector solution.
This part of the itcm_sos computer program uses a Runge-Kutta-Fehlberg 7(8) variable step size
method to integrate the orbital equations of motion. The following is a display of the final solution
computed using this explicit numerical integration method.
========================================
verification of optimal control solution
========================================
page 329
time and conditions after TCM maneuver
(heliocentric EME2000)
----------------------
Problem setup
This section provides additional details about the software implementation. For good scaling during the
optimization, the time unit used in all heliocentric calculations is days, position is expressed in
astronomical units, and the velocity and TCM delta-v unit is astronomical units per day. The areocentric
or Mars-centered motion is modeled using seconds, kilometers, and kilometers per second.
During the solution of this optimal control problem, the itcm_sos software models the heliocentric
motion implicitly using collocation and the Mars-centered orbital motion explicitly using numerical
integration of the equations of motion.
page 331
Performance index – minimize TCM delta-v
The objective function or performance index J for this simulation is the scalar magnitude of the
impulsive TCM delta-v vector. For this classic trajectory optimization problem, this index is simply
J = V . The value of the maxmin indicator in SOS tells the software whether the user is minimizing or
maximizing the performance index.
The components of the impulsive TCM delta-v are the optimization parameters used by the Sparse
Optimization Suite to solve this trajectory problem.
The optimal solution must satisfy the following state vector boundary conditions (equality constraints) at
the initial time defined by the user
rs−/ c ( tTCM ) − rs+/ c ( tTCM ) = 0
where rs−/ c and v −s / c are the heliocentric position and velocity vectors of the spacecraft prior to the TCM
maneuver time tTCM , rs+/ c and v +s / c are the heliocentric position and velocity vectors of the spacecraft
after the TCM delta-v is applied, and v is the impulsive TCM delta-v vector.
At the user-defined sphere-of-influence of Mars, the point function enforced by the software is given by
rSOI − rSOI = 0 where rSOI is the SOI value predicted by the software and rSOI is the SOI value defined
p u p u
by the user.
Targeting to a Mars-centered flight path angle, periapsis radius and orbital inclination
For user-defined flight path angle, periapsis radius and orbital inclination targets at the Martian entry
interface, the following point functions or equality constraints are enforced
u − p = 0 ru − rp = 0 cos iu − hˆ z = 0
where u , ru and iu are the user-defined entry interface flight path angle, periapsis radius and Mars
centered orbital inclination of the encounter hyperbola, respectively. In these equations, p and rp
represent the flight path angle and periapsis radius predicted by the software. Note that hˆ z is the z-
component of the predicted unit angular momentum vector. These orbital characteristics are determined
from the spacecraft’s state vector at the entry interface relative to Mars.
The general expression for the periapsis radius of an encounter hyperbola at Mars is given by
rp =
1
v2
( 1 + b v − 1)
2 4
page 332
where the normalized quantities are
rp = normalized periapsis radius = rp rm
b = normalized b-plane magnitude = b rm
v = normalized v-infinity speed = v vlc
vlc = local circular speed at Mars = m rm
rm = radius of Mars
m = gravitational constant of Mars
For a grazing flyby, rp = 1 and the normalized B-plane distance is equal to b = 1 + 2 v2 . The
required B-plane equality constraints are computed from B T = b cos and B R = b sin , where
is the user-defined B-plane angle of the grazing trajectory. Please note the B-plane angle is measured
positive clockwise from the T axis of the B-plane coordinate system. The two equality constraints for
this program option are simply the difference between the predicted and required B T and B R
components.
For this program option, the two equality constraints are simply the difference between the predicted and
user-defined B T and B R components. The B-plane constraints for this and the previous option are
scaled by dividing by the equatorial radius of Mars.
An initial guess for the heliocentric transfer trajectory is created by numerically integrating the
heliocentric equations of motion using the user’s input for the initial time and state of the spacecraft and
the initial guess for the TCM delta-v vector. The position and velocity vectors at each grid point are
determined by setting the initial guess option INIT(1) = 6 with INIT(2) = 2 which instructs the
software to use the built-in Dormand-Prince solution method.
The final time for the heliocentric phase is estimated by searching for the instance at which the
spacecraft reaches the user-defined sphere-of-influence distance at Mars. The numerical technique used
to estimate the SOI consists of Brent’s one-dimensional root-finder imbedded within a Runge-Kutta-
Fehlberg 7(8) integrator. If an initial guess for the TCM maneuver is not available, a larger SOI radius
should be used.
Technical discussion
Please consult the following Appendices for a technical summary of the equations of motion, B-plane
orbital mechanics, and trajectory and time systems implemented in this computer program.
• Appendix C – Cartesian Equations of Motion
• Appendix D – B-Plane Geometry, Coordinates and Targeting
• Appendix G – Aerospace Trajectory Coordinates and Time Systems
page 333
In this computer program the heliocentric coordinates of the planets 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 elapsed time from the Martian SOI until the entry interface is determined by an algorithm that
includes a one-dimensional root-finder embedded within a Runge-Kutta-Fehlberg 7(8) numerical
integration method. This technique searches for the time at which the predicted Mars-centered flight
path angle of the spacecraft p and the user-defined entry interface flight path angle u is zero.
In the itcm_sos computer program, the components of the inertial unit thrust vector can be defined in
terms of the right ascension and the declination angle as follows
The right ascension and declination angles can be determined from the components of the ECI unit
thrust vector according to
(
= tan −1 uTECI y , uTECI x ) ( )
= sin −1 uTECI z
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 RTN 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.
This section provides typical output from the itcm_sos computer program for the two other types of
user-defined final orbit targeting options.
page 334
The first example illustrates the solution for the “user-defined B-plane coordinates” program option.
program itcm_sos
================
page 335
time and conditions at Mars SOI
(heliocentric EME2000)
----------------------
page 336
rx (km) ry (km) rz (km) rmag (km)
-.165099600309D+04 -.257162985432D+04 0.395467928201D+04 0.499785515330D+04
========================================
verification of optimal control solution
========================================
page 337
TDB time 12:11:53.222
page 338
TDB time 02:08:24.228
This next example illustrates the SOS solution for the “grazing flyby; user-defined B-plane angle”
program option.
program itcm_sos
================
page 339
(heliocentric EME2000)
----------------------
page 340
rasc-asymptote 281.312039235815 degrees
========================================
verification of optimal control solution
========================================
page 341
TDB time 18:20:44.077
page 342
B-plane coordinates at Mars entry interface
(Mars-centered mean equator and IAU node of epoch)
--------------------------------------------------
This material is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the itcm_sos software.
TDB julian date = Barycentric Dynamical Time julian date of trajectory event
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
page 343
delta-vx = x-component of the impulsive TCM velocity vector in meters/second
The comma-separated-variable disk file is created by the odeprt subroutine and contains the following
information:
time (days) = simulation time since launch in days
raan (deg) = transfer orbit right ascension of the ascending node in degrees
The heliocentric coordinates of the spacecraft are with respect to the Earth mean equator and equinox of
J2000 coordinate system.
page 344
“Interplanetary Mission Design Handbook, Volume 1, Part 2”, JPL Publication 82-43, September 15,
1983.
“Error Analysis of Multiple Planet Trajectories”, F. M. Sturms, Jr., JPL Space Programs Summary, No.
37-27, Vol. IV.
“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.
page 345
CMATO 16 – Optimal Finite-Burn Earth Orbit-to-Interplanetary Injection
This CMATO application is a Fortran computer program named hyper_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the single-maneuver,
finite-burn Earth orbit-to-interplanetary injection trajectory optimization problem. The software
attempts to maximize the final spacecraft mass. Since this simulation involves a single propulsive
maneuver, this is equivalent to minimizing the propellant mass required for the orbital maneuver. The
hyper_sos software can also be used to solve this problem using a fixed thrust duration maneuver.
The hyper_sos 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 optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The hyper_sos software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 346
Input file format and contents
The hyper_sos software is “data-driven” by a user-created text file. 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 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 change the number
of lines. 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. All program inputs and
outputs are in an Earth-centered-inertial (ECI) coordinate system. Park orbit angular elements and the
hyperbolic targets should be specified in the same coordinate system.
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.
*************************************************************************
** Optimal Finite-Burn Earth Orbit-to-Interplanetary Injection
** single phase, continuous-thrust maneuver with user-defined final coast
** variable and fixed inertial attitude steering
** input file ==> hyper1.in - February 14, 2011
*************************************************************************
The first input defines the type of steering to use during the solution process. Additional information
about these steering options can be found in the Problem setup section.
type of steering
1 = fixed inertial attitude
2 = variable attitude
---------------------
2
The next two inputs allow the user to provide an initial guess for the right ascension and declination for
the inertially fixed steering option.
initial guess for right ascension (degrees)
0.0d0
The next three inputs define the initial mass, thrust magnitude and specific impulse of the propulsion
system, respectively.
initial spacecraft mass (kilograms)
4000.0
The next input defines the user’s initial guess for the maneuver duration, in seconds.
initial guess for thrust duration (seconds)
550.0
The next two inputs define the lower and upper bounds for the thrust duration, also in seconds. For a
fixed thrust duration mission, these two numbers should be identical.
page 347
lower bound for thrust duration (seconds)
1.0
The next six user-defined inputs define the classical orbital elements of the initial park orbit.
*****************
* INITIAL 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 the park orbit semimajor axis, eccentricity and orbital inclination to
the values input by the user. All other elements are unconstrained. Option 2 will constrain all initial
elements, and option 3 will constrain all initial elements except true longitude.
********************************
initial orbit constraint options
********************************
1 = constrain semimajor axis, eccentricity, and inclination
2 = constrain all initial orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
1
The next three inputs define the characteristics of the departure hyperbola. These inputs are the specific
orbital energy (C3) in kilometers per second squared, and the right ascension (RLA) and declination
(DLA) of the outgoing asymptote, respectively.
********************
* LAUNCH HYPERBOLA *
********************
This next numeric input allows the user to specify a final fixed-duration orbit coast. For a simulation
without a final coast, set this value to zero.
page 348
final coast duration (seconds)
100.0
This integer input specifies the type of gravity model to use during the simulation. Option 2 will include
the contribution of the oblateness gravity coefficient ( J 2 ) in the equations of motion.
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate Earth
----------------
2
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 options *
*************************
1 = numerical integration
2 = binary data file
---------------------
1
If the user elects to use a binary data file (option 3 above) for the initial guess, the following text input
specifies the name of the file to use.
name of binary initial guess data file
hyper1.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 SOS.
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 = SOS-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
1
page 349
For options 2 or 3, this next input defines either the number of data points or the time step size of the
data written to the solution file.
number of user-defined nodes or print step size in solution data file
25
The name of the solution data file is defined in this next line.
name of solution output file
hyper1.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.
********************************
* algorithm control parameters *
********************************
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
The next input is an integer that defines the number of grid points to use for the initial guess. If
necessary, the Sparse Optimization Suite will use mesh refinement to change the number and
distribution of the grid points.
number of grid points
25
The next input defines the relative error in the objective function (performance index).
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.
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.
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
10000
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.
page 350
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
The level of output from the Sparse Optimization Suite optimal control algorithm is controlled with the
following integer input. 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 Sparse Optimization Suite differential equations algorithm is controlled
with the following integer input. 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
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
The last series of user inputs allow the reading and writing of configuration input files by the simulation.
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 hyper_sos software. Additional information about
this type of file can be found in Appendix J – Sparse Optimization Suite Configuration File.
***************************************
* optimal control configuration options
***************************************
page 351
name of optimal control configuration file
hyper1_config.txt
The following is the solution for this example. This simulation used an oblate Earth gravity model, a
numerical integration initial guess, variable attitude steering, and a final 100 second coast. The program
output includes the orbital characteristics at the beginning and end of the propulsive maneuver.
program hyper_sos
=================
------------------------
beginning of finite burn
------------------------
We can see how the software has modified the angular elements of the park orbit.
------------------
end of finite burn
------------------
The following program output is the final spacecraft mass, the propellant mass consumed, the actual
thrust duration for the maneuver, and the accumulated delta-v. The delta-v is computed using a cubic
spline numerical method which uses all data points of the output file.
page 352
final mass 1764.41952920903 kilograms
This section of the output file summarizes the classical orbital elements and Earth-centered-inertial
(ECI) state vector at the end of the user-defined coast.
------------------
end of final coast
------------------
This final section of the program output displays the actual hyperbolic conditions computed by the
software. From this display we can determine how well the software satisfies the user-defined C3, RLA
and DLA targets.
------------------
outgoing hyperbola
------------------
The following are plots of the behavior of the pitch and yaw angles, the inertial right ascension and
declination angles, and the components of the ECI and RTN unit thrust vector during the maneuver.
page 353
The following plots illustrate the evolution of the specific orbital energy (C3) and the semimajor axis of
the spacecraft’s orbit as a function of time since ignition. We can see the transition from an elliptical to
a hyperbolic orbit, especially the plot of semimajor axis, as orbital energy is added to the trajectory.
page 354
These final two plots illustrate the time evolution of the orbital eccentricity of the transfer orbit and the
spacecraft’s instantaneous mass.
The hyper_sos computer program will also create an output file named hyper_sos.dat. This file
contains the Earth-centered inertial position and velocity vectors of the park orbit and launch hyperbola
at interplanetary injection, and the orientation of the departure asymptote. It is written as a single
column of data.
The next plot is a typical display of the park and hyperbolic orbits for this example. This display is
labeled with an Earth centered, inertial coordinate system. The x-axis of this system is red, the y-axis
green and the z-axis blue. The outgoing asymptote is colored magenta, the park orbit trace is red, and
the hyperbolic trajectory is black.
page 355
The fundamental plane of this right-handed, orthogonal coordinate system is the Earth’s equator. The x-
axis points in the direction of the Vernal Equinox, the z-axis is aligned with the Earth’s spin axis, and
the y-axis is advanced 90 degrees along the equator from the x-axis. As mentioned earlier, the classical
orbital elements of the park orbit and the hyperbolic targets (C3, RLA and DLA) should be provided in
the same ECI coordinate system, perhaps true-of-date or Earth mean equator and equinox of J2000.
This section summarizes the output for this same example with fixed inertial attitude steering. The
output includes the optimized right ascension and declination angles. The initial guess for the right
ascension and declination angles were both set to zero.
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
page 356
raan (deg) true anomaly (deg) arglat (deg)
0.212595426613D+01 0.214243278329D+02 0.216248060135D+03
------------------
end of final coast
------------------
------------------
outgoing hyperbola
------------------
----------------------------------------
verification of optimal control solution
----------------------------------------
The following are plots of the behavior of the inertial right ascension and declination angles, and the
evolution of the yaw and pitch angles during the propulsive maneuver.
page 357
Verification of the optimal control solution
The optimal control solution determined by the Sparse Optimization Suite can be verified by
numerically integrating the orbital equations of motion with the SOS-computed initial park orbit
conditions and the optimal control solution. This is equivalent to solving an initial value problem (IVP)
that uses the SOS optimal unit thrust vector solution. This part of the hyper_sos computer program
uses a Runge-Kutta-Fehlberg 7(8) variable step size method to integrate the orbital equations of motion.
The following is a display of the final solution computed using this explicit numerical integration
method. These results are for the variable attitude example.
----------------------------------------
verification of optimal control solution
----------------------------------------
A comparison of these results with the earlier optimal control solution exhibits excellent agreement.
The delta-v was computed by including the thrust acceleration in the verification equations of motion.
This section describes several methods that can be used to create an initial guess for hyper_sos. The
Sparse Optimization Suite attempts to obtain problem feasibility before trying to solve the optimal
page 358
control problem. If the algorithm cannot find a feasible solution, the software will print warnings and
the user will have to provide a better initial guess.
The software requires an initial guess for the thrust duration. The user should also provide lower and
upper bounds for the total thrust duration. These three inputs should be in seconds.
For hyperbolic injection from circular and near-circular orbits, the delta-v magnitude can be estimated
using the numerical technique described in Appendix H – Impulsive Interplanetary Injection from a
Circular Earth Orbit.
From the user-defined initial spacecraft mass and delta-v estimate, the propellant mass required for the
maneuver is given by the ideal rocket equation as
− V
m p = mi 1 − e Vex
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 hyper_sos.
For the numerical integration initial guess option with variable attitude steering, 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
T
For the fixed inertial attitude steering option, the software uses the user-defined initial guess for right
ascension and declination to create a unit thrust vector in the Earth-centered-inertial (ECI) coordinate
system. The software then transforms this inertial unit thrust vector to the modified equinoctial frame
and integrates the equations of motion in this system. For many simulations, the initial guesses for both
angles can be set to zero. If the simulation does not converge with these simple guesses, the user can
input “averaged” angles determined from the output of an optimized variable attitude case.
The dynamic variables at each grid point of the initial guess are determined by setting the initial guess
option INIT(1) = 6 with INIT(2) = 2 within the odeinp subroutine for this aerospace trajectory
optimization problem. These program options create an initial guess from the numerical integration of
the equations of motion coded in the oderhs subroutine. The INIT(1) = 6 program option tells the
Sparse Optimization Suite to construct an initial guess by solving an initial value problem (IVP) with a
page 359
linear control approximation. The INIT(2) = 2 program option tells the program to use the Dormand-
Prince variable step size numerical method to solve the initial value problem.
Binary restart data files can also be used to initialize a hyper_sos simulation. A typical scenario is
This technique 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 provides details about the software implementation within hyper_sos. It defines such
things as point and path constraints (boundary conditions), bounds on the dynamic variables, and the
performance index or objective function.
The software allows the user to select one of the following initial orbit constraint options.
1) constrain semimajor axis, eccentricity and inclination
2) constrain all initial orbital elements
3) option 2 with unconstrained true longitude
For all three options, the initial orbit inclination is constrained by enforcing
i
h 2 + k 2 = tan
2
where i is the park orbit inclination. Furthermore, the semi-parameter 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
Otherwise, for an elliptical park orbit, the single constraint f 2 + g 2 = e is enforced, where e is the
user-defined park orbit eccentricity.
For constraint option 2, both lower and upper bounds for the other modified equinoctial elements are set
equal to the initial elements.
page 360
f L = fU = fi g L = gU = gi
hL = hU = hi k L = kU = ki
LL = LU = Li
Option 3 is identical to option 2 with the initial true longitude bounded according to
−180 Li +180
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 interplanetary injection stage. This is simply J = m f .
The value of the maxmin indicator in the Sparse Optimization Suite 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. The spacecraft mass at the
initial time is constrained to the user-defined initial value.
Please note that the hyper_sos software will not be able to optimize the propulsive maneuver using the
fixed attitude steering option and a highly constrained initial park orbit. For this situation, the software
will display a warning and internally set maxmin to zero (no optimization).
For the variable steering program option, the scalar magnitude of the components of the unit thrust
vector at any time during the simulation is constrained as
At the final time, the solution should satisfy the following “energy scaled” unit asymptote targeted
minus predicted vector equality constraint
( C3 sˆ )T − ( C3 sˆ ) P = 0
where the user-defined “target” departure asymptote unit vector is given by
cos cos
sˆT = cos sin
sin
In this expression, is the user-defined right ascension (RLA) and is the user-defined declination
(DLA) of the hyperbolic departure orbit.
page 361
The predicted “twice specific” (per unit mass) orbital energy (C3) is determined from the final position r
and velocity v vectors according to
2
C3 = v −
2
The predicted asymptote unit vector at any trajectory time can be computed from
1
C3
1
C3
sˆ P = h e − e = h e − e
h
2
p
1 + C3 2 1 + C3
where h and e are the predicted final angular momentum and orbital eccentricity vectors, respectively.
These orientation vectors are computed using the following two equations.
h =rv
vh r 1 2
e= − = v − r − ( r v ) v
r r
The following lower and upper bounds are applied to the spacecraft mass and the modified equinoctial
dynamic variables during the propulsive maneuver.
0.05msci msc 1.05msci p 0.8 pi
−1 h + 1 − 1 k +1
where msc is the initial spacecraft mass. The elements f and g are unconstrained.
i
For the variable steering option, the radial, tangential, and normal components of the unit thrust vector
are constrained as follows
−1.1 ur +1.1 − 1.1 ut +1.1 − 1.1 un +1.1
For the inertially fixed attitude steering option, the right ascension and declination angles are bounded as
Technical discussion
In this computer program, the orbital motion of the spacecraft is modeled in the modified equinoctial
orbital elements coordinate system. Please consult Appendix A – Trajectory Modeling and Targeting in
the Modified Equinoctial Orbital Elements System for a definition of these orbital elements along with
the equations of motion in this system. Appendix G – Aerospace Trajectory Coordinates and Time
Systems also provides useful technical details about coordinate transformations.
page 362
Propulsive thrust
For the variable steering option, the components of this unit vector are control variables.
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 ) = msc − m t where msc is the initial mass of the spacecraft.
i i
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
Finally, the pitch and yaw angles can be determined from the components of the unit thrust vector
according to
= sin −1 ( uT r
) = tan −1 ( uT , uT
n t
)
Both steering angles are defined with respect to a local-vertical, local-horizontal (LVLH) system located
at the spacecraft. The in-plane pitch angle is positive above the “local horizontal” and the out-of-plane
yaw angle is positive in the direction of the angular momentum vector. The inverse tangent calculation
in the second equation is a four-quadrant operation.
For either steering option, the software provides the steering angles and the components of the unit
thrust vector in both the inertial and modified equinoctial coordinate systems. The following section
summarizes the inertial-to/from-modified equinoctial coordinate transformations and the calculation of
the inertial unit thrust vector in terms of right ascension and declination angles.
In the hyper_sos computer program, the components of the inertial unit thrust vector are defined in
terms of the right ascension and the declination angle as follows:
page 363
The right ascension and declination angles can be determined from the components of the ECI unit
thrust vector according to
(
= tan −1 uTECI y , uTECI x ) ( )
= sin −1 uTECI z
The right ascension and declination angles are treated as problem parameters in the fixed inertial
attitude steering option.
Finite-burn solutions
This section describes how to use hyper_sos to optimize the finite-burn trajectories for each of the
hyperbolic injection opportunities described in Appendix H.
For an initial spacecraft mass of 4000 kilograms, a specific impulse of 450 seconds, and a delta-v of
3641.245 meters/second, the propellant mass required for the impulsive maneuver is given by
− V
−3641.245
m p = mi 1 − e Vex = 4000 1 − e 9.80665450
= 2247.27 kilograms
For a thrust level of 19840 newtons, the calculation for thrust duration is
g I sp m p 9.80665 450 2247.27
td = = = 499.58 seconds
F 19480
With this answer for the thrust duration, we can create the following (partial) input data file for
hyper_sos. Notice that we use a thrust duration initial guess of 550 seconds and the park orbit RAAN
(176 degrees) of the first opportunity. We also constrain only the semimajor axis, eccentricity and
orbital inclination of the initial Earth park orbit.
*************************************************************************
** Optimal Finite-Burn Earth Orbit-to-Interplanetary Injection
** single phase, continuous-thrust maneuver with user-defined final coast
** variable and fixed inertial attitude steering
** input file ==> hyper2.in - February 14, 2011
*************************************************************************
type of steering
1 = fixed inertial attitude
2 = variable attitude
---------------------
2
page 364
lower bound for thrust duration (seconds)
1.0
upper bound for thrust duration (seconds)
1000.0
*****************
* INITIAL ORBIT *
*****************
********************************
initial orbit constraint options
********************************
1 = constrain semimajor axis, eccentricity and inclination
2 = constrain all initial orbital elements
3 = option 2 with unconstrained true longitude
----------------------------------------------
1
********************
* LAUNCH HYPERBOLA *
********************
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate Earth
----------------
2
*************************
* initial guess options *
*************************
1 = numerical integration
2 = binary restart file
------------------------
1
page 365
numerical integration initial guess
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
------------------
end of final coast
------------------
------------------
outgoing hyperbola
------------------
page 366
1.66666666666667 minutes
-----------------------------
verification of SOS solution
-----------------------------
Here is the hyper_sos solution for the second opportunity. The only change to the input data file
involved setting the RAAN of the park orbit to 348 degrees.
program hyper_sos
==================
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
page 367
------------------
end of final coast
------------------
------------------
outgoing hyperbola
------------------
----------------------------------------
verification of optimal control solution
----------------------------------------
The finite-burn solution requires a delta-v which is about 29 meters per second larger than the impulsive
solution.
The hyper_sos software can also be used to solve the Earth orbit-to-interplanetary injection problem
using a fixed thrust duration maneuver. This section illustrates how to modify the data file for the
variable thrust duration example given previously in this document to solve the same problem using a
fixed thrust duration maneuver.
Since the thrust duration is fixed, the propellant required is determined by the burn time and the software
is essentially solving a two-point boundary value problem (TPBVP). An estimate for the fixed thrust
duration time can be determined a priori from the optimal variable thrust time solution.
This simulation capability can be applied to missions that perform this type of orbital maneuver using
solid propellant upper or “kick” stages. These missions typically customize the performance of the stage
by offloading propellant or perhaps by modifying the geometry of the solid propellant grain. The stage
usually includes extra propellant to account for dispersions in propulsive performance due to thrust,
page 368
specific impulse or other variations. The statistical stage performance can be determined from a Monte
Carlo dispersion analysis.
In this example, the thrust duration is fixed at 520 seconds which is slightly longer than the optimal
variable thrust duration answer of 497.258 seconds. These next several lines are the changes to the input
data file used for the variable thrust example. The first part of the data fixes the lower and upper bounds
for the thrust duration. The second part of the data invokes the compressed Hermite-Simpson solution
collocation method.
lower bound for thrust duration (seconds)
520.0
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
3
The following is the numerical output for this fixed thrust duration example.
program hyper_sos
=================
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
page 369
thrust duration 520.000000000000 seconds
8.66666666666667 minutes
------------------
end of final coast
------------------
------------------
outgoing hyperbola
------------------
This plot illustrates the behavior of the pitch and yaw control angles for this example. It appears that the
“boundary value” solution modifies both the inplane and out-of-plane steering angles in order to manage
the excess energy.
page 370
Here is the program output for the same fixed thrust duration example with fixed inertial attitude
steering. This type of solution might be used for a “point and shoot” upper stage or kick motor.
program hyper_sos
=================
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
page 371
sma (km) eccentricity inclination (deg) argper (deg)
-.453142457306D+05 0.114486576255D+01 0.286230517643D+02 0.195093043483D+03
------------------
end of final coast
------------------
------------------
outgoing hyperbola
------------------
----------------------------------------
verification of optimal control solution
----------------------------------------
page 372
Contents of the simulation summary and csv files
This section is a summary of the information contained in the simulation summary screen displays and
CSV data file produced by the hyper_sos software.
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
period (min) = orbital period in minutes. If the orbit is hyperbolic, the period is
undefined and a value of 0 is displayed.
The user-defined comma-separated-variable (CSV) disk file is created by the software and contains the
following information.
time (sec) = time since ignition in seconds
page 373
yaw (deg) = thrust vector yaw angle in degrees
page 374
“Optimal Finite-Thrust Spacecraft Trajectories Using Direct Transcription and Nonlinear
Programming”, Paul J. Enright, Ph.D. Thesis, University of Illinois at Urbana-Champaign, 1991.
“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.
page 375
CMATO 17 – Low-thrust Earth Escape Trajectory Optimization
This CMATO application is a Fortran computer program named escape_sos that uses the Sparse
Optimization Suite (SOS) distributed by Applied Mathematical Analysis to solve the low-thrust finite-
burn, Earth escape trajectory optimization problem. The software models the trajectory as a single,
finite-burn propulsive maneuver. This computer program attempts to maximize the final spacecraft
mass. Since this simulation involves a single continuous maneuver, this is equivalent to minimizing the
propellant mass required to perform this orbit transfer.
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 escape_sos 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 optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The escape_sos software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 376
Input file format and contents
The escape_sos software is “data-driven” by a user-created text file. 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 font. This example attempts to optimize the maneuver
required to perform a low-thrust escape from a 1000 kilometer circular Earth orbit.
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.
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.
******************************************
** earth escape trajectory optimization
** single phase, continous-thrust maneuver
** program escape_sos
** leo2esc.in - April 25, 2012
******************************************
The first three inputs provide the initial spacecraft mass, thrust magnitude (assumed constant) and the
specific impulse (also assumed constant) of the propulsion system.
initial spacecraft mass (kilograms)
1000.0
The next two inputs define the circular orbit altitude and inclination of the initial Earth orbit.
*****************
* INITIAL ORBIT *
*****************
altitude (kilometers)
1000.0
The next two inputs specify the orbital inclination and specific orbital energy of the final escape
trajectory.
***************
* FINAL ORBIT *
***************
page 377
This next input defines the method used to estimate the transfer time.
*******************************************
* type of initial guess for transfer time *
-------------------------------------------
1 = numerical integration
2 = user-defined
-----------------
1
For option 2 above, the next input is the user’s initial guess for the transfer time.
********************************************************
* user-defined initial guess for transfer time (hours) *
********************************************************
480
The next integer input defines the type of initial guess to use for the trajectory.
*************************
* initial guess options *
*************************
1 = numerical integration
2 = binary data file
---------------------
1
This input defines the name of a restart or initial guess binary data file.
name of binary initial guess data file
leo2esc.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 solution data file to create.
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = SOS-defined nodes
2 = user-defined nodes
3 = user-defined step size
---------------------------
1
For options 2 or 3, this 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
50
The name of the comma-separated-variable solution data file is defined in this next line.
page 378
name of solution output file
leo2esc.csv
The next series of program inputs are algorithm control options and parameters for the SOS software.
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.
discretization/collocation method
---------------------------------
1 = trapezoidal
2 = separated Hermite-Simpson
3 = compressed Hermite-Simpson
-------------------------------
1
The next input defines the relative error in the objective function.
********************************
* algorithm control parameters *
********************************
The next input defines the relative error in the solution of the differential equations.
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.
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
10000
The level of output from the Sparse Optimization Suite NLP algorithm is controlled with the following
integer input.
***************************
sparse NLP iteration output
---------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
2
The level of output from the Sparse Optimization Suite optimal control algorithm is controlled with the
following integer input. Please note that option 4 will create lots of information.
page 379
**********************
optimal control output
----------------------
1 = none
2 = terse
3 = standard
4 = interpretive
-----------------
1
The level of output from the Sparse Optimization Suite 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
-------------------
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 escape_sos software. Please read Appendix J – Sparse
Optimization Suite Configuration File for more information about this file.
***************************************
* optimal control configuration options
***************************************
page 380
Optimal control solution
The following is the escape_sos solution for this example. This simulation used the numerical
integration method for estimating the transfer time, and the tangential steering method to create the
initial guess for the transfer trajectory. The output includes the orbital characteristics at the beginning
and end of the propulsive maneuver.
program escape_sos
------------------
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
The following program output is the final spacecraft mass, the propellant mass consumed, the actual
thrust duration for the maneuver, the accumulated delta-v and the final specific orbital energy.
final mass 818.781528480986 kilograms
The delta-v is estimated using a cubic spline method that integrates the thrust acceleration at each
collocation grid point of the solution. Notice that the final orbital eccentricity is equal to one which
confirms that a parabolic escape orbit has been created.
page 381
The escape_sos computer program will create a comma-separated-variable (csv) data file containing
the optimal control solution. This data file can be used to create graphic displays of important trajectory
characteristics. Additional information about the contents of this file can be in the Contents of the
simulation summary and csv files section later in this document.
The following two plots illustrate the evolution of the pitch and yaw steering angles during this finite-
burn maneuver.
The next two plots illustrate the evolution of the inertial right ascension and declination angles of the
thrust vector.
page 382
The next two plots illustrate the behavior of the orbital eccentricity and inclination during the low-thrust
escape trajectory. As expected the final orbital eccentricity is one.
This next plot illustrates the behavior of the flight path angle and specific orbital energy during the
propulsive maneuver. As expected the final orbital energy is zero.
This final plot is a graphics display of the transfer trajectory in the x-y (equatorial) plane. The measure
of the axes is Earth radii (ER).
page 383
Verification of the optimal control solution
The optimal control solution determined by the Sparse Optimization Suite can be verified by
numerically integrating the orbital equations of motion with the SOS-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 escape_sos computer program uses a
Runge-Kutta-Fehlberg 7(8) variable step size method to integrate the orbital equations of motion.
The following is a display of the final solution computed using this explicit numerical integration
method.
========================================
verification of optimal control solution
========================================
------------------
end of finite burn
------------------
page 384
thrust duration 325.810122682355 hours
13.5754217784315 days
The escape_sos software implements a simple numerical method for estimating the total maneuver
time. The program simply integrates the equations of motion until the specific orbital energy becomes
positive. The software uses a tangential thrusting steering method to generate an initial guess for the
optimal trajectory. For tangential thrusting, 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
T
guess. It works best when the initial and final orbits are nearly coplanar.
The dynamic variables at each grid point of the initial guess are determined by setting the initial guess
option INIT(1) = 6 with INIT(2) = 2 within the odeinp subroutine for this aerospace trajectory
optimization problem. These program options create an initial guess from the numerical integration of
the equations of motion coded in the oderhs subroutine. The INIT(1) = 6 program option tells the
Sparse Optimization Suite to construct an initial guess by solving an initial value problem (IVP) with a
linear control approximation. The INIT(2) = 2 program option tells the program to use the Dormand-
Prince variable step size numerical method to solve the initial value problem.
Binary restart data files can also be used to initialize an escape_sos simulation. A typical scenario is
This technique works well provided the two simulations are not dramatically different. Sometimes it
may be 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 provides additional details about the software implementation. It explains such things as
point and path constraints, the performance index and the numerical technique used to create an initial
guess for the software.
The lower and upper bounds for all modified equinoctial elements are set equal to the initial user-
defined modified equinoctial orbital elements (subscript i) as follows:
pL = pU = pi f L = fU = f i g L = gU = g i
hL = hU = hi k L = kU = ki LL = LU = Li
page 385
The initial time is also constrained to a value of zero. In optimal control terminology, these equality
constraints or boundary conditions are called point functions.
The objective function or performance index J for this simulation is the total maneuver time. This is
simply J = t f .
Since this simulation involves a single continuous maneuver, this is equivalent to minimizing the
required propellant mass. The value of the maxmin indicator tells the software whether the user is
minimizing or maximizing the performance index.
The scalar magnitude of the components of the unit thrust vector at any time during the simulation is
constrained as follows
uT = uT2r + uT2t + uT2n = 1
This formulation avoids numerical problems that may occur when using thrust steering angles as control
variables.
i
h 2 + k 2 = tan
2
where i is the mission orbit inclination.
The final, user-defined specific orbital energy C 3 is constrained with the following calculation
C3 = v 2 − 2
r
where v is the scalar velocity, r is the geocentric distance and is the Earth’s gravitational constant, all
evaluated at the final condition.
The following lower and upper bounds are applied to the modified equinoctial orbital elements during
the orbital transfer.
10 p f p 0.9 pi
−1 f +1 − 1 g +1
−1 h +1 − 1 k +1
page 386
The true longitude at any time is unbounded. The spacecraft mass at the initial time is fixed to the user-
defined initial value.
Finally, the three components of the unit thrust vector are constrained as follows:
−1.1 ur +1.1 − 1.1 ut +1.1 − 1.1 un +1.1
Technical discussion
In this computer program, the orbital motion of the spacecraft is modeled in the modified equinoctial
orbital elements coordinate system. Please consult Appendix A – Trajectory Modeling and Targeting in
the Modified Equinoctial Orbital Elements System for a definition of these orbital elements along with
the equations of motion in this system.
Propulsive Thrust
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 − m t where msci is the initial mass of the spacecraft and m is the propellant flow
rate.
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 )
Both steering angles are defined with respect to a local-vertical, local-horizontal (LVLH) system located
at the spacecraft. The in-plane pitch angle is positive above the “local horizontal” and the out-of-plane
yaw angle is positive in the direction of the angular momentum vector. The inverse tangent calculation
in the second equation is a four-quadrant operation.
page 387
The escape_sos software provides the steering angles and the components of the unit thrust vector in
both the inertial and modified equinoctial coordinate systems. The inertial-to/from-modified equinoctial
coordinate transformations is described in Appendix A.
In the escape_sos 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
(
= tan −1 uT ECI y
, uTECI
x
) (
= sin −1 uTECI z
)
where the calculation for right ascension is a four-quadrant inverse tangent operation.
This section is a summary of the information contained in the simulation summary screen displays and
the CSV data files produced by the escape_sos software.
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 388
propellant mass = expended propellant mass in kilograms
The delta-v is determined using a cubic spline integration of the thrust acceleration data at each
collocation node.
The comma-separated-variable disk file is created by the odeprt Fortran subroutine and contains the
following information.
time (hrs) = simulation time since ignition in hours
page 389
ry (er) = y-component of the spacecraft’s position vector in Earth radii
“Technique for Escape from Geosynchronous Transfer Orbit Using a Solar Sail”, Victoria L. Coverstone
and John E. Prussing, AIAA Journal of Guidance, Control and Dynamics, Vol. 26, No. 4, July-August
2003.
“Optimal Nonplanar Escape from Circular Orbits”, T. N. Edelbaum, AIAA Journal, Vol. 9, No. 12.
“Optimal Low-Thrust Takeoff from an Orbit About an Oblate Planet”, Robert A. Jacobson and William
F. Powers, Celestial Mechanics, 15 (1977) 161-189.
page 390
Appendix A
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 ( + )
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
i = 2 tan −1 ( h2 + k 2 )
argument of periapsis
= tan −1 ( g , f ) − tan −1 ( k , h )
gh− f k f h+ gk
sin = cos =
e tan ( i 2 ) e tan ( i 2 )
page 391
right ascension of the ascending node (RAAN)
= tan −1 ( k , h )
k h
sin = cos =
tan ( i 2 ) tan ( i 2 )
true anomaly
= L − ( + ) = L − tan −1 ( g , f )
1 1
sin = ( f sin L − g cos L ) cos = ( f cos L + g sin L )
e e
In these expressions, an inverse tangent expression of the form = tan −1 ( a, b ) denotes a four quadrant
evaluation where a = sin and b = cos .
The following figure illustrates the orientation of the Earth-centered-inertial (ECI) and MEE coordinate
systems on a unit sphere. The unit vectors in the ECI system are xˆ , yˆ , zˆ and the unit vectors in the MEE
system are fˆ , gˆ , wˆ .
1 − k 2 + h 2 2k h
fˆ = 2k h gˆ = 1 + k 2 − h 2
2k
2h
page 392
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 + 2hk sin L − f + 2 gh k + 2 f )
s p
2
( h cos L + k sin L + f h + gk )
s2 p
where
p
2 = h2 − k 2 s 2 = 1 + h2 + k 2 r= w = 1 + f cos L + g sin L
w
Equations of orbital motion
The system of nonlinear, first-order modified equinoctial equations of orbital motion with respect to
time is given by the next six equations.
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 dk p s2n
h= = cos L k= = sin L
dt 2w dt 2w
2
dL w 1 p
L= = p + ( h sin L − k cos L ) n
dt p w
page 393
where r , t , n are non-two-body perturbations in the radial, tangential and normal directions,
respectively. For an Earth orbiting 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.
dy
y= = A (y) P + b
dt
where
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 1 p f
cos L ( w + 1) sin L + g 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
2 T
w
b = 0 0 0 0 0 p .
p
P = r ˆi r + t ˆit + n ˆi n
where ˆi r , ˆit and ˆi n 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.
page 394
The dynamical equations of motion with true longitude L as the independent variable can be determined
from the following two vector expressions:
dz dL
z= = f (z)
dL dt
−1
dz dL 1
= f (z) = f (z)
dL dt L
where z is the vector of modified equinoctial orbital elements.
Propulsive thrust
where T is the thrust magnitude, m is the spacecraft mass, uˆ = ur ut un is the unit pointing thrust
vector expressed in the spacecraft-centered radial-tangential-normal coordinate system, and is the
throttle setting. 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:
The pitch angle is positive above the “local horizontal” and the yaw angle is positive in the direction of
the angular momentum vector.
uR
= pitch
= yaw
uT
uN
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
page 395
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
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
( ) ( hˆ rˆ ) ( hˆ rˆ )
T
uˆ TECI = hˆ rˆ .
x y z
g = g N ˆi N − g r ˆi r
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
In these equations the north direction component is indicated by subscript N and the radial direction
component is subscript r.
cos
k
n
Re '
gN = −
r2
Pk J k
k =2 r
k
n
Re
2 (
gr = − k + 1) 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
page 396
For a zonal only Earth gravity model, the east component is identically zero.
J2 = −
n
r4
(1 + h 2
+ k )
2 2
Planetary perturbations
The general vector equation for point-mass perturbations such as the Moon or planets is given by
n
d s
r = − j 3j + 3j
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.
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
rT ( r − 2sk )
qk =
sTk sk
Finally, the perturbation due to secondary bodies in the modified equinoctial coordinate system is given
by a = Q t where Q = ˆi r ˆit ˆi n .
T
page 397
Targeting with modified equinoctial elements
This section describes techniques for “targeting” with modified equinoctial orbital elements by
enforcing equality and inequality mission constraints during the trajectory optimization. Constraint
formulations that enforce both the sine and cosine of a desired orbital element should be used whenever
possible. This approach involves a combination of equality and inequality constraints and ensures that
the “targeted” orbital element is in the correct quadrant.
To illustrate this technique, here are several examples for different values of argument of perigee and the
corresponding mission constraints.
sin 0 → gh − f k 0
0 90 →
f h + g k = e tan ( i 2 ) cos
sin 0 → gh − f k 0
= 270 →
cos = 0 → f h + gk = 0
g h − f k = e tan ( i 2 ) sin
= 178 →
cos 0 → f h + gk 0
The following is a sign table of the sine and cosine for each quadrant.
f h+ gk
f h + g k = e cos tan ( i 2 ) → cos =
e tan ( i 2 )
page 398
right ascension of the ascending node constraints
k
k = tan ( i 2 ) sin → sin =
tan ( i 2 )
h
h = tan ( i 2 ) cos → cos =
tan ( i 2 )
In general,
1 1
sin = ( f sin L − g cos L ) cos = ( f cos L + g sin L )
e e
For a circular orbit,
sin = sin L cos − cos L sin cos = cos L cos + sin L sin
Targeting example
For a user-defined semimajor axis, orbital eccentricity and inclination, the set of modified equinoctial
equality constraints are as follows:
p= p f 2 + g2 = e h 2 + k 2 = tan ( i 2 )
where the tilde indicates the value of the user-defined classical orbital element.
“On the Equinoctial Orbital Elements”, R. A. Brouke and P. J. Cefola, Celestial Mechanics, Vol. 5, pp.
303-310, 1972.
“A Set of Modified Equinoctial Orbital Elements”, M. J. H. Walker, B. Ireland and J. Owens, Celestial
Mechanics, Vol. 36, pp. 409-419, 1985.
“Equinoctial Orbit Elements: Application to Optimal Transfer Problems”, Jean A. Kechichian, AIAA
90-2976, AIAA/AAS Astrodynamics Conference, Portland, OR, 20-22 August 1990.
page 399
Appendix B
This appendix summarizes the equations of motion in the flight path coordinate system. It also provides
the relationship between flight path coordinates and inertial position and velocity vectors. Flight path
coordinates are typically used to model endospheric flight and inertial coordinates are used to model
exospheric flight mechanics.
The first-order flight path equations of motion with respect to time and relative to a rotating spherical
Earth are as follows:
geocentric radius
dr
r= = V sin
dt
geographic longitude
d cos sin
= =V
dt r cos
geocentric declination
d cos cos
= =V
dt r
speed
dV (T cos − D )
V = = − g r sin + g cos cos
dt m
+ e2 r cos ( sin cos − sin cos cos )
flight azimuth
d V T sin + L sin
= = tan sin cos + sin − g
dt r mV cos V cos
r
+ 2 e ( sin − cos cos tan ) + e2 sin cos sin
V cos
page 400
where
r = geocentric radius
V = speed
= flight path angle
= geocentric declination
= longitude ( + east )
= flight azimuth ( + clockwise from north )
= bank angle ( + for a right turn )
= angle-of-attack
re = Earth equatorial radius
e = Earth inertial rotation rate
g r = radial component of gravity
g = latitudinal component of gravity
L = aerodynamic lift force
D = aerodynamic drag force
T = propulsive thrust
m = spacecraft mass
CL = lift coefficient (non-dimensional)
CD = drag coefficient (non-dimensional)
S = aerodynamic reference area
= atmospheric density = f ( h )
h = altitude
Earth gravity
The components of the Earth’s gravity vector in the flight path coordinate system can be determined
from the gradient of the potential function according to
1 U
r g
FG = U = 0 = 0
U g
− r
r
where
j
re
U = 1 − J j Pj 0 ( sin )
r j =1 r
U Pl 0
l l
r 1 U
re
= 2 −1 + ( l + 1) e J l Pl 0 ( sin ) =− 2 Jl
r r l =2 r r r l =2 r
page 401
k
Pj 0 ( sin ) = T jt sin j −2t T jt = ( −1) ( 2 j − 2t )!/ 2lt !( j − t )!( j − 2t )!
t
t =0
For a zonal-only gravity model of order four, the Legendre functions and their partial derivatives are
given by
P20 =
1
2
( 3sin 2 − 1) P30 =
1
2
( 5sin 3 − 3sin ) P40 =
1
8
( 35sin 4 − 30sin 2 + 3)
The transformation of an ECI position vector reci to an 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 time of interest. Greenwich apparent sidereal time
is given by the following expression
= g 0 + et
where g 0 is the Greenwich apparent sidereal time at 0 hours UTC, e is the inertial rotation rate of the
Earth, and t is the elapsed time since 0 hours UTC.
Finally, the flight path coordinates are determined from the following set of equations
r = rECF
2
x
+ rECF
2
y
+ rECF
2
z
v = vECF
2
x
+ vECF
2
y
+ vECF
2
z
rECFz
(
= tan −1 rECF , rECF ) = sin −1
rECF
y x
vrz
= sin −1 − = tan −1 vr , vr
vr y x
where
− sin cos − sin sin cos
v r = − sin cos 0 v ECF
− cos cos − cos sin − sin
page 402
Converting flight path coordinates to an ECI state vector
This coordinate conversion is often necessary to determine the orbital inclination and other trajectory
characteristics at entrance or exit from a celestial body atmosphere.
The Earth-centered-fixed (ECF) position and velocity vectors of the vehicle can be determined from the
flight path coordinates with the following set of equations:
rECFx = r cos cos rECFy = r cos sin rECFz = r sin
vECFx = v cos ( − cos sin sin + cos cos ) − sin sin sin
vECFy = v sin ( − cos sin sin + cos cos ) + sin sin cos
where = 90 − .
The transformation from ECF to ECI coordinates involves the transpose of the ECI-to-ECF
transformation matrices described above as follows
rECI = T rECF
T
− e sin e cos 0
T = − e cos − e sin 0
0 0 0
Vehicle aerodynamics
The next section is a summary of useful equations related to general aerodynamic characteristics of
aerospace vehicles.
general form of a drag polar
CD = CD0 + k CL
n
lift-to-drag ratio
L CL CL
E= = =
D CD CD0 + kCLn
page 403
maximum lift-to-drag ratio (value of E at which dE dCL = 0 )
E
=
(C D0 )
+ kCLn − CL ( nkCLn −1 )
(C )
2
D0 + kCLn
CD0
CL =
k ( n − 1)
n
where
CD = drag coefficient
CL = lift coefficient
k = constant
C 1
E = L = = maximum L D
CD max 2 kCD0
The following is a graphic display of a typical parabolic drag polar (shown by the red curve). The blue
line is tangent to the drag polar and visually helps locate the lift and drag coefficients at maximum lift
over drag (max L/D).
page 404
Heat rate and heat load
The heat rate experienced by an aerospace vehicle can be computed using Chapman’s stagnation point
heat rate equation according to
3.15
dq 17,600 V BTU
q= = 2
dt RN V0 0 ft − sec
where
RN = nose radius
The accumulated heat load at any mission elapsed time is determined from the integral of heat rate
according to
qL = q ( t ) dt
t2
t1
page 405
The lift L and drag D forces are given by
1 1
L= V 2CL A D= V 2C D A
2 2
where is the atmospheric density and A is the aerodynamic reference area. In these expressions,
1
V 2 is the dynamic pressure.
2
Hypersonic and Planetary Flight Mechanics, N. X. Vinh, R. D. Culp, and A. Busemann, University of
Michigan Press, 1980.
page 406
Appendix C
a ( r, v, t ) = r ( r, r, t ) = a g ( r, t ) + a m ( r, t ) + a s ( r, t ) + a d ( r, v, t ) + a srp ( r, t ) + aT ( 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
a m = acceleration due to the Moon
a s = acceleration due to the Sun
a d = acceleration due to aerodynamic drag
a srp = acceleration due to solar radiation pressure
aT = acceleration due to propulsive thrust
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 non-spherical 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
page 407
1 z 1
y= − y+ 2 x
r r r 2 x 2 + y 2 x + y 2
1 x + y
2 2
z = z +
r r r2
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 )
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 ( 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 Pn0−1 ( sin ) − ( n − 1) Pn0−2 ( sin )
n
Pnn ( sin ) = ( 2n − 1) cos Pnn−−11 ( sin ) , m 0, m n
r r
a m ( r , t ) = − m m −b 3 + e − m 3
r re − m
m −b
where
m = gravitational constant of the moon
rm −b = position vector from the moon to the satellite
re− m = position vector from the Earth to the moon
r r
a s ( r , t ) = − s s −b 3 + e − s 3
r re − s
s −b
where
s = gravitational constant of the sun
rs −b = position vector from the sun to the spacecraft
re− s = position vector from the Earth to the sun
To avoid numerical problems, use is made of Professor Richard Battin’s f ( q ) function given by
3 + 3qk + qk2
f ( qk ) = q k 3
(
1 + 1 + qk )
where
rT ( 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 d k = r − sk , where r is the position vector of the spacecraft relative
page 409
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.
The acceleration experienced by a spacecraft due to atmospheric drag is computed using the following
vector expression
1 C A
a d ( r , v, t ) = − ( r , t ) v r v r d
2 m
where
v r = satellite velocity vector relative to the atmosphere
= atmospheric density
Cd = drag coefficient of the spacecraft
A = reference area of the spacecraft
m = mass of the spacecraft
The aerodynamic drag algorithm assumes that the atmosphere rotates at the same angular speed as the
Earth. With this reasonable assumption the spacecraft’s relative velocity vector is given by
v r = v − w r where w is the inertial rotation vector of the Earth. The angular velocity vector of the
Earth is w = e 0 0 1 where e = 7.292115486E-5 radians per second is the scalar inertial rotation
T
rate.
The cross-product expansion of the previous equation gives the three components of the relative velocity
vector as follows
v x + e ry
v r = v y − e rx
vz
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 constant
a = astronomical unit
A = surface area normal to the incident radiation
m = mass of the spacecraft
page 410
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
1358 watts
Ps =
c m2
where c is the speed of light in meters/second.
The acceleration vector of the spacecraft due to solar radiation pressure is given by:
rsat −to−Sun
a srp = Csrp 3
rsat −to − Sun
where
rsat −to − Sun = rsat − rEarth−to− Sun
rsat = geocentric, inertial position vector of the spacecraft
rEarth −to − Sun = geocentric, inertial position vector of the sun
During the numerical 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 res 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 the following formulas
These are the angles between the geocentric anti-Sun vector and the geocentric vector to a spacecraft at
the time of shadow entrance or exit.
If we represent the shadow as a cylinder, the shadow angle is given by = sin −1 ( re rsc ) .
page 411
The corresponding penumbra and umbra cone angles are as follows
rs + re rs − re
p = sin −1 u = sin −1
res res
where
re = radius of the Earth
rs = radius of the Sun
res = 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 the Computer Methods for Aerospace Trajectory Optimization software
also assume that the Earth’s atmosphere increases the radius of the Earth by two percent.
An Introduction to the Mathematics and Methods of Astrodynamics, Richard H. Battin, AIAA Education
Series, 1987.
Analytical Mechanics of Space Systems, Hanspeter Schaub and John L. Junkins, AIAA Education
Series, 2003.
Modern Astrodynamics, Victor R. Bond and Mark C. Allman, Princeton University Press, 1996.
Hypersonic and Planetary Entry Flight Mechanics, Vinh, Busemann and Culp, The University of
Michigan Press, 1980.
page 412
Appendix D
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 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 at
the arrival planet.
B-plane calculations
This section describes the conversion of inertial coordinates of an arrival or departure hyperbola to
fundamental B-plane coordinates and vectors.
angular momentum vector
h =rv
radius rate
r =r v r
page 413
semi-parameter
h2
p=
semimajor axis
r
a=
r v2
2 −
orbital eccentricity
e = 1− p a
true anomaly
p−r rh
cos v = sin v =
er e
B-plane magnitude
2
2 rp
B = rp 1+ = 2 1 + V2 − 1
2
rpV V
fundamental vectors
r v − rr
zˆ =
h
pˆ = cos rˆ − sin zˆ qˆ = sin rˆ + cos zˆ
S vector
a b
S=− pˆ + qˆ where b = pa
a 2 + b2 a 2 + b2
B vector
b2 ab
B= pˆ + qˆ
a 2 + b2 a 2 + b2
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
where r and v are the spacecraft inertial position and velocity vectors and is the planet’s gravitational
constant.
page 414
Techniques for B-Plane targeting
This section describes several techniques for using B-plane coordinates to target to specific planetary or
moon encounter conditions. These targets are usually formulated as equality mission constraints which
are enforced while solving the trajectory optimization problem.
user-defined B-plane coordinates
For this targeting option, the two nonlinear equality constraints enforced by the nonlinear programming
(NLP) algorithm are
( B T ) p − ( B T )u = 0 ( B R ) p − ( B R )u = 0
where the p subscript refers to coordinates predicted by the software and the u subscript denotes
coordinates provided by the user. The predicted B-plane coordinates are based on the planet-centered
flight conditions at closest approach.
targeting to user-defined entry interface (EI) conditions with user-defined inclination
For this targeting option, the following equations can be used to determine the required B-plane
components based on the user-defined EI targets. These targets are the inertial flight path angle and
altitude relative to a spherical planet model.
B T = bt cos B R = bt sin
where
2 rei cos i
bt = cos ei + rei2 and cos =
2
v cos
Note that this targeting option could be modified to use a user-defined B-plane angle instead of orbital
inclination at the entry interface.
In these equations, ei is the user-defined flight path angle at the entry interface, rei is the arrival planet-
centered radius at the entry interface (sum of planet equatorial radius plus user-defined EI altitude) and i
is the user-defined orbital inclination.
Also, these dot product mission constraints can be expressed in terms of the x, y and z components of the
spacecraft’s inertial position and velocity vectors according to
rx v y − ry vx (r v + ry v y ) vz − ( vx2 + v y2 ) rz
B T= R=
x x
B
vx2 + v y2 vx2 + v y2 vx2 + v y2 + vz2
page 415
rp = normalized periapsis radius = rp rm
b = normalized b-plane magnitude = b rm
v = normalized v-infinity speed = v vlc
vlc = local circular speed at Mars = m rm
rm = radius of Mars
m = gravitational constant of Mars
For a grazing flyby, rp = 1 and the normalized B-plane distance or offset is equal to
2
b = 1 +
v2
where is the user-defined B-plane angle of the arrival trajectory. Please note that the B-plane angle is
measured positive clockwise from the T axis of the B-plane coordinate system. The two equality
constraints for this option are simply the difference between the predicted and required B T and B R
components.
targeting to a planet-centered node/apse alignment trajectory
This targeting option determines when a spacecraft is simultaneously at a nodal crossing and periapsis of
the arrival planet encounter hyperbola. The B-plane angle required for node-apse alignment is given by
sin h Sˆz
= sin −1
cos Sˆ 2 + Sˆ 2
h x y
Also noted in the thesis of R. H. See, the minimum and maximum values of orbital inclination can be
determined from the x and y components of the unit Ŝ vector according to
imin = 0 → Sˆx2 + Sˆ y2 = 1
page 416
The relationship between orbital inclination i, B-plane angle and asymptote declination of an
incoming or outgoing hyperbola is given by cos i = cos cos . The following is a contour plot
illustrating the achievable inclination as a function of B-plane angle and declination.
“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.
“A Complete and Fast Survey of the Orbital Insertion Design Space For Planetary Moon Missions”,
Robert Harding See, MS Thesis, University of Texas, August 2017.
“Trajectory correction maneuver design using an improved B-plane targeting method”, D. Cho, Y.
Chung and H. Bang, Acta Astronautica, 72 (2012) pp. 47-61.
page 417
Appendix E
This appendix describes two analytic algorithms that can be used to compute the propulsive impulse
required to de-orbit from circular and elliptical orbits. This impulsive answer can be used as an initial
guess for finite-burn trajectory simulations.
The scalar magnitude of the single impulsive maneuver required to de-orbit a spacecraft from an initial
circular orbit can be determined from the following expression
1 2 ( r − 1) 2 ( r − 1)
V = Vce 1 − 2 = Vci 1 − 2
r r r
−1 −1
cos e cos e
where
hi + req ri
r= = = radius ratio
he + req re
Vce = = = local circular velocity at entry interface
(he + req ) re
Vci = = = local circular velocity of initial circular orbit
(h + r )
i eq
ri
This algorithm is described in the technical article, “Deboost from Circular Orbits”, A. H. Milstead, The
Journal of the Astronautical Sciences, Vol. XIII, No. 4, pp. 170-171, Jul-Aug., 1966. Additional
information can be found in Chapter 5 of Hypersonic and Planetary Entry Flight Mechanics by Vinh,
Busemann and Culp, The University of Michigan Press.
page 418
The true anomaly on the de-orbit trajectory at the entry interface e can be determined from the
following two equations
r ad (1 − ed2 ) ad (1 − ed2 ) 1
sin e = cos e = −
ed ed re ed
where
ed = eccentricity of the de-orbit trajectory
The elapsed time-of-flight between perigee of the de-orbit trajectory and the entry true anomaly e is
given by
1 − ed e 1 − ed2 sin e
t ( e ) = 2 tan −1 tan e − d
2
1 + e 2
1 + e cos
d d e
In this equation is the Keplerian orbital period of the de-orbit trajectory and is equal to 2 ad3 .
Therefore, the flight time between the de-orbit impulse and entry interface is given by
t = t ( e ) − t (180 ) = t ( e ) −
2
2
Finally, the orbital speed at the entry interface Ve can be determined from Ve = − .
re ad
The magnitude of the impulsive delta-v for de-orbit from an initial elliptical orbit is given by
2rp 2 ( ra − 1)
V = − cos
re ra ( ra + rp ) ra ( ra2 − cos2 e )
e
where
page 419
re = geocentric radius at the entry altitude
ra = ra re
rp = rp re
The true anomaly at entry can be determined from the following series of equations.
r ad (1 − ed2 ) ad (1 − ed2 ) 1
sin e = cos e = − e = tan −1 ( sin e , cos e )
ed ed re ed
where
ed = eccentricity of the de-orbit trajectory
The time-of-flight between perigee and the entry interface true anomaly e is given by
1 − ed e 1 − ed2 sin e
t ( e ) = 2 tan −1 tan e − d
2 1 + ed
2 1 + ed cos e
In this equation, is the Keplerian or unperturbed orbital period of the de-orbit trajectory.
Therefore, the flight time between the de-orbit impulse time and the entry interface is given by
t = t ( e ) − t (180 ) = t ( e ) −
2
2
Finally, the speed at the entry interface Ve can be determined from Ve = − .
re ad
The following is a typical numerical example of de-orbit from an initial circular orbit.
****************************************
single impulse deorbit from Earth orbits
****************************************
page 420
calendar date 18-Mar-2010
page 421
geocentric declination 20.58001385 degrees
“Nearly Circular Transfer Trajectories for Descending Satellites”, George M. Low, NASA Technical
Report R-3, 1959.
“Optimum Deboost Altitude for Specified Atmospheric Entry Angle”, Jerome M. Baker, Bruce E.
Baxter, and Paul D. Arthur, AIAA Journal, Vol. 1, No. 7, July 1963.
“Deboost from Circular Orbits”, A. H. Milstead, The Journal of the Astronautical Sciences, Vol. XIII,
No. 4, pp. 170-171, July-August, 1966.
“Geometric Theory of Optimum Disorbit Problems”, A. Busemann and N. X. Vinh, NASA CR-750,
April 1967.
“Autonomous Optimal Deorbit Targeting”, Donald J. Jezewski, AAS 91-136, AAS/AIAA Spaceflight
Mechanics Meeting, February 11-13, 1991.
“Algorithm for Prompt Prediction of the Trajectory of the Motion of a Descending Reentry Vehicle
Gliding in the Rotating Atmosphere”, V. V. Betanov, D. V. Doronin, and S. E. Zakharov, Cosmic
Research, Vol. 37, No. 4, 1999, pp. 404-408.
“Analysis of the Accuracy of Ballistic Descent from a Circular Circumterrestrial Orbit”, Yu. G.
Sikharulidze and A. N. Korchagin, Cosmic Research, Vol. 40, No. 1, 2002, pp.75-87.
page 422
Appendix F
To model ballistic interplanetary missions involving asteroids and comets, the classical orbital elements
of these types of small celestial bodies relative to the mean ecliptic and equinox of J2000 coordinate
system must be provided by the user. These elements can be obtained from the JPL Near Earth Object
(NEO) website (http://neo.jpl.nasa.gov).
Here is a typical data display screen from the JPL NEO website.
Orbital Elements at Epoch 2459000.5 (2020-May-31.0) TDB
Reference: JPL 46 (heliocentric ecliptic J2000)
Element Value Uncertainty (1-sigma) Units
e .07755702331559071 4.807e-12
a 2.767656854438644 1.0356e-11 au
q 2.553005627249392 1.947e-11 au
i 10.58862149177901 4.6132e-09 deg
node 80.28698636629558 6.1769e-08 deg
peri 73.73167094328808 6.6184e-08 deg
M 162.6862516879934 7.3559e-09 deg
2458240.497283818471
tp 3.6867e-08 TDB
(2018-May-01.99728382)
1681.770739607881 9.4391e-09 d
period
4.60 2.584e-11 yr
n .2140600924499002 1.2014e-12 deg/d
Q 2.982308081627896 1.1159e-11 au
The software determines the mean anomaly of the asteroid or comet at any simulation time using the
following equation
s s
M=
a 3
t pp =
dM
dt
t pp = M t pp =
a3
( JDi − JDpp )
where s is the gravitational constant of the sun, a is the semimajor axis of the celestial body, and t pp is
the time since perihelion passage. In the third form of this equation, JDi is the simulation Julian day
and JD pp is the Julian day of perihelion passage. For consistency, the mean motion rate M should be
in the units of distance/day since the delta-time ( JDi − JD pp ) is in days.
page 423
The semimajor axis of the celestial body is determined from the perihelion distance rp and orbital
eccentricity e according to a = rp (1 − e ) .
This solution of Kepler’s equation in these computer programs is based on a numerical solution devised
by Professor J.M.A. Danby at North Carolina State University. Additional information about this
algorithm can be found in “The Solution of Kepler’s Equation”, Celestial Mechanics, 31 (1983) 95-107,
317-328 and 40 (1987) 303-312.
The initial guess for Danby's method is E0 = M + 0.85sign ( sin M ) e . The fundamental equation we
want to solve is
f ( E ) = E − e sin E − M = 0
The iteration for an updated eccentric anomaly based on a current value E n is given by the next four
equations
f f
( En ) = − ( En ) = −
f 1
f + f
2
f
n ( En ) = − En +1 = En + n
1 1 2
f + f + f
2 6
This algorithm provides quartic convergence of Kepler's equation. This process is repeated until the
convergence test f ( E ) involving the fundamental equation is satisfied, where is the
convergence tolerance. This tolerance is hardwired in the software to =1.0e-10.
Finally, the true anomaly can be calculated with the following two equations
2M
H 0 = log + 1.8
e
where H 0 is the hyperbolic anomaly. The fundamental equation and first three derivatives for this case
are
f ( H ) = e sinh H − H − M f ( H ) = e cosh H − 1
page 424
Otherwise, the iteration loop that calculates , , and so forth is the same. The true anomaly for
hyperbolic orbits is determined with this next set of equations.
Finally, the true anomaly is determined from a four-quadrant inverse tangent evaluation of these two
equations.
The classical orbital elements can be converted to inertial position and velocity vectors or modified
equinoctial orbital elements and included in the heliocentric equations of motion.
Here is the Fortran source code that implements this numerical method.
subroutine kepler1 (xma, ecc, eanom, tanom)
c Danby's method
c input
c output
c *********************************
c circular orbit
tanom = xma
eanom = xma
return
c elliptic orbit
else
c hyperbolic orbit
end if
page 425
do i = 1, 20
c elliptic orbit
s = ecc * sin(eanom)
c = ecc * cos(eanom)
f = eanom - s – xma
fp = 1.0d0 – c
fpp = s
fppp = c
else
c hyperbolic orbit
s = ecc * sinh(eanom)
c = ecc * cosh(eanom)
fp = c - 1.0d0
fpp = s
fppp = c
end if
delta = -f / fp
enddo
end if
c elliptic orbit
else
c hyperbolic orbit
page 426
end if
return
end
SPK ephemerides
Asteroid and comet ephemerides in ASCII or binary SPK format can also be created and retrieved from
JPL’s Asteroid & Comet SPK File Generation Request website located at
https://ssd.jpl.nasa.gov/x/spk.html.
Information about SPK format data can be found at https://naif.jpl.nasa.gov/naif/. Finally, be sure to
visit the JPL Small-Body Mission-Design Tool located at https://ssd.jpl.nasa.gov/?mdesign_welcome.
“The Solution of Kepler’s Equation”, Celestial Mechanics, 31 (1983) 95-107, 317-328 and 40 (1987)
303-312.
page 427
Appendix G
In many of the CMATO applications, 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)
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 day 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
1 -0.000000479966 0
Veq = 0.000000440360 0.917482137087 0.397776982902 Vec
-0.000000190919 -0.397776982902 0.917482137087
where Vec is a vector in the ecliptic frame, and Veq is a vector in the equatorial frame. The conversion
of equatorial to ecliptic coordinates involves the transpose of this matrix.
page 428
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.
Barycentric Dynamical Time 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.
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 day(TT) – 2451545.0) / 36525.
Geodetic coordinates
The following diagram illustrates the geometric relationship between geocentric (radius and declination)
and geodetic (altitude and latitude) coordinates.
page 429
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
req
c= s = c (1 − f )
2
1 − ( 2 f − f 2 ) sin 2
In these equations, req is the Earth equatorial radius (6378.14 kilometers) and f is the flattening factor
for the Earth (1/298.257).
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
hˆ = ( rˆ − 1) + f + − (1 − cos 4 ) f 2
2 4 16
In these equations, is the geocentric distance of the spacecraft, hˆ = h / req and rˆ = / req .
page 430
This algorithm is based on “Derivation of Transformation Formulas Between Geocentric and Geodetic
Coordinates for Nonzero Altitudes” by Sheila Ann T. Long, NASA TN D-7522, 1974.
This section describes the transformation of coordinates between the Earth mean equator and equinox of
J2000 (EME2000) and areocentric mean equator and IAU node of epoch coordinate systems. This
transformation is used to compute B-plane and other orbital coordinates at encounter.
A unit vector in the direction of the pole of Mars can be determined from
cos p cos p
pˆ Mars = sin p cos p
sin p
The IAU 2000 right ascension and declination of the pole of Mars in the Earth mean equator and
equinox of J2000 (EME2000) coordinate system are given by the following expressions
p = 317.68143 − 0.1061T
p = 52.88650 − 0.0609 T
where T is the time in Julian centuries given by T = ( JD − 2451545.0 ) / 36525 and JD is the TDB Julian
day. The unit vector in the direction of the IAU-defined x-axis is computed from xˆ = pˆ J 2000 pˆ Mars
where pˆ J 2000 = 0 0 1 is unit vector in the direction of the north pole of the J2000 coordinate system.
T
The unit vector in the y-axis direction of this coordinate system is yˆ = pˆ Mars xˆ .
Finally, the components of the matrix that transforms coordinates from the EME2000 system to the
Mars-centered mean equator and IAU node of epoch system are as follows
M = xˆ yˆ pˆ Mars
T
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 B-plane coordinates at encounter.
The following diagram illustrates the orientation of the lunar mean equator and IAU node of epoch
coordinate frame.
page 431
A unit vector in the direction of the north 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
P = 269.9949 + 0.0031T − 3.8787sin E1 − 0.1204sin E 2
+0.0700sin E 3 − 0.0172sin E 4 + 0.0072sin E 6
−0.0052sin E10 + 0.0043sin E13
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.
The trigonometric arguments, in degrees, for these equations are
page 432
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 yˆ = pˆ Moon xˆ .
T
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
M = xˆ yˆ pˆ Moon
T
This section describes equations that can be used to convert between inertial state vectors and classical
orbital elements. The following diagram illustrates the geometry of these orbital elements.
page 433
where
a = semimajor axis
e = orbital eccentricity
i = orbital inclination
= argument of perigee
= right ascension of the ascending node
v = true anomaly
The semimajor axis defines the size of the orbit and the orbital eccentricity defines the shape of the
orbit. The angular orbital elements are defined with respect to a fundamental x-axis, the vernal equinox,
and a fundamental plane, the equator. The z-axis of this system is collinear with the spin axis of the
Earth, and the y-axis completes a right-handed coordinate system.
The orbital inclination is the angle between the equatorial plane and the orbit plane. Spacecraft orbits
with inclinations between 0 and 90 degrees are called direct orbits and spacecraft with inclinations
greater than 90 and less than 180 degrees are called retrograde orbits. The right ascension of the
ascending node (RAAN) is the angle measured from the x-axis (vernal equinox) eastward along the
equator to the ascending node. The argument is the angle from the ascending node, measured along the
orbit plane in the direction of increasing true anomaly, to the argument of perigee. The true anomaly is
the angle from the argument of perigee, measured along the orbit plane in the direction of motion, to the
spacecraft’s location. Also shown is the argument of latitude, u, which is the angle from the ascending
node, measured in the orbit plane, to the spacecraft’s location in the orbit. It is equal to u = + .
The orbital eccentricity is an indication of the type of orbit. For values of 0 e 1 , the orbit is circular
or elliptic. The orbit is parabolic when e = 1 and the orbit is hyperbolic if e 1
The semimajor axis is calculated using the following expression:
1
a=
2 v2
−
r
where r = r = rx2 + ry2 + rz2 and v = v = v x2 + v 2y + vz2 . The angular orbital elements are calculated
from modified equinoctial orbital elements which are calculated from the ECI position and velocity
vectors.
e = h2 + k 2
The orbital inclination is determined from p and q using the following expression
i = 2 tan −1 ( p 2 + q2 )
For values of inclination greater than a small value , the right ascension of the ascending node
(RAAN) is given by
page 434
= tan −1 ( p, q )
Otherwise, the orbit is equatorial and there is no RAAN. If the value of orbital eccentricity is greater
than , the argument of perigee is determined from
= tan −1 ( h, k ) −
In these equations, all two argument inverse tangent calculations use a four quadrant inverse tangent.
The right ascension of a spacecraft is determined from the x and y components of the ECI unit position
vector as = tan −1 ( ryeci , rxeci ) .
The subpoint of a spacecraft is the point on the Earth’s surface directly below the spacecraft. The locus
of subpoints describes the ground track of a spacecraft. The east longitude of the subpoint of a
spacecraft can be determined from the x and y components of the ECF unit position vector as follows:
(
= tan −1 ry , rx
ecf ecf
)
These two position components can be determined from the x and y components of the ECI position
vector and the Greenwich sidereal time g as follows:
rxecf = rxeci cos g + ryeci sin g ryecf = ryeci cos g − rxeci sin g
The geocentric declination of perigee and apogee are given by the next two equations.
If the orbit is elliptic ( a 0 ) , the geocentric radius of perigee and apogee are given by the next two
equations.
rp = a (1 − e ) ra = a (1 + e )
The geodetic latitude and altitude of perigee and apogee can be determined from these geocentric
coordinates using the geodet1.m conversion function.
ra rp
Vp = 2 Va = 2
rp ( rp + ra ) ra ( rp + ra )
If the orbit is hyperbolic ( a 0 ) , there is no apogee and the perigee radius is equal to rp = a (1 + e )
page 435
and the perigee speed is equal to
2
Vp = +
rp a
The flight path angle is the angle between the velocity vector and the local horizontal or tangent plane at
the spacecraft’s location. It can be calculated with the following expression:
r v
= sin −1
r v
The specific orbital energy, or the energy per unit mass is determined from this next expression:
v2
E= − =−
2 r 2a
The orbital energy is the sum of a spacecraft’s kinetic and potential energy. Notice that it depends only
on the spacecraft’s semimajor axis and the gravitational constant of the central body.
Hyperbolic orbit
cos cos
sˆ = cos sin
sin
In this expression, is the right ascension of the asymptote (RLA), and is the declination of the
asymptote (DLA).
The asymptote unit vector at any trajectory time can be computed from
1 C3 1 C3
sˆ = h e − e = h e − e
h 2 p
1 + C3 2 1 + C3
where h and e are the angular momentum and orbital eccentricity vectors, respectively. In the second
expression, p is the semiparameter of the hyperbolic orbit which can be computed from
p = a (1 − e 2 )
The angular momentum and eccentricity vectors are computed using the following equations;
h =rv
page 436
vh r 1 2
e= − = v − r − ( r v ) v
r r
C3 is the “twice specific” orbital energy which is determined from the position r and velocity v vectors
according to
2
C3 = v −
2
The right ascension and declination of the asymptote can be computed from components of the unit
asymptote vector according to
= tan −1 ( sx , s y )
= sin −1 ( sz )
The right ascension and declination will be with respect to the coordinate system of the input state
vector (EME2000 for example).
cos cos
sˆ = cos sin
sin
In this expression, is the right ascension of the asymptote (RLA), and is the declination of the
asymptote (DLA).
The asymptote unit vector at any trajectory time can be computed from
1 C3 1 C3
sˆ = h e − e = h e − e
h 2 +
p
1 + C3 2 1 C
3
where h and e are the angular momentum and orbital eccentricity vectors, respectively. In the second
expression, p is the semi-parameter of the hyperbolic orbit which can be computed from p = a (1 − e 2 ) .
The angular momentum and eccentricity vectors are computed using the following equations.
vh r 1
h = r v e= − = v 2 − r − ( r v ) v
r r
C3 is the “twice specific” (per unit mass) orbital energy which is determined from the position r and
velocity v vectors according to
page 437
2
C3 = v −
2
The right ascension and declination of the asymptote can be computed from components of the unit
asymptote vector according to
= tan −1 ( sx , s y ) = sin −1 ( sz )
The asymptote unit vector in terms of the classical orbital elements of a hyperbolic orbit is given by
In this expression, is the right ascension of the ascending node (RAAN), is the argument of
periapsis and is the true anomaly.
where u = + is the argument of latitude of the launch asymptote. In this expression is the true
anomaly of the launch hyperbola “at infinity” and is a function of the orbital eccentricity e of the
hyperbola according to = cos −1 ( − 1 e ) .
tan cos u
= + tan −1 ,
tan i cos
The rectangular components of the inertial position vector are determined from
rz = r sin i sin ( + v )
page 438
where r = rx2 + ry2 + rz2 is the scalar distance.
The components of the inertial velocity vector are computed using the following equations:
vx = − cos sin ( + v ) + e sin + sin cos i cos ( + v ) + e cos
p
vy = − sin sin ( + v ) + e sin − cos cos i cos ( + v ) + e cos
p
vz = sin i cos ( + v ) + e cos
p
where
a = semimajor axis
e = orbital eccentricity
i = orbital inclination
= argument of perigee
= right ascension of the ascending node
v = true anomaly
p = a (1 − e 2 )
“Update to Mars Coordinate Frame Definitions”, R. A. Mase, JPL IOM 312.B/015-99, 15 July 1999.
“Preliminary Mars Planetary Constants and Models for Mars Sample Return”, D. Lyons, JPL IOM
312/99.DTL-1, 20 January 1999.
“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.
“Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2009”,
Celestial Mechanics and Dynamical Astronomy, 109: 101-135, 2011.
“JPL Planetary Ephemeris DE421”, E. M. Standish, JPL IOM 312.N-03-009, 24 April 2003.
“Derivation of Transformation Formulas Between Geocentric and Geodetic Coordinates for Nonzero
Altitudes” by Sheila Ann T. Long, NASA TN D-7522, 1974.
page 439
Appendix H
This appendix describes an algorithm that can be used to determine the trajectory characteristics of an
interplanetary injection that uses a single impulsive maneuver to transfer a spacecraft from a circular
Earth park orbit to a departure hyperbola. The methodology is based on the equations derived in
Chapter 4 of Richard Battin’s classic text, Astronautical Guidance, and Chapter 11 of An Introduction to
the Mathematics and Methods of Astrodynamics, both written by Professor Battin and published by the
American Institute of Aeronautics and Astronautics (AIAA). This algorithm can be used to create a
thrust duration initial guess for the hyper_sos software.
The numerical algorithm is valid for geocentric orbit inclinations that satisfy the following geometric
constraint i where i is the orbital inclination of the park orbit. The algorithm also assumes a
circular Earth park orbit and that injection occurs impulsively at the perigee of the departure hyperbola.
Whenever i , there will be two opportunities to establish a departure hyperbola that will satisfy the
energy and orientation of the outgoing asymptote. Typically, one injection opportunity will occur when
the spacecraft is ascending and the other when the spacecraft is descending along the park orbit. For the
case where i = , there will be a single injection opportunity.
The relationship between orbital inclination i, B-plane angle and asymptote declination of an
incoming or outgoing hyperbola is given by cos i = cos cos . The following is a contour plot
illustrating the achievable inclination as a function of B-plane angle and declination.
This section summarizes the equations used to determine the right ascension of the ascending node
(RAAN) of the park orbit and the injection true anomaly on the park orbit.
page 440
A unit vector is the direction of the departure asymptote is given by
cos cos
sˆ = cos sin
sin
where
= right ascension of departure asymptote
= declination of departure asymptote
The angle between the outgoing asymptote and the spin axis of the Earth is given by = cos−1 ( sˆ zˆ )
where zˆ = 0 0 1 . Note that = 90 − .
T
The park orbit right ascension of the ascending node for each opportunity can be determined from
cot cot
1 = 180 + + sin −1 2 = 360 + − sin −1
tan i tan i
The true anomaly on the park orbit for each injection opportunity can be determined from
cos cos
1 = cos −1 − 2 = − cos −1 −
sin i sin i
where
1
= sin −1
1 + rp V
2
In the last equation, rp is the geocentric radius of the park orbit and is the gravitational constant of
the Earth. The speed of a spacecraft “at infinity” is determined from V = C3 .
For a tangential impulsive injection maneuver that occurs at perigee of the hyperbola, the true anomaly
on the hyperbola orbit is zero. Furthermore, since the orbit transfer modeled for this case is coplanar,
the right ascension of the ascending node (RAAN) computed above should be the same for both the park
orbit and the launch hyperbola. This can be verified by examining the hyperbola’s RAAN which is
computed using the state vector at injection.
The velocity vector at any geocentric position vector r required to achieve a launch hyperbola defined
by V , and is given by
1 1
Vh = d + V sˆ + d − V rˆ
2 2
where
page 441
V2
d= +
(1 + cos ) rp 4
and is the angle between the spacecraft’s position vector and the departure asymptote unit vector
which can be computed using cos = sˆ rˆ .
The injection v vector can be determined from V = Vh − Vp where v p is the inertial velocity vector
in the park orbit at the impulsive injection and rˆ = r r .
cos cos
ˆi =
cos sin
sin
where
= right ascension of departure asymptote
= declination of departure asymptote
The velocity vector of the spacecraft on the initial circular orbit is given by V0 = r ˆi .
The velocity vector at any geocentric position vector r required to achieve a departure hyperbola
1
defined by v , and is given by V1 = V ( D + 1) ˆi + ( D − 1) ˆi r
2
where
4
D = 1+
(
rV2 1 + ˆi ˆi r )
and
cos cos − sin sin cos i − cos sin − sin cos cos i
ˆi = sin cos + cos sin cos i ˆi = − sin sin + cos cos cos i
r
sin sin i cos sin i
In these equations, is the right ascension of the ascending node, i is the orbital inclination, is the
true anomaly at injection, r is the geocentric radius of the park orbit and V = C3 .
The injection V vector can be determined from V = V1 − V0 . Finally, the scalar injection delta-v is
V = V .
page 442
The orientation of the park orbit and departure hyperbola at injection is computed using a two-
dimensional grid search involving the park orbit right ascension of the ascending node (RAAN) and the
true anomaly of the impulsive maneuver on the park orbit. During the grid search, the software uses a
nonlinear programming (NLP) algorithm which is part of Sparse Optimization Suite to find the current
minimum delta-v and saves the RAAN and true anomaly values corresponding to the “best” delta-v.
Example calculation
Here are the park orbit and departure hyperbola characteristics for a typical example.
c3 9.28000000000000 km**2/sec**2
page 443
rx (km) ry (km) rz (km) rmag (km)
-.6072821513D+04 -.2106348521D+04 0.1327240269D+04 0.6563340000D+04
The following is a graphics display illustrating the two injection opportunities for this example. This
display is labeled with an Earth centered, inertial (ECI) coordinate system. The x-axis of this system is
red, the y-axis is green and the z-axis is blue. The outgoing asymptote is colored magenta, the park orbit
traces are red, and the hyperbolic trajectories are black. Please note the units for each coordinate axis
are Earth radii (ER).
page 444
Delta-v penalty for off-nominal injection
The velocity-required equation given above can also be used to access the delta-v penalty for off-
nominal injection. Such things as ignition timing errors and other spacecraft contingencies may result in
an injection maneuver that does not occur at the optimal true anomaly on the park orbit.
The following plot illustrates how the injection delta-v penalty changes as the true anomaly at injection
is displaced from the optimal.
page 445
“Design of Lunar and Interplanetary Ascent Trajectories”, Victor C. Clarke, Jr., JPL Technical Report
No. 32-30, March 15, 1962.
“Optimal Noncoplanar Escape from Circular Orbits”, T. N. Edelbaum, AIAA Journal, Vol. 9, No. 12,
December 1971.
“Interplanetary Mission Design Handbook, Volume 1, Part 2”, JPL Publication 82-43, September 15,
1983.
An Introduction to the Mathematics and Methods of Astrodynamics, Richard H. Battin, AIAA Education
Series, 1987.
page 446
Appendix I
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 functionally as
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, E 0 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 447
the time equation becomes
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 s−c
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 s−c
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.
page 448
Gooding’s solution of Lambert’s problem
The algorithm used in the Computer Methods for Aerospace Trajectory Optimization software suite 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.
Another practical numerical method for solving Lambert’s problem is described in “A Practical Note on
the Use of Lambert’s Equation” by Geza Gedeon, AIAA Journal, Volume 3, Number 1, 1965, pages
149-150. 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.
Additional information can also be found in G. S. Gedeon, “Lambertian Mechanics”, Proceedings of the
12th International Astronautical Congress, Vol. I, 172-190.
a3
t= (1 − k ) m + k ( − sin ) ( − sin )
where k may be either +1 (posigrade) or –1 (retrograde), and m is the number of revolutions about the
central body.
s
z=
2a
and solves the problem with a Newton-Raphson procedure. In this equation, a is the semimajor axis of
the transfer orbit and
r +r +c
s= 1 2
2
c
w = 1−
s
1 − k 1/ 2
m + k z − z (1 − z ) − w z − w z − w z (1 − w2 z )
1
N (z) =
1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2
2
1/ 2 1/ 2
zz 2
The Newton-Raphson algorithm also requires the derivative of this equation given by
page 449
3N ( z )
dN 1 k w3
N ( z ) = = − − 1/ 2
dz z 21/ 2 (1 − z )1/ 2 (1 − w2 z )1/ 2 2
An initial guess for this algorithm is created by first solving the two-body form of Lambert’s problem.
At each shooting iteration, the initial delta-velocity vector is updated according to
V = 12 r
−1
where the error in the final position vector r is determined from the difference between the two body
final position vector rtb and the final position vector predicted by numerical integration rint of the orbital
equations of motion as follows
r = rtb − rint
Vn +1 = Vn + V
This sub-matrix consists of the partial derivatives of the rectangular cartesian components of the final
position vector with respect to the initial velocity vector.
In this classic trajectory optimization problem, the components of the initial and final delta-v vectors are
the control variables and the scalar magnitude of the flyby or rendezvous V is the objective function
or performance index. The NLP implementation uses the two-body solution for Lambert’s problem as
its initial guess.
For the flyby problem, this method attempts to match all three components of the position vector. For
the rendezvous problem, the NLP attempts to match all three components of both the target position and
velocity vectors. These mission requirements are formulated as equality constraints.
page 450
“A Practical Note on the Use of Lambert’s Equation” Geza Gedeon, AIAA Journal, Volume 3, Number
1, 1965, pages 149-150.
An Introduction to the Mathematics and Methods of Astrodynamics, Richard H. Battin, AIAA Education
Series, 1987.
Analytical Mechanics of Space Systems, Hanspeter Schaub and John L. Junkins, AIAA Education
Series, 2003.
Modern Astrodynamics, Victor R. Bond and Mark C. Allman, Princeton University Press, 1996.
page 451
Appendix J
This suite of trajectory optimization computer programs can read and use a user-defined SOS
configuration file. A description of each element in this file can be found in the INSOCX routine
described in section 6.2, Subprograms for Optimal Control, and the INSNLP routine in Section 2.2,
Subprograms for Optimization both documented in the Sparse Optimization Suite user’s manual.
Please note the 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
oneburn_sos 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
page 452
NLPOMR=M
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 453
Appendix K
This appendix presents several typical Fortran subroutines used in the software implementation of
CMATO applications. Each subroutine is annotated to help explain the processing.
This first example illustrates a typical subroutine that calculates an initial guess.
subroutine odeigs (iphase, ngrdpt, t, z, nz, iferr)
c ************************************
save
include 'iofiles.inc'
include 'socscom1.inc'
iferr = 0
xjdate1 = xjdatei1
c -------------------------------------
c solve lambert's problem for first leg
c -------------------------------------
c posigrade transfer
page 454
direct = 1.0d0
revmax = 0.0d0
isn = 1
iferr = -1
return
end if
do i = 1, 3
rti1(i) = rp1(i)
end do
tol = 1.0d-10
do i = 1, 3
end do
vinfm_in = vecmag(vinf_in)
c ********************
c flyby-to-arrival leg
c ********************
do i = 1, 3
rti2(i) = rp2(i)
page 455
end do
isn = 1
direct = 1.0d0
revmax = 0.0d0
do i = 1, 3
end do
vinfm_out = vecmag(vinf_out)
tol = 1.0d-10
c *****************************************************************
c create state vector on first leg of transfer orbit at grid points
c *****************************************************************
t = (ngrdpt - 1) * deltat
tol = 1.0d-10
tof = 86400.0d0 * t
page 456
end if
c ******************************************************************
c create state vector on second leg of transfer orbit at grid points
c ******************************************************************
c ---------------------------------------------------
c solve lambert's problem for second heliocentric leg
c ---------------------------------------------------
c posigrade transfer
direct = 1.0d0
revmax = 0.0d0
isn = 1
iferr = -1
return
end if
do i = 1, 3
rti2(i) = rp2(i)
end do
tol = 1.0d-10
page 457
z(1) = rtf2(1) / aunit
z(2) = rtf2(2) / aunit
z(3) = rtf2(3) / aunit
end if
return
end
The following Fortran subroutine illustrates the computations necessary for evaluating the right hand
side differential equations of motion.
subroutine oderhs(iphase, t, ydyn, ny, p, np, frhs, nf, iferr)
c input
c output
c ************************************
include 'socscom1.inc'
iferr = 0
c -------------------------------------
c central body (sun) point mass gravity
c -------------------------------------
page 458
rs2scm = sqrt(ydyn(1) * ydyn(1) + ydyn(2) * ydyn(2)
& + ydyn(3) * ydyn(3))
do i = 1, 3
end do
c ----------------------------
c planetary point mass gravity
c ----------------------------
nplanets = 8
else
nplanets = 9
end if
xjdate = xjdatei1 + t
do i = 1, nplanets
do j = 1, 3
end do
end do
do i = 1, nplanets
end do
do i = 1, nplanets
end do
do k = 1, nplanets
do i = 1, 3
end do
do j = 1, 3
accp(j) = 0.0d0
do k = 1, nplanets
end if
end do
end do
frhs(1) = ydyn(4)
frhs(2) = ydyn(5)
frhs(3) = ydyn(6)
return
end
c ************************************
include 'socscom1.inc'
page 460
parameter (zero = 0.0d0, one = 1.0d0)
data pi / 3.141592653589793d0 /
iferr = 0
c *********************************************************************
c launch planet "position & velocity match" at the beginning of phase 1
c *********************************************************************
c *************************************************
c launch delta-v contribution to objective function
c *************************************************
end if
end if
c ************************************************
c flyby planet position vector match and incoming
c v-infinity point functions at the end of phase 1
c ************************************************
page 461
xjdate = xjdatei1 + time
do i = 1, 3
end do
ptf(4) = vinf_in(1)
ptf(5) = vinf_in(2)
ptf(6) = vinf_in(3)
end if
c *****************************************************************
c "v-infinity and flyby altitude match" at the beginning of phase 2
c *****************************************************************
do i = 1, 3
vinf_in(i) = parm(i + 3)
end do
end do
vinfm_in = vecmag(vinf_in)
vinfm_out = vecmag(vinf_out)
c ---------------------------
c v-infinity match constraint
c ---------------------------
v1xv2m = vecmag(v1xv2)
c -------------------------------
c flyby altitude match constraint
c -------------------------------
c scale constraint
end if
c ****************************************************************
c arrival planet "position & velocity match" at the end of phase 2
c ****************************************************************
end if
c **************************************************
c arrival delta-v contribution to objective function
c **************************************************
end if
end if
return
end
The following is the source code for a typical SOS support subroutine. This Fortran code implements
Shepperd’s method for solving the two-body initial value problem (IVP).
subroutine twobody2 (xmu, tol, tau, ri, vi, rf, vf)
c Shepperd's method
c input
c output
c ************************************
page 464
data pi2 /6.283185307179586d0/
rm1 = vecmag(ri)
u = 0.0d0
else
umax = 1.0d+24
end if
umin = -umax
delu = 0.0d0
else
end if
tsav = 1.0d99
niter = 0
do while (.true.)
niter = niter + 1
q = beta * u * u
q = q / (1.0d0 + q)
u0 = 1.0d0 - 2.0d0 * q
u1 = 2.0d0 * u * (1.0d0 - q)
n = 0
l = 3
id = 15
k = -9
a = 1.0d0
b = 1.0d0
g = 1.0d0
do while (.true.)
page 465
gsav = g
k = -k
l = l + 2
id = id + 4 * l
n = n + (1 + k) * l
a = id / (id - n * a * q)
b = (a - 1.0d0) * b
g = g + b
end do
uu = (16.0d0/15.0d0) * u1 * u1 * u1 * u1 * u1 * g + delu
u2 = 2.0d0 * u1 * u1
u1 = 2.0d0 * u0 * u1
u0 = 2.0d0 * u0 * u0 - 1.0d0
u3 = beta * uu + u1 * u2 / 3.0d0
usav = u
tsav = t
terr = tau - t
du = terr / dtdu
umax = u
u = u + du
else
umin = u
u = u + du
end if
end if
end do
uc = u
fm = -xmu * u2 / rm1
ggm = -xmu * u2 / r
f = 1.0d0 + fm
g = rm1 * u1 + rdotv * u2
ff = -xmu * u1 / (rm1 * r)
gg = 1.0d0 + ggm
do i = 1, 3
end do
return
end
page 467