Computer Methods For Orbit Transfer
Computer Methods For Orbit Transfer
http://celestialandorbitalmechanicswebsite.yolasite.com/
Program leo2geo_ocs
Continuous Low-Thrust LEO-to-GEO Trajectory Optimization
This document is the user’s manual for a Fortran computer program called leo2geo_ocs that uses the
Sparse Optimization Suite 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 continuous propulsive maneuver, this is equivalent to minimizing the
propellant mass required for the orbital 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:
The leo2geo_ocs software consists of Fortran routines that perform the following tasks:
set algorithm control parameters and call the transcription/optimal control subroutine
define the problem structure and perform initialization related to scaling, lower and upper
bounds, initial conditions, etc.
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 leo2geo_ocs software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 1
Program execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
leo2geo_ocs leo2geo_jk.in
If the software is executed without an input file on the command line, the computer program will display
the following title screen and file name prompt:
*************************************
* program leo2geo_ocs *
* *
* low-thrust LEO-to-GEO *
* trajectory optimization *
* *
* March 20, 2012 *
*************************************
The user should respond to this prompt with the name of a compatible input data file including the
filename extension.
The screen output created by the leo2geo_ocs computer program can be re-directed to a text file with
a command line similar to
To create a DOS command window in Windows 7, select start, then All Programs, then Accessories
and finally Command Prompt. The size, font and other characteristics of the screen can be controlled
by the user with the c:\ icon in the upper left corner of the window. To log into the subdirectory created
during the installation of the Fortran executable and support files, type root:\ and then cd subdirectory
from the DOS command line where root is the name of the root directory, usually c:, and subdirectory is
the name of the subdirectory created by the user.
The leo2geo_ocs 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
italic font.
The following is a typical input file used by the leo2geo_ocs 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
page 2
Dynamics, Vol. 22, No. 3, May-June 1999. For this example the initial true longitude is free. However,
the optimal control solution includes the effect of propellant mass depletion due to thrusting while the
example in Dr. Kechichian’s 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.
***************************************************
** leo-to-geo low-thrust trajectory optimization
** single phase continous-thrust maneuver
** program leo2geo_ocs - 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.
Please note the proper units for each data item.
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 mission orbit.
***************
* FINAL ORBIT *
***************
page 3
semimajor axis (kilometers)
42000.0
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 or thrust duration
time. Please see the “Creating an initial guess” section later in this document 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
----------------
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” technical discussion for additional information about this program item.
page 4
************************
* initial guess options*
************************
1 = linear guess with tangential thrusting
2 = numerical integration with Edelbaum steering
3 = binary data file
---------------------
2
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
leo2geo_jk.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 3, 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 software. 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 = OCS-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. Please consult Appendix A for a
description of the information written to this file.
name of solution output file
leo2geo_jk.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 *
********************************
page 5
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.
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 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 6
The level of output from the differential equations algorithm is controlled with the following integer
input. Please note that option 5 will create lots of information.
****************************
differential equation output
----------------------------
1 = none
2 = terse
3 = standard
4 = interpretive
5 = diagnostic
---------------
1
The level of output can be further controlled by the user with this final text input. This program option
sets the value of the SOCOUT character variable described in the Sparse Optimization Suite user’s
manual. To ignore this special output control, input the simple character string no.
*******************
user-defined output
-------------------
input no to ignore
------------------
a0b0c0d0e0f0g0h0i0j2k0l0m0n0o0p0q0r0
The last series of inputs allow the reading and writing of configuration input files. The user should
always create a configuration file before attempting to read one. These configuration files are simple
text files which can be edited external to the leo2geo_ocs software. Please consult Appendix B for
additional information about this program option.
***************************************
* optimal control configuration options
***************************************
The following is the program output for this example. It includes the orbital elements of the initial LEO
and the final GEO mission orbit. It also summarizes the total thrust duration, final spacecraft mass,
propellant mass required for the orbit transfer and the accumulated delta-v.
The leo2geo_ocs software will also create a comma-separated-variable (csv) output file. This file
contains the state vector, orbital elements and steering angles during the transfer trajectory. It has the
file name specified by the user in the simulation definition (input) data file. Please consult Appendix A
for additional information about the contents of this file.
page 7
===================
program leo2geo_ocs
===================
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
The following are typical transfer trajectory, optimal control and orbital element plots for this example.
They were created with the Grapher plotting program (www.goldensoftware.com).
The 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.
page 8
This next plot illustrates the behavior of the pitch and yaw steering angles during the transfer.
page 9
This plot summarizes the inertial right ascension and declination angles for this maneuver.
The next three plots illustrate the behavior of the semimajor axis, orbital eccentricity and orbital
inclination of the transfer orbit during the continuous low-thrust maneuver.
page 10
page 11
Verification of the optimal control solution
The optimal control solution determined by the software can be verified by numerically integrating the
orbital equations of motion with the optimal control-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 leo2geo_ocs computer program uses a Runge-
Kutta-Fehlberg 7(8) variable step size method to integrate the orbital equations of motion.
The following is a summary of the final optimal solution computed using this explicit numerical
integration method.
========================================
verification of optimal control solution
========================================
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_ocs 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 12
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 guess option in the leo2geo_ocs software.
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 leo2geo_ocs simulation. A typical scenario is
This techniques works well provided the two simulations are not dramatically different. Sometimes it is
necessary to make successive small changes in the mission definition and run multiples simulations to
eventually reach the final desired solution.
Problem setup
This part of the user’s manual provides details about the software implementation within the
leo2geo_ocs computer program. It defines such things as point and path constraints (boundary
conditions), bounds on the dynamic variables, and the performance index or objective function.
The objective function or performance index J for this simulation is the mass of the spacecraft when it
reaches the final mission orbit. This is simply
J mf
The value of the maxmin indicator in the software tells the program 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:
uT uT2r uT2t uT2n 1
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 .
The leo2geo_ocs 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
page 14
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
k tan i 2 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 , hy , 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.
1.1 p f p 0.9 pi
1 f 1 1 g 1
1 h 1 1 k 1
0 L 200 2
page 15
where msci is the initial spacecraft mass, and pi is the semiparameter of the initial orbit and p f is the
semiparameter of the final orbit. The upper bound on true longitude L allows for a maximum of 200
complete orbits during the transfer.
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
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These equations
exhibit no singularity for zero eccentricity and orbital inclinations equal to 0 and 90 degrees. However,
two components of the orbital element set are singular for an orbital inclination of 180 degrees.
The relationship between direct modified equinoctial and classical orbital elements is defined by the
following definitions
p a 1 e2 f e cos
k tan i 2 sin L
where
p semiparameter
a semimajor axis
e orbital eccentricity
i orbital inclination
argument of periapsis
right ascension of the ascending node
true anomaly
L true longitude
The relationship between classical and modified equinoctial orbital elements is:
p
semimajor axis a
1 f 2 g2
orbital eccentricity e f 2 g2
The mathematical relationships between an inertial state vector and the corresponding modified
equinoctial elements are summarized as follows:
position vector
r
s 2 cos L cos L 2hk sin L
2
r 2 sin L sin L 2hk cos L
r 2
s
2r
h sin L k cos L
s2
velocity vector
1
2 sin L 2 sin L 2hk cos L g 2 f h k 2 g
s p
1
v 2 cos L 2 cos L 2hk sin L f 2 gh k 2 f
s p
2
h cos L k sin L f h gk
s2 p
where
2 h2 k 2 s2 1 h2 k 2
p
r w 1 f cos L g sin L
w
The system of first-order modified equinoctial equations of orbital motion are given by
dp 2 p p
p t
dt w
df p t gn
f
dt
r sin L w 1 cos L f w h sin L k cos L w
dg p f n
g r cos L w 1 sin L g t h sin L k cos L
dt w w
page 17
dh p s2n
h cos L
dt 2w
dk p s 2n
k sin L
dt 2w
2
dL w 1 p
L p h sin L k cos L n
dt p w
where r , t , n are non-two-body perturbations in the radial, tangential and normal directions,
respectively. 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 in
the direction of the angular momentum vector of the spacecraft’s orbit.
The equations of orbital motion can also be expressed in vector form as follows:
dy
y A y P b
dt
where
2p p
0 0
w
w 1 cos L f
p p 1 p g
sin L h sin L k cos L
w w
w 1 sin L g
p p 1 p f
cos L h sin L k cos L
w w
A
p s 2 cos L
0 0
2w
p s 2 sin L
0 0
2w
p 1
0 0 h sin L k cos L
w
and
T
w
2
b 0 0 0 0 0 p
p
page 18
P r ˆi r t ˆit n ˆin
where ˆir , ˆit and ˆin are unit vectors in the radial, tangential and normal directions. These unit vectors can
be computed from the inertial position vector r and velocity vector v according to
ˆi r ˆi r v ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
For unperturbed two-body motion, P 0 and the first five equations of motion are simply
p f g h k 0 . Therefore, for two-body motion these modified equinoctial orbital elements are
constant. The true longitude is often called the fast variable of this orbital element set.
Propulsive thrust
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 the software.
The spacecraft mass at any mission elapsed time t is given by m t msci mt where msci is the initial
mass of the spacecraft.
The components of the unit thrust vector can also be defined in terms of the in-plane pitch angle and
the out-of-plane yaw angle as follows:
The pitch and yaw angles can be determined from the components of the unit thrust vector according to
page 19
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.
The relationship between a unit thrust vector in the Earth-centered-inertial (ECI) coordinate system uˆ TECI
and the corresponding unit thrust vector in the modified equinoctial (MEE) system uˆ TMEE is given by
uˆ TECI ˆir ˆi
t
ˆi uˆ
n TMEE
where
ˆi r ˆi r v ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
rˆ
x hˆ rˆ x
hˆ x
uˆ TECI Q uˆ TMEE rˆy
hˆ rˆ y
ˆh 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
In the leo2geo_ocs computer program, the components of the inertial unit thrust vector are defined in
terms of the right ascension and the declination angle as follows:
Finally, the right ascension and declination angles can be determined from the components of the ECI
unit thrust vector according to
tan 1 uT ECI y
, uTECI
x
sin 1 uT ECI z
where the calculation for right ascension is a four quadrant inverse tangent operation.
page 20
Gravitational acceleration
g g N ˆi N gr ˆ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
For a zonal only Earth gravity model, the east component is identically zero.
a g QT g
page 21
3 J 2 Re2 12 h sin L k cos L 2
J2 1
r
2r 4
1 h k
2 2 2
J2
n
r4
1 h 2
k
2 2
page 22
Algorithm resources
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.
“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.
“A Set of Modified Equinoctial Orbital Elements”, M. J. H. Walker, B. Ireland and J. Owens, Celestial
Mechanics, Vol. 36, pp. 409-419, 1985.
“On the Equinoctial Orbital Elements”, R. A. Brouke and P. J. Cefola, Celestial Mechanics, Vol. 5, pp.
303-310, 1972.
“Optimal Interplanetary Orbit Transfers by Direct Transcription”, John T. Betts, The Journal of the
Astronautical Sciences, Vol. 42, No. 3, July-September 1994, pp. 247-268.
“Using Sparse Nonlinear Programming to Compute Low Thrust Orbit Transfers”, John T. Betts, The
Journal of the Astronautical Sciences, Vol. 41, No. 3, July-September 1993, pp. 349-371.
“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 23
APPENDIX A
Contents of the Simulation Summary and CSV Files
This appendix is a brief summary of the information contained in the simulation summary screen
displays and the CSV data files produced by the leo2geo_ocs 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.
The comma-separated-variable disk file is created by the odeprt subroutine and contains the following
information:
page 24
time (days) = simulation time since ignition in days
page 25
APPENDIX B
Typical Sparse Optimization Suite Configuration File
The leo2geo_ocs computer progran can read and use a user-defined configuration file. A description
of each element in this file can be found in the INOCS routine in section 6.2, Subprograms for Optimal
Control, and the INSNLP routine in Section 2.2, Subprograms for Optimization of the Sparse
Optimization Suite user’s manual. Please note that the leo2geo_ocs software can read and use a
subset of the information in this file. For example, a subset configuration file might contain only the
following information;
ODETOL=0.1D-06
INSNLP:IOFLAG=5
SOCOUT=I4K4
The following is a typical “full version” configuration file created during the execution of the
leo2geo_ocs software.
AEQTOL=0.1000000000000000D-02
DTAUX=0.0000000000000000D+00
OBJCTL=0.1000000000000000D-04
ODETOL=0.1000000011686097D-06
PGDCTL=0.1000000000000000D-02
PRTMSD=0.1490116119384766D-07
PRTMXD=0.1000000000000000D-02
PRTSFD=0.1000000000000000D-04
QDRTOL=0.1000000000000000D-02
RESTOL=0.1000000000000000D-04
SMLTOL=0.1490116119384766D-10
TOLJSD=0.1000000000000000D-05
TOLM5A=0.1490116119384766D-07
TOLM5R=0.1490116119384766D-07
IDSCPH=0
IDSCND=0
IDSCVR=0
IDSCFN=0
IDTSFD=-1
IPFAUX=0
IPFSFD=0
IPRSFD=1
IPGRD=0
IPNLP=10
IPODE=0
IPUAUX=0
IPUOCP=6
IRSTRT=2
ISCALE=0
ISFHES=41
ISFINP=42
ISFRST=43
ISFSCL=44
ITSWCH=2
M5DTYP=0
MITODE=20
MTSWCH=-1
MXDATA=0
MXPARM=10
MXPCON=20
MXSTAT=20
MXTERM=50
NPTAUX=100
NSSWCH=-1
SOCOUT=A0B0C0D0E0F0G0H0I0J2K0L0M0N0O0P0Q0R0S1T0U0V0W0X0Y0Z0
SPRTHS=SPARSE
NLPALG=SNLPMN
NLPOMR=M
KEYDPL=.lueiLUE
page 26
RHSTMP=RHSTMPLT
RSTFIL=hyper1.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 27
Program aeroassist_ocs
This document is the user’s manual for a Fortran computer program called aeroassist_ocs that uses
the Sparse Optimization Suite 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_ocs software consists of Fortran routines that perform the following tasks:
set algorithm control parameters and call the transcription/optimal control subroutine
define the problem structure and perform initialization related to scaling, lower and upper
bounds, initial conditions, etc.
compute the right-hand-side differential equations
evaluate any point and path constraints
display the optimal solution results and create an output file
The Sparse Optimization Suite 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 1
Program execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
Aeroassist_ocs geo2leo_max_speed.in
If the software is executed without an input file on the command line, the computer program will display
the following information screen and file name prompt:
************************************
* Program aeroassist_ocs *
* *
* aeroassist trajectory *
* optimization *
* *
* June 9, 2011 *
************************************
The user should respond to this prompt with the name of a compatible input data file including the
filename extension.
The aeroassist_ocs 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 italic font.
This 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/foot 2 -second .
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.
********************************************************
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
********************************************************
page 2
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
***********************************************
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
******************
page 3
orbital inclination at deorbit maneuver (degrees)
0.0
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
-------------------------------------
initial flight path angle (-90 <= fpa <= +90; degrees)
-4.0
upper bound for initial flight path angle (-90 <= fpa <= +90; degrees)
-0.5
page 4
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.
************************************************
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
-------------------------------------
page 5
lower bound for final altitude (feet)
400000.0
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
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
-----------------------------------
page 6
lower bound for altitude (feet)
10000.0
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 7
lower bound for initial bank angle (degrees)
-180.0d0
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
-----------------------------------
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.
page 8
******************
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
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).
page 9
******************************************
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).
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. Please consult Appendix A for additional information about the contents of this file.
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.
maximum number of algorithm iterations
10000
The level of output from the NLP algorithm is controlled with the following integer input.
page 10
***************************
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_ocs software. Please consult Appendix F.
***************************************
* optimal control configuration options
***************************************
page 11
name of optimal control configuration file
aeroassist_config1.txt
The aeroassist_ocs software also requires a user-created ASCII data file with the name
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_ocs scientific simulation has converged, it will display a complete 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 12
program aeroassist_ocs
======================
page 13
inertial fpa -5.20130119814137 degrees
aerodynamic characteristics
---------------------------
page 14
lift coefficient at max L/D 0.151185789203691
The following are plots created from the trajectory summary file. The first plot illustrates the behavior
of the normalized lift coefficient and bank angle during the atmospheric pass.
This next plot summarizes the altitude and relative velocity of the vehicle as a function of time since the
entry interface (EI).
The next plot illustrates the behavior of the relative flight path and azimuth angles during the aero-assist
pass through the atmosphere.
page 15
This 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.
This final plot summarizes the behavior of the orbital eccentricity and inclination during the atmospheric
phase of the mission.
page 16
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_ocs 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 later in this section 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
page 17
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.
For the second and third initial conditions options, the aeroassist_ocs 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 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.
The algorithm used to compute the scalar magnitude of the deorbit maneuver along with other important
flight characteristics is described in Appendix E.
This section describes the two types of trajectory optimization performed by the aeroassist_ocs
software.
J vf
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.
h
J cos1 z
h
where hz is the z-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.
page 18
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
q v2
2
where is the atmospheric density and v is the relative speed at the current flight condition.
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
where
hz
cos i
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.
page 19
Technical Discussion
This section describes the numerical algorithms implemented in the aeroassist_ocs computer
program. It summarizes the equations of motion, Earth gravity model, vehicle aerodynamics, coordinate
conversions and other important software features.
The first-order flight path equations of motion of an aerospace vehicle relative to a rotating spherical
Earth and a zonal gravity model are summarized 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
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 20
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
1
L aerodynamic lift force V 2C L S
2
1
D aerodynamic drag force V 2CD S
2
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
and
re Earth equatorial radius
e Earth inertial rotation rate
g r radial component of gravity
g latitudinal component of gravity
The bank angle is the angle between the instantaneous orbit plane and the aerodynamic lift vector. The
bank angle is positive for a right turn as viewed from the rear of the vehicle.
The components of the gravity vector can be determined from the gradient of the potential function
according to
1 U
r g
FG U 0 0
U g
r
r
page 21
where
j
re
U J j Pj 0 sin
1
r j 1 r
U
l
re
2 1 l 1 J l Pl 0 sin
r r l 2 r
Pl 0
l
1 U
re
r
2
r
r J l
l 2
k
Pj 0 sin T jt sin j 2t
t 0
T jt 1 2 j 2t !/ 2lt ! j t ! j 2t !
t
For a zonal-only gravity model of order four, the Legendre functions and their partial derivatives are
given by
P20 3sin 2 1 P30 5sin3 3sin P40 35sin 4 30sin 2 3
1 1 1
2 2 8
This is the Earth gravity model implemented in the aeroassist_ocs computer program.
This section describes the relationship between flight path coordinates and inertial position and velocity.
Flight path coordinates are used during the aero-assist pass and inertial coordinates are used to model the
deorbit-to-entry portion of the flight.
This coordinate conversion is necessary for aeroassist_ocs simulations that determine entry
interface conditions from an impulsive deorbit maneuver from an initial circular orbit.
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
page 22
cos sin 0
T sin cos 0
0 0 1
and is the Greenwich apparent sidereal time at the moment 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 UT, e is the inertial rotation rate of the
Earth, and t is the elapsed time since 0 hours UT.
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
This coordinate conversion is necessary in order to determine the orbital inclination and other orbital
characteristics at exit from the atmosphere.
The Earth-centered-fixed (ECF) position and velocity vectors of the aero-assist vehicle can be
determined from the flight path coordinates with the following set of equations:
rECFz r sin
page 23
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:
This section provides general information about vehicle aerodynamics. It also describes the type of
aerodynamic modeling used in the aeroassist_ocs computer program.
Lift-to-drag ratio
L CL CL
E
D CD CD0 kCLn
E
C D0
kCLn CL nkCLn 1
C
2
D0 kCLn
page 24
Lift coefficient at maximum lift-to-drag ratio
CD0
CL
k n 1
n
nCD0
CD
n 1
In general,
C n n 1
n 1
E L
CD n n kCDn 0 1
where
CD drag coefficient
CL lift coefficient
k constant
and
C 1
E L maximum L D
CD max 2 kCD0
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 time 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.
page 25
The following is a graphic display of a typical parabolic drag polar.
page 26
References and Bibliography
(1) “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.
(2) “Optimal Finite-Thrust Spacecraft Trajectories Using Direct Transcription and Nonlinear
Programming”, Paul J. Enright, Ph.D. Thesis, University of Illinois at Urbana-Champaign, 1991.
(3) “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.
(5) “Improved Collocation Methods with Application to Direct Trajectory Optimization”, Albert L.
Herman, Ph.D. Thesis, University of Illinois at Urbana-Champaign, 1995.
(6) “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.
(7) “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.
(8) “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.
(9) “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.
(11) Hypersonic and Planetary Flight Mechanics, N. X. Vinh, R. D. Culp, and A. Busemann, University
of Michigan Press, 1980.
(12) “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.
(13) “Optimal Maneuvers of Orbital Transfer Vehicles”, John M. Hanson, Ph.D. Thesis, University of
Michigan, Department of Aerospace Engineering, 1983.
(14) “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.
(15) “Combining Propulsive and Aerodynamic Maneuvers to Achieve Optimal Orbital Transfer”, John
M. Hanson, AIAA Journal of Guidance, Control and Dynamics, Vol. 12. No. 5, Sept.-Oct. 1989.
page 27
APPENDIX A
Contents of the Simulation Summary CSV File
This appendix is a brief summary of the information contained in the CSV data file produced by the
aeroassist_ocs software. The comma-separated-variable disk file is created by the odeprt
subroutine and contains the following information:
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
page 28
perigee altitude (nm) = perigee altitude in nautical miles
Notes:
(1) The accumulated heat load is determined from a cubic spline integration of the heat rate of the
optimized solution at all collocation nodes.
(2) The rate of change of the flight variables is determined from the equations of motion.
page 29
APPENDIX B
Fortran Functions and Subroutines
This appendix is a brief summary of the major Fortran functions and subroutines included in the
aeroassist_ocs computer program.
oderhs.for - subroutine that evaluates the equations of motion and any algebraic
equations
readfpn.for - read and echo floating point number from an input file subroutine
page 30
APPENDIX C
Example Fortran Subroutine
This appendix contains the source code for a single Fortran 77 subroutine and illustrates typical
programming conventions used in the aeroassist_ocs software. This subroutine is the point
function routine required by the Sparse Optimization Suite.
c ************************************
include 'socscom1.inc'
include 'pconstr.inc'
iferr = 0
c ---------------------------------------
c extract current flight path coordinates
c ---------------------------------------
c altitude (feet)
xalt = ydyn(1)
c longitude (radians)
elon = ydyn(2)
c geocentric declination
dec = ydyn(3)
vrel = ydyn(4)
fpa = ydyn(5)
azim = ydyn(6)
page 31
c ---------------------------------------------
c beginning of phase 1 - atmospheric entry
c (parameter #1 ==> inertial flight path angle)
c ---------------------------------------------
fpae = parm(1)
c ---------------------------------
c match states at atmospheric entry
c ---------------------------------
c declination (radians)
c velocity (feet/second)
c azimuth (radians)
end if
c ---------------------------------
c end of phase 1 - atmospheric exit
c ---------------------------------
fpc(1) = elon
fpc(2) = dec
fpc(3) = fpa
fpc(4) = azim
fpc(5) = rmag
fpc(6) = vrel
page 32
hmag = vecmag(hv)
c ------------------------------------------------------
c final orbit inclination constraint at atmospheric exit
c (constrain cosine of final orbit inclination)
c ------------------------------------------------------
end if
c ------------------------------------------------
c maximize orbital inclination at atmospheric exit
c ------------------------------------------------
end if
end if
return
end
page 33
APPENDIX D
Maximize Orbital Inclination Example
This appendix contains 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 inclination equal to 5 degrees. The speed at atmospheric exit is constrained to be >= 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 34
The following is the aeroassist_ocs program output for this example.
program aeroassist_ocs
======================
page 35
universal time 00:00:00.000
page 36
r-perigee (nm) h-perigee (nm) r-apogee (nm) h-apogee (nm)
0.319642898433D+04 -.247491205835D+03 0.394392019018D+04 0.500000000016D+03
aerodynamic characteristics
---------------------------
page 37
APPENDIX E
De-orbit from a Circular Earth Orbit
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.
The true anomaly on the de-orbit trajectory at the entry interface e can be determined from the
following two equations
page 38
r ad 1 ed2
sin e
ed
ad 1 ed2 1
cos e
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 ed
2 1 ed cos 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
Finally, the orbital speed at the entry interface Ve can be determined from
2
Ve
re ad
page 39
APPENDIX F
Typical Sparse Optimization SuiteConfiguration File
The aeroassist_ocs computer progran can read and use a user-defined configuration file. A
description of each element in this file can be found in the INSOCX routine in section 6.2, Subprograms
for Optimal Control, and the INSNLP routine in Section 2.2, Subprograms for Optimization of the
Sparse Optimization Suite user’s manual. Please note that the aeroassist_ocs software can read and
use a subset of the information in this file. For example, a subset configuration file might contain only
the following information;
ODETOL=0.1D-06
INSNLP:IOFLAG=5
SOCOUT=I4K4
The following is a typical “full version” configuration file created during the execution of the
aeroassist 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=0
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
page 40
NSSWCH=-1
SOCOUT=A0B0C0D0E0F0G0H0I0J2K0L0M0N0O0P0Q0R0S1T0U0V0W0X0Y0Z0
SPRTHS=SPARSE
NLPALG=SNLPMN
NLPOMR=M
KEYDPL=.lueiLUE
RHSTMP=RHSTMPLT
RSTFIL=socx.restart
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=500000
INSNLP:MNSAME=2
INSNLP:NEWTON=0
INSNLP:NITMAX=50000
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 41
Orbital Mechanics with MATLAB
This MATLAB script calculates the single impulsive maneuver required to establish a reentry altitude
and flight path angle relative to a non-rotating, spherical Earth. The algorithm uses a tangential delta-v
applied opposite to the velocity vector of an initial circular orbit to establish the de-orbit trajectory.
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
and
e flight path angle at entry interface
hi altitude of initial circular orbit
page 1
Orbital Mechanics with MATLAB
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.
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
sin e
ed
ad 1 ed2 1
cos e
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
Finally, the orbital speed at the entry interface Ve can be determined from
2
Ve
re ad
page 2
Orbital Mechanics with MATLAB
This MATLAB script will prompt you for the altitude of the initial circular orbit, and the entry altitude
and flight path angle. The following is a typical user interaction with this script.
program cdeorbit
program cdeorbit
entry trajectory
eccentricity 0.06990358
The software will also calculate and display the entry velocity and flight path angle relative to a rotating
spherical Earth. The following is the relative flight information for this example.
page 3
Orbital Mechanics with MATLAB
Finally, the software will graphically display the initial circular orbit and the de-orbit trajectory. The
graphic display for this example is as follows where the red dots represent the original circular orbit and
the blue dots represent the de-orbit trajectory, both at one minute intervals. The black circle is the
surface of a spherical Earth and the distances are in Earth radii.
The maneuver creates an elliptical de-orbit trajectory with an apogee located at the maneuver point. The
apogee altitude of this trajectory is equal to the altitude of the initial circular orbit.
This MATLAB script calculates the single impulsive maneuver required to establish a reentry altitude
and flight path angle relative to a non-rotating spherical Earth. The algorithm uses a tangential V
applied opposite to the velocity vector at apogee of the initial elliptical orbit to establish the de-orbit
trajectory that enters the Earth’s atmosphere.
2rp 2 ra 1
V cos
re ra ra rp ra ra2 cos2 e
e
page 4
Orbital Mechanics with MATLAB
where
re geocentric radius at the entry altitude
ra ra re
rp rp re
e flight path angle at entry
ra apogee radius of the initial elliptical orbit
rp perigee radius of the initial elliptical orbit
gravitational constant of the Earth
The true anomaly at entry can be determined from the following series of equations:
r ad 1 ed2
sin e
ed
ad 1 ed2 1
cos e
ed re ed
where
ed eccentricity of deorbit trajectory
ad semimajor axis of deorbit trajectory
The time of flight between perigee and the entry true anomaly e is given by:
1 1 ed e ed 1 ed2 sin e
t e 2 tan tan
2 1 ed
2 1 ed cos e
Therefore, the flight time between the de-orbit impulse time and entry is given by
t t e t 180 t e
2
page 5
Orbital Mechanics with MATLAB
2
Ve
re ad
Please note that these equations are also valid for the case of de-orbit from an initial circular orbit as
described in the previous cdeorbit.m script.
program edeorbit
program edeorbit
initial orbit
eccentricity 0.727044
entry trajectory
eccentricity 0.73456961
page 6
Orbital Mechanics with MATLAB
The software will also calculate and display the entry velocity and flight path angle relative to a rotating
spherical Earth. The following is the relative flight path information for this example.
This MATLAB script will also graphically display the initial elliptic orbit and the de-orbit trajectory.
The graphic display for this example is as follows where the red dots represent the original elliptical
orbit and the blue dots represent the de-orbit trajectory, both at one minute intervals. The black circle is
the surface of a spherical Earth and the distances are in Earth radii.
page 7
Program deorbit_ocs
This document is the user’s manual for a Fortran computer program called deorbit_ocs that uses the
Sparse Optimization Suite 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:
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 (www.siam.org).
The deorbit_ocs software consists of Fortran routines that perform the following tasks:
set algorithm control parameters and call the transcription/optimal control subroutine
define the problem structure and perform initialization related to scaling, lower and upper
bounds, initial conditions, etc.
compute the right-hand-side differential equations
evaluate any point and path constraints
display the optimal solution results and create an output file
The Sparse Optimization Suite will use this information to automatically transcribe the user’s optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The deorbit_ocs software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 1
Program Execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
deorbit_ocs cleo2ei.in
If the software is executed without an input file on the command line, the computer program will display
the following information screen and file name prompt:
***********************************
* program deorbit_ocs *
* *
* deorbit trajectory optimization *
* *
* May 10, 2012 *
***********************************
The user should respond to this prompt with the name of a compatible input data file including the
filename extension.
The screen output created by the deorbit_ocs computer program can be re-directed to a text file with
a command line similar to
deorbit_ocs cleo2ei.in >cleo2ei.txt
To create a DOS command window in Windows 7, select start, then All Programs, then Accessories
and finally Command Prompt. The size, font and other characteristics of the screen can be controlled
by the user with the c:\ icon in the upper left corner of the window. To log into the subdirectory created
during the installation of the Fortran executable and support files, type root:\ and then cd subdirectory
from the DOS command line where root is the name of the root directory, usually c:, and subdirectory is
the name of the subdirectory created by the user.
The deorbit_ocs software is “data-driven” by a user-created text file. This text file should be simple
ASCII format with no special characters.
The following is a typical input file used by this computer program. In the following discussion the
actual input file contents are in courier font and all explanations are in times italic font. This example
attempts to optimize the maneuver required to de-orbit a spacecraft from a circular Earth orbit (LEO) to
typical entry interface (EI) conditions.
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.
page 2
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_ocs
** 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
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
page 3
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.
************************************
* 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.
Important note: To disregard a mission constraint, input the value 1.0d99 for that constraint.
*********************************************************
* entry interface constraints (set to 1.0d99 to ignore) *
*********************************************************
page 4
geodetic altitude (kilometers)
121.92d0
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 = OCS-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
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
page 5
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 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.
****************************
differential equation output
----------------------------
1 = none
2 = terse
page 6
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. Appendix
B contains a brief summary of this information.
program deorbit_ocs
===================
initial epoch
-------------
------------------------
beginning of finite burn
------------------------
------------------
page 7
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 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 8
sma (km) eccentricity inclination (deg) argper (deg)
0.663096280332D+04 0.386110555799D-01 0.286533250810D+02 0.307476929735D+02
This final section of the numeric 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 OC-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_ocs 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 9
beginning of coast maneuver
---------------------------
In additional to the user-defined solution output file, the deorbit_ocs computer program will create a
comma-separated-variable data file named maneuver.csv. This data file contains the information
described in Appendix B starting at ignition and ending at burnout 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.
These two plots summarize the relative and inertial flight path angles and velocities.
page 11
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.
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:
page 12
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 at all times is simply uT 0 1 0 . Please note that this type of steering method
T
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.
An algorithm for estimating the impulse de-orbit delta-v from initial circular orbits is explained in
Appendix C. A numerical method for calculating the impulsive maneuver required for de-orbiting from
an initial elliptical Earth orbit can be found in Appendix D.
Problem setup
This part of the user’s manual provides details about the software implementation within
deorbit_ocs. 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
If the initial 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
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 mf
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 14
(3) Path constraint – unit thrust vector scalar magnitude
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 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 E.
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.
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
page 15
1.1 ur 1.1
1.1 ut 1.1
1.1 un 1.1
Technical Discussion
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These equations
exhibit no singularity for zero eccentricity and orbital inclinations equal to 0 and 90 degrees. However,
two components of the orbital element set are singular for an orbital inclination of 180 degrees.
The relationship between direct modified equinoctial and classical orbital elements is defined by the
following definitions
p a 1 e2 f e cos g e sin
h tan i 2 cos k tan i 2 sin L
where
p semiparameter
a semimajor axis
e orbital eccentricity
i orbital inclination
argument of periapsis
right ascension of the ascending node
true anomaly
L true longitude
The relationship between classical and modified equinoctial orbital elements is summarized as follows:
p
semimajor axis a
1 f 2 g2
orbital eccentricity e f 2 g2
page 16
true anomaly L L tan 1 g f
The mathematical relationships between an inertial state vector and the corresponding modified
equinoctial elements are summarized as follows:
position vector
r
s 2 cos L cos L 2hk sin L
2
r 2 sin L sin L 2hk cos L
r 2
s
2r
h sin L k cos L
s2
velocity vector
1
2 sin L 2 sin L 2hk cos L g 2 f h k 2 g
s p
1
v 2 cos L 2
cos L 2 hk sin L f 2 gh k 2
f
s p
2
h cos L k sin L f h gk
s2 p
where
2 h2 k 2 s2 1 h2 k 2
p
r w 1 f cos L g sin L
w
The system of first-order modified equinoctial equations of orbital motion are given by
dp 2 p p
p t
dt w
df p t gn
f sin L
w 1 cos L f
h sin L k cos L
w
r
dt w
dg p f n
g r cos L w 1 sin L g t h sin L k cos L
dt w w
dh p s2n
h cos L
dt 2w
page 17
dk p s 2n
k sin L
dt 2w
2
dL w 1 p
L p h sin L k cos L n
dt p w
where r , t , n are non-two-body perturbations in the radial, tangential and normal directions,
respectively. The radial direction is along the radius vector of the spacecraft measured positive in a
direction away from the gravitational center, the tangential direction is perpendicular to this radius
vector measured positive in the direction of orbital motion, and the normal direction is positive along the
angular momentum vector of the spacecraft’s orbit.
The equations of orbital motion can also be expressed in vector form as follows:
dy
y A y P b
dt
where
2p p
0 0
w
w 1 cos L f
p p 1 p g
sin L h sin L k cos L
w w
w 1 sin L g
p p 1 p f
cos L h sin L k cos L
w w
A
2
0 0
p s cos L
2w
p s 2 sin L
0 0
2w
p 1
0 0 h sin L k cos L
w
and
2 T
w
b 0 0 0 0 0 p
p
P r ˆi r t ˆit n ˆin
page 18
where ˆir , ˆit and ˆin are unit vectors in the radial, tangential and normal directions.
These unit vectors can be computed from the inertial position vector r and velocity vector v according to
ˆi r ˆi r v ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
For unperturbed two-body motion, P 0 and the first five equations of motion are simply
p f g h k 0 . Therefore, for two-body motion these modified equinoctial orbital elements are
constant.
The true longitude is often called the fast variable of this orbital element set.
g g N ˆi N gr ˆ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
4
Re '
gN
r2
Pk J k
k 2 r
k
4
R
gr 2 k 1 e Pk J k
r k 2 r
where
page 19
gravitational constant
r geocentric distance of the spacecraft
Re equatorial radius of the Earth
geocentric latitude
J k zonal gravity coefficient
Pk k th order Legendre polynomial
For a zonal only Earth gravity model, the east component is identically zero.
J2 1
r
2r 4
1 h 2
k
2 2
J2
r4 1 h2 k 2
n
2
Propulsive Thrust
T
aT uˆ T
m t
T
where T is the thrust magnitude, m is the spacecraft mass and uˆ T uTr uTt uTn is the unit pointing
thrust vector expressed in the spacecraft-centered radial-tangential-normal coordinate system. The
components of this unit vector are the control variables.
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.
page 20
The spacecraft mass at any mission elapsed time t is given by m t msci mt where msci is the initial
mass of the spacecraft 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 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.
The deorbit_ocs 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.
The relationship between a unit thrust vector in the ECI coordinate system uˆ TECI and the corresponding
unit thrust vector in the modified equinoctial system uˆ TMEE is given by
uˆ TECI ˆir ˆi
t
ˆi uˆ
n TMEE
where
ˆi r rˆ ˆi r v hˆ ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
rˆ
x hˆ rˆ x
hˆ x
uˆ TECI Q uˆ TMEE rˆy
hˆ rˆ y
ˆh uˆ
y TMEE
rˆz hˆ rˆ z
hˆ z
In these equations, r is the inertial position vector and v is the inertial velocity vector of the spacecraft.
In the deorbit_ocs computer program, the components of the inertial unit thrust vector are defined in
terms of the right ascension and the declination angle as follows:
page 21
uTECI cos cos uTECI sin cos uTECI sin
x y z
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.
The mathematical relationship between flight path and inertial coordinates is explained in Appendix E.
Geodetic coordinates
An algorithm for converting from geocentric declination and radius to geodetic altitude and latitude is
described in Appendix F. It uses a series solution involving the flattening factor of the Earth.
page 22
Algorithm Resources
“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.
“Survey of Numerical Methods for Trajectory Optimization”, John T. Betts, AIAA Journal of Guidance,
Control and Dynamics, Vol. 21, No. 2, March-April 1998.
“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.
“Equinoctial Orbit Elements: Application to Optimal Transfer Problems”, Jean A. Kechichian, AIAA
90-2976, AIAA/AAS Astrodynamics Conference, Portland, OR, 20-22 August 1990.
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.
“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, Jul-Aug., 1966.
Hypersonic and Planetary Entry Flight Mechanics, Vinh, Busemann and Culp, The University of
Michigan Press, 1980.
“On Autonomous Optimal Deorbit Guidance”, Morgan C. Baldwin, Binfeng Pan and Ping Lu, AIAA
2009-5667, AIAA Guidance, Navigation, and Control Conference, August 10-13, 2009.
“Autonomous Optimal Deorbit Targeting”, Donald J. Jezewski, AAS 91-136, AAS/AIAA Spaceflight
Mechanics Meeting, February 11-13, 1991.
“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.
“Geometric Theory of Optimum Disorbit Problems”, A. Busemann and N. X. Vinh, NASA CR-750,
April 1967.
“Nearly Circular Transfer Trajectories for Descending Satellites”, George M. Low, NASA Technical
Report R-3, 1959.
page 23
APPENDIX A
Example De-orbit from an Elliptical Earth Orbit
This appendix 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 D.
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_ocs
** heo2ei.in - May 10, 2012
************************************************
************************************
* type of propulsive initial guess *
************************************
1 = thrust duration
2 = delta-v
-----------
2
******************
* coast maneuver *
******************
page 24
lower bound for coast duration (minutes; > 0)
200.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
----------------------------------------------
3
*********************************************************
* entry interface constraints (set to 1.0d99 to ignore) *
*********************************************************
*************************
* type of gravity model *
-------------------------
1 = spherical Earth
2 = oblate gravity model
------------------------
2
page 25
The program output for this example is
program deorbit_ocs
===================
initial epoch
-------------
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
page 26
---------------------------
beginning of coast maneuver
---------------------------
---------------------
end of coast maneuver
---------------------
========================================
verification of optimal control solution
========================================
page 28
inertial flight path coordinates at entry interface
---------------------------------------------------
page 29
APPENDIX B
Contents of the Simulation Summary and CSV Files
This appendix is a brief summary of the information contained in the simulation summary screen
displays and the CSV data files produced by the deorbit_ocs 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 user-defined comma-separated-variable (csv) disk files is created by the odeprt subroutine and
contains the following information:
page 31
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
page 32
APPENDIX C
De-orbit from a Circular Earth Orbit
This appendix summarizes an algorithm can be used to compute the impulsive delta-v required to de-
orbit a spacecraft initially in a circular Earth orbit. The “targets” at the entry interface consist of the
altitude and flight path angle.
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 33
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
sin e
ed
ad 1 ed2 1
cos e
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 1 ed e ed 1 ed2 sin e
t e 2 tan tan
2
1 ed 2 1 ed cos 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
Finally, the orbital speed at the entry interface Ve can be determined from
2
Ve
re ad
page 34
APPENDIX D
De-orbit from an Elliptical Earth Orbit
This appendix summarizes an algorithm can be used to compute the impulsive delta-v required to de-
orbit a spacecraft initially in an elliptical Earth orbit.
The scalar 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
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
sin e
ed
ad 1 ed2 1
cos e
ed re ed
where
ed eccentricity of the de-orbit trajectory
page 35
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
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
Ve
re ad
page 36
APPENDIX E
Flight Path Coordinates
Relative flight path coordinates are defined with respect to a rotating spherical Earth. This set of
coordinates consists of the following elements;
r geocentric radius
V speed
flight path angle
geocentric declination
geographic longitude east
flight azimuth clockwise from north
The following are several useful equations that summarize the relationships between inertial and relative
flight path coordinates.
vr sin r vi sin i
where the r subscript denotes relative coordinates and the i subscript inertial coordinates.
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 Earth.
The transformation of an Earth-centered inertial (ECI) position vector rECI to an Earth-centered fixed
(ECF) position vector rECF is given by the following vector-matrix operation
page 37
rECF T rECI
cos sin 0
T sin cos 0
0 0 1
and is the Greenwich apparent sidereal time at the moment of interest. Greenwich sidereal time is
given by the following expression
g 0 et
where g 0 is the Greenwich sidereal time at 0 hours 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
rECF
2
y
rECF
2
v vECF
2
vECF
2
y
vECF
2
z
tan 1 rECF , rECFy x
rECFz
sin 1
rECF
vRz
sin 1
v R
tan 1 vR , vR
y x
where
sin cos sin sin cos
v R sin cos 0 v ECF
cos cos cos sin sin
Please note that the two argument inverse tangent calculation is a four quadrant operation.
A set of inertial flight path coordinates can be determined from these equations by setting the value of
Earth rotation to zero.
page 38
APPENDIX F
Geodetic Coordinates
The following diagram illustrates the geometric relationship between geocentric (radius and declination)
and geodetic (altitude and latitude) coordinates.
In this diagram, is the geocentric declination, is the geodetic latitude, r is the geocentric distance,
and h is the geodetic altitude.
The exact mathematical relationship between geocentric and geodetic coordinates is given by the
following system of two nonlinear equations
c h cos r cos 0
s h sin r sin 0
where the geodetic constants c and s are given by
req
c
1 2 f f 2 sin 2
s c 1 f
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).
page 39
In this computer program, 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 satellite, hˆ h / req and rˆ / req .
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.
page 40
Orbital Mechanics with MATLAB
Coplanar Equations
For the coplanar Hohmann transfer both velocity impulses are confined to the orbital planes of the initial
and final orbits. For a Hohmann transfer from a lower altitude orbit to a higher altitude circular orbit,
the first impulse creates an elliptical transfer orbit with a perigee altitude equal to the altitude of the
initial circular orbit and an apogee altitude equal to the altitude of the final orbit. The second impulse
circularizes the transfer orbit at apogee. Both impulses are posigrade which means that they are in the
direction of orbital motion.
rf ri ri
R1 2 R2 R3 2
ri rf rf ri rf
where ri is the geocentric radius of the initial circular park orbit and rf is the radius of the final circular
mission orbit. The relationship between radius and initial orbit altitude hi and the final orbit altitude h f
is as follows:
ri re hi
rf re h f
where re is the radius of the Earth.
and is simply the difference between the speed on the initial orbit and the perigee speed of the transfer
orbit. The scalar magnitude of the second impulse is
which is the difference between the speed on the final orbit and the apogee speed of the transfer ellipse.
page 1
Orbital Mechanics with MATLAB
In each of these V equations Vlc is called the local circular velocity. It can be determined from
Vlc
ri
and represents the scalar speed in the initial orbit. In these equations is the gravitational constant of
the central body. The transfer time from the first impulse to the second is equal to one half the orbital
period of the transfer ellipse
a3
where a is the semimajor axis of the transfer orbit and is equal to ri rf / 2 . The orbital eccentricity of
the transfer ellipse is
max ri , rf min ri , rf
e
rf ri
The following diagram illustrates the geometry of the coplanar Hohmann transfer.
transfer orbit
V1
ri
rf
initial orbit
V2
final orbit
Non-coplanar Equations
The non-coplanar Hohmann transfer involves orbital transfer between two circular orbits which have
different orbital inclinations. For this problem the propulsive energy is minimized if we optimally
partition the total orbital inclination change between the first and second impulses.
page 2
Orbital Mechanics with MATLAB
where 1 is the plane change associated with the first impulse. The magnitude of the second impulse is
where 2 is the plane change associated with the second impulse. These two equations are different
forms of the law of cosines.
The total V required for the maneuver is the sum of the two impulses as follows
V V1 V2
t 1 2
where t is the total plane change angle between the initial and final orbits.
Optimizing the non-coplanar Hohmann transfer involves allocating the total plane change angle between
the two maneuvers such that the total V required for the mission is minimized. We can determine this
answer by solving for the root of a derivative.
The partial derivative of the total V with respect to the first plane change angle is given by:
If we determine the value of 1 which makes this derivative zero, we have found the optimum plane
change required at the first impulse. Once 1 is calculated we can determine 2 from the total plane
change angle relationship and the velocity impulses from the previous equations.
Numerical Solution
This numerical algorithm has been implemented in an interactive MATLAB script called hohmann.m.
This script prompts the user for the initial and final altitudes in kilometers and the initial and final orbital
inclinations in degrees. The software then calls the Brent root-finding algorithm to solve the partial
derivative equation described above.
page 3
Orbital Mechanics with MATLAB
where hohmfunc is the objective function for this problem. Since we know that the optimum first plane
change angle is somewhere between 0 and the total plane change angle dinc, we pass these as the
bounds of the root. In the parameter list rtol is the user-defined root-finding convergence tolerance.
The following is a typical orbit transfer from a low altitude Earth orbit (LEO) at an altitude of 185.2
kilometers and an orbital inclination of 28.5 degrees to a geosynchronous Earth orbit (GSO) at an
altitude of 35786.36 kilometers and 0 degrees inclination.
The following is a V diagram for the first maneuver of this orbit transfer example. In this view we are
looking along the line of nodes which is the mutual intersection of the park and transfer orbit planes with
the equatorial plane.
V
Vi
Vp
26.3o
28.5o
equator
In this diagram Vi is the speed on the initial park orbit, V p is the perigee speed of the elliptic transfer
orbit, and V is the impulse required for the first maneuver. The inclinations of the park and transfer
orbit are also labeled. From this geometry and the law of cosines, the required V is given by
where i is the inclination difference or plane change between the park and transfer orbits.
The following is a typical user interaction with this MATLAB script. User inputs are in bold font.
This MATLAB script is valid for Hohmann transfers from a high initial circular orbit to a lower final
orbit. It also handles the case of transfer to a mission orbit with higher orbital inclination.
page 5
Orbital Mechanics with MATLAB
The hohmann script will also create a graphics display of the initial, transfer and final orbits. 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 green. 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 location of
each impulse is marked with a small blue circle.
The interactive graphic features of MATLAB allow the user to rotate and zoom the display. These
capabilities allow the user to interactively find the best viewpoint as well as verify basic three-
dimensional geometry of the orbital transfer.
The hohmann MATLAB script will also create color a Postscript disk file of this graphic image. This
image includes a TIFF preview and is created with MATLAB code similar to
This section summarizes the primer vector analysis included with this MATLAB script. The term
primer vector was invented by Derek F. Lawden and represents the adjoint vector for velocity. A
technical discussion about primer theory can be found in Lawden’s classic text, Optimal Trajectories for
Space Navigation, Butterworths, London, 1963. Another excellent resource is “Primer Vector Theory
and Applications”, Donald J. Jezewski, NASA TR R-454, November 1975, along with “Optimal, Multi-
burn, Space Trajectories”, also by Jezewski.
As shown by Lawden, the following four necessary conditions must be satisfied in order for an
impulsive orbital transfer to be locally optimal:
(1) the primer vector and its first derivative are everywhere continuous
(2) whenever a velocity impulse occurs, the primer is a unit vector aligned with the impulse and
has unit magnitude p pˆ uˆ T and p 1
page 6
Orbital Mechanics with MATLAB
(3) the magnitude of the primer vector may not exceed unity on a coasting arc p p 1
(4) at all interior impulses (not at the initial or final times) p p 0 ; therefore, d p dt 0 at the
intermediate impulses
Furthermore, the scalar magnitudes of the primer vector derivative at the initial and final impulses
provide information about how to improve the nominal transfer trajectory by changing the endpoint
times and/or moving the impulse times. These four cases for non-zero slopes are summarized as
follows;
If p0 0 and p f 0 perform an initial coast before the first impulse and add a final coast
after the second impulse
If p0 0 and p f 0 perform an initial coast before the first impulse and move the second
impulse to a later time
If p0 0 and p f 0 perform the first impulse at an earlier time and add a final coast after the
second impulse
If p0 0 and p f 0 perform the first impulse at an earlier time and move the second
impulse to a later time
The primer vector analysis of a two impulse orbital transfer involves the following steps.
r r
r v0 11 12 rr rv
t , t0
0
v v 21 22 vr vv
r v0
0
where
x / x0 x / y0 x / z0
r
11 y / x0 y / y0 y / z0
r0 z / x z / y0 z / z0
0
and so forth.
The value of the primer vector at any time t along a two body trajectory is given by
p t 11 t, t0 p0 12 t , t0 p0
p t 21 t, t0 p0 22 t, t0 p0
page 7
Orbital Mechanics with MATLAB
The primer vector boundary conditions at the initial and final impulses are as follows:
V0 V f
p t0 p0 p t f p f
V0 V f
These two conditions illustrate that at the locations of velocity impulses, the primer vector is a unit
vector in the direction of the corresponding impulse.
p t0 p0 12
1
t f , t0 p f 11 t f , t0 p0
provided the 12 sub-matrix is non-singular.
The scalar magnitude of the derivative of the primer vector can be determined from
d p d pp
p p
2
dt dt p
The following two graphic images illustrate the behavior of the magnitudes of the primer vector and its
derivative for the example given earlier. The location of each impulse is marked with a small red circle.
page 8
Orbital Mechanics with MATLAB
From the properties of the primer vector and its derivative, we can see that this orbit transfer is optimal.
The hohmann MATLAB script will also create color a Postscript disk file of these graphic images. This
image includes a TIFF preview and is created with MATLAB source code similar to
Algorithm resources
(1) Walter Hohmann, Die Erreichbarkeit der Himmelskorper, Oldenbourgh, Munich, 1925. Also, The
Attainability of Heavenly Bodies, NASA Technical Translation F-44, 1960.
(4) R. H. Battin, An Introduction to the Mathematics and Methods of Astrodynamics, AIAA, 1987.
(5) D. F. Lawden, Optimal Trajectories for Space Navigation, Butterworths, London, 1963.
(6) John E. Prussing, “Simple Proof of the Global Optimality of the Hohmann Transfer”, AIAA Journal
of Guidance, Control and Dynamics, Vol. 15, No. 4.
(7) A. Miele, M. Ciarcia, and J. Mathwig, “Reflections on the Hohmann Transfer”, Journal of
Optimization Theory and Applications, Vol. 123, No. 2, pp. 233-253, November 2004.
page 9
Orbital Mechanics with MATLAB
This document is the user’s manual for a MATLAB script named phohmann which can be used to solve
the gravity perturbed Hohmann transfer between coplanar and non-coplanar circular Earth orbits. The
algorithm starts with a two-body Hohmann transfer initial guess and then uses the SNOPT nonlinear
programming (NLP) method to determine the optimum two impulse orbit transfer subject to non-
spherical Earth gravity perturbations. Appendix A summarizes the governing equations for the two-
body Hohmann transfer. It also includes information about the MATLAB implementation used to solve
this classic astrodynamics problem. This script is valid for “exterior” Hohmann transfers from a lower
altitude circular orbit to a higher altitude circular orbit.
The phohmann script uses modified equinoctial orbital elements to solve the gravity perturbed orbit
transfer “targeting” problem. Additional information about these orbital elements can be found in
Appendix B. That appendix also explains how to use components and combinations of these non-
singular elements to calculate a variety of final orbital element targets or boundary conditions.
MATLAB versions of SNOPT for several computer platforms can be found at Professor Philip Gill’s
web site which is located at http://scicomp.ucsd.edu/~peg/. Professor Gill’s web site also includes a
PDF version of the SNOPT software user’s guide. A brief introduction to nonlinear programming can
be found in Appendix C.
The phohmann MATLAB script will interactively prompt the user for the name of the simulation
definition input data file. This prompt is similar to the following;
The file type defaults to names with a *.in filename extension. However, you can select any
phohmann compatible ASCII data file by selecting the Files of type: field or by typing the name of the
file directly in the File name: field.
page 1
Orbital Mechanics with MATLAB
The phohmann software is “data-driven” by a user-created text file. This text file should be simple
ASCII format with no special characters.
The following is a typical input file used by this MATLAB script. In the following discussion the actual
input file contents are in courier font and all explanations are in times italic font. This example is a
Hohmann transfer from a low Earth orbit (LEO) to a geosynchronous orbit (GSO). In this data file, user
provided inputs are in bold 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 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 data file for phohmann MATLAB script
* impulsive LEO-to-GSO orbital transfer
* filename ==> leo2gso.in
********************************************
The first inputs to the program define the initial UTC calendar date and time for the simulation. The
data for the calendar year should include all four digits. The calendar date and time are required in
order to correctly calculate the tesseral or longitude-dependent components of the Earth’s gravity.
initial UTC
(0 <= hours <= 24, 0 <= minutes <= 60, 0 <= seconds <= 60)
----------------------------------------------------------
20, 18, 33.0
The next three inputs are the altitude, orbital inclination and right ascension of the ascending node
(RAAN) of the initial circular orbit.
*************
initial orbit
*************
right ascension of the ascending node (degrees; 0 <= raan <= 360)
-----------------------------------------------------------------
100.0
page 2
Orbital Mechanics with MATLAB
The next two inputs are the altitude and orbital inclination of the final circular orbit.
***********
final orbit
***********
The Earth gravitational constant and radius are user-defined by the next two inputs.
****************************************
astrodynamic constants and gravity model
****************************************
Finally, the name of the Earth gravity model to use in the simulation and the order and degree of this
model are set by the following three inputs.
name of Earth gravity model data file
-------------------------------------
egm96.dat
The following is the phohmann solution for this example. The first part of the display is the two-body
Hohmann transfer solution. The second section summarizes the SNOPT iterations and summary. The
final section is the perturbed Hohmann transfer solution found during the optimization.
two-body Hohmann transfer solution
page 3
Orbital Mechanics with MATLAB
second inclination change 26.3355 degrees
orbital elements and state vector of the transfer orbit after the first impulse
-------------------------------------------------------------------------------
orbital elements and state vector of the transfer orbit prior to second impulse
-------------------------------------------------------------------------------
orbital elements and state vector of the transfer orbit after the initial delta-v
---------------------------------------------------------------------------------
orbital elements and state vector of the transfer orbit prior to the final delta-v
----------------------------------------------------------------------------------
page 6
Orbital Mechanics with MATLAB
initial delta-v vector, magnitude and steering angles
-----------------------------------------------------
The following is a brief summary of the information provided by this MATLAB script.
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
page 7
Orbital Mechanics with MATLAB
vmag (km/sec) = scalar magnitude of the velocity vector in kilometers per second
x-component of delta-v = ECI x-component of the impulsive delta-v maneuver in meters per second
y-component of delta-v = ECI y-component of the impulsive delta-v maneuver in meters per second
z-component of delta-v = ECI z-component of the impulsive delta-v maneuver in meters per second
delta-v magnitude = scalar magnitude of the impulsive delta-v maneuver in meters per second
transfer time = time interval between the two impulsive maneuvers in seconds, minutes and hours
Additional information about the data displayed by the optimization algorithm can be found in the
SNOPT user’s manual which is available at Professor Gill’s website which is located at
http://scicomp.ucsd.edu/~peg/.
The pitch and yaw angles for each impulsive maneuver are computed and displayed in a local-vertical-
local horizontal coordinate system. The following diagram illustrates the geometry of the pitch and yaw
angles in this system. In this figure, the radial direction is along the geocentric radius vector directed
away from the Earth, the tangential direction is tangent to the orbit in the direction of the orbital motion,
and the normal direction is along the angular momentum vector of the orbit. The pitch angle is positive
above the local horizontal plane formed by the tangential and normal directions, and the yaw angle is
positive in the direction of the angular momentum vector which is perpendicular to the orbit plane.
uR
pitch
= yaw
uT
uN
The phohmann script will also create a graphics display of the initial, transfer and final orbits. 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 green. 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 location of
each impulse is marked with a small blue circle.
page 8
Orbital Mechanics with MATLAB
Trajectory image files are saved to disk in both encapsulated, color Postscript format and MATLAB fig
format. The disk file names are phohmann1.eps and phohmann1.fig. The interactive features of
MATLAB graphics allow the user to re-load and manipulate the fig version of the trajectory display.
These capabilities allow the user to interactively find the best viewpoint as well as verify basic three-
dimensional geometry of the orbital maneuver.
Technical discussion
In this MATLAB script, the orbital motion is modeled with respect to a true-of-date Earth-centered-
inertial (ECI) coordinate system. The origin of this system is the center of the Earth and the
fundamental plane is the Earth’s equator. The x-axis is aligned with the true-of-date Vernal Equinox,
the z-axis is aligned with the Earth’s spin axis, and the y-axis completes this orthogonal, right-handed
coordinate system.
This MATLAB script uses a spherical harmonic representation of the Earth’s geopotential function
given by
0R 0 n R m
n n
where is the geocentric latitude, is the geocentric east longitude and r r x 2 y 2 z 2 is the
geocentric distance. 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 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
page 9
Orbital Mechanics with MATLAB
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
1 x2 y2
z z
r r r 2
The three partial derivatives of the geopotential with respect to r, , are given by
1 N R
n
r r r n 2 r m 0
N R
n n
r n2 r
C
m 0
m
n cos m Snm sin m Pnm1 sin m tan Pnm sin
N R
n n
r n2 r
mS
m 0
m
n cos m Cnm sin m Pnm sin
where
R radius of the Earth
r geocentric distance
Snm , Cnm harmonic coefficients
geocentric latitude sin 1 z r
longitude g
right ascension tan 1 ry rx
g right ascension of Greenwich
Right ascension is measured positive east of the vernal equinox, longitude is measured positive east of
Greenwich, and latitude is positive above the Earth’s equator and negative below.
For m 0 , the coefficients are called zonal terms, when m n the coefficients are sectorial terms, and
for n m 0 the coefficients are called tesseral terms.
The Legendre polynomials with argument sin are computed using recursion relationships given by:
page 10
Orbital Mechanics with MATLAB
1
Pn0 sin 2n 1 sin Pn01 sin n 1 Pn02 sin
n
Pnn sin 2n 1 cos Pnn11 sin , m 0, m n
and Pi j 0 for j i .
The following are the first 14 lines of the 18 by 18 egm96.dat gravity model file included with this
script. Column 1 is the degree l, column 2 is the order m, column 3 is the C coefficients and the last
column contains the S gravity model coefficients.
2 0 -1.08262668355E-003 0.00000000000E+000
3 0 2.53265648533E-006 0.00000000000E+000
4 0 1.61962159137E-006 0.00000000000E+000
5 0 2.27296082869E-007 0.00000000000E+000
6 0 -5.40681239107E-007 0.00000000000E+000
7 0 3.52359908418E-007 0.00000000000E+000
8 0 2.04799466985E-007 0.00000000000E+000
9 0 1.20616967365E-007 0.00000000000E+000
10 0 2.41145438626E-007 0.00000000000E+000
11 0 -2.44402148325E-007 0.00000000000E+000
12 0 1.88626318279E-007 0.00000000000E+000
13 0 2.19788001661E-007 0.00000000000E+000
14 0 -1.30744533118E-007 0.00000000000E+000
Gravity model coefficients are often published in normalized form. The relationship between
normalized Cl ,m , Sl ,m and un-normalized gravity coefficients Cl ,m , Sl ,m is given by the following
expression:
l m ! Cl ,m
12
Cl ,m 1
Sl ,m 2 m 0 2l 1 l m ! Sl ,m
page 11
Orbital Mechanics with MATLAB
The following is the MATLAB source code for the function that opens and reads a gravity model file
(fname) and creates matrices of the un-normalized coefficients.
% input
% output
% column 1 is the degree, column 2 is the order, column 3 are the C coefficients
% and the last column contains the S gravity model coefficients. For example,
% 2 0 -1.08262668355E-003 0.00000000000E+000
% 3 0 2.53265648533E-006 0.00000000000E+000
% 4 0 1.61962159137E-006 0.00000000000E+000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
gdata = dlmread(fname);
% initialize coefficients
idim = gdata(nrows, 1) + 1;
for n = 1:nrows
i = gdata(n, 1);
j = gdata(n, 2);
end
As mentioned earlier, the trajectory optimization uses the two-body Hohmann transfer solution for the
initial guess. For this problem, the components of the initial and final impulsive delta-v vector are
control variables. The transfer time from the initial to the final impulse is also an “indirect” or implicit
control variable as will be explained later. The objective or cost function for this problem is the sum of
the scalar magnitude of the two impulses given by
page 12
Orbital Mechanics with MATLAB
f vi v f
The SNOPT algorithm requires initial guesses (xg) for the six components of the delta-v vectors as well
as lower (xlwr) and upper (xupr) bounds on each component. It also requires lower (flow) and upper
(fupp) bounds on the objective function and any linear or nonlinear constraints.
The following is the MATLAB source code that sets up this information.
xg = xg';
% define lower and upper bounds for components of delta-v vectors (kilometers/second)
dvm = norm(xg(1:3));
for i = 1:1:3
end
dvm = norm(xg(4:6));
for i = 4:1:6
end
xlwr = xlwr';
xupr = xupr';
flow(1) = 0.0d0;
fupp(1) = +Inf;
flow(2) = 0.0d0;
fupp(2) = 0.0d0;
page 13
Orbital Mechanics with MATLAB
flow(3) = 0.0d0;
fupp(3) = 0.0d0;
flow(4) = 0.0d0;
fupp(4) = 0.0d0;
flow(5) = 0.0d0;
fupp(5) = 0.0d0;
flow(6) = 0.0d0;
fupp(6) = 0.0d0;
end
flow = flow';
fupp = fupp';
snspec('snopt_specs.txt');
snscreen on;
[x, f, inform, xmul, fmul] = snopt(xg, xlwr, xupr, flow, fupp, 'tpbvp');
The tpbvp MATLAB function defines the current value of the objective function and the mission
constraints. The function that evaluates the Earth gravity model and the first order equations of motion
is called ceqm1. Here’s the source code for this function.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ydot = [ y(4)
y(5)
page 14
Orbital Mechanics with MATLAB
y(6)
agrav(1)
agrav(2)
agrav(3)];
Notice that the main script will read a SNOPT “specs” file named snopt_specs.txt which has the
following contents.
Additional information about this special file can be found in the SNOPT documentation.
The tpbvp objective function starts with the two-body solution for the position and velocity vectors of
the maneuver on the initial orbit and the current value for the delta-v vector and numerically integrates
the first-order form of the orbital equations to the descending node. At the descending node the software
adds the current value of the second delta-v vector to the velocity vector of the transfer orbit to
determine the velocity vector on the final mission orbit.
The position vector at the descending node and the resultant velocity vector are used to compute the
current modified equinoctial orbital elements of the final mission orbit.
The following is the MATLAB source code within the tpbvp function that uses the “event finding”
feature of the built-in ode45 algorithm to predict the descending node conditions. The bound for the
search time (tend) is 102% of the two-body Hohmann transfer time.
rwrk = xi(1:3);
vwrk = xi(4:6);
[t, ysol, tevent, yevent, ie] = ode45(@ceqm1, [0 tend], [rwrk vwrk], options);
The following is the MATLAB source code for descending node objective function nc_event. The
computed value is simply the current z-component of the unit position vector.
% required by phohmann.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
isterminal = 1;
direction = -1;
Note that setting direction = -1 ensures a descending node crossing since we want to search for
values of the z-component of position that are decreasing. This implementation essentially treats the
coast time between the maneuvers as an “indirect” or implicit control variable.
This section summarizes the technique used to compute and enforce the nonlinear constraints that define
the final mission orbit. Since the final orbit of the Hohmann transfer is circular, we enforce the
following three modified equinoctial element nonlinear constraints
pt p p 0 ft f p 0 gt g p 0
In these three equations, the t subscript implies “target” or desired values and the p subscript implies
values “predicted” by the optimization process. The targeted values are computed using the position and
velocity vectors of the mission orbit determined during the two-body Hohmann transfer solution.
If the final mission orbit is equatorial (inclination = 0), we want to enforce the following two constraints.
ht hp 0 kt k p 0
If the orbital inclination of the final mission orbit is non-zero, we enforce the following single nonlinear
mission constraint.
ht2 kt2 hp2 k p2 0
Here’s the MATLAB source code that evaluates this constraint.
% equatorial orbit (h = k = 0)
f(5) = mee_final(4);
page 16
Orbital Mechanics with MATLAB
f(6) = mee_final(5);
else
end
Note that we are not enforcing the right ascension of the ascending node (RAAN) or the true anomaly of
the final mission orbit.
Additional information about targeting with the modified equinoctial orbital elements can be found in
Appendix B.
Algorithm resources
(1) Walter Hohmann, Die Erreichbarkeit der Himmelskorper, Oldenbourgh, Munich, 1925. Also, The
Attainability of Heavenly Bodies, NASA Technical Translation F-44, 1960.
(4) R. H. Battin, An Introduction to the Mathematics and Methods of Astrodynamics, AIAA, 1987.
(5) D. F. Lawden, Optimal Trajectories for Space Navigation, Butterworths, London, 1963.
(6) John E. Prussing, “Simple Proof of the Global Optimality of the Hohmann Transfer”, AIAA Journal
of Guidance, Control and Dynamics, Vol. 15, No. 4.
(7) A. Miele, M. Ciarcia, and J. Mathwig, “Reflections on the Hohmann Transfer”, Journal of
Optimization Theory and Applications, Vol. 123, No. 2, pp. 233-253, November 2004.
page 17
Orbital Mechanics with MATLAB
Appendix A
Two-body Hohmann Transfer
The coplanar circular orbit-to-circular orbit transfer was discovered by the German engineer Walter
Hohmann in 1925 and described in his classic report, The Attainability of Celestial Bodies. The transfer
consists of a velocity impulse on an initial circular orbit, in the direction of motion and collinear with the
velocity vector, which propels the space vehicle into an elliptical transfer orbit. At a transfer angle of
180 degrees from the first impulse, a second velocity impulse or V , also collinear and in the direction
of motion, places the vehicle into a final circular orbit at the desired final altitude. The impulsive V
assumption means that the velocity, but not the position, of the vehicle is changed instantaneously. This
is equivalent to a rocket engine with infinite thrust magnitude. Therefore, the Hohmann formulation is
the ideal and minimum energy solution to this type of orbit transfer problem.
Coplanar Equations
For the coplanar Hohmann transfer both velocity impulses are confined to the orbital planes of the initial
and final orbits. For a Hohmann transfer from a lower altitude orbit to a higher altitude circular orbit,
the first impulse creates an elliptical transfer orbit with a perigee altitude equal to the altitude of the
initial circular orbit and an apogee altitude equal to the altitude of the final orbit. The second impulse
circularizes the transfer orbit at apogee. Both impulses are posigrade which means that they are in the
direction of orbital motion.
rf ri ri
R1 2 R2 R3 2
ri rf rf ri rf
where ri is the geocentric radius of the initial circular park orbit and rf is the radius of the final circular
mission orbit. The relationship between radius and initial orbit altitude hi and the final orbit altitude h f
is as follows:
ri re hi
rf re h f
where re is the radius of the Earth.
and is simply the difference between the speed on the initial orbit and the perigee speed of the transfer
orbit. The scalar magnitude of the second impulse is
which is the difference between the speed on the final orbit and the apogee speed of the transfer ellipse.
page 18
Orbital Mechanics with MATLAB
In each of these V equations Vlc is called the local circular velocity. It can be determined from
Vlc ri .
and represents the scalar speed in the initial orbit. In these equations is the gravitational constant of
the central body. The transfer time from the first impulse to the second is equal to one half the orbital
period of the transfer ellipse
a3
where a is the semimajor axis of the transfer orbit and is equal to ri rf / 2 . The orbital eccentricity of
the transfer ellipse is
max ri , rf min ri , rf
e
rf ri
The following diagram illustrates the geometry of the coplanar Hohmann transfer.
transfer orbit
V1
ri
rf
initial orbit
V2
final orbit
Non-coplanar Equations
The non-coplanar Hohmann transfer involves orbital transfer between two circular orbits which have
different orbital inclinations. For this problem the propulsive energy is minimized if we optimally
partition the total orbital inclination change between the first and second impulses.
where 1 is the plane change associated with the first impulse. The magnitude of the second impulse is
page 19
Orbital Mechanics with MATLAB
where 2 is the plane change associated with the second impulse. These two equations are different
forms of the law of cosines.
The total V required for the maneuver is the sum of the two impulses as follows
V V1 V2
t 1 2
where t is the total plane change angle between the initial and final orbits.
Optimizing the non-coplanar Hohmann transfer involves allocating the total plane change angle between
the two maneuvers such that the total V required for the mission is minimized. We can determine this
answer by solving for the root of a derivative.
The partial derivative of the total V with respect to the first plane change angle is given by:
If we determine the value of 1 which makes this derivative zero, we have found the optimum plane
change required at the first impulse. Once 1 is calculated we can determine 2 from the total plane
change angle relationship and the velocity impulses from the previous equations.
Numerical Solution
This numerical algorithm has been implemented in an interactive MATLAB script called hohmann.m.
This script prompts the user for the initial and final altitudes in kilometers and the initial and final orbital
inclinations in degrees. The software then calls the Brent root-finding algorithm to solve the partial
derivative equation described above.
where hohmfunc is the objective function for this problem. Since we know that the optimum first plane
change angle is somewhere between 0 and the total plane change angle dinc, we pass these as the
bounds of the root. In the parameter list rtol is the user-defined root-finding convergence tolerance.
The following discussion pertains to a typical orbit transfer from a low altitude Earth orbit (LEO) at an
altitude of 185.2 kilometers and an orbital inclination of 28.5 degrees to a geosynchronous Earth orbit
(GSO) at an altitude of 35786.36 kilometers and 0 degrees inclination.
page 20
Orbital Mechanics with MATLAB
The following is a V diagram for the first maneuver of this orbit transfer example. In this view we are
looking along the line of nodes which is the mutual intersection of the park and transfer orbit planes with
the equatorial plane.
V
Vi
Vp
26.3o
28.5o
equator
In this diagram Vi is the speed on the initial park orbit, V p is the perigee speed of the elliptic transfer
orbit, and V is the impulse required for the first maneuver. The inclinations of the park and transfer
orbit are also labeled. From this geometry and the law of cosines, the required V is given by
where i is the inclination difference or plane change between the park and transfer orbits.
Algorithm resources
(1) Walter Hohmann, Die Erreichbarkeit der Himmelskorper, Oldenbourgh, Munich, 1925. Also, The
Attainability of Heavenly Bodies, NASA Technical Translation F-44, 1960.
(2) John E. Prussing, “Simple Proof of the Global Optimality of the Hohmann Transfer”, AIAA Journal
of Guidance, Control and Dynamics, Vol. 15, No. 4.
(3) A. Miele, M. Ciarcia, and J. Mathwig, “Reflections on the Hohmann Transfer”, Journal of
Optimization Theory and Applications, Vol. 123, No. 2, pp. 233-253, November 2004.
page 21
Orbital Mechanics with MATLAB
Appendix B
Targeting with Modified Equinoctial Orbital Elements
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These direct
modified equinoctial equations exhibit no singularity for zero eccentricity and orbital inclinations equal
to 0 and 90 degrees. However, please note that two of the components are singular for an orbital
inclination of 180 degrees.
The classic reference for these elements is “A Set of Modified Equinoctial Orbital Elements”, M. J. H.
Walker, B. Ireland and J. Owens, Celestial Mechanics, Vol. 36, pp. 409-419, 1985.
The modified equinoctial elements are defined in terms of the classical orbital elements as follows:
p a 1 e 2
f e cos
g e sin
h tan i 2 cos
k tan i 2 sin
L
where
p semiparameter
a semimajor axis
e orbital eccentricity
i orbital inclination
argument of perigee
right ascension of the ascending node
true anomaly
L true longitude
The classical orbital elements can be recovered from the modified equinoctial orbital elements with
semimajor axis
p
a
1 f 2 g2
orbital eccentricity
e f 2 g2
page 22
Orbital Mechanics with MATLAB
orbital inclination
i 2 tan 1 h2 k 2
argument of periapsis
tan 1 g, f tan 1 k , h
gh f k
sin
e tan i 2
f h gk
cos
e tan i 2
tan 1 k , h
k
sin
tan i 2
h
cos
tan i 2
true anomaly
L L tan 1 g , f
1
sin f sin L g cos L
e
1
cos f cos L g sin L
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 .
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:
page 23
Orbital Mechanics with MATLAB
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.
e f 2 g2
i
tan h 2 k 2
2
gh f k
g h f k e sin tan i 2 sin
e tan i 2
f h gk
f h g k e cos tan i 2 cos
e tan i 2
k
k tan i 2 sin sin
tan i 2
page 24
Orbital Mechanics with MATLAB
h
h tan i 2 cos cos
tan i 2
L L tan 1 g , f
In general,
1
sin f sin L g cos L
e
1
cos f cos L g sin L
e
Algorithm resources
“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, August 20-22, 1990.
page 25
Orbital Mechanics with MATLAB
Appendix C
Nonlinear Programming Problem
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 font.
The system dynamics are defined by a vector system of ordinary differential equations called the state
equations that can be represented as follows
dy
y f y t , u t , p, t
dt
The initial dynamic variables at time t0 are defined by ψ0 ψ y t0 , u t0 , t0 and the terminal
conditions at the final time t f are defined by ψ f ψ y t f , u t f , t f . These conditions are called the
boundary values of the trajectory problem.
For any mission time t there are also simple bounds on the state variables
yl y t yu
the control variables
ul u t u u
pl p t pu
The basic nonlinear programming problem (NLP) involves the determination of 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 26
Orbital Mechanics with MATLAB
Algorithm resources
(1) “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.
(2) “Optimal Finite-Thrust Spacecraft Trajectories Using Direct Transcription and Nonlinear
Programming”, Paul J. Enright, Ph.D. Thesis, University of Illinois at Urbana-Champaign, 1991.
(3) “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.
(4) “Improved Collocation Methods with Application to Direct Trajectory Optimization”, Albert L.
Herman, Ph.D. Thesis, University of Illinois at Urbana-Champaign, 1995.
(5) “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.
(6) Practical Optimization, Philip E. Gill, Walter Murray and Margaret H. Wright, Emerald Group
Publishing Limited, 1982.
page 27
Orbital Mechanics with MATLAB
This document describes a MATLAB script called oota_matlab.m that can be used to determine
optimum one and two impulse orbital transfers between non-coplanar circular and elliptical orbits. The
method is general and the initial and final orbits need not be coapsidal. The algorithm is based on the
orbit transfer and rendezvous work of Gary McCue, Gentry Lee and David Bender, described in
“Numerical Investigation of Minimum Impulse Orbital Transfer”, AIAA Journal, 3, 2328-2334 (1965),
and “An Analysis of Two-Impulse Orbital Transfer”, AIAA Journal, 2, 1767-1773 (1964).
The numerical solution of this classic astrodynamic problem involves a combination of one-dimensional
root-finding using Brent’s method and multi-dimensional unconstrained minimization using the built-in
fminsearch algorithm provided with MATLAB. The oota_matlab MATLAB script uses primer
vector theory to determine the optimality of the solution(s) computed by this numerical method.
To execute the oota_matlab script, log into the directory containing the source code and type
oota_matlab in the MATLAB command window. This MATLAB script is “data driven” by a simple
text file created by the user. The script will prompt the user for the name of the data file with a screen
similar to
The file type defaults to names with a *.in filename extension. However, you can select any
oota_matlab.m compatible ASCII data file by selecting the Files of type: field or by typing the name
of the file directly in the File name: field.
The oota_matlab script reads a simple ASCII data file that defines the initial and final orbits along
with the algorithm search characteristics. The following is a typical data file named leo2gso.in for
this application. This example solves the problem of two impulse, non-coplanar orbital transfer from a
typical low altitude circular Earth orbit (LEO) to a circular geosynchronous Earth orbit (GSO).
page 1
Orbital Mechanics with MATLAB
The annotation text in this file can be modified but should not be deleted because the MATLAB
function that reads this data (read_oota.m) expects to find exactly 81 lines of text and numeric
information. The first two data items define the gravitational constant and radius of the central body.
Please note the units and valid range for each input. User inputs are shown in bold font.
*************************************************
* input data file for oota_matlab.m MATLAB script
* impulsive LEO-to-GSO orbital transfer
* filename ==> leo2gso.dat
*************************************************
*************
initial orbit
*************
***********
final orbit
***********
page 2
Orbital Mechanics with MATLAB
***************************
algorithm search parameters
***************************
The last section of this data file defines the algorithm grid search parameters to use during the
optimization. These numbers define the initial true anomaly for the initial and final orbits, the true
anomaly search increment for each orbit, and the total number of intervals to analyze. Notice that the
combination of true anomaly search increments and number of search intervals in this example will
encompass the entire true anomaly range for both the initial and final orbits.
Solution information
The oota_matlab MATLAB script provides the following types of information about the solution(s).
The following is the summary text file for the leo2gso example described in the previous section. The
argument of latitude is the sum of the argument of perigee and true anomaly at the impulse location. It
describes the location of a maneuver relative to the ascending node of the initial and transfer orbit. For
equatorial orbits, the argument of perigee is measured relative to the x-axis of the Earth-centered-inertial
(ECI) coordinate system.
input data file ==> leo2gso.in
oota dv1 true dv2 true dv1 arg dv2 arg delta-v1 delta-v2 total
solution anomaly anomaly latitude latitude magnitude magnitude delta-v
number (degrees) (degrees) (degrees) (degrees) (m/s) (m/s) (m/s)
-------- --------- --------- --------- --------- --------- --------- ---------
page 3
Orbital Mechanics with MATLAB
Summary text files are saved to disk with a file name consisting of the name of the input data file (minus
the filename extension) concatenated with _summary.txt. For example, the name of the summary text
file for this case is leo2gso_summary.txt.
The following is the first solution contained in the detailed solutions text file. The initial part of this file
contains the name of the simulation definition input data file, the solution number and information about
the minimization algorithm performance.
solution number 1
Optimization terminated:
the current x satisfies the termination criteria using OPTIONS.TolX of 1.000000e-08
and F(X) satisfies the convergence criteria using OPTIONS.TolFun of 1.000000e-08
page 4
Orbital Mechanics with MATLAB
Detailed text files are saved to disk with a file name consisting of the name of the input data file (minus
the filename extension) concatenated with _solutions.txt. For example, the name of the summary
text file for this test case is leo2gso_solutions.txt.
The following is a brief description of the information provided in the detailed text file.
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 velocity vector in kilometers per second
transfer time = flight time between the two impulses in seconds, minutes and hours
The pitch and yaw angles for each impulsive maneuver are computed and displayed in the local-vertical-
local horizontal (LVLH; also called the radial-tangential-normal) coordinate system. The following
diagram illustrates the geometry of the pitch and yaw angles in this system. In this figure, the radial
direction is along the geocentric radius vector directed away from the Earth, the tangential direction is
tangent to the orbit, and the normal direction is along the angular momentum vector of the orbit.
uR
pitch
= yaw
uT
uN
The oota_matlab script will also create a graphics display of the initial, transfer and final orbits for
each solution. The following is one of the graphic images for this example. The initial orbit trace is red,
the transfer orbit is blue and the final mission orbit is green. 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. Impulse locations are marked with small blue circles.
Trajectory image files are saved to disk in both encapsulated, color Postscript format and MATLAB fig
format with a file name consisting of the name of the input data file (minus the filename extension)
concatenated with _traj, the solution number and either .eps or .fig. For example, the names of the
graphics disk files for the first solution are leo2gso_traj1.eps and leo2gso_traj1.fig. The
interactive features of MATLAB graphics allow the user to manipulate the fig version of the trajectory
display. These capabilities allow the user to interactively find the best viewpoint as well as verify basic
three-dimensional geometry of the orbital transfer.
page 6
Orbital Mechanics with MATLAB
The oota_matlab script will also create a graphics disk file of the primer vector and its derivative for
each solution. The image for one of the solutions for this example is shown below. These plots
illustrate the behavior of the scalar magnitudes of the primer vector and its derivative as a function of
elapsed time since the first impulse.
Primer image files are saved to disk with a file name consisting of the name of the input data file (minus
the filename extension) concatenated with _primer, the solution number and .eps. For example, the
name of the graphics file for the first solution is leo2gso_primer1.eps. Please note that these files
are also saved in encapsulated, color Postscript format.
page 7
Orbital Mechanics with MATLAB
The type of minimization algorithm and grid search implemented in this MATLAB script will often
produce duplicate solutions to a particular orbit transfer problem. The summary and detailed text files
allow the user to eliminate these duplicate solutions and retain one or more unique solutions.
Technical Discussion
The solution to this important astrodynamics problem is formulated in a reference coordinate system.
The fundamental reference plane of this coordinate system is the final orbit plane and the x-axis is
aligned with the intersection of the planes of the initial and final orbits. The z-axis of this system is
aligned with the angular momentum vector of the final orbit and the y-axis completes this orthogonal
coordinate system. In the equations which follow, elements of the initial orbit have a subscript of 1 and
elements of the final orbit a subscript of 2. Elements of the transfer orbit will have a subscript of t.
The following diagram illustrates the geometry of a two impulse orbital transfer. The relative
inclination between the initial and final orbit planes is ir and is the transfer angle which is the angle
from the first and second impulse measured in the plane of the transfer orbit. N corresponds to the x-
axis, W1 is in the direction of the initial orbit angular momentum vector, and W2 is in the direction of
the angular momentum vector of the final orbit.
The independent variables for this problem are 1 , 2 and pt , where 1 is the angle from the N axis to
the first impulse as measured in the initial orbit plane, 2 is the angle from the N axis to the second
impulse as measured in the final orbit plane, and pt is the semi-parameter of the transfer orbit. The
expression for N is as follows
W W1
N 2
W2 W1
page 8
Orbital Mechanics with MATLAB
The relative inclination between the initial and final orbit planes is determined from
ir cos1 w1 w2
where w1 is the ECI unit angular momentum vector of the initial orbit given by
sin 1 sin i1
w1 cos 1 sin i1
cos i1
and w 2 is the ECI unit angular momentum vector of the final orbit given by
sin 2 sin i2
w 2 cos 2 sin i2
cos i2
The unit position vector at the first impulse in the reference coordinate system is
cos 1
U1 sin 1 cos ir
sin 1 sin ir
and the unit position vector of the second impulse, also in the reference coordinate system, is determined
from
cos 2
U 2 sin 2
0
The transfer angle can be computed from the following dot product
cos1 U1 U2
The minimum and maximum bounds on the semi-parameter of the transfer orbit can be determined from
the following two expressions
r1 r2 r1 r2 r1 r2 r1 r2
pmin pmax
r1 r2 2 r1 r2 r1 r2 r1 r2 2 r1 r2 r1 r2
The partial derivative of the total required V with respect to the semi-parameter of the transfer orbit is
as follows
page 9
Orbital Mechanics with MATLAB
Part of the optimal orbital transfer solution involves finding the value of pt which lies between pmin and
pmax and makes this partial derivative expression equal to zero.
The V vectors in the reference coordinate system are given by the following two expressions
V1 V zU1 V1
V2 V2 V zU2
where the upper sign in these two equations corresponds to the short transfer and
z tan
p 2
with
V pt
r2 r1
r1 r2
The velocity vector of the satellite prior to the first impulse with respect to the reference coordinate
system is calculated from
V1 W1 e1 U1
p1
V2 W2 e 2 U2
p2
In these expressions, e1 is the reference coordinate system eccentricity vector of the initial orbit which is
given by
e1 e1 cos 1 sin 1 cos ir sin 1 sin ir
T
e2 e2 cos 2 sin 2 0
T
where e1 and e2 are the scalar eccentricity of the initial and final orbits, respectively.
The total scalar delta-v required for the orbit transfer is given by V V1 V2 .
page 10
Orbital Mechanics with MATLAB
In terms of the Earth-centered-inertial (ECI) components of the two V vectors, the total scalar V
required for the orbital transfer is
Eventually, we want to convert the reference coordinate system solution to ECI vectors and then to
classical orbital elements. The transformation of an ECI position or velocity vector Xeci to its
corresponding reference coordinate system companion Xrcs is given by the following matrix-vector
multiplication
X eci T X rcs
The conversion of a vector in the reference coordinate system to its corresponding ECI vector involves
the transpose of this matrix as follows
X rcs T X eci
The elements of the reference coordinate system-to-ECI transformation matrix T are given by the
following nine expressions
where
cos1 N U sign N z
and
U cos 2 sin 2 0
T
The position vector of the initial and transfer orbits at the first impulse in the reference coordinate
system is
p1
r1 U1
1 e1 cos 1
1
and the position vector of the transfer and final orbit at the second impulse is
page 11
Orbital Mechanics with MATLAB
p2
r2 U2
1 e2 cos 2 2
In these equations the arguments of perigee 1 and 2 are with respect to the reference coordinate
system. They can be determined with the following three equations
and
cos 2 cos 2 sin 2 sin 2 cos i2
eci cos 2 sin 2 sin 2 cos 2 cos i2
2
sin 2 sin i2
where all the orbital elements in these two equations are with respect to the ECI coordinate system.
p1 a1 1 e12
p2 a2 1 e22
where a1 and a2 are the semimajor axes of the initial and final orbits, respectively.
The transfer orbit velocity vectors prior to the first and second impulses in the reference coordinate
system are calculated from the next two equations
The transfer orbit position and velocity vectors can be transformed into the ECI coordinate system using
the transpose of the T matrix as described above, and then converted to classical orbital elements.
page 12
Orbital Mechanics with MATLAB
Time-of-flight
The time of flight between perigee and another true anomaly on an elliptic orbit is given by
1 1 e e 1 e2 sin
tof 2 tan tan
2 1 e
2 1 e cos
where
orbital period
e orbital eccentricity
true anomaly
Therefore, the flight time between any two true anomalies on the same elliptical orbit is given by
This equation is implemented in a MATLAB function named tof1.m which is used to compute the
transfer time between the first and second impulses for the case of a two-impulse orbit transfer. Here’s
the syntax for this function.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This section summarizes the primer vector analysis used to determine the optimality of solutions
computed by this MATLAB script. The term primer vector was invented by Derek F. Lawden and
represents the adjoint vector for velocity in the optimal control theory for space trajectories.
A technical discussion about primer theory can be found in Lawden’s classic text, Optimal Trajectories
for Space Navigation, Butterworths, London, 1963. Another excellent resource is “Primer Vector
Theory and Applications”, Donald J. Jezewski, NASA TR R-454, November 1975, along with
“Optimal, Multi-burn, Space Trajectories”, also by Jezewski. As noted by Donald Jezewski, the primer
vector is sometimes called the Lagrange multiplier, costate vector or perhaps an adjoint variable.
page 13
Orbital Mechanics with MATLAB
As shown by D. F. Lawden, the following four necessary conditions must be satisfied in order for an
impulsive orbital transfer to be locally optimal.
(1) the primer vector and its first derivative are everywhere continuous
(2) whenever a velocity impulse occurs, the primer is a unit vector aligned with the impulse and
has unit magnitude p pˆ uˆ T and p 1
(3) the magnitude of the primer vector may not exceed unity on a coasting arc p p 1
(4) at all interior impulses (not at the initial or final times) p p 0 ; therefore, d p dt 0 at the
intermediate impulses
Furthermore, the scalar magnitudes of the primer vector derivative at the initial and final impulses
provide information about how to improve the nominal transfer trajectory by changing the endpoint
times and/or moving the impulse times. These four cases for non-zero slopes are summarized as
follows;
If p0 0 and p f 0 perform an initial coast before the first impulse and add a final coast
after the second impulse
If p0 0 and p f 0 perform an initial coast before the first impulse and move the second
impulse to a later time
If p0 0 and p f 0 perform the first impulse at an earlier time and add a final coast after the
second impulse
If p0 0 and p f 0 perform the first impulse at an earlier time and move the second
impulse to a later time
The primer vector analysis of a two impulse orbital transfer involves the following computational steps.
r r
r v0 11 12 rr rv
t , t0
0
v v 21 22 vr vv
r v0
0
where
x / x0 x / y0 x / z0
r
11 y / x0 y / y0 y / z0
r0 z / x z / y0 z / z0
0
and so forth.
page 14
Orbital Mechanics with MATLAB
The value of the primer vector at any time t along a two body trajectory is given by
p t 11 t, t0 p0 12 t , t0 p0
p t 21 t, t0 p0 22 t, t0 p0
In these equations, t0 represents the time of the first impulse and t f is the time of the second impulse.
The primer vector boundary conditions at the initial and final impulses are as follows
V0 V f
p t0 p0 p t f p f
V0 V f
These two conditions illustrate that at the locations of velocity impulses, the primer vector is a unit
vector in the direction of the corresponding impulse.
p t0 p0 12
1
t f , t0 p f 11 t f , t0 p0
provided the 12 state transition sub-matrix is non-singular.
The scalar magnitude of the derivative of the primer vector at any mission elapsed time can be
determined from
d p d pp
p p
2
dt dt p
An oota_matlab solution is deemed locally optimal if all the following primer vector and derivative
magnitude conditions are true.
p t0 1.001 p t f 1.001
p t0 0.00001 p t f 0.00001
page 15
Orbital Mechanics with MATLAB
The first two equations enforce the primer optimality at the first and second impulses. The second
equation checks for primer optimality everywhere along the coast portion of the transfer trajectory.
Finally, the last two equations ensure that the primer derivative conditions at the first and second
impulse locations are also satisfied.
The oota_matlab script creates 300 equally spaced time values along the transfer trajectory. The
scalar magnitude of the primer vector and its derivative are computed at these time points using the
equations of the previous section. The maximum value of the primer magnitude along the orbit transfer
is determined using the MATLAB max statement operating on the vector of primer values.
The following is the snippet of MATLAB source code that performs the optimality check.
if (y1(1) <= tol_pv && y1(end) <= tol_pv && max(y1) <= tol_pv ...
&& abs(y2(1)) <= tol_pvd && abs(y2(end)) <= tol_pvd)
In this statement, y1 is the array of primer vector magnitudes, y2 is the array of primer derivative
magnitudes, tol_pv is the tolerance on the primer vector magnitude (1.001) and tol_pvd is the
primer derivative magnitude tolerance (0.0001). Notice that this statement checks the absolute value of
the primer derivative magnitudes since they may be positive or negative at maneuver locations.
These primer and derivative array values are also used to create the graphics image for a two-impulse
orbit transfer.
page 16
Orbital Mechanics with MATLAB
The poota script uses modified equinoctial orbital elements to solve the gravity perturbed orbit transfer
“targeting” problem. Additional information about these orbital elements can be found in Appendix A.
That appendix also explains how to use components and combinations of these non-singular elements to
calculate a variety of final orbital element targets or boundary conditions.
MATLAB versions of SNOPT for several computer platforms can be requested at Professor Philip Gill’s
web site which is located at http://ccom.ucsd.edu/~optimizers/. Professor Gill’s web site also includes a
PDF version of the SNOPT software user’s guide. A brief introduction to nonlinear programming can
be found in Appendix B of this document.
The poota MATLAB script will interactively prompt the user for the name of the simulation definition
input data file. This prompt is similar to the following;
The file type defaults to names with a *.in filename extension. However, you can select any poota
compatible ASCII data file by selecting the Files of type: field or by typing the name of the file directly
in the File name: field.
page 1
Orbital Mechanics with MATLAB
The poota software is “data-driven” by a user-created text file. This text file should be simple ASCII
format with no special characters.
The following is a typical input file used by this MATLAB script. In the following discussion the actual
input file contents are in courier font and all explanations are in times italic font. This example is a
transfer from a low Earth orbit (LEO) to a Molniya (from the Russian word for “lightning”) elliptical
Earth orbit (EEO). This input file was created using the optimal output from an oota.m simulation. In
this data file, user provided inputs are in bold 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 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 text lines.
**************************************************************
* input data file for poota.m MATLAB script
* impulsive, gravity-perturbed LEO-to-Molniya orbital transfer
* filename ==> leo2moly.in ==> December 14, 2017
**************************************************************
The first inputs to the program define the initial UTC calendar date and time for the simulation. The
data for the calendar year should include all four digits. The calendar date and time are required to
correctly calculate the tesseral or longitude-dependent components of the Earth’s gravity.
initial calendar date
(1 <= month <= 12, 1 <= day <= 31, year = all digits!)
------------------------------------------------------
2, 11, 2013
initial UTC
(0 <= hours <= 24, 0 <= minutes <= 60, 0 <= seconds <= 60)
----------------------------------------------------------
20, 18, 19.36
The next six inputs are the classical orbital elements of the initial low Earth Orbit (LEO) prior to the
first impulsive maneuver. These items can be extracted from an oota.m simulation or any other
compatible computer program.
******************************************
initial orbit - prior to the first impulse
******************************************
page 2
Orbital Mechanics with MATLAB
orbital inclination (degrees)
(0 <= inclination <= 180)
51.6
The next three inputs define the Earth-centered-inertial (ECI) delta-v guess for the first impulsive
maneuver in the units of meters/second.
**********************************************
initial guess for the first ECI delta-v vector
**********************************************
delta-vx (meters/second)
1330.4075
delta-vy (meters/second)
1218.4185
delta-vz (meters/second)
1441.6042
The next three inputs summarize the ECI delta-v guess for the second impulsive maneuver also in the
units of meters/second.
***********************************************
initial guess for the second ECI delta-v vector
***********************************************
delta-vx (meters/second)
1410.9169
delta-vy (meters/second)
-908.8023
delta-vz (meters/second)
2707.6089
The next set of six classical orbital elements inputs correspond to the final orbit “targets”.
*********************
final orbit "targets"
*********************
page 3
Orbital Mechanics with MATLAB
argument of perigee (degrees)
(0 <= argument of perigee <= 360)
270.0
This next input is the two-body initial guess for the orbit transfer time in seconds.
**************************************
two-body orbit transfer time (seconds)
**************************************
7374.8151
The Earth gravitational constant and radius are user-defined by the next two inputs.
****************************************
astrodynamic constants and gravity model
****************************************
Finally, the name of the Earth gravity model to use in the simulation and the order and degree of this
model are set by the following three inputs.
name of Earth gravity model data file
-------------------------------------
egm96.dat
The following is the poota solution for this example. The first part of the display summarizes useful
information about the user-defined initial guess. The second section summarizes the SNOPT iterations
and summary. The final section of the output is the gravity perturbed orbit transfer solution found
during the optimization.
Gravity-perturbed, Two-impulse Orbit Transfer Analysis
======================================================
initial guess for orbital elements and state vector of the transfer orbit after the first impulse
-------------------------------------------------------------------------------------------------
initial guess for orbital elements and state vector of the transfer orbit prior to second impulse
-------------------------------------------------------------------------------------------------
initial guess for orbital elements and state vector of the transfer orbit after the second impulse
--------------------------------------------------------------------------------------------------
page 5
Orbital Mechanics with MATLAB
initial guess for initial delta-v vector, magnitude and steering angles
-----------------------------------------------------------------------
initial guess for final delta-v vector, magnitude and steering angles
---------------------------------------------------------------------
Scale option 0
predicted orbital elements and state vector of the transfer orbit after the initial delta-v
-------------------------------------------------------------------------------------------
predicted orbital elements and state vector of the transfer orbit prior to the final delta-v
--------------------------------------------------------------------------------------------
page 7
Orbital Mechanics with MATLAB
predicted initial delta-v vector, magnitude and steering angles
---------------------------------------------------------------
The following is a brief summary of the information provided by this MATLAB script.
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.
page 8
Orbital Mechanics with MATLAB
vmag (km/sec) = scalar magnitude of the velocity vector in kilometers per second
x-component of delta-v = ECI x-component of the impulsive delta-v maneuver in meters per second
y-component of delta-v = ECI y-component of the impulsive delta-v maneuver in meters per second
z-component of delta-v = ECI z-component of the impulsive delta-v maneuver in meters per second
delta-v magnitude = scalar magnitude of the impulsive delta-v maneuver in meters per second
transfer time = time interval between the two impulsive maneuvers in seconds, minutes and hours
Additional information about the data displayed by the optimization algorithm can be found in the
SNOPT user’s manual which is available at Professor Gill’s website which is located at
http://scicomp.ucsd.edu/~peg/.
The pitch and yaw angles for each impulsive maneuver are computed and displayed in a local-vertical-
local horizontal coordinate system. The following diagram illustrates the geometry of the pitch and yaw
angles in this system. In this figure, the radial direction is along the geocentric radius vector directed
away from the Earth, the tangential direction is tangent to the orbit in the direction of the orbital motion,
and the normal direction is along the angular momentum vector of the orbit. The pitch angle is positive
above the local horizontal plane formed by the tangential and normal directions, and the yaw angle is
positive in the direction of the angular momentum vector which is perpendicular to the orbit plane.
uR
= pitch
= yaw
uT
uN
The poota script will also create a graphics display of the initial, transfer and final orbits. 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 green. 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 location of
each impulse is marked with a small blue circle.
page 9
Orbital Mechanics with MATLAB
Trajectory image files are saved to disk in both encapsulated, color Postscript format and MATLAB
fig format. The disk file names are poota1.eps and poota1.fig. The interactive features of
MATLAB graphics allow the user to re-load and manipulate the fig version of the trajectory display.
These capabilities also allow the user to interactively find the best viewpoint as well as verify basic
three-dimensional geometry of the orbital maneuver.
Technical discussion
In this MATLAB script, the orbital motion is modeled with respect to a true-of-date Earth-centered-
inertial (ECI) coordinate system. The origin of this system is the center of the Earth and the
fundamental plane is the Earth’s equator. The x-axis is aligned with the true-of-date Vernal Equinox,
the z-axis is aligned with the Earth’s spin axis, and the y-axis completes this orthogonal, right-handed
coordinate system.
This MATLAB script uses a spherical harmonic representation of the Earth’s geopotential function
given by
0R 0 n R m
n n
where is the geocentric latitude, is the geocentric east longitude and r = r = x 2 + y 2 + z 2 is the
geocentric distance. In this expression the S’s and C’s are unnormalized harmonic coefficients of the
page 10
Orbital Mechanics with MATLAB
geopotential, and the P’s are associated Legendre polynomials of degree n and order m with argument
u = sin .
The software calculates the 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
1 x2 + y2
z= z +
r r r 2
The three partial derivatives of the geopotential with respect to r, , are given by
1 N R
n
r r r n =2 r m =0
N R
n n
=
r n =2 r
(C
m =0
m
n cos m + Snm sin m ) Pnm+1 ( sin ) − m tan Pnm (sin )
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
Snm , Cnm = harmonic coefficients
= geocentric latitude = sin −1 ( z r )
= longitude = − g
= right ascension = tan −1 ( ry rx )
g = right ascension of Greenwich
page 11
Orbital Mechanics with MATLAB
Right ascension is measured positive east of the vernal equinox, longitude is measured positive east of
Greenwich, and latitude is positive above the Earth’s equator and negative below.
For m = 0 , the coefficients are called zonal terms, when m = n the coefficients are sectorial terms, and
for n m 0 the coefficients are called tesseral terms.
The Legendre polynomials with argument sin are computed using recursion relationships given by:
1
Pn0 ( sin ) = ( 2n − 1) sin Pn0−1 ( sin ) − ( n − 1) Pn0−2 (sin )
n
Pnn ( sin ) = ( 2n − 1) cos Pnn−−11 ( sin ) , m 0, m n
and Pi j = 0 for j i .
The following are the first 14 lines of the 18 by 18 egm96.dat gravity model file included with this
script. Column 1 is the degree l, column 2 is the order m, column 3 is the C coefficients and the last
column contains the S gravity model coefficients.
2 0 -1.08262668355E-003 0.00000000000E+000
3 0 2.53265648533E-006 0.00000000000E+000
4 0 1.61962159137E-006 0.00000000000E+000
5 0 2.27296082869E-007 0.00000000000E+000
6 0 -5.40681239107E-007 0.00000000000E+000
7 0 3.52359908418E-007 0.00000000000E+000
8 0 2.04799466985E-007 0.00000000000E+000
9 0 1.20616967365E-007 0.00000000000E+000
10 0 2.41145438626E-007 0.00000000000E+000
11 0 -2.44402148325E-007 0.00000000000E+000
12 0 1.88626318279E-007 0.00000000000E+000
13 0 2.19788001661E-007 0.00000000000E+000
14 0 -1.30744533118E-007 0.00000000000E+000
Gravity model coefficients are often published in normalized form. The relationship between
normalized Cl ,m , Sl ,m and un-normalized gravity coefficients Cl ,m , Sl ,m is given by the following
expression:
page 12
Orbital Mechanics with MATLAB
( l + m )! Cl ,m
12
Cl ,m 1
=
Sl ,m ( 2 − m 0 )( 2l + 1) ( l − m ) ! Sl ,m
The following is the MATLAB source code for the function that opens and reads a gravity model file
(fname) and creates matrices of the un-normalized coefficients.
% input
% output
% column 1 is the degree, column 2 is the order, column 3 are the C coefficients
% and the last column contains the S gravity model coefficients. For example,
% 2 0 -1.08262668355E-003 0.00000000000E+000
% 3 0 2.53265648533E-006 0.00000000000E+000
% 4 0 1.61962159137E-006 0.00000000000E+000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
gdata = dlmread(fname);
% initialize coefficients
idim = gdata(nrows, 1) + 1;
for n = 1:nrows
i = gdata(n, 1);
j = gdata(n, 2);
end
page 13
Orbital Mechanics with MATLAB
As mentioned earlier, the trajectory optimization uses a two-body orbital transfer solution generated
with the oota.m MATLAB script for the initial guess. For this problem, the components of the initial
and final impulsive delta-v vector and the orbit transfer time are control variables. The objective or cost
function for this problem is the sum of the scalar magnitude of the two impulses given by
f = vi + v f
The SNOPT algorithm requires initial guesses (xg) for the six components of the delta-v vectors as well
as lower (xlwr) and upper (xupr) bounds on each component. It also requires lower (flow) and upper
(fupp) bounds on the objective function and any linear or nonlinear constraints.
The following is the MATLAB source code that sets up this information.
% initial guess for components of initial delta-v
xg(1) = dv1(1);
xg(2) = dv1(2);
xg(3) = dv1(3);
xg(4) = dv2(1);
xg(5) = dv2(2);
xg(6) = dv2(3);
xg(7) = ttransfer;
xg = xg';
% define lower and upper bounds for components of delta-v vectors (kilometers/second)
for i = 1:1:3
end
for i = 4:1:6
end
page 14
Orbital Mechanics with MATLAB
% bounds on objective function
flow(1) = 0.0e0;
fupp(1) = +Inf;
% semimajor axis ==> enforce final modified equinoctial "p" equality constraint
flow(2) = 0.0;
fupp(2) = 0.0;
% orbital eccentricity ==> enforce final modified equinoctial "sqrt(f^ + g^2)" equality
constraint
flow(3) = 0.0;
fupp(3) = 0.0;
% orbital inclination ==> enforce final modified equinoctial "sqrt(h^2 + k^2)" equality
constraint
flow(4) = 0.0;
fupp(4) = 0.0;
flow(5) = sin(oev_mo(4));
fupp(5) = sin(oev_mo(4));
flow(6) = cos(oev_mo(4));
fupp(6) = cos(oev_mo(4));
% raan constraints
flow(7) = sin(oev_mo(5));
fupp(7) = sin(oev_mo(5));
flow(8) = cos(oev_mo(5));
fupp(8) = cos(oev_mo(5));
flow = flow';
fupp = fupp';
snscreen on;
snscreen on;
[x, f, inform, xmul, fmul] = snopt(xg, xlwr, xupr, flow, fupp, 'tpbvp');
page 15
Orbital Mechanics with MATLAB
The tpbvp MATLAB function defines the current value of the objective function and the mission
constraints. The function that evaluates the Earth gravity model and the first order equations of motion
is called ceqm1. Here’s the source code for this function.
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ydot = [ y(4)
y(5)
y(6)
agrav(1)
agrav(2)
agrav(3)];
The tpbvp objective function starts with the two-body solution for the position and velocity vectors of
the maneuver on the initial orbit and the current value for the delta-v vector and numerically integrates
the first-order form of the orbital equations for the predicted transfer time. At the final time the software
adds the current value of the second delta-v vector to the velocity vector of the transfer orbit to
determine the velocity vector on the final mission orbit. This predicted state vector is used to compute
the current modified equinoctial orbital elements of the final mission orbit.
The following is the MATLAB source code for the tpbvp function.
function [f, g] = tpbvp(x)
% input
% output
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ritop(1) = rpo(1);
ritop(2) = rpo(2);
ritop(3) = rpo(3);
ttime = x(7);
rmop = rftop;
f = f';
% no derivatives
g = [];
This section summarizes the technique used to compute and enforce the nonlinear constraints that define
the final mission or “targeted” orbit. The semimajor axis constraint is simply
p p − pt = 0
f p2 + g 2p = f t 2 + g t2
g p hp − f p k p f p hp + g p k p
sin t = and cos t =
e p tan ( i p 2 ) e p tan ( i p 2 )
page 18
Orbital Mechanics with MATLAB
kp hp
sin t = and cos t =
tan ( i p 2 ) tan ( i p 2 )
In these equations, the t subscript implies “target” or desired values and the p subscript implies values
“predicted” by the optimization process. The targeted values are computed using the position and
velocity vectors of the mission orbit determined during the transfer orbit solution. Note that true
anomaly of the final or mission orbit is not enforced explicitly since it results from the numerical
integration for the predicted orbital transfer time.
Additional information about targeting with the modified equinoctial orbital elements can be found in
Appendix B.
Algorithm resources
(1) Walter Hohmann, Die Erreichbarkeit der Himmelskorper, Oldenbourgh, Munich, 1925. Also, The
Attainability of Heavenly Bodies, NASA Technical Translation F-44, 1960.
(4) R. H. Battin, An Introduction to the Mathematics and Methods of Astrodynamics, AIAA, 1987.
(5) D. F. Lawden, Optimal Trajectories for Space Navigation, Butterworths, London, 1963.
(6) John E. Prussing, “Simple Proof of the Global Optimality of the Hohmann Transfer”, AIAA Journal
of Guidance, Control and Dynamics, Vol. 15, No. 4.
(7) A. Miele, M. Ciarcia, and J. Mathwig, “Reflections on the Hohmann Transfer”, Journal of
Optimization Theory and Applications, Vol. 123, No. 2, pp. 233-253, November 2004.
page 19
Orbital Mechanics with MATLAB
Appendix A
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These direct
modified equinoctial equations exhibit no singularity for zero eccentricity and orbital inclinations equal
to 0 and 90 degrees. However, please note that two of the components are singular for an orbital
inclination of 180 degrees.
The classic reference for these elements is “A Set of Modified Equinoctial Orbital Elements”, M. J. H.
Walker, B. Ireland and J. Owens, Celestial Mechanics, Vol. 36, pp. 409-419, 1985.
The modified equinoctial elements are defined in terms of the classical orbital elements as follows:
p = a (1 − e 2 )
f = e cos ( + )
g = e sin ( + )
h = tan ( i 2 ) cos
k = tan ( i 2 ) sin
L = + +
where
p= semiparameter
a= semimajor axis
e= orbital eccentricity
i= orbital inclination
= argument of perigee
= right ascension of the ascending node
= true anomaly
L= true longitude
The classical orbital elements can be recovered from the modified equinoctial orbital elements with
semimajor axis
p
a=
1 − f 2 − g2
orbital eccentricity
e= f 2 + g2
page 20
Orbital Mechanics with MATLAB
orbital inclination
i = 2 tan −1 ( h2 + k 2 )
argument of periapsis
= tan −1 ( g , f ) − tan −1 ( k , h )
gh− f k
sin =
e tan ( i 2 )
f h+ gk
cos =
e tan ( i 2 )
= tan −1 ( k , h )
k
sin =
tan ( i 2 )
h
cos =
tan ( i 2 )
true anomaly
= L − ( + ) = L − tan −1 ( g , f )
1
sin = ( f sin L − g cos L )
e
1
cos = ( f cos L + g sin L )
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 .
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:
page 21
Orbital Mechanics with MATLAB
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.
e= f 2 + g2
i
tan = h 2 + k 2
2
gh− f k
g h − f k = e sin tan ( i 2 ) → sin =
e tan ( i 2 )
f h+ gk
f h + g k = e cos tan ( i 2 ) → cos =
e tan ( i 2 )
k
k = tan ( i 2 ) sin → sin =
tan ( i 2 )
page 22
Orbital Mechanics with MATLAB
h
h = tan ( i 2 ) cos → cos =
tan ( i 2 )
= L − ( + ) = L − tan −1 ( g , f )
In general,
1
sin = ( f sin L − g cos L )
e
1
cos = ( f cos L + g sin L )
e
Algorithm resources
“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, August 20-22, 1990.
page 23
Orbital Mechanics with MATLAB
Appendix B
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 font.
The system dynamics are defined by a vector system of ordinary differential equations called the state
equations that can be represented as follows
dy
y= = f y ( t ) , u ( t ) , p, t
dt
The initial dynamic variables at time t0 are defined by ψ0 ψ y ( t0 ) , u ( t0 ) , t0 and the terminal
conditions at the final time t f are defined by ψ f ψ y ( t f ) , u ( t f ) , t f . These conditions are called the
boundary values of the trajectory problem.
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
p l p ( t ) pu
The basic nonlinear programming problem (NLP) involves the determination of 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 24
Orbital Mechanics with MATLAB
Algorithm resources
(1) “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.
(2) “Optimal Finite-Thrust Spacecraft Trajectories Using Direct Transcription and Nonlinear
Programming”, Paul J. Enright, Ph.D. Thesis, University of Illinois at Urbana-Champaign, 1991.
(3) “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.
(4) “Improved Collocation Methods with Application to Direct Trajectory Optimization”, Albert L.
Herman, Ph.D. Thesis, University of Illinois at Urbana-Champaign, 1995.
(5) “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.
(6) Practical Optimization, Philip E. Gill, Walter Murray and Margaret H. Wright, Emerald Group
Publishing Limited, 1982.
page 25
Program rendezvous_ocs
This document is the user’s manual for a Fortran computer program called rendezvous_ocs that uses
the Sparse Optimization Suite 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 (www.siam.org).
The rendezvous_ocs software consists of Fortran routines that perform the following tasks:
set algorithm control parameters and call the transcription/optimal control subroutine
define the problem structure and perform initialization related to scaling, lower and upper
bounds, initial conditions, etc.
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_ocs software allows the user to select the type of initial guess, collocation method,
and other important algorithm control parameters.
page 1
Program execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
rendezvous_ocs leo2meo_10k.in
If the software is executed without an input file on the command line, the computer program will display
the following information screen and file name prompt:
************************************
* program rendezvous_ocs *
* *
* finite burn earth orbit *
* rendezvous optimization *
* *
* April 10, 2012 *
************************************
The user should respond to this prompt with the name of a compatible input data file including the
filename extension.
The screen output created by the rendezvous_ocs computer program can be re-directed to a text file
with a command line similar to
To create a DOS command window in Windows 7, select start, then All Programs, then Accessories
and finally Command Prompt. The size, font and other characteristics of the screen can be controlled
by the user with the c:\ icon in the upper left corner of the window. To log into the subdirectory created
during the installation of the Fortran executable and support files, type root:\ and then cd subdirectory
from the DOS command line where root is the name of the root directory, usually c:, and subdirectory is
the name of the subdirectory created by the user.
The rendezvous_ocs 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 italic 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.
page 2
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_ocs
** 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
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
page 3
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 *
***************
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
page 4
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.
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
---------------------------------
page 5
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
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
----------------------------
page 6
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 rendezvous_ocs software. Please consult Appendix C.
***************************************
* optimal control configuration options
***************************************
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_ocs
======================
rendezvous trajectory
---------------------------
beginning of maneuver phase
---------------------------
page 7
raan (deg) true anomaly (deg) arglat (deg) period (min)
0.200000000000D+02 0.300000000000D+02 0.130000000000D+03 0.118684693004D+03
---------------------
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
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
------------------------
page 8
0.550628877938D+02 0.467623343061D+02 0.246514821552D+03 0.165811819507D+03
------------------
end of coast phase
------------------
After the simulation is complete, the software will display a simulation summary similar to the
following;
SIMULATION SUMMARY
==================
The rendezvous_ocs computer program will also create an output file called orbits.csv. This file
contains the Earth-centered inertial position and velocity vectors of the park orbit and final mission
orbit. The rendezvous_ocs software package includes a MATLAB script called oplot.m that can be
used to create trajectory graphic displays using this 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 orbital transfer.
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.
page 9
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 10
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 next 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_ocs 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 11
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 12
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 .
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.
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_ocs simulation. A typical
scenario is
This techniques 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 13
(2) 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 mf
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 computation of inertial position and velocity vectors from the modified equinoctial orbital elements
in described in the Technical Discussion section later in this document.
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
page 14
Technical Discussion
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These equations
exhibit no singularity for zero eccentricity and orbital inclinations equal to 0 and 90 degrees. However,
two components of the orbital element set are singular for an orbital inclination of 180 degrees.
The relationship between direct modified equinoctial and classical orbital elements is defined by the
following definitions
p a 1 e2 f e cos g e sin
h tan i 2 cos k tan i 2 sin L
where
p semiparameter
a semimajor axis
e orbital eccentricity
i orbital inclination
argument of periapsis
right ascension of the ascending node
true anomaly
L true longitude
The relationship between classical and modified equinoctial orbital elements is summarized as follows:
semimajor axis
p
a
1 f 2 g2
orbital eccentricity
e f 2 g2
orbital inclination
i 2 tan 1 h2 k 2
argument of periapsis
tan 1 g f tan 1 k h
tan 1 k h
page 15
true anomaly
L L tan 1 g f
The mathematical relationships between an inertial state vector and the corresponding modified
equinoctial elements are summarized as follows:
position vector
r
s 2 cos L cos L 2hk sin L
2
r 2 sin L 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
2 h2 k 2
s2 1 h2 k 2
p
r
w
w 1 f cos L g sin L
The system of first-order modified equinoctial equations of orbital motion are given by
dp 2 p p
p t
dt w
df p g
f r sin L w 1 cos L f t h sin L k cos L n
dt w w
page 16
dg p f n
g r cos L w 1 sin L g t h sin L k cos L
dt w w
dh p s2n
h cos L
dt 2w
dk p s 2n
k sin L
dt 2w
2
dL w 1 p
L p h sin L k cos L n
dt p w
where r , t , n are non-two-body perturbations in the radial, tangential and normal directions,
respectively. The radial direction is along the radius vector of the spacecraft measured positive in a
direction away from the gravitational center, the tangential direction is perpendicular to this radius
vector measured positive in the direction of orbital motion, and the normal direction is positive along the
angular momentum vector of the spacecraft’s orbit.
The equations of orbital motion can also be expressed in vector form as follows:
dy
y A y P b
dt
where
2p p
0 0
w
w 1 cos L f
p p 1 p g
sin L h sin L k cos L
w w
w 1 sin L g
p p 1 p f
cos L h sin L k cos L
w w
A
p s 2 cos L
0 0
2w
2
p s sin L
0 0
2w
p 1
0 0 h sin L k cos L
w
and
T
w
2
b 0 0 0 0 0 p
p
page 17
The total non-two-body acceleration vector is given by P r ˆi r t ˆit n ˆin .
where ˆir , ˆit and ˆin are unit vectors in the radial, tangential and normal directions. These unit vectors can
be computed from the inertial position vector r and velocity vector v according to
ˆi r ˆi r v ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
For unperturbed two-body motion, P 0 and the first five equations of motion are simply
p f g h k 0 . Therefore, for two-body motion these modified equinoctial orbital elements are
constant. The true longitude is often called the fast variable of this orbital element set.
g g N ˆi N gr ˆir
where
ˆi
eˆ N eˆ TN ˆi r ˆi r
eˆ ˆi ˆi
N
eˆ N T
N r r
and
eˆ N 0 0 1
T
In these equations the north direction component is indicated by subscript N and the radial direction
component is subscript r.
cos
k
4
Re '
gN
r2
Pk J k
k 2 r
k
4
R
gr 2 k 1 e Pk J k
r k 2 r
where
gravitational constant
r geocentric distance of the spacecraft
Re equatorial radius of the Earth
geocentric latitude
J k zonal gravity coefficient
Pk k th order Legendre polynomial
page 18
For a zonal only Earth gravity model, the east component is identically zero.
a g QT g
where Q ˆi r ˆit ˆin .
J2 1
r
2r 4
1 h 2
k
2 2
J2
n
r4
1 h 2
k
2 2
Propulsive Thrust
T
aT uˆ T
m t
T
where T is the thrust magnitude, m is the spacecraft mass and uˆ T uTr uTt uTn is the unit pointing
thrust vector expressed in the spacecraft-centered radial-tangential-normal coordinate system. The
components of this unit vector are the control variables.
dm T
m
dt g I sp
where g is the acceleration of gravity and I sp is the specific impulse of the propulsive system. The
product g I sp is also called the exhaust velocity.
The spacecraft mass at any mission elapsed time t is given by m t msci mt where msci is the initial
mass of the spacecraft 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:
page 19
uTr sin uTt cos cos uTn cos sin
Finally, the pitch and yaw angles can be determined from the components of the unit thrust vector
according to
sin 1 uTr
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.
The rendezvous_ocs 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.
The relationship between a unit thrust vector in the ECI coordinate system uˆ TECI and the corresponding
unit thrust vector in the modified equinoctial system uˆ TMEE is given by
uˆ TECI ˆir ˆi
t
ˆi uˆ
n TMEE
where
ˆi r rˆ ˆi r v hˆ ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
rˆ
x hˆ rˆ x
hˆ x
uˆ TECI Q uˆ TMEE rˆy
hˆ rˆ y
hˆ y uˆ TMEE
rˆz hˆ rˆ z
hˆ z
In these equations, r is the inertial position vector and v is the inertial velocity vector of the spacecraft.
In the rendezvous_ocs computer program, the components of the inertial unit thrust vector are
defined in terms of the right ascension and the declination angle as follows:
page 20
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.
Algorithm Resources
“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.
“Optimal Interplanetary Orbit Transfers by Direct Transcription”, John T. Betts, The Journal of the
Astronautical Sciences, Vol. 42, No. 3, July-September 1994, pp. 247-268.
“Using Sparse Nonlinear Programming to Compute Low Thrust Orbit Transfers”, John T. Betts, The
Journal of the Astronautical Sciences, Vol. 41, No. 3, July-September 1993, pp. 349-371.
“Equinoctial Orbit Elements: Application to Optimal Transfer Problems”, Jean A. Kechichian, AIAA
90-2976, AIAA/AAS Astrodynamics Conference, Portland, OR, 20-22 August 1990.
“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 21
APPENDIX A
Contents of the Simulation Summary and CSV Files
This appendix is a brief summary of the information contained in the simulation summary screen
displays and the CSV data files produced by the rendezvous_ocs software.
mission elapsed time = simulation time since beginning of the mission (hh:mm:ss.sss)
arglat (deg) = argument of latitude in degrees. The argument of latitude is the sum of
true anomaly and argument of perigee.
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:
page 22
time (sec) = simulation time since ignition in seconds
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
page 23
rp2-z (er) = z-component of the final orbit position vector in earth radii
page 24
APPENDIX B
Example Flyby Trajectory Analysis
This appendix 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’s the initial part of the simulation definition input file for this example.
*************************************
** finite-burn earth-orbit rendezvous
** trajectory optimization
** program rendezvous_ocs
** leo2meo_flyby.in - April 10, 2012
*************************************
*****************************************
type of propulsive maneuver initial guess
*****************************************
1 = thrust duration
2 = delta-v magnitude
---------------------
2
-------------------
propulsive maneuver
-------------------
page 25
Here’s the program output for this example.
program rendezvous_ocs
======================
flyby trajectory
---------------------------
beginning of maneuver phase
---------------------------
---------------------
end of maneuver phase
---------------------
------------------------
beginning of coast phase
------------------------
page 26
sma (km) eccentricity inclination (deg) argper (deg)
0.898711286539D+04 0.235466089640D+00 0.350916114708D+02 0.903365417492D+02
------------------
end of coast phase
------------------
SIMULATION SUMMARY
==================
page 27
sma (km) eccentricity inclination (deg) argper (deg)
0.898867644662D+04 0.235360359825D+00 0.351008505110D+02 0.903369671277D+02
Here are plots of the behavior of the control variables and throttle setting for this example.
page 28
APPENDIX C
Typical Sparse Optimization Suite Configuration File
The rendezvous_ocs computer progran can read and use a user-defined configuration file. A
description of each element in this file can be found in the INSOCX routine in section 6.2, Subprograms
for Optimal Control, and the INSNLP routine in Section 2.2, Subprograms for Optimization of the
Sparse Optimization Suite user’s manual. Please note that the rendezvous_ocs software can read and
use a subset of the information in this file. For example, a subset configuration file might contain only
the following information;
ODETOL=0.1D-06
INSNLP:IOFLAG=5
SOCOUT=I4K4
The following is a typical “full version” configuration file created during the execution of the
rendezvous_ocs software.
AEQTOL=0.1000000000000000D-02
DTAUX=0.0000000000000000D+00
OBJCTL=0.1000000000000000D-04
ODETOL=0.1000000011686097D-06
PGDCTL=0.1000000000000000D-02
PRTMSD=0.1490116119384766D-07
PRTMXD=0.1000000000000000D-02
PRTSFD=0.1000000000000000D-04
QDRTOL=0.1000000000000000D-02
RESTOL=0.1000000000000000D-04
SMLTOL=0.1490116119384766D-10
TOLJSD=0.1000000000000000D-05
TOLM5A=0.1490116119384766D-07
TOLM5R=0.1490116119384766D-07
IDSCPH=0
IDSCND=0
IDSCVR=0
IDSCFN=0
IDTSFD=-1
IPFAUX=0
IPFSFD=0
IPRSFD=1
IPGRD=0
IPNLP=10
IPODE=0
IPUAUX=0
IPUOCP=6
IRSTRT=2
ISCALE=0
ISFHES=41
ISFINP=42
ISFRST=43
ISFSCL=44
ITSWCH=2
M5DTYP=0
MITODE=20
MTSWCH=-1
MXDATA=0
MXPARM=10
MXPCON=20
MXSTAT=20
MXTERM=50
NPTAUX=100
NSSWCH=-1
SOCOUT=A0B0C0D0E0F0G0H0I0J2K0L0M0N0O0P0Q0R0S1T0U0V0W0X0Y0Z0
SPRTHS=SPARSE
NLPALG=SNLPMN
NLPOMR=M
KEYDPL=.lueiLUE
page 29
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 30
Orbital Mechanics with MATLAB
This document describes an interactive MATLAB script (sep_ltot.m) which can be used to
determine the characteristics of continuous, low-thrust orbital transfer between two nonplanar
circular orbits using solar-electric propulsion (SEP). The numerical method used in this script 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 Jean. A. Kechichian, AIAA-92-4576-CP. The original Edelbaum algorithm is
described in “Propulsion Requirements for Controllable Satellites”, ARS Journal, August 1961,
pp. 1079-1089.
This algorithm is valid for total inclination changes ∆i given by 0 < ∆i < 114.6D . This algorithm
assumes that the thrust acceleration magnitude and spacecraft mass are both constant during the
orbit transfer. Earth shadow effects on the orbital transfer are ignored in this MATLAB script.
2η P
T=
gI sp
where η is the non-dimensional propulsive efficiency, P is the input power in kilowatts, g is the
acceleration of gravity in meters/second and I sp is the specific impulse in seconds. The quantity
gI sp is also called the exhaust velocity. Note that with these metric units the thrust will be in
milli-newtons. The thrust acceleration required in the equations to follow is equal to aT = T m
where m is the mass of the spacecraft.
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 circular orbit altitude is h0 , the final circular orbit
altitude is h f , and ∆i is the total orbital inclination change.
page 1
Orbital Mechanics with MATLAB
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 aT where aT is the thrust acceleration. The time
evolution of the out-of-plane yaw angle, speed and inclination change are given by the following
three expressions:
⎛ V0 sin β 0 ⎞
β ( t ) = tan −1 ⎜ ⎟
⎝ V0 cos β 0 − aT t ⎠
2 ⎡ −1 ⎛ aT t − V0 cos β 0 ⎞ π ⎤
∆i ( t ) = ⎢ tan ⎜ ⎟ + − β0 ⎥
π⎣ ⎝ V0 sin β 0 ⎠ 2 ⎦
Finally, the propellant mass m p required for the maneuver can be determined from the ideal
rocket equation as follows:
(
m p = mi 1 − e
−∆V gI sp
)
where mi is the initial spacecraft mass.
This MATLAB script will prompt you for the initial and final altitudes and orbital inclinations,
and the SEP propulsive characteristics. The following is a typical user interaction with this
script. It illustrates an orbital transfer from a low Earth orbit (LEO) with an inclination of 28.5°
to a geosynchronous Earth orbit (GSO) with an orbital inclination of 0°.
page 2
Orbital Mechanics with MATLAB
page 3
Orbital Mechanics with MATLAB
The software will also graphically display the time evolution of the thrust vector yaw angle,
spacecraft speed, inclination change and semimajor axis. The graphics for this example are as
follows:
SEP Low−thrust Orbit Transfer
70
60
Yaw Angle (deg)
50
40
30
20
0 20 40 60 80 100 120 140 160 180 200
30
25
Inclination (deg)
20
15
10
−5
0 20 40 60 80 100 120 140 160 180 200
Simulation Time (days)
7000
Velocity (m/s)
6000
5000
4000
3000
0 20 40 60 80 100 120 140 160 180 200
4
x 10
5
Semimajor Axis (kilometers)
0
0 20 40 60 80 100 120 140 160 180 200
Simulation Time (days)
page 4
Orbital Mechanics with MATLAB
This document describes an interactive MATLAB script named ss2d_opt.m that can be used to
analyze and optimize two-dimensional, heliocentric solar sail trajectories between the orbits of Earth and
Venus and between the Earth and Mars. In this script, the heliocentric planet orbits are assumed to be
circular and coplanar. The optimal steering angles for minimum transfer time are modeled as piecewise-
linear variations as suggested in “Near Minimum-Time Trajectories for Solar Sails”, by Michiel Otten
and Colin R. McInnes, AIAA Journal of Guidance, Control and Dynamics, Vol. 24, No. 3.
The optimization of these steering angles is performed using the SNOPT nonlinear programming (NLP)
algorithm. MATLAB versions of SNOPT for several computer platforms can be found at Professor
Philip Gill’s web site which is located at http://scicomp.ucsd.edu/~peg/. Professor Gill’s web site also
includes a PDF version of the SNOPT software user’s guide.
This MATLAB script solves the problem of transferring from the Earth’s orbit and arriving at the orbit
of either Venus or Mars with the proper distance and velocity. It does not attempt to solve the
rendezvous problem between the actual or ephemeris locations of each planet. The ss2d_opt script
provides both numerical and graphical information about the trajectory analysis.
To execute the ss2d_opt script, log into the directory containing the source code and type ss2d_opt
in the MATLAB command window.
The ss2d_opt MATLAB script is “data driven” by a simple text file created by the user. The script
will prompt the user for the name of the data file with a screen similar to
The file type defaults to names with a *.dat filename extension. However, you can select any
compatible ASCII data file by selecting the Files of type: field or by typing the name of the file directly
in the File name: field.
page 1
Orbital Mechanics with MATLAB
The following are the contents of a typical ss2d_opt compatible input data file. Please note the proper
units. User input is denoted in bold font.
***************************************
* input data file for ss2d_opt.m
* Earth-to-Mars trajectory - ideal sail
***************************************
The following is the numerical information output by the script for this example.
number of segments 25
page 2
Orbital Mechanics with MATLAB
The following is a plot of the optimal piecewise-linear steering angles during the transfer.
This plot illustrates the transfer trajectory between the Earth (blue) and Mars (red). The beginning and
end of the transfer is marked with a small o. Please note the scale for the x- and y-coordinates are
Astronomical Units.
page 3
Orbital Mechanics with MATLAB
The following two plots illustrate the behavior of the radial distance and polar angle during the mission.
The scale for the radial distance is Astronomical Units and the polar angle scale is degrees.
These next two plots illustrate the behavior of the radial and tangential or transverse velocities during
the transfer. The scale for both velocity plots is AU/day.
The ss2d_opt MATLAB script will create color Postscript disk files of these graphic images. These
images include a TIFF preview and are created with MATLAB code similar to
Technical Discussion
This trajectory optimization problem is modeled in a two-dimensional polar coordinate system. The
planets are assumed to be in circular and coplanar heliocentric orbits. No allowance is made for the
eccentricity or orbital inclination of the planetary orbits. Therefore, all orbital motion is confined to the
ecliptic plane.
page 4
Orbital Mechanics with MATLAB
The following diagram illustrates the geometry of this coordinate system along with the orientation of
the steering angle.
0
In this diagram, r is the heliocentric distance of the solar sail, is the polar angle, v is the transverse or
tangential component of the velocity, u is the radial component of the solar sail’s velocity and is the
steering or solar sail orientation angle. The steering angle is measured relative to the tangential direction
and is positive in the counter-clockwise direction.
Space travel by solar sail is made possible by solar radiation pressure (SRP). The solar radiation force
results from the impingement of photons on the reflective, Sun-facing surface of the solar sail.
2 2
r S r
P P 0
r c r
where
P 4.563 N m 2 = SRP at 1 AU
S0 1368 w m 2 at 1 AU
r distance at 1 AU
c speed of light
page 5
Orbital Mechanics with MATLAB
Dimensional analysis
To “streamline” the numerical calculations, the fundamental distance, velocity and time in the equations
of motion are normalized. In this MATLAB script, all heliocentric distances are normalized with
respect to the Astronomical Unit which is equal to 149597870.691 kilometers. Likewise, all velocity
values are normalized with respect to the “local circular velocity” at the heliocentric distance of the
Earth’s circular orbit, r0 . Therefore, the velocity unit is r0 since r0 is equal to 1 AU.
Finally, all time values are normalized with respect to r03 1 since again r0 is equal to 1
AU. In these equations, is the gravitational constant of the Sun. The corresponding value for this
astronomical constant is 0.0002959122082855912 AU 3 day 2 .
Equations of motion
The two-dimensional equations of motion in the polar coordinate system are given by
ru
v
r
v2 1 a
u 2 2 cos b1 b2 cos2 b3 cos
r r r
uv a
v cos sin b2 cos b3
r r2
where
r radial distance
polar angle
u radial velocity
The acceleration ratio is the ratio of the of the acceleration due to SRP and the acceleration due to the
point-mass gravity of the Sun, both evaluated at a distance of 1 AU. The SRP acceleration is also called
the characteristic acceleration which is defined to be the acceleration experienced by an ideal solar sail
oriented perpendicular to the direction of the Sun at a heliocentric distance of 1 AU.
page 6
Orbital Mechanics with MATLAB
Therefore, the acceleration ratio is equal to ac a where ac is the characteristic acceleration and a
is the solar acceleration. Values for the characteristic acceleration are typically 0.5 to 1.0 millimeters
per second2. The acceleration due to the Sun is equal to r 2 . If we convert the characteristic
acceleration in meters per second to normalized units according to
m 86400 s day
2
ac 2
s 1000 m km 149597870.691km AU
we will have characteristic acceleration in units of AU per day. Likewise, we can convert the solar
acceleration to the same unit according to
a
km 3
s2 km
2
86400 s day
2
r2 km2 s 149597870.691km AU
The sail optical properties are a function of the method and material used to manufacture the sail. For an
ideal solar sail, b1 b3 0 and b2 1 . According to “Solar sail trajectories with piecewise-constant
steering laws”, by Giovanni Mengali and Alessandro A. Quarta, Aerospace Science and Technology, 13
(2009) 431-441, the values for a solar sail with a highly reflective aluminum-coated front side and a
highly emissive chromium-coated back side are b1 0.0864, b2 0.8272 and b3 0.00545 .
Trajectory optimization
y t
z
u t
consisting of the state variables y and the control variables u for any time t. In this discussion vectors
are denoted in bold.
The system dynamics are defined by a vector system of ordinary differential equations called the state
equations that can be represented as follows:
dy
y f y t , u t , p, t
dt
The initial dynamic variables at time t0 are defined by ψ0 ψ y t0 , u t0 , t0 and the terminal
conditions at the final time t f are defined by ψ f ψ y t f , u t f , t f . These conditions are called the
boundary values of the trajectory problem. The problem may also be subject to path constraints of the
form g y t , u t , t 0 .
page 7
Orbital Mechanics with MATLAB
For any mission time t there are also simple bounds on the state variables
yl y t yu
the control variables
ul u t u u
The basic nonlinear programming problem (NLP is to determine the control vector history and problem
parameters that minimize the scalar performance index or objective function given by
J y t0 , t0 , y t f , t f , p
In this MATLAB script, the total transfer time is the objective function which we are attempting to
minimize. The control variables are the steering angles in each time segment. The final boundary
conditions or equality constraints are the heliocentric distance and velocities at the destination planet.
The initial conditions are fixed to the normalized values r0 1, u0 0, v0 1,0 0 . The final boundary
conditions are rf 0.723331 for Venus, rf 1.52368 for Mars, u f 0, v f 1 rf . The final polar
angle is not constrained since we are solving a minimum time orbital transfer problem.
The following is the MATLAB source code that initializes the optimization problem. It establishes the
proper initial and final conditions, calculates initial guesses for the steering angles and objective
function, and also sets lower and upper bounds on the final dynamic variables and objective function.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% initial and final times and states
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
xinitial(1) = 1.0d0;
xinitial(2) = 0.0d0;
xinitial(3) = 1.0d0;
xinitial(4) = 0.0;
% final conditions
if (iplanet == 1)
% Venus
xfinal(1) = 0.723331;
page 8
Orbital Mechanics with MATLAB
else
% Mars
xfinal(1) = 1.52368d0;
end
xfinal(2) = 0.0d0;
xg(2:nsegments + 1) = alpha_g;
xg = xg';
xlb(2:nsegments + 1) = alpha_lb;
xub(2:nsegments + 1) = alpha_ub;
% transpose bounds
xlb = xlb';
xub = xub';
flow(1) = 0.0d0;
fupp(1) = +Inf;
flow(2) = xfinal(1);
fupp(2) = xfinal(1);
flow(3) = xfinal(2);
fupp(3) = xfinal(2);
flow(4) = xfinal(3);
fupp(4) = xfinal(3);
page 9
Orbital Mechanics with MATLAB
flow = flow';
fupp = fupp';
The following is the call to the SNOPT algorithm to solve the problem.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% solve solar sail shooting problem
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
snscreen('on');
[x, f, inform, xmul, fmul] = snopt(xg, xlb, xub, flow, fupp, 'ss2d_shoot');
The following is the MATLAB source code for the function that performs the shooting calculations.
This function starts with the initial conditions and integrates the equations of motion along each
trajectory segment using the current values of the steering angles for each segment.
% inputs
% outputs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
neq = 4;
tetol = 1.0e-10;
ti = -deltat;
page 10
Orbital Mechanics with MATLAB
tof = x(1);
yi(1) = xinitial(1);
yi(2) = xinitial(2);
yi(3) = xinitial(3);
yi(4) = xinitial(4);
for i = 1:1:nsegments
ti = ti + deltat;
tf = ti + deltat;
yi = yfinal;
break;
end
end
f(1) = x(1);
f(2) = yfinal(1);
f(3) = yfinal(2);
f(4) = yfinal(3);
% transpose
page 11
Orbital Mechanics with MATLAB
f = f';
% no derivatives
g = [];
The following is the MATLAB function that evaluates the two-dimensional equations of motion.
% required by ss2d_opt.m
% input
% output
% ydot(1) = r-dot
% ydot(2) = u-dot
% ydot(3) = v-dot
% ydot(4) = theta-dot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
r = y(1);
u = y(2);
v = y(3);
% r-dot
ydot(1) = u;
% u-dot
% v-dot
page 12
Orbital Mechanics with MATLAB
% theta-dot
ydot(4) = v / r;
Algorithm resources
C. G. Sauer, Jr., “Optimum Solar Sail Interplanetary Trajectories”, AIAA Paper 76-0792, 1976.
Kirill Simon and Yuri Zakharov, “Optimization of Interplanetary Trajectories with Solar Sail”, IAF-95-
A.2.08.
Bernd Dachwald, “Optimal Solar Sail Trajectories for Mission to the Outer Solar System”, AIAA
Journal of Guidance, Control and Dynamics, Vol. 28, No. 1, 2005, pp. 173-177.
Giovanni Mengali and Alessandro A. Quarta, “Semi-Analytical Method for the Analysis of Solar Sail
Heliocentric Orbit Raising”, AIAA Journal of Guidance, Control, and Dynamics, Vol. 35, No. 1,
January-February 2012.
Bernd Dachwald and Malcolm Macdonald, “Parametric Model and Optimal Control of Solar Sails with
Optical Degradation”, AIAA Journal of Guidance, Control, and Dynamics, Vol. 29, No. 5, September-
October 2006.
Guido Colasurdo and Lorenzo Casalino, “Optimal Control for Interplanetary Trajectories with Nonideal
Solar Sail”, AIAA Journal of Spacecraft and Rockets, Vol. 40, No. 2, March-April 2003.
Victoria L. Coverstone and John E. Prussing, “Technique for Escape from Geosynchronous Transfer
Orbit Using a Solar Sail, AIAA Journal of Guidance, Control, and Dynamics, Vol. 26, No. 4, July-
August 2003.
page 13
Orbital Mechanics with MATLAB
Appendix A
Additional Script Examples
This appendix summarizes input data files and script results for two additional examples. The first
example is an Earth-to-Venus transfer with an ideal solar sail and the second example illustrates an
Earth-to-Mars mission with a non-ideal solar sail.
For this example, the steering angles are negative since they are bounded by 90 0 . These
bounds force the script to fly an interplanetary transfer to an inner planet.
****************************************
* input data file for ss2d_opt.m
* Earth-to-Venus trajectory - ideal sail
****************************************
number of segments 35
page 14
Orbital Mechanics with MATLAB
initial state vector
page 15
Orbital Mechanics with MATLAB
Earth-to-Mars with optical solar sail
This example uses 50 trajectory segments and models a typical non-ideal solar sail.
*******************************************
* input data file for ss2d_opt.m
* Earth-to-Mars trajectory – non-ideal sail
*******************************************
number of segments 50
page 16
Orbital Mechanics with MATLAB
page 17
Orbital Mechanics with MATLAB
This document describes a MATLAB script called bielliptic.m that can be used to determine the
characteristics of a time-free, three impulse bi-elliptic transfer between two coplanar circular orbits. The
impulsive V assumption means that the velocity, but not the position, of the space vehicle is changed
instantaneously. This script also creates graphic displays of the three-dimensional orbits and transfer
trajectory, and the evolution of the primer vector and its derivative.
For the coplanar bi-elliptic transfer, all three velocity impulses are confined to the orbital planes of the
initial and final orbits. The first impulse creates an elliptical transfer orbit with a perigee altitude equal
to the altitude of the initial circular orbit and an apogee altitude well beyond the altitude of the final
orbit. The second impulse creates a second transfer ellipse with an apogee radius equal to that of the
first transfer ellipse and a perigee radius identical to the value of the final orbit radius.
The third impulsive maneuver circularizes the second transfer orbit at perigee of the transfer orbit. The
first two impulses are posigrade which means that they are in the direction of orbital motion. The third
impulse is retrograde since it must slow down the spacecraft for insertion into the final mission orbit.
For final to initial radius ratios greater than 15.58, the bi-elliptic transfer requires less total propulsive
energy than the Hohmann transfer. It can also be shown that an outer (intermediate apogee altitude
greater than the final orbit altitude) bi-elliptic transfer is more efficient than an inner transfer.
The following is a typical user interaction with this script. User inputs to the script are in bold font.
Please note that the script will either accept a user-defined intermediate altitude or calculate the
optimum value using Brent’s root-finding algorithm.
<1> optimal
<2> user-defined
selection (1 or 2)
? 2
page 1
Orbital Mechanics with MATLAB
The bielliptic MATLAB script will also create graphic displays of the three-dimensional initial,
final and transfer trajectory and the evolution of the primer vector and its derivative. The first graphic
image is a three-dimensional display of the solution. In this image, the initial orbit is red, the final orbit
is green, and the transfer trajectory is blue. 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
interactive graphic features of MATLAB allow the user to rotate and zoom the display. These
capabilities allow the user to interactively find the best viewpoint as well as verify basic three-
dimensional geometry of the orbital transfer.
These next two plots illustrate the evolution of the primer vector and its derivative as a function of time,
in days, since the first impulse. The location of each impulse is marked with a small red circle.
The bielliptic MATLAB script will also create color Postscript disk files of these graphic images.
Each image includes a TIFF preview and is created with MATLAB source code similar to
print -depsc -tiff -r300 bielliptic1.eps
page 3
Orbital Mechanics with MATLAB
For comparison, here are the characteristics of this mission using a two impulse Hohmann transfer.
Since the radius ratio rf ri for this example is less than 15.58, the Hohmann orbit transfer is more
efficient, in terms of the total V required, than the bi-elliptic transfer.
The following is the script output for this same example where we allow the software to compute the
optimal intermediate altitude. Since the radius ratio is less than 15.58, the script finds a two impulse
Hohmann transfer. For this situation, the apogee altitude of the intermediate transfer ellipses is equal to
the altitude of the final circular orbit.
page 4
Orbital Mechanics with MATLAB
page 5
Orbital Mechanics with MATLAB
Here’s the script output and primer plots for an orbit transfer example where we allow the software to
compute the optimal apogee altitude of the two intermediate transfer ellipses. For this example, the
altitude of the initial circular orbit is 300 kilometers and the altitude of the final circular orbit is 100,000
kilometers rf ri 15.929 .
Here’s the Hohmann transfer solution for this example. Since the radius ratio for this example is greater
than 15.58, the bi-elliptic orbit transfer is more efficient than the Hohmann transfer.
page 7
Orbital Mechanics with MATLAB
Technical Discussion
The following diagram (not to scale) illustrates the geometry of the coplanar bi-elliptic orbit transfer. In
this figure, ri is the geocentric radius of the initial circular orbit, ra is the apogee radius of the two
transfer ellipses, and rf is the radius of the final circular orbit. The locations and directions of the first,
second and third impulsive maneuvers are labeled V1 , V2 and V3 , respectively.
V2
ra
rf
ri
V1
V3
The total impulsive delta-v for a bi-elliptic orbital transfer is a function of the initial, intermediate and
final orbital altitudes. The relationship between geocentric radius and orbital altitude is as follows:
ri re hi ra re ha rf re h f
page 8
Orbital Mechanics with MATLAB
where ri is the geocentric radius of the initial circular park orbit, ra is the radius at the intermediate
impulse, and rf is the radius of the final circular mission orbit. In these equations, hi , ha and h f are the
corresponding altitudes and re is the radius of the Earth.
and is simply the difference between the speed on the initial circular orbit and the perigee speed of the
first transfer ellipse. The scalar magnitude of the second impulse is
which is the difference between the speed at apogee of the first transfer ellipse and the apogee speed of
the second transfer ellipse.
V3 v f v2 p
which is the speed difference between the final circular orbit and the speed at perigee of the second
transfer ellipse.
The orbital speeds required for these computations can be determined from
vi vf
ri rf
2 2
v p1 va1
ri a1 ra a1
2 2
v p2 va2
rf a2 ra a2
In these equations, is the gravitational constant of the central body, and the semimajor axis of each
transfer ellipse is computed from
r r r r
a1 i a a2 a f
2 2
The transfer time from the first impulse to the final impulse is equal to the sum of the half orbital periods
of the two transfer ellipses according to
a13 a23
page 9
Orbital Mechanics with MATLAB
Software implementation
For the optimal intermediate altitude script option, the software calls the built-in bounded
minimization MATLAB algorithm to solve for the intermediate apogee altitude that minimizes the total
delta-v required for the mission.
where befunc is the objective function for this problem. In the argument list, xmin and xmax are the
lower and upper bounds for the intermediate radius, x is the solved-for intermediate altitude, and fx is
the corresponding total delta-v. In this script, they are equal to the radius of the final orbit and one
hundred times this radius as follows
xmin = rf;
The following is the MATLAB source code for the objective function.
% required by bielliptic.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global mu ri rf
vi = sqrt(mu / ri);
page 10
Orbital Mechanics with MATLAB
vf = sqrt(mu / rf);
The classic bi-elliptic technical paper is “The Bi-elliptical Transfer Between Co-planar Circular Orbits”
by Rudolf F. Hoelker and Robert Silber which was published in Advances in Ballistic Missiles and
Space Technology, Volume 3, Pergamon, Oxford, 1961.
An excellent document that describes impulsive orbital transfers is “Optimal Impulsive Maneuvers in
Orbital Transfers” by Silvano Sgubini and Paolo Teofilatto. A PDF version of this document can be
downloaded from http://naca.central.cranfield.ac.uk/dcsss/2002/E05a_sgubini.pdf.
This section summarizes the primer vector analysis included with this MATLAB script. The term
primer vector was invented by Derek F. Lawden and represents the adjoint vector for velocity. A
technical discussion about primer theory can be found in Lawden’s classic text, Optimal Trajectories for
Space Navigation, Butterworths, London, 1963. Another excellent resource is “Primer Vector Theory
and Applications”, Donald J. Jezewski, NASA TR R-454, November 1975, along with “Optimal, Multi-
burn, Space Trajectories”, also by Jezewski.
As shown by Lawden, the following four necessary conditions must be satisfied in order for an
impulsive orbital transfer to be locally optimal:
(1) the primer vector and its first derivative are everywhere continuous
(2) whenever a velocity impulse occurs, the primer is a unit vector aligned with the impulse and
has unit magnitude p pˆ uˆ T and p 1
(3) the magnitude of the primer vector may not exceed unity on a coasting arc p p 1
page 11
Orbital Mechanics with MATLAB
(4) at all interior impulses (not at the initial or final times) p p 0 ; therefore, d p dt 0 at the
intermediate impulses
Furthermore, the scalar magnitudes of the primer vector derivative at the initial and final impulses
provide information about how to improve the nominal transfer trajectory by changing the endpoint
times and/or moving the impulse times. These four cases for non-zero slopes are summarized as
follows;
If p0 0 and p f 0 perform an initial coast before the first impulse and add a final coast
after the second impulse
If p0 0 and p f 0 perform an initial coast before the first impulse and move the second
impulse to a later time
If p0 0 and p f 0 perform the first impulse at an earlier time and add a final coast after the
second impulse
If p0 0 and p f 0 perform the first impulse at an earlier time and move the second
impulse to a later time
The primer vector analysis of a two impulse orbital transfer involves the following steps.
r r
r v0 11 12 rr rv
t , t0
0
v v 21 22 vr vv
r v0
0
where
x / x0 x / y0 x / z0
r
11 y / x0 y / y0 y / z0
r0 z / x z / y0 z / z0
0
and so forth.
The value of the primer vector at any time t along a two body trajectory is given by
p t 11 t, t0 p0 12 t , t0 p0
p t 21 t, t0 p0 22 t, t0 p0
page 12
Orbital Mechanics with MATLAB
p p0
t , t0
p p0
The primer vector boundary conditions at the initial and final impulses are as follows:
V0 V f
p t0 p0 p t f p f
V0 V f
These two conditions illustrate that at the locations of velocity impulses, the primer vector is a unit
vector in the direction of the corresponding impulse.
p t0 p0 12
1
t f , t0 p f 11 t f , t0 p0
provided the 12 sub-matrix is non-singular.
The scalar magnitude of the derivative of the primer vector can be determined from
d p d pp
p p
2
dt dt p
As noted by D. J. Jezewski, the primer vector is sometimes called the Lagrange multiplier, costate vector
or perhaps an adjoint variable.
page 13
Program oneburn_ocs
This document is the user’s manual for a Fortran computer program called oneburn_ocs that uses the
Sparse Optimization Suite 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 (www.siam.org).
The oneburn_ocs software consists of Fortran routines that perform the following tasks:
set algorithm control parameters and call the transcription/optimal control subroutine
define the problem structure and perform initialization related to scaling, lower and upper
bounds, initial conditions, etc.
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_ocs software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 1
Program Execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
oneburn_ocs leo2gto.in
If the software is executed without an input file on the command line, the computer program will display
the following information screen and file name prompt:
*************************************'
* program oneburn_ocs *'
* *'
* single maneuver, finite-burn *'
* trajectory optimization *'
* *'
* February 20, 2012 *'
*************************************'
The user should respond to this prompt with the name of a compatible input data file including the
filename extension.
The screen output created by the oneburn_ocs computer program can be re-directed to a text file with
a command line similar to
To create a DOS command window in Windows 7, select start, then All Programs, then Accessories
and finally Command Prompt. The size, font and other characteristics of the screen can be controlled
by the user with the c:\ icon in the upper left corner of the window. To log into the subdirectory created
during the installation of the Fortran executable and support files, type root:\ and then cd subdirectory
from the DOS command line where root is the name of the root directory, usually c:, and subdirectory is
the name of the subdirectory created by the user.
The oneburn_ocs software is “data-driven” by a user-created text file. This text file should be simple
ASCII format with no special characters.
The following is a typical input file used by this computer program. In the following discussion the
actual input file contents are in courier font and all explanations are in times italic font. This example
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).
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
page 2
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-orbit trajectory optimization
** single finite-burn maneuver with final coast
** program oneburn_ocs
** leo2gto.in – February 20, 2012
************************************************
The first 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)
10000.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
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 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.
**************
coast maneuver
**************
page 3
initial guess for coast duration (seconds)
20.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 *
*****************
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
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 4
right ascension of the ascending node (degrees)
0.0d0
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
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 *
******************************
page 5
This next input specifies the type of solution data file to create.
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = OCS-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
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
page 6
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.
****************************
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 oneburn_ocs software. Please consult Appendix C.
***************************************
* optimal control configuration options
***************************************
page 7
name of optimal control configuration file
leo2gto_config.txt
The following is the optimal control solution for this example. This example 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). Appendix A contains a brief summary of this information.
program oneburn_ocs
===================
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
page 8
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 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 9
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.
These 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.
page 10
The following is a graphics display of the initial (red trace) and final orbits (blue trace).
page 11
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 OC-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 oneburn_ocs 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 12
In additional to the user-defined solution output file, the oneburn_ocs program will create two
additional comma-separated-variable data files named orbits.csv and maneuver.csv. The first file
contains the position vectors of the initial and final orbits normalized with respect to the radius of the
Earth. The second data file contains the information described in Appendix A starting at ignition and
ending at burnout of the propulsive maneuver.
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
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 of these 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 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
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
page 13
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_ocs simulation. A typical scenario is
This techniques 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 part of the user’s manual provides details about the software implementation within
oneburn_ocs. 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
If the initial orbit is circular, the software enforces the following two equality constraints:
f 0 and g 0
f 2 g2 e
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 mf
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 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:
page 15
i
h 2 k 2 tan
2
where i is the 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 as follows:
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.
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
page 16
1.1 ur 1.1
1.1 ut 1.1
1.1 un 1.1
Technical Discussion
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These equations
exhibit no singularity for zero eccentricity and orbital inclinations equal to 0 and 90 degrees. However,
two components of the orbital element set are singular for an orbital inclination of 180 degrees.
The relationship between direct modified equinoctial and classical orbital elements is defined by the
following definitions
p a 1 e2 f e cos g e sin
h tan i 2 cos k tan i 2 sin L
where
p semiparameter
a semimajor axis
e orbital eccentricity
i orbital inclination
argument of periapsis
right ascension of the ascending node
true anomaly
L true longitude
The relationship between classical and modified equinoctial orbital elements is summarized as follows:
p
semimajor axis a
1 f 2 g2
orbital eccentricity e f 2 g2
page 17
The mathematical relationships between an inertial state vector and the corresponding modified
equinoctial elements are summarized as follows:
position vector
r
s 2 cos L cos L 2hk sin L
2
r 2 sin L sin L 2hk cos L
r 2
s
2r
h sin L k cos L
s2
velocity vector
1
2 sin L 2 sin L 2hk cos L g 2 f h k 2 g
s p
1
v 2 cos L 2
cos L 2 hk sin L f 2 gh k 2
f
s p
2
h cos L k sin L f h gk
s2 p
where
2 h2 k 2 s2 1 h2 k 2
p
r w 1 f cos L g sin L
w
The system of first-order modified equinoctial equations of orbital motion are given by
dp 2 p p
p t
dt w
df p t gn
f sin L
w 1 cos L f
h sin L k cos L
w
r
dt w
dg p f n
g r cos L w 1 sin L g t h sin L k cos L
dt w w
dh p s2n
h cos L
dt 2w
dk p s 2n
k sin L
dt 2w
page 18
2
dL w 1 p
L p h sin L k cos L n
dt p w
where r , t , n are non-two-body perturbations in the radial, tangential and normal directions,
respectively. The radial direction is along the radius vector of the spacecraft measured positive in a
direction away from the gravitational center, the tangential direction is perpendicular to this radius
vector measured positive in the direction of orbital motion, and the normal direction is positive along the
angular momentum vector of the spacecraft’s orbit.
The equations of orbital motion can also be expressed in vector form as follows:
dy
y A y P b
dt
where
2p p
0 0
w
w 1 cos L f
p p 1 p g
sin L h sin L k cos L
w w
w 1 sin L g
p p 1 p f
cos L h sin L k cos L
w w
A
2
0 0
p s cos L
2w
p s 2 sin L
0 0
2w
p 1
0 0 h sin L k cos L
w
and
2 T
w
b 0 0 0 0 0 p
p
P r ˆi r t ˆit n ˆin
where ˆir , ˆit and ˆin are unit vectors in the radial, tangential and normal directions. These unit vectors can
be computed from the inertial position vector r and velocity vector v according to
page 19
ˆi r ˆi r v ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
For unperturbed two-body motion, P 0 and the first five equations of motion are simply
p f g h k 0 . Therefore, for two-body motion these modified equinoctial orbital elements are
constant. The true longitude is often called the fast variable of this orbital element set.
g g N ˆi N gr ˆ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
4
Re '
gN
r2
Pk J k
k 2 r
k
4
R
gr 2 k 1 e Pk J k
r k 2 r
where
gravitational constant
r geocentric distance of the spacecraft
Re equatorial radius of the Earth
geocentric latitude
J k zonal gravity coefficient
Pk k th order Legendre polynomial
For a zonal only Earth gravity model, the east component is identically zero.
page 20
For J 2 effects only, the three components are as follows:
J2
n
r4
1 h 2
k
2 2
Propulsive Thrust
T
aT uˆ T
m t
T
where T is the thrust magnitude, m is the spacecraft mass and uˆ T uTr uTt uTn is the unit pointing
thrust vector expressed in the spacecraft-centered radial-tangential-normal coordinate system. The
components of this unit vector are the control variables.
dm T
m
dt g I sp
where g is the acceleration of gravity and I sp is the specific impulse of the propulsive system. The
product g I sp is also called the exhaust velocity.
The spacecraft mass at any mission elapsed time t is given by m t msci mt where msci is the initial
mass of the spacecraft 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
page 21
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.
The oneburn_ocs 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.
The relationship between a unit thrust vector in the ECI coordinate system uˆ TECI and the corresponding
unit thrust vector in the modified equinoctial system uˆ TMEE is given by
uˆ TECI ˆir ˆi
t
ˆi uˆ
n TMEE
where
ˆi r rˆ ˆi r v hˆ ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
rˆ
x hˆ rˆ x
hˆ x
uˆ TECI Q uˆ TMEE rˆy
hˆ rˆ y
hˆ y uˆ TMEE
rˆz hˆ rˆ z
hˆ z
In these equations, r is the inertial position vector and v is the inertial velocity vector of the spacecraft.
In the oneburn_ocs computer program, the components of the inertial unit thrust vector are defined in
terms of the right ascension and the declination angle as follows:
Finally, the right ascension and declination angles can be determined from the components of the ECI
unit thrust vector according to
tan 1 uT ECI y
, uTECI
x
sin 1 uT ECI z
where the calculation for right ascension is a four quadrant inverse tangent operation.
page 22
Algorithm Resources
“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.
“Survey of Numerical Methods for Trajectory Optimization”, John T. Betts, AIAA Journal of Guidance,
Control and Dynamics, Vol. 21, No. 2, March-April 1998.
“Optimal Interplanetary Orbit Transfers by Direct Transcription”, John T. Betts, The Journal of the
Astronautical Sciences, Vol. 42, No. 3, July-September 1994, pp. 247-268.
“Using Sparse Nonlinear Programming to Compute Low Thrust Orbit Transfers”, John T. Betts, The
Journal of the Astronautical Sciences, Vol. 41, No. 3, July-September 1993, pp. 349-371.
“Equinoctial Orbit Elements: Application to Optimal Transfer Problems”, Jean A. Kechichian, AIAA
90-2976, AIAA/AAS Astrodynamics Conference, Portland, OR, 20-22 August 1990.
“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.
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.
page 23
APPENDIX A
Contents of the Simulation Summary and CSV Files
This appendix is a brief summary of the information contained in the simulation summary screen
displays and the CSV data files produced by the oneburn_ocs 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 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 subroutine and
contains the following information:
page 24
time (min) = simulation time since ignition in minutes
rasc (deg) = inertial right ascension 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
page 26
APPENDIX B
Example LEO-to-LEO Orbit Transfer
This appendix illustrates the orbit transfer for a 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_ocs
** 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 *
***************
******************************
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 *
*************************
page 28
1 = numerical integration
2 = binary data file
---------------------
1
******************************
* binary restart file option *
******************************
**********************************************
* type of comma-delimited solution data file *
**********************************************
1 = OCS-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
page 29
**********************
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 graphics display for this example. The initial orbit trace is blue, the final orbit is
red and the transfer maneuver trace is black.
page 30
Here are the numerical results created by the oneburn_ocs program for this example.
program oneburn_ocs
===================
------------------------
beginning of finite burn
------------------------
------------------
end of finite burn
------------------
---------------------------
beginning of coast maneuver
---------------------------
page 31
raan (deg) true anomaly (deg) arglat (deg) period (min)
0.200014039317D+02 0.513704955945D+02 0.703324185873D+01 0.915636904293D+02
---------------------
end of coast maneuver
---------------------
========================================
verification of optimal control solution
========================================
------------------
end of finite burn
------------------
page 32
final mission orbit
-------------------
page 33
APPENDIX C
Typical Sparse Optimization Suite Configuration File
The oneburn_ocs computer progran can read and use a user-defined configuration file. A description
of each element in this file can be found in the INSOCX routine in section 6.2, Subprograms for
Optimal Control, and the INSNLP routine in Section 2.2, Subprograms for Optimization of the Sparse
Optimization Suite user’s manual. Please note that the oneburn_ocs software can read and use a
subset of the information in this file. For example, a subset configuration file might contain only the
following information;
ODETOL=0.1D-06
INSNLP:IOFLAG=5
SOCOUT=I4K4
The following is a typical “full version” configuration file created during the execution of the
oneburn_ocs software.
AEQTOL=0.1000000000000000D-02
DTAUX=0.0000000000000000D+00
OBJCTL=0.1000000000000000D-04
ODETOL=0.1000000011686097D-06
PGDCTL=0.1000000000000000D-02
PRTMSD=0.1490116119384766D-07
PRTMXD=0.1000000000000000D-02
PRTSFD=0.1000000000000000D-04
QDRTOL=0.1000000000000000D-02
RESTOL=0.1000000000000000D-04
SMLTOL=0.1490116119384766D-10
TOLJSD=0.1000000000000000D-05
TOLM5A=0.1490116119384766D-07
TOLM5R=0.1490116119384766D-07
IDSCPH=0
IDSCND=0
IDSCVR=0
IDSCFN=0
IDTSFD=-1
IPFAUX=0
IPFSFD=0
IPRSFD=1
IPGRD=0
IPNLP=10
IPODE=0
IPUAUX=0
IPUOCP=6
IRSTRT=2
ISCALE=0
ISFHES=41
ISFINP=42
ISFRST=43
ISFSCL=44
ITSWCH=2
M5DTYP=0
MITODE=20
MTSWCH=-1
MXDATA=0
MXPARM=10
MXPCON=20
MXSTAT=20
MXTERM=50
NPTAUX=100
NSSWCH=-1
SOCOUT=A0B0C0D0E0F0G0H0I0J2K0L0M0N0O0P0Q0R0S1T0U0V0W0X0Y0Z0
SPRTHS=SPARSE
NLPALG=SNLPMN
NLPOMR=M
KEYDPL=.lueiLUE
page 34
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 35
Program twoburn_ocs
This document is the user’s manual for a Fortran computer program called twoburn_ocs that uses the
Sparse Optimization Suite 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:
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 (www.siam.org).
The twoburn_ocs software consists of Fortran routines that perform the following tasks:
set algorithm control parameters and call the transcription/optimal control subroutine
define the problem structure and perform initialization related to scaling, lower and upper
bounds, initial conditions, etc.
compute the right-hand-side differential equations
evaluate any point and path constraints
display the optimal solution results and create an output file
The Sparse Optimization Suite will use this information to automatically transcribe the user’s optimal
control problem and perform the optimization using a sparse nonlinear programming (NLP) method.
The twoburn_ocs software allows the user to select the type of initial guess, collocation method, and
other important algorithm control parameters.
page 1
Program execution
An input file created by the user can be run from the command line or a simple batch file with a
statement similar to the following:
twoburn_ocs leo2geo.in
If the software is executed without an input file on the command line, the computer program will display
the following information screen and file name prompt:
***********************************
* program twoburn_ocs *
* *
* two-maneuver, finite-burn *
* trajectory optimization *
* *
* April 15, 2012 *
***********************************
The user should respond to this prompt with the name of a compatible input data file including the
filename extension.
The screen output created by the twoburn_ocs computer program can be re-directed to a text file with
a command line similar to
To create a DOS command window in Windows 7, select start, then All Programs, then Accessories
and finally Command Prompt. The size, font and other characteristics of the screen can be controlled
by the user with the c:\ icon in the upper left corner of the window. To log into the subdirectory created
during the installation of the Fortran executable and support files, type root:\ and then cd subdirectory
from the DOS command line where root is the name of the root directory, usually c:, and subdirectory is
the name of the subdirectory created by the user.
The twoburn_ocs 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 italic 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.
page 2
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_ocs
** 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
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 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. 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 *
***************
page 4
orbital eccentricity (non-dimensional)
0.0
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
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
page 5
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 *
********************************
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
page 6
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.
****************************
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 7
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 rendezvous_ocs software. Please consult Appendix C.
***************************************
* optimal control configuration options
***************************************
The following is the twoburn_ocs solution for this example. The output includes the time and orbital
characteristics at the beginning and end of each mission phase.
program twoburn_ocs
===================
--------------------------------------
beginning of first propulsive maneuver
--------------------------------------
--------------------------------
end of first propulsive maneuver
--------------------------------
page 8
sma (km) eccentricity inclination (deg) argper (deg)
0.244711724047D+05 0.725948454612D+00 0.264721389995D+02 0.179895113440D+03
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.
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 9
vx (kps) vy (kps) vz (kps) vmag (kps)
-.137738985018D+01 -.487203868378D+00 0.715777169774D+00 0.162693188718D+01
---------------------------------------
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.
After the simulation is complete, the software will display a simulation summary similar to the
following;
SIMULATION SUMMARY
------------------
page 10
initial spacecraft mass 15000.0000000000 kilograms
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.
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.
page 11
The following two plots illustrate the evolution of the geocentric radius and velocity during the each
finite-burn maneuver.
All of these plots were created using the Grapher scientific plotting program (www.goldensoftware.com)
and the contents of the simulation summary data file described in Appendix A.
The twoburn_ocs 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_ocs software package includes a MATLAB script
called 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 12
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_ocs 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:
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 of these inputs should be in seconds. If the twoburn_ocs computer
program cannot find a feasible solution, try increasing the guess for thrust duration.
page 14
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
h 2 k 2 tan
2
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:
page 15
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 mf
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:
i
h 2 k 2 tan
2
where i is the mission orbit inclination.
page 16
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 as follows:
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.
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:
page 17
1.1 ur 1.1
1.1 ut 1.1
1.1 un 1.1
Technical Discussion
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These equations
exhibit no singularity for zero eccentricity and orbital inclinations equal to 0 and 90 degrees. However,
two components of the orbital element set are singular for an orbital inclination of 180 degrees.
The relationship between direct modified equinoctial and classical orbital elements is defined by the
following definitions
p a 1 e2 f e cos g e sin
h tan i 2 cos k tan i 2 sin L
where
p semiparameter
a semimajor axis
e orbital eccentricity
i orbital inclination
argument of periapsis
right ascension of the ascending node
true anomaly
L true longitude
The relationship between classical and modified equinoctial orbital elements is summarized as follows:
p
semimajor axis a
1 f 2 g2
orbital eccentricity e f 2 g2
page 18
The mathematical relationships between an inertial state vector and the corresponding modified
equinoctial elements are summarized as follows:
position vector
r
s 2 cos L cos L 2hk sin L
2
r 2 sin L sin L 2hk cos L
r 2
s
2r
h sin L k cos L
s2
velocity vector
1
2 sin L 2 sin L 2hk cos L g 2 f h k 2 g
s p
1
v 2 cos L 2
cos L 2 hk sin L f 2 gh k 2
f
s p
2
h cos L k sin L f h gk
s2 p
where
2 h2 k 2 s2 1 h2 k 2
p
r w 1 f cos L g sin L
w
The system of first-order modified equinoctial equations of orbital motion are given by
dp 2 p p
p t
dt w
df p t gn
f sin L
w 1 cos L f
h sin L k cos L
dt r
w w
dg p f n
g r cos L w 1 sin L g t h sin L k cos L
dt w w
dh p s2n
h cos L
dt 2w
dk p s 2n
k sin L
dt 2w
page 19
2
dL w 1 p
L p h sin L k cos L n
dt p w
where r , t , n are non-two-body perturbations in the radial, tangential and normal directions,
respectively. The radial direction is along the radius vector of the spacecraft measured positive in a
direction away from the gravitational center, the tangential direction is perpendicular to this radius
vector measured positive in the direction of orbital motion, and the normal direction is positive along the
angular momentum vector of the spacecraft’s orbit.
The equations of orbital motion can also be expressed in vector form as follows:
dy
y A y P b
dt
where
2p p
0 0
w
w 1 cos L f
p p 1 p g
sin L h sin L k cos L
w w
w 1 sin L g
p p 1 p f
cos L h sin L k cos L
w w
A
2
0 0
p s cos L
2w
p s 2 sin L
0 0
2w
p 1
0 0 h sin L k cos L
w
and
2 T
w
b 0 0 0 0 0 p
p
P r ˆi r t ˆit n ˆin
where ˆir , ˆit and ˆin are unit vectors in the radial, tangential and normal directions. These unit vectors can
be computed from the inertial position vector r and velocity vector v according to
page 20
ˆi r ˆi r v ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
For unperturbed two-body motion, P 0 and the first five equations of motion are simply
p f g h k 0 . Therefore, for two-body motion these modified equinoctial orbital elements are
constant. The true longitude is often called the fast variable of this orbital element set.
g g N ˆi N gr ˆir
where
ˆi
eˆ N eˆ TN ˆi r ˆi r
eˆ ˆi ˆi
N
eˆ N T
N r r
and
eˆ N 0 0 1
T
In these equations the north direction component is indicated by subscript N and the radial direction
component is subscript r.
cos
k
4
Re '
gN
r2
Pk J k
k 2 r
k
4
R
gr 2 k 1 e Pk J k
r k 2 r
where
gravitational constant
r geocentric distance of the spacecraft
Re equatorial radius of the Earth
geocentric latitude
J k zonal gravity coefficient
Pk k th order Legendre polynomial
For a zonal only Earth gravity model, the east component is identically zero.
page 21
For J 2 effects only, the three components are as follows:
J2
n
r4
1 h 2
k
2 2
Propulsive Thrust
T
aT uˆ T
m t
T
where T is the thrust magnitude, m is the spacecraft mass and uˆ T uTr uTt uTn is the unit pointing
thrust vector expressed in the spacecraft-centered radial-tangential-normal coordinate system. The
components of this unit vector are the control variables.
dm T
m
dt g I sp
where g is the acceleration of gravity and I sp is the specific impulse of the propulsive system. The
product g I sp is also called the exhaust velocity.
The spacecraft mass at any mission elapsed time t is given by m t msci mt where msci is the initial
mass of the spacecraft 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
page 22
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.
The twoburn_ocs 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.
The relationship between a unit thrust vector in the ECI coordinate system uˆ TECI and the corresponding
unit thrust vector in the modified equinoctial system uˆ TMEE is given by
uˆ TECI ˆir ˆi
t
ˆi uˆ
n TMEE
where
ˆi r rˆ ˆi r v hˆ ˆi ˆi ˆi r v r
rv rv r
r n t n r
r
rˆ
x hˆ rˆ x
hˆ x
uˆ TECI Q uˆ TMEE rˆy
hˆ rˆ y
hˆ y uˆ TMEE
rˆz hˆ rˆ z
hˆ z
In these equations, r is the inertial position vector and v is the inertial velocity vector of the spacecraft.
In the twoburn_ocs computer program, the components of the inertial unit thrust vector are defined in
terms of the right ascension and the declination angle as follows:
Finally, the right ascension and declination angles can be determined from the components of the ECI
unit thrust vector according to
tan 1 uT ECI y
, uTECI
x
sin 1 uT ECI z
where the calculation for right ascension is a four quadrant inverse tangent operation.
page 23
Algorithm Resources
“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.
“Optimal Interplanetary Orbit Transfers by Direct Transcription”, John T. Betts, The Journal of the
Astronautical Sciences, Vol. 42, No. 3, July-September 1994, pp. 247-268.
“Using Sparse Nonlinear Programming to Compute Low Thrust Orbit Transfers”, John T. Betts, The
Journal of the Astronautical Sciences, Vol. 41, No. 3, July-September 1993, pp. 349-371.
“Equinoctial Orbit Elements: Application to Optimal Transfer Problems”, Jean A. Kechichian, AIAA
90-2976, AIAA/AAS Astrodynamics Conference, Portland, OR, 20-22 August 1990.
“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 24
APPENDIX A
Contents of the Simulation Summary and CSV Files
This appendix is a brief summary of the information contained in the simulation summary screen
displays and the CSV data files produced by the twoburn_ocs software.
mission elapsed time = simulation time since the beginning of the simulation
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.
The comma-separated-variable disk file is created by the odeprt subroutine and contains the following
information:
page 25
time (min) = mission elapsed time in minutes
This appendix illustrates the twoburn_ocs solution and trajectory graphics for a variable attitude,
medium-thrust LEO-to-ISS (International Space Station) orbit transfer. For this example, the impulsive
delta-v’s were determined using the hohmann.exe computer program which can be found at The
Celestial and Orbital Mechanics Website (www.cdeagle.com). The hohmann.exe software
computes a Hohmann transfer solution for this problem.
The following is the first part of the input data file for this example.
****************************************
** two maneuver, finite-burn earth-orbit
** trajectory optimization
** program twoburn_ocs
** 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
--------------------------
page 27
-----------
coast phase
-----------
*****************
* 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
***************
* FINAL ORBIT *
***************
page 28
******************************
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 trajectory characteristics for this example.
page 29
Here’s the main program output and verification for this example.
program twoburn_ocs
===================
--------------------------------------
beginning of first propulsive maneuver
--------------------------------------
page 30
raan (deg) true anomaly (deg) arglat (deg) period (min)
0.100363294121D+03 0.326736552541D+03 0.326736552541D+03 0.881916022527D+02
--------------------------------
end of first propulsive maneuver
--------------------------------
------------------------
beginning of coast phase
------------------------
------------------
end of coast phase
------------------
page 31
sma (km) eccentricity inclination (deg) argper (deg)
0.667584555215D+04 0.152066565657D-01 0.329380649128D+02 0.355274673206D+03
---------------------------------------
beginning of second propulsive maneuver
---------------------------------------
---------------------------------
end of second propulsive maneuver
---------------------------------
page 32
SIMULATION SUMMARY
------------------
========================================
verification of optimal control solution
========================================
-------------------
final mission orbit
-------------------
page 33
APPENDIX C
Typical Sparse Optimization Suite Configuration File
The twoburn_ocs computer progran can read and use a user-defined configuration file. A description
of each element in this file can be found in the INSOCX routine in section 6.2, Subprograms for
Optimal Control, and the INSNLP routine in Section 2.2, Subprograms for Optimization of the Sparse
Optimization Suite user’s manual. Please note that the twoburn_ocs software can read and use a
subset of the information in this file. For example, a subset configuration file might contain only the
following information;
ODETOL=0.1D-06
INSNLP:IOFLAG=5
SOCOUT=I4K4
The following is a typical “full version” configuration file created during the execution of the
twoburn_ocs software.
AEQTOL=0.1000000000000000D-02
DTAUX=0.0000000000000000D+00
OBJCTL=0.1000000000000000D-04
ODETOL=0.1000000011686097D-06
PGDCTL=0.1000000000000000D-02
PRTMSD=0.1490116119384766D-07
PRTMXD=0.1000000000000000D-02
PRTSFD=0.1000000000000000D-04
QDRTOL=0.1000000000000000D-02
RESTOL=0.1000000000000000D-04
SMLTOL=0.1490116119384766D-10
TOLJSD=0.1000000000000000D-05
TOLM5A=0.1490116119384766D-07
TOLM5R=0.1490116119384766D-07
IDSCPH=0
IDSCND=0
IDSCVR=0
IDSCFN=0
IDTSFD=-1
IPFAUX=0
IPFSFD=0
IPRSFD=1
IPGRD=0
IPNLP=10
IPODE=0
IPUAUX=0
IPUOCP=6
IRSTRT=2
ISCALE=0
ISFHES=41
ISFINP=42
ISFRST=43
ISFSCL=44
ITSWCH=2
M5DTYP=0
MITODE=20
MTSWCH=-1
MXDATA=0
MXPARM=10
MXPCON=20
MXSTAT=20
MXTERM=50
NPTAUX=100
NSSWCH=-1
SOCOUT=A0B0C0D0E0F0G0H0I0J2K0L0M0N0O0P0Q0R0S1T0U0V0W0X0Y0Z0
SPRTHS=SPARSE
NLPALG=SNLPMN
NLPOMR=M
KEYDPL=.lueiLUE
page 34
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 35
Orbital Mechanics with MATLAB
In the following discussion the passive satellite is called the target and the active or maneuvering
satellite is called the chaser. The state vector of the chaser satellite is defined with respect to a
local vertical-local horizontal (LVLH) coordinate system centered at the target satellite.
The relationship between the chaser vehicle state vector x, y, z, x, y and z at any time t to the
initial state vector x0 , y0 , z0 , x0 , y0 and z0 at time t0 is given by the following state transition
matrix for unperturbed relative motion:
4 2
1 6 t sin t 0 3t sin t 1 cos t
0
x x0
y 0 0 y0
2 1
4 3cos t 0 1 cos t sin t
z z0
0 0 cos t 0 0
1
sin t x
x 0
y 0 6 1 cos t 0 3 4 cos t 2sin t 0 y0
z 0 3 sin t 0 2sin t cos t 0 z0
0 0 sin t 0 0 cos t
where / r / re is the orbital rate of the target’s circular orbit with r equal to the radius
3
of the target’s orbit and re equal to the radius of the Earth. In this equation, is the
gravitational constant of the Earth.
The x, y and z position components of the chaser satellite as a function of time are given by the
following three expressions:
2y y x
x t x0 0 3x0 6 y0 t 2 0 cos t 4 0 6 y0 sin t
x x y
y t 2 0 4 y0 2 0 3 y0 cos t 0 sin t
z0
z t z0 cos t sin t
page 1
Orbital Mechanics with MATLAB
This MATLAB script calculates and graphically displays the relative Keplerian motion between
two satellites in circular Earth orbits. This script provides the following user options:
This MATLAB script displays two-dimensional motion in the x-y or orbit plane.
This program option allows the user to input the initials conditions of the chaser vehicle relative
to the target. The user can graphically display the relative trajectory for either one orbital period
or a user-defined duration.
The following is a typical user interaction with this script and this option.
selection (1, 2 or 3)
? 1
page 2
Orbital Mechanics with MATLAB
user-defined orbit
selection (1 or 2)
? 2
The following is the companion graphics display for this example. The orbital motion of the
target satellite is to the right. The target satellite is labeled with the letter T and the chaser
satellite is labeled with the letter C. The chaser trajectory is displayed at the time interval input
by the user.
page 3
Orbital Mechanics with MATLAB
The relative motion trajectory of the chaser spacecraft is a “drifting” ellipse with its center
located at c, d where
y0
c x0 2 3x0 6 y0 t
2 x0
d 4 y0
x y
2 2
a 2 2 0 3 y0 0
Synchronous orbit
The initial velocity components required for a chaser vehicle to be synchronous or “co-orbital”
with a target vehicle located in a user-defined circular orbit are given by
x0s 2 y0
y0 s 0
The initial velocity components for any initial x0 and y0 position components are given by the
following two expressions:
3
x0 y0
2
3
x0 y0
y0 2
req
y0
r
Therefore, the components of the initial velocity increment for a synchronous orbit are given by
Vx x0s x0
V y y0s y0
page 4
Orbital Mechanics with MATLAB
The relative motion trajectory is an ellipse with its center located at c,0 where
y0
c x0 2
2
y
a 2 y02 0
The following is a typical user interaction and data output for this program option.
selection (1, 2 or 3)
? 2
synchronous orbit
page 5
Orbital Mechanics with MATLAB
selection (1 or 2)
? 2
The following is the companion graphics display of a synchronous orbit. The orbital motion of
the target satellite is to the right. The target satellite is labeled with the letter T and the chaser
satellite is labeled with the letter C. The chaser trajectory is displayed at the time interval input
by the user.
Orbital rendezvous is the process of bringing a chaser vehicle from some initial location to a
final location with zero relative velocity in a specified transfer time. This type of orbit transfer
involves an initial maneuver that starts the transfer and a second maneuver that stops the chaser
spacecraft at the final location. This program option of the grmotion script calculates the
page 6
Orbital Mechanics with MATLAB
magnitude and direction of these two impulsive maneuvers and graphically displays the transfer
trajectory.
The initial velocity components required for a rendezvous orbit are given by
The components of the terminal phase initiation V required to start the orbital rendezvous are
determined from the following equations
Vx x0tpi x0
Vy y0tpi y0
where x0 and y0 are the x and y velocity components of the chaser vehicle prior to this
impulsive maneuver.
The components of the V required to brake the vehicle at the target are given by
The following is a typical user interaction with this MATLAB script and this program option.
selection (1, 2 or 3)
? 3
page 7
Orbital Mechanics with MATLAB
rendezvous orbit
page 8
Orbital Mechanics with MATLAB
The following diagram illustrates the geometry of this type of orbital maneuver.
In this picture the orbital inclinations of the initial and final orbits are ii and i f , respectively. The
RAAN of the initial orbit is i and f is the RAAN of the final orbit. The right ascension of the
ascending node of an orbit is measured from the inertial x-axis along the equator in the direction of the
Earth's rotation. From spherical trigonometry relationships, is the angle between the two orbit planes.
The next diagram illustrates the possible points of intersection. From this ground track schematic we
can see that there are two pairs of orbit intersections on both the initial and final orbits which depend on
the relative RAAN between these two orbits.
final orbit
imp=1 imp=2
initial orbits
equator
imp=3
imp=4
The total plane change angle due to the modification of inclination and RAAN can be expressed as
We can define an index imp that depends on the sign of the RAAN change f i as follows
page 1
Orbital Mechanics with MATLAB
or
It is convenient to define the location of impulses by their argument of latitude. The argument of
latitude is the angle from the ascending node, measured along the orbital plane, to the point of interest.
The argument of latitude is equal to the sum of the argument of perigee and true anomaly. Since for
circular orbits there is no argument of perigee, the argument of latitude and true anomaly are identical.
The two possible arguments of latitude on the initial orbit depend on the values of imp as follows
We can determine the argument of latitude of an impulse on the final orbit by forming the unit position
vectors from the ascending node to the impulse. The argument of latitude of the first opportunity on the
final orbit is given by
u cos1 U1 U2
where U1 is the unit position vector of the impulse on the initial orbit and U 2 is the unit position vector
to the ascending node of the final orbit. The argument of latitude of the second impulse opportunity on
the final orbit is equal to 180 degrees plus this value.
The maneuver V vector is given by the vector difference between the velocity vectors of the initial and
final orbits as follows
V Vf Vi
These velocity vectors are evaluated at the points of orbital intersection. The scalar magnitude of the
V is determined from the components of this vector according to
For the case where there is no RAAN change, the two impulse locations occur at the common ascending
and descending nodes of both the initial and final orbits. The arguments of latitude of these two orbital
points are 0 and 180 degrees, respectively.
The required V can also be determined using vector manipulation. Unit vectors normal to each orbit
plane can be defined as follows
page 2
Orbital Mechanics with MATLAB
A unit vector along the intersection of the initial and final orbit planes is given by
n f ni
m
n f ni
ni m
Vi Vlc
ni m
nf m
Vf Vlc
nf m
where Vlc r is the local circular velocity at the maneuver altitude. In this equation, is the
gravitational constant of the Earth and r is the geocentric radius of the circular orbit.
V Vf Vi
The equations described here have been implemented in an interactive MATLAB script called
maneuver1.m. This script will prompt you for the altitude, inclination and RAAN of both the initial
and final orbits. A typical user interaction with this script along with the output is as follows.
program maneuver1
initial orbit
page 3
Orbital Mechanics with MATLAB
final orbit
solution # 1
solution # 2
The pitch and yaw angles for each impulsive maneuver are computed and displayed in the local-vertical-
local horizontal (LVLH; also called the radial-tangential-normal RTN) coordinate system. The
following diagram illustrates the geometry of the pitch and yaw angles in this system. In this figure, the
radial direction is along the geocentric radius vector directed away from the Earth, the tangential
direction is tangent to the orbit in the direction of the orbital motion, and the normal direction is along
the angular momentum vector of the orbit. The pitch angle is positive above the local horizontal plane
formed by the tangential and normal directions, and the yaw angle is positive in the direction of the
angular momentum vector which is perpendicular to the orbit plane.
uR
pitch
= yaw
uT
uN
page 4
Orbital Mechanics with MATLAB
The maneuver1 script will also create a graphics display of the initial and final orbits for each solution.
The following is one of the graphic images for this example. The initial orbit trace is red and the final
mission orbit is blue. The dimensions are Earth radii (ER) and the plot is labeled with an Earth-
centered-inertial (ECI) coordinate system where green is the x-axis, red is the y-axis and blue is the z-
axis. The impulse location is marked with a small blue circle.
Trajectory image files are saved to disk in both encapsulated, color Postscript format and MATLAB fig
format with a file name indicating the solution number. For the first solution, the file names are
plane_change1.eps and plane_change1.fig. The interactive features of MATLAB graphics
allow the user to manipulate the fig version of the trajectory display. These capabilities allow the user
to interactively find the best viewpoint as well as verify basic three-dimensional geometry of the orbital
maneuver.
page 5
Targeting with Modified Equinoctial Orbital Elements
The modified equinoctial orbital elements are a set of orbital elements that are useful for trajectory
analysis and optimization. They are valid for circular, elliptic, and hyperbolic orbits. These direct
modified equinoctial equations exhibit no singularity for zero eccentricity and orbital inclinations equal
to 0 and 90 degrees. However, please note that two of the components are singular for an orbital
inclination of 180 degrees.
The modified equinoctial elements are defined in terms of the classical orbital elements as follows:
p = a (1 − e 2 )
f = e cos (ω + Ω )
g = e sin (ω + Ω )
h = tan ( i 2 ) cos Ω
k = tan ( i 2 ) sin Ω
L =θ +ω + Ω
where
p= semiparameter
a= semimajor axis
e= orbital eccentricity
i= orbital inclination
ω = argument of perigee
Ω = right ascension of the ascending node
θ = true anomaly
L = true longitude
The classical orbital elements can be recovered from the modified equinoctial orbital elements with
semimajor axis
p
a=
1 − f 2 − g2
orbital eccentricity
e= f 2 + g2
orbital inclination
i = 2 tan −1 ( h2 + k 2 )
page 1
argument of periapsis
ω = tan −1 ( g , f ) − tan −1 ( k , h )
gh− f k
sin ω =
e tan ( i 2 )
f h+ gk
cos ω =
e tan ( i 2 )
Ω = tan −1 ( k , h )
k
sin Ω =
tan ( i 2 )
h
cos Ω =
tan ( i 2 )
true anomaly
θ = L − (ω + Ω ) = L − tan −1 ( g , f )
1
sin θ = ( f sin L − g cos L )
e
1
cosθ = ( f cos L + g sin L )
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 θ .
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:
page 2
⎧ sin ω ≤ 0 → gh − f k ≤ 0
ω = 270D → ⎨
⎩cos ω = 0 → f h + gk = 0
⎧ g h − f k = e tan ( i 2 ) sin ω
ω = 178D → ⎨
⎩ cos ω ≤ 0 → f h + gk ≤ 0
The following is a sign table of the sine and cosine for each quadrant.
e= f 2 + g2
⎛i⎞
tan ⎜ ⎟ = h 2 + k 2
⎝2⎠
gh− f k
g h − f k = e sin ω tan ( i 2 ) → sin ω =
e tan ( i 2 )
f h+ gk
f h + g k = e cos ω tan ( i 2 ) → cos ω =
e tan ( i 2 )
k
k = tan ( i 2 ) sin Ω → sin Ω =
tan ( i 2 )
h
h = tan ( i 2 ) cos Ω → cos Ω =
tan ( i 2 )
page 3
true anomaly constraints
θ = L − (ω + Ω ) = L − tan −1 ( g , f )
In general,
1
sin θ = ( f sin L − g cos L )
e
1
cosθ = ( f cos L + g sin L )
e
Targeting Example
For a user-defined semimajor axis, eccentricity and inclination, the set of modified equinoctial
constraints are as follows:
p = p
f 2 + g 2 = e
h 2 + k 2 = tan ( i 2 )
where the tilde indicates the value of the user-defined classical orbital element.
References
“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, August 20-22, 1990.
page 4