GMATMath Spec
GMATMath Spec
Contents
1 Time 11
1.1 Time Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.1 Atomic Time: TAI and A.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.2 Universal Time: UTC and UT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.1.3 Dynamic Time: TT, TDB and TCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.2 Time Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.2.1 Julian Date and Modified Julian Date . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.2.2 Gregorian Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2 Coordinate Systems 17
2.1 General Coordinate SystemTransformations . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2 Pseudo-Rotating CoordinateSystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.3 ITRF and ICRF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.4 Transformation from ICRT to MJ2000Eq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5 The FJ2k Inertial System and FK5 Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5.1 Overview of FK5 Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5.2 Precession Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5.3 Nutation Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5.4 Sidereal Time Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.5.5 Polar Motion Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.6 Deriving RJ2k ,i and ṘJ2k ,i for Various Coordinate Systems . . . . . . . . . . . . . . . . . . 28
2.6.1 Equator System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.6.2 MJ2000 Ecliptic (MJ2000Ec) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.6.3 True of Epoch Equator (TOEEq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.6.4 Mean of Epoch Equator (MOEEq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.6.5 True of Date Equator (TODEq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.6.6 Mean of Date Equator (MODEq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.7 Mean of Date Ecliptic (MODEc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.8 True of Date Ecliptic (TODEc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.9 Topocentric Horizon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.10 Celestial Body Fixed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.6.11 Body Inertial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.6.12 Object Referenced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.6.13 Geocentric Solar Ecliptic (GSE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.6.14 Geocentric Solar Magnetic (GSM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.6.15 Body-Spin Sun Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.7 Appendix 1: Derivatives of ObjectReferenced Unit Vectors . . . . . . . . . . . . . . . . . . . . 38
2.7.1 Basic Rotation Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3 Calculation Objects 45
3.1 Spacecraft State Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.1.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2
Draft for Release R2018a
CONTENTS 3
3.2.44 VelApoapsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.2.45 VelPeriapsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.2.46 VMAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.3 Other Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.3.1 MA to TA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.3.2 EA to TA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.3.3 HA to TA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.4 Libration Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.5 Barycenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.6 Ground Station Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4 Dynamics Modelling 83
4.1 Orbit Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.1.1 Orbital Equations of Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.1.2 Coordinate Systems for Integration of the Equations of Motion . . . . . . . . . . . . . 84
4.1.3 Orbit Variational Equations and the State Transition Matrix . . . . . . . . . . . . . . 84
4.1.4 Multiple Spacecraft Propgation and Coupled Propagation of the Equations of Motion 85
4.2 Force Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.2.1 n-Body Point Mass Gravity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.2.2 Non-Spherical Gravity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
4.2.3 Atmospheric Drag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.2.4 Solar Radiation Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.2.5 Relativistic Corrections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.2.6 Spacecraft Thrust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.3 Attitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.3.1 Attitude Propagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
4.3.2 Attitude Parameterizations and Conversions . . . . . . . . . . . . . . . . . . . . . . . . 104
4.4 Spacecraft Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.4.1 RF Hardware Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.4.2 Thruster Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.4.3 Tank Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4.4.4 Mass Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
4.5 Environment Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
4.5.1 Ephemerides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
4.5.2 Atmospheric Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.6 Flux and Geomagnetic Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.6.1 File Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.6.2 Historical (Observed) data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
4.6.3 Near Term Daily Predictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
4.6.4 Long Term Monthly Predictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
4.6.5 Tank Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
8 Solvers 189
8.1 Differential Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
8.2 Broyden’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
8.3 Newton’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
8.4 Matlab fmincon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
8.5 The Vary Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
9 Events 191
9.1 Overview of Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
9.2 Issues in Locating Zero Crossings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
9.3 Root Finding Options in GMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
9.4 Algorithm for Event Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
10 Graphics 197
10.1 Ground Track Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
10.2 Footprint and Limb Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
10.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
10.2.2 Intersection of Line and Ellipsoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
10.2.3 Determining the Limb Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
10.2.4 Selecting Points for Accurate Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
12 MathSpecAppendices 207
12.1 Vector Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Draft for Release R2018a
List of Figures
7
Draft for Release R2018a
8 LIST OF FIGURES
List of Tables
2.1 Recommended Values for Pole and Prime Meridian Locations of the Sun and Planets1 . . . . 41
2.2 Recommended Values for Pole and Prime Meridian Locations of Luna1 . . . . . . . . . . . . . 42
9
Draft for Release R2018a
10 LIST OF TABLES
Draft for Release R2018a
Chapter 1
Time
Time is the primary independent variable in GMAT. Time is used in integrating the equations of motion, and
calculating planetary ephemerides, the orientations of planets and moons, and atmospheric density among
others. GMAT uses three types of time systems depending on the type of calculations being performed:
universal time systems based on the Earth’s rotation with respect to the Sun; dynamic time systems that
are based on the dynamic motion of the solar system and take into account relativistic effects; and atomic
time systems based on the oscillation of the cesium atom. Each of these time systems has specific uses and
is discussed below. In addition, universal, dynamic, and atomic time systems can be expressed in different
time formats. The two time formats used in GMAT are the Modified Julian Date (MJD) format, and the
Gregorian Date (GD) format. In the next section, we’ll take a look at the time systems used in GMAT, and
when GMAT uses each time system. Then we’ll look at the different time formats.
11
Draft for Release R2018a
12 CHAPTER 1. TIME
U T C = U T 1 − ∆U T 1 (1.3)
In GMAT, ∆U T 1 is read from the file eopc04.62-now provided by the International Earth Rotation and
Reference Systems Service (IERS). The file containing the latest measurements and predictions can be found
at
http://www.iers.org/. For times past the last epoch contained in the file, GMAT uses the last value of ∆U T 1
contained in the file. GMAT uses UTC as a time system to define spacecraft state information. UT1 is used
to determine the Greenwich hour angle and for the sidereal time portion of FK5 reduction.
Calculating TDB exactly is a complicated process that involves iteratively solving a transcendental equa-
tion. For this reason, it is convenient to use the following approximation
where TT T is the time in TT expressed in the Julian Century format. TT T can be calculated from
JDT T − 2, 451, 545.0
TT T = (1.7)
36, 525
where JDT T is the time in TT expressed in the Julian Date format. For a more complete discussion of
the TDB time system, see Vallado3 (pp. 195-198) and Seidelmann4 (pp. 41-48). GMAT uses TDB as the
default time system in the JPL ephemerides files. There is an option to use TT in the ephemerides using
the UseTTForEphemeris flag.
Draft for Release R2018a
1.2. TIME FORMATS 13
The last dynamic time system GMAT uses is Barycentic Coordinate Time. In 1992, the IAU adopted this
system and clarified the relationships between space-time coordinates.4 In general, calculating TCB requires
a four-dimensional space-time transformation that is well beyond the scope of this discussion. However,
TCB can be approximated using the following equation:
The present estimate of the value of LB is 1.550505x10−8 (+/ − 1x10−14 ) (Fukushima et al., Celestial
Mechanics, 38, 215, 1986). It is important to note that the main difference between TDB and TCB is a
secular drift, and that as of the J2000 Epoch, the difference was approximately 11.25 seconds and growing.5
GMAT uses time in the TCB system to evaluate the IAU data for the spin axes and prime meridian locations
of all planets and moons except for Earth.1 Note that Seidelmann1 mistakenly says that time in TCB should
be used in the equations given for the pole and meridian locations of the planets. The correct time to use is
TDB, and GMAT uses this time system.
2451545.0 TT
2451544.9996274998411 T AI
2451544.9992571294708 U T C
2451544.9999999990686 T DB
In the next two sections we’ll look at how to convert an epoch in a given time system from the GD format
to the JD format, and vice versa.
The fundamental epoch for most astrodynamic calculations is the J2000.0 epoch.4 This epoch is GD 01
Jan 2000 12:00:00.000 in the TT time system and is expressed as JD 2451545.0 TT. To convert between
Julian Date format and Gregorian Date format, GMAT uses Algorithm 14 from Vallado3
M +9
7 Y + Int 12
JD = 367Y − Int +
4
(1.9)
s
+m
60 +H
275M 60
Int + D + 1, 721, 013.5 +
9 24
where Y is the four digit year, Int signifies real truncation, and M , D, H, m and s are month, day, hour,
minutes, and seconds respectively. This equation is valid for the time period 01 Mar. 1900 to 28 Feb. 2100.
For numerical reasons it is often convenient to work in a Modified Julian Date (MJD) format to ensure
we can capture enough significant figures using double precision computers. In GMAT the MJD system is
defined as
M JD = JD − 2, 430, 000.0 (1.10)
where the reference epoch expressed in the GD format is 05 Jan 1941 12:00:00.000. However, we must be
careful in calculating the Modified Julian Date, or we will lose the precision we are trying to gain. GMAT
calculates the MJD as follows:
M +9
7 Y + Int 12
JDay =367Y − Int +
4
(1.11)
275M
Int + D + 1, 721, 013.5
9
s
+m
60 +H
PartofDay = 60 (1.12)
24
MJD = (JDay − 2, 430, 000.0) + PartofDay (1.13)
The important subtlety is that we must subtract the MJD reference from the JD, before we add the fraction
of day, to avoid losing precision in the MJD.
Y ear = Y ear − 1
LM onth[2] = 29
Dayof Y r = TRUNC(Days)
M on = # of months in summation
h = TRUNC(T emp)
1.3 Conclusions
In this chapter we looked at three time systems that GMAT uses to perform internal calculations: atomic
time, universal time, and dynamic time. Atomic time is used to integrate spacecraft equations of motion,
while universal time is used to determine the sidereal time and greenwhich hour angle for use in FK5
reduction. Dynamic time systems are used in the JPL ephemerides and in the IAU planetary orientation
data. Time, in any of these time systems, are represented in two formats: the Gregorian Date, and Julian
Date. We looked at how to convert between different time systems, and between different time formats.
Draft for Release R2018a
16 CHAPTER 1. TIME
Draft for Release R2018a
Chapter 2
Coordinate Systems
rO
p Position of point p w/r/t frame FO expressed in FO
[rO
p ]
F
Position of point p w/r/t frame FO expressed in FF
rF
f /o Position vector from origin of FO to origin of FF expressed in FF
RF /O Rotation matrix from frame FO to FF
ωOf /o Angular velocity of frame FO w/r/t FF , expressed in frame FO
ωFf /o Angular velocity of frame FO w/r/t FF , expressed in frame FF
Equation (2.1) is the equation used to convert a vector known in frame Fi to a vector in frame Ff , where
both a rotation and a translation are required. The first term in Eq. (2.1) is the term that performs the
rotation portion of the transformation. Here, ri is the position vector w/r/t to Fi and is expressed in Fi .
Rf i is the rotation matrix that rotates from Fi to Ff . rif is the vector that goes from the origin of Ff to
the origin of Fi , and is expressed in Ff .
We also need to be able to determine the time rate of change of a vector in frame Ff if we know the time
rate of change of the vector in Fi . To determine the equation that describes the transformation, we must
take the derivative of Eq. (2.1) with respect to time.
drf dRf i ri drif
= + (2.2)
dt dt dt
17
Draft for Release R2018a
18 CHAPTER 2. COORDINATE SYSTEMS
rF
o
rO
o
ri/f
FF
FO
Let’s use a single dot above a variable to denote the first derivative of that variable with respect to time.
Then, we can expand this to obtain
ṙf = Ṙf i ri + Rf i r˙i + ṙif (2.3)
In Eq. (2.3) we see a term that contains the time derivative of the rotation matrix from Fi to Ff . We can
write the time derivative of Rf i as
Ṙf i = Rf i ω x x
f i = {ω f i }f Rf i (2.4)
where ω f i is the angular velocity of Fi with respect to Ff expressed in Fi . The skew symmetric matrix, ω x ,
is defined as
0 −ωz ωy
ω x = ωz 0 −ωx (2.5)
−ωy ωx 0
In summary, using Eq. (2.4) to transform a derivative vector from Fi to Ff we can use any of the following
three equations:
ṙf = Rf i ωx
f i ri + Rf i ṙi + ṙif (2.6)
| {z } |{z}
Rot. T rans.
ṙf = {ωx
f i }f Rf i ri + Rf i ṙi + ṙif (2.7)
| {z } |{z}
Rot. T rans.
We choose between Eqs. (2.6), (2.7), or (2.8) depending on the type of information we have, and which frame
is most convenient to express the angular velocity ωf i in. In general, we know ri and ṙi . To perform the
transformation we need to determine R, Ṙ, and ṙif and these quantities depend on Fi and Ff .
One of the difficulties in implementing coordinate system transformations in GMAT is that we often
can’t calculate Rf i and Ṙf i directly. For example, it is nontrivial to directly calculate the rotation matrix
from the Earth fixed frame to the Moon fixed frame. Hence, we need to choose a convenient intermediate
coordinate system. We choose the axis system defined by Earth’s mean equinox and mean equator at the
J2000 epoch, denoted FJ2k , as the intermediate reference frame for all transformations that require an
Draft for Release R2018a
2.2. PSEUDO-ROTATING COORDINATE SYSTEMS 19
intermediate transformation. This choice is motivated by the fact that most of the data needed to calculate
R and Ṙ is given so that it is fast and convenient to calculate RJ2k ,i , and ṘJ2k ,i .
The steps taken to perform a general coordinate transformation in GMAT are described below and
illustrated in Fig. 2.2. We start with a vector and its first derivative known in frame Fi , and wish to determine
the vector and its first derivative with respect to frame Ff . However, we assume that the transformation to
go directly from Fi to Ff is not known.
The first step in the process is to perform a rotation from Fi to FJ2k . We define this intermediate system
as F1 . No translation is performed in step one. Using only the rotation portions of from Eqs. (2.1) and (2.8)
we see that
{ri }1 = RJ2k ,i ri (2.9)
where {vRi }J2k is the velocity of the origin of FR w/r/t the origin of Fi . Similarly, {vf R }J2k is the velocity
of the origin of Ff w/r/t the origin of FR . Finally, we perform a rotation from FJ2k to Ff about the origin
of Ff to obtain the desired quantities.
rf = Rf,J2k {vf }2 (2.14)
and
drf
= Rf,J2k {vf }2 (2.17)
dt
To perform the transformations describe in the last few sections, we need to be able to calculate the
rotation matrix between any coordinate system and FJ2k , and the derivative of the rotation matrix. In the
following sections we calculate these matrices for the systems used in GMAT. We assume that we want the
Draft for Release R2018a
20 CHAPTER 2. COORDINATE SYSTEMS
ri
rf
F1
F2
Fi
rRi rf R Ff
J2k
transformation from some generic frame Fi to FJ2k which is the Earth Mean J2000 Equatorial (MJ2000Eq)
system. The rotation matrix from FJ2k to Fi can be found by the simple relationship.
Ri,J2k = R−1 T
J2k ,i = RJ2k ,i (2.18)
and
T
Ṙif = Ṙ−1
J2k ,i = ṘJ2k ,i (2.19)
Draft for Release R2018a
2.3. ITRF AND ICRF 21
where W is the polar motion matrix, R3 is a 3 rotation through the Earth rotation angle θ (see Section
2.7.1), and C is a single matrix that captures precession, nutation, and frame bias. The time derivative
of the rotation matrix assumes that the only significant time variation of the rotation matrix is due to the
Earth’s spin and is computed using
R = CT R3 (−θ)ω xE W (2.21)
where
0 −ωe 0
ωxE = ωe 0 0 (2.22)
0 0 0
where TT T is given by Eq. (1.7)and xp and yp are interpolated using third order lagrange interpolation from
Earth Orientation Parameters (EOP) files provided by the IERS. The Earth Rotation angle is computed
from
θ = 2π(0.7790572732640 + 1.00273781191135448(JDUT 1 − 2451545.0)) (2.25)
where JDUT 1 is the Julian date expressed in UT1 using Eq. (1.3).
CT is computed using
1 − bX 2 −bXY X
T
C = −bXY 1 − bY 2 Y R3 (s) (2.26)
−X −Y 1 − b(X 2 + Y 2 )
where
1
b= √ (2.27)
1+ 1 − X2 − Y 2
The variables X, Y , are respectively the x-component and y-component of the Celestial Intermediate Pole
unit vector (CIP), and s is called the Celestial Intermediate Origin (CIO) locator. The computation of X,
Y , and s requires evaluating series expansions with thousands of terms and many trigonometric function
evaluations and is computationally expensive. Vallado et. al. show that it is possible to precompute X, Y ,
and s at one day intervals and interpolate the values using ninth order Lagrange interpolation and provide
values that are accurate to within the error of the theory itself. The interpolation of X, Y , and s is over
two orders of magnitude faster than the series evaluation. Interpolation of data at 1 day intervals is possible
because all physical affects with a period of two days or less are not included in the theory for X, Y , s and
are accounted for in the daily observations provided by the IERS in the EOP files.6 GMAT interpolates
tabulated values X, Y , s created using the IAU SOFA routines. s is computed using the routine iauS06a.c
which uses the 2000A nutation model and 2006 precession model. X and Y are computed using the IAU
SOFA routine called iauXy06 which also uses the the 2000A nutation model and 2006 precession model.
Draft for Release R2018a
22 CHAPTER 2. COORDINATE SYSTEMS
2. If A1 and A2 have different base axis systems, use B to convert from A1 to the base axes of A2
The motion is illustrated in Fig. 2.3. The principal moment of inertia is defined as the Celestial Ephemeris
Pole, and due to the fact that Earth’s mass distribution changes with time, the Celestial Ephemeris Pole
is not constant with respect to the Earth’s surface. Precession is the coning motion that the Celestial
Ephemeris Pole makes around the ecliptic north pole. The other principal component of the motion of the
Celestial Ephemeris Pole is commonly called nutation and is the oscillation in the angle between the Celestial
Ephemeris Pole and the north ecliptic pole. The theory of Precession and Nutation come from dynamics
models of the Earth’s motion. The second type of motion is called sidereal time, and represents a rotation
about the Celestial Ephemeris Pole. The sidereal time model is a combination of theory ad observation. The
third motion is that of the Earth’s instantaneous spin axis with respect to the Earth’s surface. As, we’ll see
below, the Earth’s spin axis is not constant with respect to the Earth’s crust and it’s motion is called Polar
Motion. A portion of polar motion is due to complicated dynamics, and a portion is due to unmodelled
errors in nutation. Polar motion is determined from observation. Now that we’ve had a brief introduction
to precession, nutation, sidereal time, and polar motion, let’s look at each in more detail.
Precession
As we mentioned above, precession is the coning motion of the Celestial Ephemeris Pole about the ecliptic
north pole and is illustrated in Fig 2.3. The motion is caused by two primary effects. The first is the motion
of the ecliptic plane due to the gravitational effects of the Sun, Moon, and planets on the Earth’s orbit, and
is called planetary precession. If the Earth’s equator were fixed in inertial space, the effects of planetary
precession would cause a precession of the equinox of about 12” per century and a decrease in the obliquity of
the ecliptic of about 47” per century.4 The second cause of precession is due to the gravitational attraction of
the Sun and Moon on the irregular mass distribution of the Earth. This causes a change in the orientation of
the Earth’s equatorial plane with respect to inertial space with a smooth, long-period motion with a period
of 26,000 years. The combined effects of planetary and lunisolar precession are called general precession and
account for the secular and long period motion of the Celestial Ephemeris Pole (the short period motion is
called nutation). The secular and long period motion is often used to define a mean equator and equinox,
because it does not contain the short period motion that is modelled using nutation. Precession is modelled
using three cubic equations that are shown in Section
Nutation
Nutation is the most complex motion in FK5 reduction. According to Seidelmann,4 nutation is “the short
period motion of the Earth’s rotation axis with respect to a space-fixed coordinate system.” Nutation is
actually a superposition of motions with many different periods, the longest of which is 18.6 years and
is associated with the regression of the node of the Moon’s orbit. There are nutation effects due to the
gravitational torque of the Sun, Moon, and planets on the Earth’s irregular mass distribution. There are
also Nutation effects due to the fact that Earth is not a rigid body. Nutation motion has an amplitude of
about 9” and is usually represented as the sum of two components one in longitude and one in obliquity.
Draft for Release R2018a
24 CHAPTER 2. COORDINATE SYSTEMS
Nutation is modelled by separating the free and forced motion of the Earth. The forcing terms are due
to torques from the Sun, Moon, and planets. The free terms are determined by observation because they are
beyond our current modelling abilities. The resulting theory is a series expansion that contains coefficients
and is a function of the location of the Sun, Moon, and planets. Nutation is intimately connected with polar
motion, and in fact, as we’ll see in a later section, errors in nutation modelling are captured in polar motion
measurements. Nutation is modelled by separating the free and forced motion of the Earth. The forcing
terms are due to torques from the Sun, Moon, and planets. The free terms are determined by observation
because they are beyond our current modelling abilities. The resulting theory is a series expansion that
contains coefficients and is a function of the location of the Sun, Moon, and planets. Nutation is intimately
connected with polar motion, and in fact, as we’ll see in a later section, errors in nutation modelling are
captured in polar motion measurements.
Draft for Release R2018a
2.5. THE FJ2K INERTIAL SYSTEM AND FK5 REDUCTION 25
ITRF
PEF
TODEq
TODEc
MODEc
MODEq
FK5
RIF = PRECT NUTT STT PMT = RT3 (−ζ)RT2 (Θ)RT3 (−z) RT1 (ǭ)RT3 (−∆Ψ)RT1 (−ǫ) RT3 (θAST ) RT1 (−yp )RT2 (−xp )
| {z }| {z } | {z } | {z }
PRECT NUTT STT PMT
PM ST NUT PREC
z }| { z }| { z }| {z }| {
RF I = PM ST NUT PREC = R2 (−xp )R1 (−yp ) R3 (θAST ) R1 (−ǫ)R3 (−∆Ψ)R1 (ǭ) R3 (−z)R2 (Θ)R3 (−ζ)
ITRF
PEF
TODEq
TODEc
MODEc
MODEq
FK5
Figure 2.4: Intermediate Transformations and Coordinate Systems in FK5 Reduction
Sidereal Time
As we mentioned previously, Earth’s nutation is caused by the combined gravitational effect of the Moon
and Sun. So, we would expect to see the time dependent location of the Moon and Sun appear in the
equations for Earth nutation. The theories of nutation described below take into account of the Moon and
Sun position by modelling mean anomalies of the Moon and Sun, l and l′ respectively, the mean argument
of latitude of the Moon, F , the difference between the mean longitude of the Sun and Moon, D, and the
Draft for Release R2018a
26 CHAPTER 2. COORDINATE SYSTEMS
mean longitude of the ascending node of the Moon’s orbit, Ω. The equations used to determine these values
as a function of TT DB are:
l =134.96340251◦ + (1717915923.2178TT DB+
(2.36)
31.8792TT2 DB + 0.051635TT3 DB − 0.00024470TT4 DB )”
pa = 1.39697137214◦TT DB + 0.0003086TT2 DB
118
X
∆ǫpl = (Ci + Di TT DB ) cos apl (2.49)
i=1
ǫ = ǭ + ∆ǫ (2.53)
In GMAT, the planetary terms are optional. If the user has selected to include the planetary terms, the
The calculation of the equation of the equinoxes is dependent upon the time. If the Julian date falls after
2450449.5, then we use
ST = R3 (θAST ) (2.59)
• x-axis: Along the line formed by the intersection of the bodies equator and the ecliptic plane.
The Equator system in GMAT is a true equator of date axis system. The equatorial coordinate system
is defined only for celestial bodies. For a particular body, the equatorial system is defined by the bodies
equatorial plane and its intersection with the ecliptic plane, at the current epoch. The Earth and Moon have
highly accurate models for their equatorial systems and and are treated at the end of this section. For the
remaining bodies in the solar system, the equatorial coordinate system is calculated in GMAT using data
published by the International Astronomical Union (IAU).1 The IAU publishes data that gives the spin axis
direction and prime meridian location of all the planets and major moons as a function of time. For the
Earth, GMAT uses FK5 reduction for the Equator system. For the Moon, GMAT can use either the IAU
data, or Euler angles provided in the JPL DE405 files.
Let’s look more closely at the data provided by the IAU. Figure 2.5 contains an illustration of the three
variables, αo , δo , and W , that are used to define a body’s spin axis and prime meridian location w/r/t
MJ2000Eq. αo and δo are used to define a body’s spin axis direction. W is the body’s sidereal time. The
equations for αo , δo , and W for the nine planets and the Earth’s moon are found in Tables 2.1 and 2.2. From
Υ
Prime Meridian
90◦ + αo
W
90◦ − δo
Equator of FJ2k
Figure 2.5: IAU Definition of Pole and Meridian Locations for Planets and Moons
αo and δo vary slowly with time, so we can assume the derivative of RIi for the Equator system is the zero
matrix.
0.0 0.0 0.0
ṘJ2k ,i = 0.0 0.0 0.0 (2.62)
0.0 0.0 0.0
If the user chooses to use the DE405 files to determine the Moon’s orientation, then GMAT gets a set of
Euler angles and rates from the DE405 files. We then use the following equations to determine RJ2k ,i and
ṘJ2k ,i .
where
0.0 0.0 0.0
Ṙ1 (θ2 ) = 0.0 −θ̇2 sin θ2 θ̇2 cos θ2 (2.65)
0.0 −θ̇2 cos θ2 −θ̇2 sin θ2
and
−θ̇1 sin θ1 θ̇1 cos θ1 0.0
Ṙ3 (θ1 ) = −θ̇1 cos θ1 −θ̇1 sin θ1 0.0 (2.66)
0.0 0.0 0.0
Finally, for the Earth, the Equator axis system a true of date equator system and is calculated using the
algorithm described in Sec. 2.6.5.
• x-axis: Along the line formed by the intersection of the Earth’s mean equator and the mean ecliptic
plane, at the J2000 epoch. The axis points in the direction of the first point of Aries.
The matrix to rotate from MJ2000 Ecliptic (MJ2000Ec) to MJ2000 Equatorial (MJ2000Eq) is a rotation
about the x-axis through the obliquity of the ecliptic at the J2000 epoch which is 23.439291◦:
1.0 0.0 0.0
R = 0.0 0.91748206 −0.397777156 (2.67)
0.0 0.39777716 0.9174820621
GMAT uses more significant digits than included here. The rotation matrix is constant by definition so its
time derivative is identically the zero matrix.
0.0 0.0 0.0
Ṙ = 0.0 0.0 0.0 (2.68)
0.0 0.0 0.0
• z-axis: Normal to the Earth’s true equatorial plane at the chosen Epoch.
The TOEEq axis system is an intermediate system in FK5 reduction. RIi and ṘIi for the TOEEq system
are calculated using the following equations
where to is the epoch defined in the coordinate system description provided by the user in the epoch field.
Hence, to is a constant value for the TOEEq system. For a given to , the matrices associated with the TOEEq
system only need to be evaluated once and can be reused later when necessary. P(to ) and N(to ) are part of
the FK5 reduction algorithm and are explained in detail in Sec. 2.5.3 and 2.5.2 . Because to is fixed for a
TOEEq system, the derivative of RIi is identically equal to the zero matrix.
0.0 0.0 0.0
Ṙ = 0.0 0.0 0.0 (2.70)
0.0 0.0 0.0
• x-axis: Along the mean equinox at the chosen epoch. The axis points in the direction of the first point
of Aries.
• z-axis: Normal to the Earth’s mean equatorial plane at the chosen Epoch.
The MOEEq is an intermediate system in FK5 reduction and RIi and ṘIi for the MOEEq system can be
calculated using the following equations
RIi = PT (to ) (2.71)
where to is the epoch defined in the coordinate system description provided by the user in the epoch field.
Hence to is a constant value for the MOEEq system. For a given to , the matrices associated with the MOEEq
system only need to be evaluated once and can be reused later when necessary. P(to ) is described in Sec.
2.5.2. Because to is fixed for a MOEEq system, the derivative of RIi is the zero matrix.
0.0 0.0 0.0
Ṙ = 0.0 0.0 0.0 (2.72)
0.0 0.0 0.0
where to is the epoch. Unlike the TOEEq sytem, for the TODEq system to is a variable and usually comes
from the epoch of the object whose state we wish to convert. P(to ) and N(to ) are part of the FK5 reduction
algorithm and can be found in Vallado pgs. 214 - 219. Because to is not fixed for a TODEq system the
derivative of RIi is non-zero. However, we will assume its derivative is negligibly small so that
0.0 0.0 0.0
Ṙ = 0.0 0.0 0.0 (2.74)
0.0 0.0 0.0
Draft for Release R2018a
2.6. DERIVING RJ2K ,I AND ṘJ2K ,I FOR VARIOUS COORDINATE SYSTEMS 31
where to is the epoch. Unlike the MOEEq sytem, for the MODEq system to is a variable and usually comes
from the epoch of the object whose state we wish to convert. P(to ) and N(to ) are part of the FK5 reduction
algorithm and can be found in Vallado3 pgs. 214 - 219. Because to is not fixed for a MODEq system, the
derivative of RIi is non-zero. However, we will assume its derivative is negligibly small so that
0.0 0.0 0.0
Ṙ = 0.0 0.0 0.0 (2.76)
0.0 0.0 0.0
where to is the epoch. For the MODEc system to is a variable and usually comes from the epoch of the
object whose state we wish to convert. P(to ) comes from the FK5 reduction algorithm and can be found in
Vallado3 pgs. 214 - 219. ǭ is given by Vallado,3 Eq. (3-52). For a more complete discussion, you can also
refer to Seidelmann,4 pgs. 114 - 115. Because to is not fixed for a MODEc system, the derivative of RIi is
non-zero. However, we will assume its derivative is negligibly small so that
0.0 0.0 0.0
Ṙ = 0.0 0.0 0.0 (2.78)
0.0 0.0 0.0
where to is the epoch. Unlike the TOEEc sytem, for the TODEc system to is a variable and usually comes
from the epoch of the object whose state we wish to convert. P(to )is part of the FK5 reduction algorithm
and can be found in Vallado pgs. 214 - 219. ǭ is given by Vallado,3 Eq. (3-52). ∆Ψ is given by Eq.(3-62) in
Vallado.3 For a more complete discussion, you can also refer to Seidelmann,4 pgs. 114 - 115. Because to is
not fixed for a MODEq system, the derivative of RIi is non-zero. However, we will assume its derivative is
negligibly small so that
0.0 0.0 0.0
Ṙ = 0.0 0.0 0.0 (2.80)
0.0 0.0 0.0
• x-axis: Completes the right handed set and points south in the local horizon system.
• z-axis: Normal to the local horizon. The local horizon is defined by the selection of the HorizonReference
which is either Sphere or Ellipsoid.
Draft for Release R2018a
32 CHAPTER 2. COORDINATE SYSTEMS
The calculation of the Topocentric to MJ2000Eq systems is different for the different ground system
state representations. Regardless of how the user inputs the state of a ground station, the Topocentric axes
are always defined with respect to the reference shape of the central body. GMAT uses the appropriate
transformation to convert the user input to the cartesian location of the ground station expressed in the
local body-fixed frame. This cartesian representation is used to calculate the topocentric axes.
Define the axes of the topocentric coordinate system, expressed in the body fixed system as x̂, ŷ, and ẑ.
Define, xF , yF , and zF as the location of the station in the local body-fixed coordinate system. Calculate
the geocentric latitude to use as an initial guess to find the geodetic latitude
e2 = 2f − f 2 (2.82)
φ′ = φgd (2.83)
R
C = p (2.84)
1 − e2 sin2 φ
zF + Ce2 sin φ
φgd = atan (2.85)
rxy
′
δ = |φgd − φ | (2.86)
EndWhile
λ = atan2(yF , xF ) (2.87)
Finally,
cos φgd cos λ
ẑ = cos φgd sin λ (2.88)
sin φgd
ŷ = k̂ × ẑ (2.89)
where
k̂ = [0 0 1]T (2.90)
x̂ = ŷ × ẑ (2.91)
The last step is to determine the rotation matrix from the topocenric system to the inertial system by
using the rotation matrix from body fixed to inertial, RIF , at the desired epoch, t. We determine the body
fixed rotation matrix using the algorithm in Sec. 3.1.9. Once we have evaluated RIF and ṘIF we calculate
RIT and ṘIT using
and
0.0 0.0 0.0
d
RT1 (90◦ − δo ) = 0.0 0.0 0.0 (2.101)
dt 0.0 0.0 0.0
−Ẇ sin(W ) −Ẇ cos(W ) 0.0
d
RT3 (W ) = Ẇ cos(W ) −Ẇ sin(W ) 0.0 (2.102)
dt
0.0 0.0 0.0
where Ẇ is the time derivative of W for the given body. Note, Seidelmann1 does not provide the values for
Ẇ so we include them in Table 2.1. In summary
d T
Ṙ = RT3 (90◦ + αo )RT1 (90◦ − δo ) R (W ) (2.103)
dt 3
Draft for Release R2018a
34 CHAPTER 2. COORDINATE SYSTEMS
v
n
r
Location of Secondary
Location of Primary
h i
ṘIi = x̂˙ ŷ˙ ẑ˙ (2.109)
Recall that the user chooses two axes to an Object Referenced system among the following choices: r̂, v̂,
n̂, −r̂, −v̂, and −n̂. In general, one of the axes chosen by the user must be either n̂, or −n̂.
If the user defines the x-axis and y-axis then GMAT determines the z axis using
ẑ = x̂ × ŷ (2.110)
and
ẑ˙ = x̂˙ × ŷ + x̂ × ŷ˙ (2.111)
If the user defines the y-axis and z-axis, then GMAT determines the x axis using
x̂ = ŷ × ẑ (2.112)
and
x̂˙ = ŷ˙ × ẑ + ŷ × ẑ˙ (2.113)
And finally, if the user defines the x-axis and z-axis then GMAT determines the y axis using
ŷ = ẑ × x̂ (2.114)
and
ŷ˙ = ẑ˙ × x̂ + ẑ × x̂˙ (2.115)
Depending on the users choice of axes for an Object Referenced coordinate system, GMAT will need to
calculate r̂, v̂, n̂, r̂, ˙ These are given by:
˙ and n̂.
˙ v̂,
r r
r̂ = = (2.116)
krk r
v v
v̂ = = (2.117)
kvk v
r×v
n̂ = (2.118)
kr × vk
Draft for Release R2018a
36 CHAPTER 2. COORDINATE SYSTEMS
v r̂
r̂˙ = − (r̂ · v) (2.119)
r r
a v̂
v̂˙ = − (v̂ · a) (2.120)
v v
r × a n̂
n̂˙ = − (r × a · n̂) (2.121)
n n
where rsun is the vector from the Earth to the Sun in the MJ2000Eq axis system. The z-axis is defined to
be the ecliptic pole. To ensure we have an orthogonal system, we calculate ẑ using
rsun × vsun
ẑ = (2.123)
krsun × vsun k
ŷ = ẑ × x̂ (2.124)
We can construct the rotation matrix that goes from the GSE axis system to the MJ2000Eq axis system as
RIi = [ x̂ ŷ ẑ ] (2.125)
We also need to compute the derivative of the rotation matrix. We start by computing
dx̂ vsun vsun
= − x̂ x̂ · (2.126)
dt rsun rsun
where vsun is the velocity of the Sun with respect to the Earth in the MJ2000Eq system. We can approximate
the derivative of the z axis using
dẑ
≈0 (2.127)
dt
dŷ dx̂
= ẑ × (2.128)
dt dt
dx̂ dŷ dẑ
ṘIi = (2.129)
dt dt dt
λd = 70.1◦ W (2.131)
φd = 78.6◦ N (2.132)
Draft for Release R2018a
2.6. DERIVING RJ2K ,I AND ṘJ2K ,I FOR VARIOUS COORDINATE SYSTEMS 37
If RIF is the rotation matrix from the Earth Fixed frame to MJ2000Eq at the current epoch, then we
can write the vector that describes the dipole direction in the inertial frame as
Let’s define
y = (RIF {rd }F ) × x̂ (2.139)
and
y = k(RIF {rd }F ) × x̂k (2.140)
then
dy x̂
= ẏ = ṘIF {rd }F × x̂ + (RIF {rd }F ) × (2.141)
dt dt
Now we can write
dŷ ˙ ẏ ẏ
= ŷ = − ŷ ŷ · (2.142)
dt y y
Finally,
ẑ˙ = x̂˙ × ŷ + x̂ × ŷ˙ (2.143)
and
dx̂ dŷ dẑ
ṘIi = (2.144)
dt dt dt
• z lies in the plane of the body’s spin axis and the x axis
This system is similar to the GSM system with the following two differences: (1) The magnetic field vector
is replaced with the body’s spin axis, and (2) the system is based on the fixed frame of the central body
and not always referenced to the Earth fixed system, and (3) x points in the opposite direction in the two
systems.
Draft for Release R2018a
38 CHAPTER 2. COORDINATE SYSTEMS
Define the vector rsun as the vector from the central body to the sun. Then,
rsun
x̂ = (2.145)
krsun k
If RI/F is the rotation matrix from the central body’s fixed frame to MJ2000Eq at the current epoch,
then we can write the vector that describes the spin axis in the inertial frame as
rIs = RI/F rF
s (2.147)
and
dy dx̂
= ẏ = ṘI/F rF
s × x̂ + rIs × (2.152)
dt dt
Now we can write
dŷ ẏ ẏ
= ŷ˙ = − ŷ ŷ · (2.153)
dt y y
Finally,
ẑ˙ = x̂˙ × ŷ + x̂ × ŷ˙ (2.154)
and
dx̂ dŷ dẑ
ṘIi = (2.155)
dt dt dt
so we know that
dn
=r×a (2.158)
dt
Draft for Release R2018a
2.7. APPENDIX 1: DERIVATIVES OF OBJECTREFERENCED UNIT VECTORS 39
dr dkrk d v·r
= = (rT r)1/2 = (2.161)
dt dt dt r
dr v·r
= (2.162)
dt r
dv dkvk d v·a
= = (vT v)1/2 = (2.163)
dt dt dt v
so we can write
dv v·a
= (2.164)
dt v
v
v̂ = (2.165)
kvk
r
r̂ = (2.166)
krk
r×v
n̂ = (2.167)
kr × vk
∂ v̂ ∂ a v v · a
v̂˙ = = vv −1 = − 2 (2.170)
∂t ∂t v v v
which can be rewritten as
a v̂
v̂˙ = − (v̂ · a) (2.171)
v v
Finally,
d r×a n
n̂˙ = nn−1 = − 3 (r × a · n) (2.172)
dt n n
r × a n̂
n̂˙ = − (r × a · n̂) (2.173)
n n
Draft for Release R2018a
40 CHAPTER 2. COORDINATE SYSTEMS
Table 2.1: Recommended Values for Pole and Prime Meridian Locations of the Sun and Planets1
Name Values
Sun αo = 286.13◦ (deg)
δo = 63.87◦ (deg)
W = 84.10◦ + 14.1844000◦d (deg)
Ẇ = 14.1844000◦ (deg/s)
Venus αo = 272.76
δo = 67.16
W = 160.20 − 1.4813688d
Ẇ = −1.4813688
Uranus αo = 257.311
δo = −15.175
W = 203.81 − 501.1600928d
Ẇ = −501.1600928
Pluto αo = 313.02
δo = 9.09
W = 236.77 − 56.3623195d
Ẇ = −56.3623195
Draft for Release R2018a
42 CHAPTER 2. COORDINATE SYSTEMS
Table 2.2: Recommended Values for Pole and Prime Meridian Locations of Luna1
Name Values
Luna
αo = 269.9949 +0.0031T −3.8787 sin E1 −0.1204 sin E2
+0.0700 sin E3 −0.0172 sin E4 +0.0072 sin E6
−0.0052 sin E10 −0.0043 sin E13
where
E1 = 125.045 − 0.0529921d E2 = 250.089 − 0.1059842d
E3 = 260.008 + 13.0120009d E4 = 176.625 + 13.3407154d
E5 = 357.529 + 0.9856003d E6 = 311.589 + 26.4057084d
E7 = 134.963 + 13.0649930d E8 = 276.617 + 0.3287146d
E9 = 34.226 + 1.7484877d E10 = 15.134 − 0.1589763d
E11 = 119.743 + 0.0036096d E12 = 239.961 + 0.1643573d
E13 = 25.053 + 12.9590088d
Draft for Release R2018a
2.7. APPENDIX 1: DERIVATIVES OF OBJECTREFERENCED UNIT VECTORS 43
Fi , Ff , ri , vi
First Rotation
Calculate
False
F1 .Axes = FK5 RIi
ṘIi
True
{ri }1 = ri
{vi }1 = vi
Translation
{ri }1 = RIi ri
Calculate
False
rif Fi .Origin = Ff .Origin {vi }1 = ṘIi ri + RIi vi
vif
True
{rf }2 = {ri }1
{vf }2 = {vi }1
Second Rotation
{rf }2 = {ri }1 + rif Calculate
False
Ff .Axes = FK5 Rf I
{vf }2 = {vi }1 + vif
Ṙf I
True
rf = {rf }2
vf = {vf }2
rf = Rf I {rf }2
rf , vf
vf = Ṙf I {rf }2 + Rf I {vf }2
Chapter 3
Calculation Objects
GMAT has the ability to calculate numerous quantities that are dependent upon the states of objects,
coordinate systems, and the mission sequence. These calculation objects can range from the spacecraft
state, to the local atmospheric density, to the positions of celestial bodies with respect to spacecraft, or other
celestial bodies. In chapter, we present how GMAT performs these calculations by showing the mathematical
algorithms.
The chapter begins by discussing different orbit state representations. Each of the orbit state represen-
tations available in GMAT are defined. Next we present the algorithms used to convert between different
state representations. These include the Keplerian elements, modified Keplerian elements, Cartesian state,
spherical state, and the equinoctial elements. In the second section we present how GMAT calculates all
calculation parameters. Examples include the orbit period, percent shadow, and energy. The algorithms to
calculate all parameters are included and described in detail. We conclude this chapter with a presentation
of the algorithms used to calculate libration point and barycenter locations.
3.1.1 Definitions
The Keplerian elements are one of the most commonly used state representations. They provide a way to
define the spacecraft state in way that provides an intuitive understanding of the motion of spacecraft in
orbit. The Keplerian elements are denoted a, e, i, ω, Ω, and ν. They are defined in detail in Table 3.2 and
illustrated in Fig. 3.1. Sections 3.1.2 and 3.1.3 show the algorithms that GMAT uses to convert between the
Keplerian elements and the cartesian state.
The cartesian state is another common state representation and is often used in the numerical integration
of the equations of motion. The cartesian state with respect to a given coordinate system is described in
detail in Table 3.1.
The equinoctial elements are a set of non-singular elements that can be used to describe the state of a
spacecraft. Because they are nonsingular, they are useful for expressing the equations of motion in Variation
of Parameters (VOP) form. The elements can be unintuitive to use however. The equinoctial elements are
described in detail in Table 3.4.
The modified Keplerian elements are similar to the Keplerian elements except a and e are replaced with
the radius of periapsis rp , and the radius of apoapsis ra . rp and ra are often more convenient and intuitive for
describing the dimensions of a Keplerian orbit than a and e. The modified Keplerian elements are defined
in detail in Table 3.6. Note that both the Keplerian and modified Keplerian elements are undefined for
parabolic orbits because the semimajor axis is infinite. Currently, GMAT does not support parabolic orbits
45
Draft for Release R2018a
46 CHAPTER 3. CALCULATION OBJECTS
zI
h, ẑep
i
ν xp
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
yI
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ω
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ω
x̂ep N
x̂I ,Υ
for this reason. Let’s begin by looking at how GMAT converts from the Cartesian state to the Keplerian
elements.
Find: a, e, i, ω, Ω, and ν
We begin by calculating the specific angular momentum and its magnitude.
h= r×v (3.1)
h = khk (3.2)
Draft for Release R2018a
3.1. SPACECRAFT STATE REPRESENTATIONS 47
Elliptic Inclined e ≥ 10−11 , 10−11 ≤ Ω is the angle between the x-axis and the line of
i ≤ π − 10−11 nodes. ω is the angle between the line of nodes and
the eccentricity vector, ν is the angle between the ec-
centricity vector and the spacecraft position vector.
Elliptic Equatorial e ≥ 10−11 , i < Ω = 0, ω is the angle between the x-axis and the
10−11 |i > π − 10−11 eccentricity vector, ν is the angle between the eccen-
tricity vector and the spacecraft position vector.
Circular Inclined e < 10−11 , 10−11 ≤ Ω is the angle between the x-axis and the line of
i ≤ π − 10−11 nodes, ω = 0, ν is the angle between the line of nodes
and the spacecraft position vector.
Circular Equatorial e < 10−11 , i < Ω = 0, ω = 0, ν is the angle between the x-axis and
10−11 |i > π − 10−11 the spacecraft position vector.
Draft for Release R2018a
48 CHAPTER 3. CALCULATION OBJECTS
v
r
r̂
North
δ ψ
y αf
x
Figure 3.2: The Spherical Elements
n = [ 0 0 1 ]T × h (3.3)
n = knk (3.4)
The orbit eccentricity and energy are calculated using
r = krk (3.5)
v = kvk (3.6)
µ
(v 2 − )r − (r · v)v
e= r (3.7)
µ
e = kek (3.8)
2
v µ
ξ= − (3.9)
2 r
For parabolic orbits, the semimajor axis is infinite and the energy is zero. Here we check to see if the orbit
is near parabolic. If |1 − e| < 10−7 an error message is reported and conversion is aborted.
The semimajor axis is computed using
µ
a=− (3.10)
2ξ
Here we check to see if the conic section is nearly singular. If |a(1 − e)| < .001(km) then an error message
is thrown and conversion is aborted.
If the above tests pass, then we continue and calculate the inclination.
hz
i = cos−1 (3.11)
h
There are four special cases for Ω, ω, and ν and each case is treated differently.
Special Case 1: Non-circular, Inclined Orbit
Draft for Release R2018a
3.1. SPACECRAFT STATE REPRESENTATIONS 49
Ω=0 (3.15)
ex
ω = cos−1 (3.16)
e
Fix quadrant for ω: if ey < 0, then ω = 2π − ω
e · r
ν = cos−1 (3.17)
er
ω=0 (3.19)
n · r
ν = cos−1 (3.20)
nr
Fix quadrant for ν: if rz < 0, then ν = 2π − ν
Special Case 4: Circular, Equatorial Orbit
if (e < 10−11 ) and (i < 10−11 )|(i > π − 10−11 ), then
Ω=0 (3.21)
ω=0 (3.22)
r
x
ν = cos−1 (3.23)
r
Fix quadrant for ν: if ry < 0, then ν = 2π − ν
In the next section, we look at how to perform the inverse transformation and convert from Keplerian
elements to the Cartesian state vector.
Draft for Release R2018a
50 CHAPTER 3. CALCULATION OBJECTS
If the previous tests pass, we continue by calculating the semilatus rectum, and the radius.
p = a(1 − e2 ); (3.25)
If 1 + e cos ν < 1e − 10, then the following warning is displayed but computation proceeds. “Warning: The
orbital radius is large in the conversion from Keplerian to Cartesian state and the state may be near a
singularity causing numerical errors in the conversion.”
p
r= (3.26)
1 + e cos ν
The position components of the cartesian state vector are calculated using the following three equations.
r
µ
ẏ = (cos ν + e) (− sin ω sin Ω + cos i cos Ω cos ω) −
p
r (3.31)
µ
sin ν (cos ω sin Ω + cos i cos Ω sin ω)
p
r
µ
ż = [(cos ν + e) sin i cos w − sin ν sin i sin ω] (3.32)
p
Now let’s look at how to calculate the cartesian state given the equinoctial elements.
f (F )
F (i + 1) = F (i) − (3.34)
f ′ (F )
where
na2
Ẋ1 = hkβ cos F − (1 − h2 β) sin F (3.42)
r
na2
Ẏ1 = (1 − k 2 β) cos F − hkβ sin F (3.43)
r
The transformation from the equinoctial system to the inertial Cartesian system is given by
r = X1 f̂ + Y1 ĝ (3.44)
Currently GMAT sets j = 1 for all input states. Now let’s look at how to calculate the cartesian state
given the equinoctial elements.
r = krk (3.48)
v = kvk (3.49)
µ
(v 2 − )r − (r · v)v
e= r (3.50)
µ
e = kek (3.51)
2
v µ
ξ= − (3.52)
2 r
For parabolic orbits, the semimajor axis is infinite and the energy is zero. Here we check to see if the orbit
is near parabolic. If |1 − e| < 10−7 an error message is reported and conversion is aborted.
The semimajor axis is computed using
µ
a=− (3.53)
2ξ
Here we check to see if the conic section is nearly singular. If |a(1 − e)| < .001(km) then an error message
is thrown and conversion is aborted.
The angular momentum unit vector is
r×v
ĥ = (3.54)
kr × vk
The unit vectors that define the equinoctial coordinate system can be calculated using
ĥ2x
fx = 1 − (3.55)
1 + ĥz j
Draft for Release R2018a
3.1. SPACECRAFT STATE REPRESENTATIONS 53
ĥx ĥy
fy = − (3.56)
1 + ĥz j
fz = −ĥx j (3.57)
where j = 1 if ĥz > 0 and j = −1 otherwise. Currently GMAT always assumes j = 1.
ĝ = ĥ × f̂ (3.58)
We now have the necessary information to calculate the elements h, k, p, and q using the following
relationships.
h = e · ĝ (3.59)
k = e · f̂ (3.60)
ĥx
p= (3.61)
1 + ĥz j
ĥy
q=− (3.62)
1 + ĥz j
The final element to calculate is the mean longitude, λ. We begin by computing the eccentric longitude,
F , using
X1 = r · f̂ (3.63)
Y1 = r · ĝ (3.64)
and
1 − k 2 β X1 − hkβY1
cos F = k + √ (3.65)
a 1 − h2 − k 2
1 − h2 β Y1 − hkβX1
sin F = h + √ (3.66)
a 1 − h2 − k 2
sin F
F = tan−1
2 (3.67)
cos F
where β is given by Eq. 3.37. The mean longitude is computed using the generalized Kepler equation
r = krk (3.69)
v = kvk (3.72)
Draft for Release R2018a
54 CHAPTER 3. CALCULATION OBJECTS
Rℓi = [ x̂ ŷ ẑ ]T (3.77)
v′ = Rℓi v (3.78)
αf = tan−1 ′ ′
2 (vy , vz ) (3.79)
Now that we have looked at how to convert from the Cartesian state to the spherical state, let’s look at
the inverse transformation that converts from the spherical state (with ψ and αf ) to the cartesian state.
Draft for Release R2018a
3.1. SPACECRAFT STATE REPRESENTATIONS 55
ra = a(1 + e) (3.92)
rp = a(1 − e) (3.93)
Now let’s look at the inverse transformation.
3.2.1 A1Gregorian
Description: A1Gregorian is the epoch of an object, in the A1 time system, given in the Gregorian date
format.
Dependency: None.
The A1 date, in modified Julian date format is the current independent variable for time in GMAT.
Therefore, it is not necessary to convert the date to another system for this parameter. The only calculation
required for this parameter is to use the algorithm in Sec. ?? to convert from Modified Julian date format
to Gregorian date format.
3.2.2 A1ModJulian
Description: A1ModJulian is the epoch of an object, in the A1 time system, given in the modified Julian
date format.
Dependency: None.
The A1 date, in modified Julian date format is the current independent variable for time in GMAT.
There are no calculations required for this parameter.
3.2.3 Altitude
Description: Altitude is the distance between a spacecraft and a plane tangent to the surface of the body
at the sub-satellite point. GMAT assumes the body is an ellipsoid. The equatorial radius, and properties of
the ellipsoid depend upon the particular body chosen by the user.
Draft for Release R2018a
58 CHAPTER 3. CALCULATION OBJECTS
e2 = 2f − f 2 (3.97)
rxy R
h= −q ; (3.98)
cos(φgd ) 1 − e2 sin2 φgd
3.2.4 AOP
Description: AOP is the argument of periapsis of a spacecraft. The argument of periapsis is the angle between
the eccentricity vector and a vector in the direction of the right ascension of the ascending node. See below
for treatment of circular and equatorial orbits. This algorithm is adopted from Vallado.3
Dependency: Coordinate System.
Given: r and v
Find: ω
r = krk
v = kvk
µ
v2 − r − (r · v)v
e= r
µ
e = kek
Special Case: Circular Orbit
if e < 10−11 then, ω = 0.0 and return.
Otherwise continue,
h= r×v
h = khk
−1 hz
i = cos
h
Special Case: Elliptic, Equatorial Orbit
if i < 10−11 then, e
x
ω = cos−1 (3.99)
e
where ex is the first component of the eccentricity vector.
Fix quadrant for ω: if ey < 0, then ω = 2π − ω
Draft for Release R2018a
3.2. SIMPLE PARAMETERS 59
Otherwise continue
Special Case: Elliptic, Inclined Orbit
n = [ 0 0 1 ]T × h
n·e
ω = cos−1
knkkek
Fix quadrant for ω: if ez < 0, then ω = 2π − ω.
Finally, ω is converted to degrees.
3.2.5 Apoapsis
Description: Apoapsis is the parameter used in stopping conditions to allow the stopping condition algorithm
to locate the time when a spacecraft is at apoapsis. Apoapsis is defined as a point, along an orbital path,
when the component of velocity, in the spacecraft position vector direction, changes from positive to negative.
The Apoapsis parameter is defined as the dot product of the position and velocity vectors.
Dependency: Central Body.
Given: r, v in F1
Find: A
Definitions:
• F1 is the coordinate system in which GMAT originally knows r and v
• F2 is a system with the MJ2000Eq axes, centered at the central body selected by the user.
• A is the Apoapsis parameter
if (F1 6= F2 ) convert r and v to F2 . Then,
A= r·v (3.100)
3.2.6 AZI
Description: AZI is the azimuth angle of a spacecraft, as shown in Fig. 3.1 using the symbol αf .
Dependency: Coordinate System.
Given: r, v and F
Find: αf
AZI is calculated using the algorithm shown in Sec. 3.1.6. There is little benefit using a routine that
calculates only αf and not ψ.
if the selected coordinate system does not have a celestial body as its origin, then exit and throw an error
message.
z-axis of FB
Central Body
xy-plane of FB
T
θB
R B·R
B
B·T
Figure 3.3: Geometry of the B-Plane as Seen From a Viewpoint Perpendicular to the B-Plane
r = krk
v = kvk
Calculate eccentricity related information
µ
v2 − r − (r · v)v
e= r
µ
e = kek
e
ê =
e
If e ≤ 1, then the method fails and returns.
Now let’s calculate the angular momentum and orbit normal vectors.
h= r×v
h = kr × vk
h
ĥ =
h
A unit vector normal to both the eccentricity vector and the orbit normal vector is defined as:
n̂ = ĥ × ê
Draft for Release R2018a
3.2. SIMPLE PARAMETERS 61
Central Body
Incoming Trajectory B
Incoming
Asymptote
Figure 3.4: The B-Vector as Seen From a Viewpoint Perpendicular to Orbit Plane
The following relations are only true for hyperbolic orbits: The semiminor axis, b, can be calculated using
h2
b= √
µ e2 − 1
[ S y − S x 0 ]T
T= q
Sx2 + Sy2
R= S×T
Finally, the desired quantities are found using
BT = B · T
BR = B · R
if F1 6= F2 , convert r and v to F2
A= r·v (3.101)
Draft for Release R2018a
62 CHAPTER 3. CALCULATION OBJECTS
3.2.8 BetaAngle
Definition: The Beta angle, β, is defined as the angle between the orbit normal vector, and the vector from
the celestial body to the sun.
r⊕ × v⊕
ĥ =
kr⊕ × v⊕ k
rs⊕
r̂s⊕ =
ks⊕ k
β = sin−1 ĥ · r̂s⊕ (3.102)
• r⊕ : Position vector of spacecraft with respect to celestial body, in the EarthMJ2000Eq system.
• v⊕ : Velocity vector of spacecraft with respect to celestial body, in the EarthMJ2000Eq system.
BR
θB = tan−1 (3.104)
BT
which is implemented using atan2(BR , BT )
3.2.10 C3Energy
Given: a, and µ
Find: C3
µ
C3 = − (3.105)
a
Comment : a is calculated from the satellite cartesian state as shown in Section 3.1.2, and µ is associated
with the specified central body.
3.2.11 DEC
Description: DEC is the declination of a spacecraft, as shown in Fig. 3.2 using the symbol δ.
Dependency: Coordinate System.
Given: r, v and F
Find: δ
Begin by converting r and v to F if necessary. Then,
r = krk (3.106)
z
δ = sin−1 ( ) (3.107)
r
Draft for Release R2018a
3.2. SIMPLE PARAMETERS 63
3.2.12 DECV
Description: DECV is the declination of velocity of a spacecraft.
Dependency: Coordinate System.
Given: r, v and F
Find: δv
Begin by converting r and v to F if necessary. Then,
vz
δv = sin−1 ( ) (3.108)
v
3.2.13 ECC
Description: ECC is the eccentricity of an orbit and must be greater than or equal to zero. The eccentricity
contains information on the shape of an orbit. If ECC is zero then the orbit is circular. If ECC is greater
than zero, but less than one, the orbit is elliptic. If ECC equals one, the orbit is parabolic. Finally, if ECC
is greater than one, the orbit is hyperbolic. The algorithm used in GMAT to calculate SMA is adopted from
Vallado.3
Dependency: Central Body.
Given: r, v, and µ (Central Body)
Find: e
r = krk (3.109)
v = kvk (3.110)
µ
(v 2 − )r − (r · v)v
e= r (3.111)
µ
e = kek (3.112)
3.2.14 FPA
Description: FPA is the orbit vertical Flight Path Angle as as shown in Fig. 3.2 using the symbol ψ.
Dependency: Coordinate System.
Given: r, v, and coordinate system F .
Find: ψ
Begin by converting r and v to F if necessary. Then,
r · v
ψ = cos−1 (3.113)
rv
3.2.15 EA
Given: ν, e
Find: E
Otherwise,
√
1 − e2 sin(ν)
sin(E) = (3.114)
1 + e cos ν
e + cos ν
cos(E) = (3.115)
1 + e cos ν
E = atan2(sin E, cos E) (3.116)
Draft for Release R2018a
64 CHAPTER 3. CALCULATION OBJECTS
3.2.16 Energy
Description: Energy is the orbit energy.
Dependency: Central Body.
Given: r, v, and central body.
Find: ξ
Begin by converting r and v to a coordinate system with the origin equal to the central body defined by
the user, and the MJ2000Eq axis system. Then,
r=r (3.117)
v=v (3.118)
v2 µ
ξ= − (3.119)
2 r
3.2.17 HMAG
Description: HMAG is the magnitude of the orbit angular momentum.
Dependency: Central Body.
Given: r, v, and central body.
Find: h
Begin by converting r and v to a coordinate system with the origin equal to the central body defined by
the user, and the MJ2000Eq axis system. Then,
h= r×v (3.120)
h = khk (3.121)
h = r × v = [ h x h y h z ]T (3.122)
3.2.19 HA
Description: HA is the orbit Hyperbolic Anomaly and is only defined for hyperbolic orbits. For non-hyperbolic
orbits, HA returns a value of zero.
Dependency: Central Body. Given: ν, e
Find: H
Otherwise,
√
sin(ν) e2 − 1
sinh(H) = (3.123)
1 + e cos ν
H = asinh(sinh(H)) (3.124)
Draft for Release R2018a
3.2. SIMPLE PARAMETERS 65
3.2.20 INC
Description: INC is the inclination of an orbit in the chosen coordinate system.
Dependency: Coordinate System.
Given: r, v, and coordinate system mathcalF .
Find: e
Begin by converting r and v to mathcalF if necessary. Then,
h= r×v (3.125)
h=h (3.126)
hz
i = cos−1 ( ) (3.127)
h
3.2.21 Latitude
Description: Latitude is the geodetic latitude of a spacecraft. The geodedic latitude is defined as the the
angle φgc , as shown in Fig. ( ), where the sub-satellite point is defined by the interscection of a line drawn
from the spacecraft and perpendicular to a plane tangent to the surface of the body. GMAT assumes the
body is an ellipsoid. The equatorial radius, and properties of the ellipsoid depend upon the particular body
chosen by the user. The algorithm in GMAT is taken from Vallado.3
φgc φgd
• φgd is the geodedic latitude of the spacecraft in the body fixed frame.
Draft for Release R2018a
66 CHAPTER 3. CALCULATION OBJECTS
Calculate the geocentric latitude to use as an initial guess to find the geodetic latitude
e2 = 2f − f 2 (3.130)
Set δ = 1.0 to initialize the loop, then,
While ( δ > 10−7 )
φ′ = φgd (3.131)
!
Re2 sin2 φgd
φgd = atan2 z + p , rxy (3.132)
1 − e2 sin φgd
δ = |φgd − φ′ | (3.133)
EndWhile
After convergence, φgd is converted to degrees, and converted to fall between −90◦ and +90◦ degrees.
3.2.22 Longitude
Description: Longitude is the longitude of an object, in the body fixed frame of the central body chosen by
the user.
Dependency: Central Body.
Given: r, central body.
Find: φ
Begin by converting r to the body fixed system of the central body defined by the user. Then,
φ = tan−1
2 (y, x); (3.134)
The calculation is completed by converting to degrees and setting the value to such that −180 ≤ φ < 180.
3.2.23 LST
Description: LST is the local sidereal time of an object, with respect to the selected central body. The local
sidereal time is the sum of the longitude in the bodies fixed frame, and the mean sidereal time. This is
illustrated in Fig. 3.6, where FI is the body’s equatorial inertial system (as described in Sec. 2.6.1), FF
is the body’s fixed system (as described in Sec. 2.6.10). λ is the longitude of the object, in this case a
spacecraft, and θMST is the mean sidereal time of the prime meridian.
Dependency: Central Body.
Given: r, ti (epoch of spacecraft in internal time system), and central body
Find: θLST
Definitions:
• FI equatorial inertial system (as described in Sec. 2.6.1) of selected central body.
• θMST is the mean sidereal time of the central body’s prime meridian.
ŷI
x̂F
ŷF
θLST
λ θMHA
θMST x̂I
We begin by calculating λ using the algorithm described in Sec. 3.2.22. The mean sidereal time θMST is
calculated differently for Earth than for other central bodies. If the central body is Earth, then we use the
following equations to calculate θMST .
First, convert ti , which is the spacecraft epoch in the interal time system (A1 Modified Julian Date), to
TUT 1 , which is the number elapsed Julian centuries from the J2000 epoch.
tut1 − 21544.5
TUT 1 = (3.135)
36525
θMST =67310.54841s+
h 3600s
(876600 + 8640184.812866)TUT 1+ (3.136)
1h
2 −6 3
0.093104TUT 1 − 6.2 × 10 TUT 1
3.2.24 MA
Given: ν, e
Find: M
If e < ( 1 - 1e−11 ) then calculate E using algorithm in Sec. 3.2.15. Then M is calculated using
M = E − e sin E (3.137)
Note: E must be expressed in radians in the above equation, and results in M in radians.
If e > ( 1 + 1e−11 ) then calculate H using algorithm in Sec. 3.2.19. Then M is calculated using
M = e sinh H − H (3.138)
Note: H must be expressed in radians in the above equation, and results in M in radians. GMAT outputs
MA in degrees.
If neither of the above conditions are satisfied, M = 0, and output “Warning: Orbit is near parabolic in
mean anomaly calculation. Setting MA = 0”.
Draft for Release R2018a
68 CHAPTER 3. CALCULATION OBJECTS
3.2.25 MHA
3.2.26 MM
Given: a, e, and µ
Find: n
The orbit is considered either circular or elliptic ( both orbit types use the same equation to calculate n) if
e < 1 − 1e−11 . In this case the mean motion, n, is calculated using
r
µ
n= (3.139)
a3
The orbit is considered hyperbolic if e > 1 + 1e−11 . In this case the mean motion, n, is calculated using
r
µ
n= − 3 (3.140)
a
If neither of the above two conditions are met, the mean motion is calculated using
√
n=2 µ (3.141)
Comment : a and e are calculated from the satellite cartesian state as shown in Section 3.1.2, and µ is
associated with the specified central body.
3.2.27 OrbitPeriod
Given: a, and µ
Find: T
If a < 0, then T = 0, return.
Otherwise,
s
a3
T = 2π (3.142)
µ
Comment : a is calculated from the satellite cartesian state as shown in Section 3.1.2, and µ is associated
with the specified central body.
3.2.28 PercentShadow
The PercentShadow parameter calculates the percentage of the apparent solar disk that is in view from the
perspective of a spacecraft. The algorithm used in GMAT was adapted from Montenbruck10 pgs. 80-83.
s⊙
rB
r⊙
We begin by calculating the vector from the occulting body to the spacecraft, s, using
s = r − rB (3.143)
and the vector from the occulting body to the sun, s⊙ , using
s⊙ = r⊙ − rB (3.144)
(Note that when the occulting body is the same as the central body, s = r, and s⊙ = r⊙ )
Next we calculate the apparent radius of the Sun and occulting body using
R⊙
′
R⊙ = sin−1 (3.145)
kr⊙ − rk
RB
′
RB = sin−1 (3.146)
kr − rB k
If D′ ≥ R⊙
′ ′
+ RB , then the spacecraft is not in the body’s shadow and
p = 0; (3.148)
If D′ ≤ RB
′ ′
− R⊙ , then the spacecraft is in full shadow and
p = 100; (3.149)
If neither of the above conditions are met, the spacecraft is in partial shadow.
If |Rs′ − RB
′
| < D′ < Rs′ + RB′
, then we can calculate the percentage of shadow by calculating the area
of overlap, A, of the two apparent disks as shown in Fig. 3.8.
′
′
2 −1 c1 ′
2 −1 D − c1
A = R⊙ cos ′ + RB cos ′ − D ′ c2 (3.150)
R⊙ RB
Draft for Release R2018a
70 CHAPTER 3. CALCULATION OBJECTS
′
RB
′
R⊙
D′
Occulting Body
Sun
where
′ ′ ′
D 2 + R⊙2 − RB2
c1 = (3.151)
2D′
and
q
R⊙2 − c21
′
c2 = (3.152)
A
p = 100 (3.153)
πR⊙2
′
′ ′
If the condition |R⊙ − RB | < D′ < R⊙
′ ′
+ RB is not satisfied, then the eclipse is annular and we use
′
R2
p = 100 B (3.154)
R⊙2
′
3.2.29 RA
Description: RA is the right ascension of a spacecraft, as shown in Fig. 3.2 using the symbol λ.
Dependency: Coordinate System.
Given: r, v and F
Find: λ
Begin by converting r and v to F if necessary. Then,
λ = tan−1
2 (y, x) (3.155)
3.2.30 RAV
Description: RAV is the right ascension of velocity of a spacecraft, as shown in Fig. 3.2 using the symbol λv .
Dependency: Coordinate System.
Given: r, v and F
Find: λv
Begin by converting r and v to F if necessary. Then,
λv = tan−1
2 (vy , vx ) (3.156)
Draft for Release R2018a
3.2. SIMPLE PARAMETERS 71
3.2.31 RAAN
Description: RAAN is the right ascension of the ascending node as shown in Fig. 3.1 using the symbol Ω.
Dependency: Coordinate System.
Given: r, v, and coordinate system F .
Find: e
Begin by converting r and v to F if necessary. Then,
h= r×v (3.157)
h = khk (3.158)
T
n=[ 0 0 1 ] ×h (3.159)
n = knk (3.160)
−1 hz
i = cos (3.161)
h
if (i ≥ 10−11 ), then n
x
Ω = cos−1 (3.162)
n
Fix quadrant for Ω: if ny < 0, then Ω = 2π − Ω
if (i < 10−11 ), then
Ω=0 (3.163)
3.2.32 RadApo
Given: a, and e
Find: ra
if 1 − e < 10−12 then ra = 0. Note, this means that for parabolica, and hyperbolic orbits, GMAT outputs a
value of zero for RadApo. Otherwise,
ra = a(1 + e) (3.164)
Comment : a and e are calculated from the satellite cartesian state as shown in Section 3.1.2.
3.2.33 RadPer
Given: a, and e
Find: rp
rp = a(1 − e) (3.165)
Comment : a and e are calculated from the satellite cartesian state as shown in Section 3.1.2.
h= r×v (3.166)
h = khk (3.167)
Draft for Release R2018a
72 CHAPTER 3. CALCULATION OBJECTS
2µ
C3 = v 2 − (3.168)
r
where µ is gravitational parameter of the central body at the origin of the given coordinate system. The
outgoing asmympote unit vector, ŝ, is computed using
√
1 C3
ŝ = 2 (h × e) − e (3.169)
h µ
1 + C3
µ
3.2.35 RMAG
Description: RMAG is the magnitude of the spacecraft’s position vector.
Dependency: Central Body.
Given: r and central body.
Find: r
Begin by converting r to a coordinate system with the origin equal to the central body defined by the
user, and the MJ2000Eq axis system. Then,
r = krk (3.172)
3.2.36 SemilatusRectum
Description: SemilatusRectum is the orbit semilatus rectum, which is the magnitude of the position vector,
when at true anomaly of 90◦ .
Dependency: Central Body.
Given: r, v, and µ (central body).
Find: p
Begin by converting r and v to a coordinate system with the origin equal to the central body defined by
the user, and the MJ2000Eq axis system. Then,
h= r×v (3.173)
h = khk (3.174)
2
h
p= (3.175)
µ
3.2.37 SMA
Description: SMA is the semimajor axis of an orbit. The SMA contains information on the size and type of
an orbit. If the SMA is positive, the orbit is elliptic. If the SMA is negative the orbit is hyperbolic. The
SMA is undefined for parabolic orbits. The algorithm used in GMAT to calculate SMA is adopted from
Vallado.3
Dependency: Central Body.
Given: r, v, and µ (Central Body)
Find: a
r = krk (3.176)
v = kvk (3.177)
v2 µ
ξ= − (3.178)
2 r
Draft for Release R2018a
3.2. SIMPLE PARAMETERS 73
3.2.38 TA
Description: TA is the orbit true anomaly as shown in Fig. 3.1 using the symbol ν.
Dependency: Central Body.
Given: r, v, and coordinate system F .
Find: ν
Begin by converting r and v to F if necessary. Then,
h= r×v (3.180)
h = khk (3.181)
T
n=[ 0 0 1 ] ×h (3.182)
n = knk (3.183)
r = krk (3.184)
v = kvk (3.185)
µ
(v 2 − )r − (r · v)v
e= r (3.186)
µ
e = kek (3.187)
−1 hz
i = cos (3.188)
h
There are three special cases, and they are treated differently.
Special Case 1: Elliptic Orbit
if (e ≥ 10−11 ), then e · r
ν = cos−1 (3.189)
er
Fix quadrant for ν: if r · v < 0, then ν = 2π − ν
Special Case 2: Circular, Inclined Orbit
if (e < 10−11 ) and (i ≥ 10−11 ), then n · r
ν = cos−1 (3.190)
nr
Fix quadrant for ν: if rz < 0, then ν = 2π − ν
Special Case 3: Circular, Equatorial Orbit
if (e < 10−11 ) and (i < 10−11 ), then r
x
ν = cos−1 (3.191)
r
Fix quadrant for ν: if ry < 0, then ν = 2π − ν
3.2.39 TAIModJulian
Description: TAIModJulian is the epoch in the TAI time system, expressed in the modified Julian date
format. See Sec. 1.1.1 and 1.2.1 for more details.
Dependency: None.
Given: A1 (epoch in the internal, A1 time system).
Find: T AI
To convert from A1 to TAI we use the following equation
T AI = A1 − 0.0343817sec (3.192)
Draft for Release R2018a
74 CHAPTER 3. CALCULATION OBJECTS
3.2.40 TTModJulian
Description: TTModJulian is the epoch in the TT time system, expressed in the modified Julian date format.
See Sec. 1.1.3 and 1.2.1 for more details.
Dependency: None.
Given: A1 (epoch in the internal, A1 time system).
Find: T T
To convert from A1 to TT we use the following equation
3.2.41 TTGregorian
Description: TTGregorian is the epoch in the TT time system, expressed in the Gregorian date format. See
Sec. 1.1.3 and 1.2.2 for more details.
Dependency: None.
Given: A1 (epoch in the internal, A1 time system).
Find: T T
To convert from A1 to TT we use Eq. (3.193). Then, knowing the epoch in the TT time system in the
modified Julian date format, we use the algorithm in Sec. 1.2.1 to obtain the Gregorian date.
d
s
αu
αp
The radii of the umbra and penumbra cones, rp and ru , at distance ℓ, are respectively
RB
rp = tan αp ℓ + (3.198)
sin αp
RB
ru = tan αu ℓ − (3.199)
sin αu
Finally, if ℓ ≥ 0
dp = d − rp (3.200)
du = d − |ru | (3.201)
If ℓ > 0 du < 0 and ru < 0, then the object is in the total umbral eclipse region.
If ℓ > 0 du < 0 and ru ≥ 0, then the object is in the annular umbral eclipse region.
If ℓ < 0, then the object is on the day side of the occulting body and is not in shadow and
dp = |d − rp | (3.202)
du = |d − |ru || (3.203)
3.2.43 UTCModJulian
Description: UTCModJulian is the epoch in the UTC time system, expressed in the modified Julian date
format. See Sec. 1.1.2 and 1.2.1 for more details.
Dependency: None.
Given: A1 (epoch in the internal, A1 time system).
Find: U T C
To convert from A1 to UTC we use the following equation
The default is to read ∆AT from the file named tai-utc.dat. ∆AT is the accumulated leap seconds since
Jan. 1961.
3.2.44 VelApoapsis
Given: a, e, and µ
Find: va
If e > ( 1 - 1e−12 ) then va = 0.
Otherwise, s
µ 1−e
va = (3.205)
a 1+e
Comment : a and e are calculated from the satellite cartesian state as shown in Section 3.1.2, and µ is
associated with the specified central body.
3.2.45 VelPeriapsis
Given: a, e, and µ
Find: vp
s
µ 1+e
vp = (3.206)
a 1−e
Comment : a and e are calculated from the satellite cartesian state as shown in Section 3.1.2, and µ is
associated with the specified central body.
Draft for Release R2018a
76 CHAPTER 3. CALCULATION OBJECTS
3.2.46 VMAG
Description: VMAG is the magnitude of the spacecraft’s velocity vector, when the velocity is expressed in the
chosen coordinate system.
Dependency: Coordinate System.
Given: v and coordinate system F .
Find: v
Begin by converting v to coordinate system F if necessary. Then,
q
v = kvk = vx2 + vy2 + vz2 (3.207)
3.3.2 EA to TA
Description: This algorithm shows how to calculate ν given E and e and is taken from Vallado.3
Given: E and e.
Find: ν
√
1 − e2 sin(E)
sin ν = (3.208)
1 − e cos E
cos E − e
cos ν = (3.209)
1 − e cos E
ν = atan2(sin ν, cos ν) (3.210)
3.3.3 HA to TA
Description: This algorithm shows how to calculate ν given H and e and is taken from Vallado.3
Given: H and e.
Find: ν
√
e2 − 1 sinh(H)
sin ν = − (3.211)
1 − e cosh H
cosh H − e
cos ν = (3.212)
1 − e cosh H
ν = atan2(sin ν, cos ν) (3.213)
• Define the primary as the heavier of the two bodies, the secondary as the lighter.
• Define the coordinate system x-axis as the axis pointing from the primary to the secondary.
• Define the y-axis to be orthogonal to the x-axis in the plane of the secondary’s motion about the
primary, pointing in the direction the secondary moves about the primary.
• Define the z-axis orthogonal to the x and y axes to form a right-handed system.
This coordinates system is illustrated in Fig. 3.11. The locations of the libration points in the rotating
coordinate system can be found by calculating the values of γ that solve the following equations:
Earth , L1 , L2 at t2
Earth , L1 , L2 at t1
L5
γ3 γ1 γ2
x
L3 L1 L2
∗ ∗
µ 1−µ
Primary Secondary
L4
Figure 3.11: Location of Libration Points
Table 3.7: Location of Libration Points in RLP Frame, with the Origin at the Primary Body
Point x-Position y-Position
L1 1 − γ1 0
L2 1 + γ2 0
L3 −γ3 √0
L4 1/2 √3/2
L5 1/2 - 3/2
We now need to redimensionalize the results found in the rotating system, and perform the necessary
transformations to obtain the results in the MJ2000 system. Let’s assume that rs , vs , and as are the
position, velocity, and acceleration vectors respectively of the secondary body, with respect to the primary
body, expressed in the FK5 system. Then, the position of the ith libration point can be expressed in the
rotating system with the origin centered on the primary body as
T
ri = rs [xi yi 0] (3.224)
where
rs = krs k (3.225)
The velocity of the ith libration point can be expressed in the rotating system with the origin centered on
the primary body as
vs · rs
vi = [xi yi 0]T (3.226)
rs
Now we have the redimensionalized position and velocity vectors of the libration point in the rotating
coordinate system defined by the motion of the secondary body with respect to the primary body. To
determine the position and velocity vectors in the FK5 system, with the origin located at the primary body,
Draft for Release R2018a
80 CHAPTER 3. CALCULATION OBJECTS
and
˙
x̂1 ŷ˙ 1 ẑ˙1
ṘIi = x̂˙ 2 ŷ˙ 2 ẑ˙2 (3.228)
x̂˙ 3 ŷ˙ 3 ẑ˙3
where
rs
x̂ = (3.229)
rs
rs × vs
ẑ = (3.230)
krs × vs k
ŷ = ẑ × x̂ (3.231)
and
vs r̂s
x̂˙ = r̂˙ s = − (r̂s · vs ) (3.232)
rs rs
rs × as ẑ
ẑ˙ = − (rs × as · ẑ) (3.233)
krs × vs k krs × vs k
3.5 Barycenter
The barycenter of a system of point masses, rb , is also called the center of mass. If we have a system of n
bodies, and we know the position of the ith body with respect to a common reference system, then we can
calculate the barycenter of the system using
n
X
mi ri
i=1
rb = n (3.237)
X
mi
i=1
Similarly, we can calculate the velocity of the barycenter using the following equation
n
X
mi vi
i=1
vb = n (3.238)
X
mi
i=1
Draft for Release R2018a
3.6. GROUND STATION MODEL 81
If the station location is defined in terms of the Geodetic reference, then the cartesian location is calculated
as follows:12
Rb
C = q (3.240)
1 − e2b sin2 φ
S = C 1 − e2b (3.241)
rxy cos λ
rF = rxy sin λ (3.244)
rz
To calculate the body-centered MJ2000Eq representation, we calculate the rotation matrix from fixed to
inertial, RIF , using the algorithm in Sec 2.6.10 of the GMAT Mathematical Specification. Then,
rI = RIF rF (3.245)
Draft for Release R2018a
82 CHAPTER 3. CALCULATION OBJECTS
Draft for Release R2018a
Chapter 4
Dynamics Modelling
In this chapter, we present the mathematical forumulation of the orbit and attitude dynamcis models in
GMAT. One of the fundamental capabilities of GMAT is to model the motion of spacecraft in different flight
regimes. The flight regime, such as low Earth, libration point, or lunar, are determined by the forces and
perturbations that dominate the dynamics. The chapter begins with an overview of the orbital equations of
motion and their variational equations. Next, we discuss the formulation for orbital perturbations and the
equations used to model spacecraft thrust. The second half of the chapter is devoted to attitude modeling
and we present the specifications for attitude conversions and kinematic attitude models.
d(mv) X
= Fext (4.1)
dt
where m is the total mass of the spacecraft, r is the position vector of the spacecraft, t is time, and the right
hand side of the equation represents the total sum of external forces. Solving for the acceleration gives us
the second order differential equation
d2 r X Fext ṁ ∂r
= − (4.2)
d2 t m m ∂t
The terms included in the RHS of the equations of motion can be selected by the user, and the form of
several terms (and whether they appear at all) are dependent upon the coordinate system of integration.
If we include all of the possible forces GMAT can model in the summation on the RHS of Eq. (4.2), and
we assume the origin of integration is a celestial body (the barycentric form is slightly different), then the
orbital equations of motion are
nb
!
d2 r µ o
X rks rkj ṁs dr 1 2 Cd A PSR CR A⊙
= − r + ∇φsj + G mk 3 − r3 + − ρvrel v̂rel + r̂s⊙ +
dt2 r3 k=1
rks kj m dt 2 ms ms
k6=j (4.3)
µ µ 2
µ 3
4 − v r + 4(r · v)v + 2(Ω × v) + 2 (r × v)(r · J) + (v × J)
c2 r 3 r c2 r 3 r 2
83
Draft for Release R2018a
84 CHAPTER 4. DYNAMICS MODELLING
nb
!
X rkj
Indirect Third Body Point Mass G mk − 3
k=1
rkj
k6=j
ṁs dr
Spacecraft Thrust
m dt
1 2 Cd A
Atmospheric Drag − ρvrel v̂rel
2 ms
PSR CR A⊙
Solar Radiation Pressure r̂s⊙
ms
µ µ 2
Schwarzschild solution 4 − v r + 4(r · v)v + 2(Ω × v)
c2 r 3 r
ẋ = f (x, t) (4.4)
where T
x = rT vT = [x y z ẋ ẏ ż]T (4.5)
and T T
ẋ = ṙT v̇T = [ẋ ẏ ż ẍ ÿ z̈] (4.6)
Expanding the dynamics equations and retaining only the first order terms yields
∂f
ẋ ≈ ẋ|ref + (x − x|ref ) (4.7)
∂x
We can rewrite Eq. (4.7) by defining δx = ẋ − ẋ|ref as follows.
δ ẋ = Aδx (4.8)
Draft for Release R2018a
4.2. FORCE MODELLING 85
where the Jacobian of the state equations is defined as the “A” matrix as follows:
∂f
A= (4.9)
∂x
From linear systems theory, the solution to Eq. (4.8) has the form
Φ̇ = AΦ (4.11)
GMAT simultaneously integrates the variational equations along with the non-linear state equations from
to to tf to obtain the State Transition Matrix (STM):
Z tf
Φ(to , tf ) = AΦdt (4.12)
to
k th Body
Central Body
rk
rsk
r
xxxxxx
xxxxxx
xxxxxx
xxxxxx
xxxxxx
r̃j xxxxx
xxxxx
xxxxx
xxxxx
r̃s
ŷI
x̂I
We need the governing differential equation that describes the motion of the spacecraft with respect to
the central body. However, we know that we must apply Newton’s 2nd Law in an inertial frame. So, we
begin by defining the relative position of the spacecraft with respect to the central body. From inspection
of Fig.4.1 we see that
r̃j + r = r̃s (4.17)
By reordering and taking the second derivative with respect to time we obtain
where (rk − r) is a vector from the spacecraft to the k th body, ms is the mass of the spacecraft, and mk is
the mass of the k th body. We can write ¨r̃s as simply
n
¨r̃s = G
X mk
(rk − r) (4.20)
krk − rk3
k=1
where the first term is the influence of the spacecraft on the central body, and the second term is the influence
of the k point mass gravitational bodies. We can write ¨r̃j as simply
n
¨r̃j = Gms r + G mk
X
r
3 k
(4.22)
r3 k=1
krkk
k6=j
Draft for Release R2018a
4.2. FORCE MODELLING 87
We can break down the acceleration in the equation above into three physical categories. The first term is
the acceleration on the spacecraft due to a point mass central body. The second type of terms are called
direct terms. They account for the force of the k th body on the spacecraft. The third type of terms are
called indirect. They account for the force of the k th body on the central body.
Let’s look at the contributions to the sensitivity matrix due to point mass perturbations. We notice that
apm is not a function of velocity. So,
Apm = Dpm = 03×3 (4.25)
We also know that
Bpm = I3×3 (4.26)
This leaves Cpm as the only non-trivial term for point mass gravitational effects. Let’s look first at the
derivatives of the point mass term. We can use the vector identity in Eq. (12.4) to arrive at
∂ µj µj rrT
− 3 r = − 3 I3 + 3µj 5 (4.27)
∂r r r r
Similarly, applying Eq. (12.4) to the direct terms we see that
n n n
!
∂ X rk − r X µk X (rk − r) (rk − r)T
µ k = − I3 + 3 µk (4.28)
∂r k=1 krk − rk3 k=1
krk − rk3 k=1
(krk − r) k5
k6=j k6=j k6=j
Finally, the derivative of the indirect terms are zero and we have
n n
!
T
µj rrT X µk X (rk − r) (rk − r)
Cpm = − 3 I3 + 3µj 5 − I3 + 3 µk (4.29)
| r {z r } k=1 krk − rk3 k=1
(krk − r) k5
1 k6=j k6=j
| {z }
2
We know from dynamics that the acceleration in an inertial frame can be calculated using
acb = ∇U (4.31)
where U is the gravitational potential. The potential for a nonspherical body comes from the solution to
Laplace’s equation:
∇2 U = 0 (4.32)
The solution to this equation is most easily expressed in spherical, body-fixed coordinates because it allows
for a convenient separation of variables.
In spherical coordinates the gradient of the gravitational potential is
∂U 1 ∂U 1 ∂U
∇U = ur + uφ + uλ (4.33)
∂r r ∂φ r cos φ ∂λ
We see that there are two singularities in Eq. (4.33). The first is when r = 0, which is a nonphysical case and
we will not discuss it further. The second singularity occurs when φ = ±90◦ . Pines13 developed a uniform
expression of the gravitational potential that avoids the singularity at the poles:
∞ n Xn
µ X R⊗
U= 1+ Anm (u)[Cnm cos(mλ) cosm φ
r n=1
r m=0
(4.34)
+ Snm sin(mλ) cosm φ]
Examining this form of the potential it is easy to see that there is not a singularity at the poles when taking
the gradient in spherical coordinates. Pines rewrites Eq. (4.34) as
∞ n Xn
µ X R⊗
U= 1+ Anm (u)[Cnm rm (s, t)
r n=1
r m=0
(4.35)
+ Snm im (s, t)]
where Cnm and Snm are the gravitational coefficients, s, t, and u are given by
and rm (s, t) and im (s, t) are calculated using the recursive relationships
r0 = 1, r1 = s, i0 = 0, i1 = t
rm = srm−1 − tim−1 , im = sim−1 + trm−1
The coefficients Anm (u) are called “derived” Legendre functions and are given by
dm
Anm (u) = (Pn (u)) (4.36)
dum
where we know from Rodrigues’14 formula that
1 dn 2
Pn0 (u) = Pn (u) = (u − 1)n (4.37)
2n n! dun
and
dm
Pnm (u) = (1 − u2 )m/2 Pn (u) (4.38)
dum
For numerical reasons it is useful to normalize some of the terms in the potential function, U . By
normalizing the spherical coefficients and the derived Legendre polynomials we can improve the stability
of recursive algorithms used to calculate the Legendre polynomials and improved numerical problems. We
Draft for Release R2018a
4.2. FORCE MODELLING 89
use the nondimensionalization approach and described by Lundberg.14 Lundberg chooses the normalization
factor so that the normalized spherical harmonics C̄nm and S̄nm will have a mean square value of one on
the unit sphere. The normalized Legendre functions, P̄nm , are defined so that the product of the spherical
harmonic coefficients and the corresponding Legendre functions remain constant, or
P̄nm C̄nm = Pnm Cnm P̄nm S̄nm = Pnm Snm (4.39)
GMAT uses the normalization factor Nnm given by
1/2
(n − m)!(2n + 1)!
Nnm = (4.40)
(n + m)!
The non-dimensional spherical harmonic coefficients and Legendre functions are
Cnm Snm
P̄nm = Nnm Pnm C̄nm = S̄nm = (4.41)
Nnm Nnm
The derived Legendre polynomials are normalized using
Ānm = Nnm Anm (4.42)
where Ānm are the normalized Legendre polynomials. Lundberg14 showed that there are several recursive
algorithms to compute Ānm but that only two are stable. GMAT uses the following algorithm to recursively
calculate the derived Legendre polynomicals
1/2
(2n + 1)(2n − 1)
Ānm =u Ān−1,m
(n − m)(n + m)
1/2 (4.43)
(2n + 1)(n − m − 1)(n + m − 1)
− Ān−2,m
(2n − 3)(n + m)(n − m)
The recursive algorithm is started using
√
Ā11 = 3 cos φ (4.44)
r
2n + 1
Ānn = cos φ Ān−1,n−1 (4.45)
2n
The above equations are normalized using Eq. (4.42) and used in
The acceleration due to nonspherical gravity can be written as
∂U s ∂U t ∂U u ∂U
ag = − − − r̂
∂r r ∂s r ∂t r ∂u
T (4.46)
1 ∂U 1 ∂U 1 ∂U
+
r ∂s r ∂t r ∂u
To simplify the partial derivatives in Eq. (4.46), Pines defines some intermediate variables as follows
ρ = a/r (4.47)
ρ0 = µ/r
ρ1 = ρρ0 (4.48)
ρn = ρρn−1 for n > 1
Using Lundberg’s nondimensionalization approach, we can write
D̄nm (s, t) = C̄nm rm (s, t) + S̄nm im (s, t)
Ēnm (s, t) = C̄nm rm−1 (s, t) + S̄nm im−1 (s, t)
F̄nm (s, t) = S̄nm rm−1 (s, t) − C̄nm im−1 (s, t)
Ḡnm (s, t) = C̄nm rm−2 (s, t) + S̄nm im−2 (s, t)
H̄nm (s, t) = S̄nm rm−2 (s, t) − C̄nm im−2 (s, t)
(4.49)
Draft for Release R2018a
90 CHAPTER 4. DYNAMICS MODELLING
where
1/2
cn+1,m+2 = cn+1,m+1 [(n − m)(n + m + 3)]
1/2
cn,m+2 = cn,m+1 [(n − m − 1)(n + m + 2)]
1/2
(n + m + 4)(n + m + 3)
cn+2,m+2 = cn+1,m+1
(2n + 5)(2n + 4)
Draft for Release R2018a
4.2. FORCE MODELLING 91
Finally,
∂ag
Cg = (4.63)
∂r
where Cg is a symmetric matrix with components given by
Note that
∂U s ∂U t ∂U u ∂U
a4 = − − − (4.70)
∂r r ∂s r ∂t r ∂u
and is given in Eq. (4.50).
1 2 Cd A
ad = − ρvrel v̂rel (4.71)
2 ms
where
vrel = v − ω ⊗ × r + vw (4.72)
and ω⊗ is the central bodies angular velocity vector, vw is the local wind velocity, Cd is the drag coefficient,
A is the cross sectional area normal to vrel , ρ is the atmospheric density, and ms is the spacecraft mass.
The partial derivatives of the drag force with respect to position and velocity are:
∂ad 1 Cd A ∂ρ T ∂vw x ∂vw x
=− vrel vrel + ρvrel v̂rel − ω B + ρvrel − ωB (4.73)
∂r 2 ms ∂r ∂r ∂r
∂ad 1 ρCd A T
=− vrel v̂rel + vrel I3 (4.74)
∂v 2 ms
s = rs − r (4.76)
where rs is the Sun’s position vector and r is the spacecrafts position vector.
As = Ds = 03×3 (4.77)
Bs = I3×3 (4.78)
CR A 1 ssT
Cs = PSR I3 − 3 5 (4.79)
ms s3 s
where
s = ksk (4.80)
Draft for Release R2018a
92 CHAPTER 4. DYNAMICS MODELLING
FT (T, P )
ṁ = fd (4.86)
Isp (T, P )g
To convert the thrust from the requested local VNB system to the inertial system, GMAT creates a
coordinate system configured as shown below. The Origin field on the thruster is used in two places on the
coordinate system: as both the Origin and the Primary. The axes are set to ObjectReferenced, and the
x-axis and y-axis are respectively set to “V” and “N”.
Create CoordinateSystem SATVNB;
GMAT SATVNB.Origin = DefaultSC;
GMAT SATVNB.Axes = ObjectReferenced;
GMAT SATVNB.Primary = Earth;
GMAT SATVNB.Secondary = DefaultSC;
GMAT SATVNB.XAxis = V;
GMAT SATVNB.YAxis = N;
Using this system, the x-axis is in the velocity direction, the n-axis is in the velocity direction, and the
z-axis completes the right-handed set. Note, the secondary body is not set until the thruster is assigned to
a spacecraft, and then, the secondary is set to be the owner- spacecraft. The script snippet above shows the
configuration after the thruster has been attached to spacecraft “DefaultSC”, using, for example, the script
line DefaultSC.Thrusters = {Thruster1};
Draft for Release R2018a
94 CHAPTER 4. DYNAMICS MODELLING
The LVLH system, similarly to the VNB system, is a local system that is constructed based on the motion
of the owner spacecraft with respect to an origin and axes system chosen by the user. As an example, below
the thruster named Thruster1 is configured to use a local LVLH coordinate system based on the motion of
the owner spacecraft “MySat” and the moon.
Create Thruster Thruster1
Thruster1.CoordinateSystem = Local;
Thruster1.Origin = Luna;
Thruster1.Axes = LVLH;
Internally, GMAT creates a coordinate system configured as shown below. The Origin field on the
thruster is used in two places on the coordinate system, as both the Origin and the Primary. The axes are
set to ObjectReferenced.
Create CoordinateSystem SATLVLH;
GMAT SATLVLH.Origin = MySat;
GMAT SATLVLH.Axes = ObjectReferenced;
GMAT SATLVLH.Primary = Luna;
GMAT SATLVLH.Secondary = MySat;
GMAT SATLVLH.XAxis = -R;
GMAT SATLVLH.YAxis = -N;
Using this system, the y-axis is opposite of orbit normal, the z-axis points towards the origin, and the
x-axis completes the right-handed set.
Draft for Release R2018a
4.3. ATTITUDE 95
4.3 Attitude
The attitude of a spacecraft can be defined qualitatively as how the spacecraft is oriented in inertial space,
and how that orientation changes in time. GMAT has the ability to model the orientation and rate of rotation
of a spacecraft using several different mathematical models. Currently, GMAT assumes that a spacecraft is
a rigid body.
There are many ways to quantitatively describe the orientation and rate of rotation of a spacecraft, just
like there are many ways we can quantitatively describe an orbit state. Let’s define any set of numbers
that can uniquely define the spacecraft attitude as an attitude parameterization. GMAT allows its users to
employ several common attitude parameterizations including quaternions, Euler angles, the Direction Cosine
Matrix (DCM) or Attitude Matrix A, Euler angle rates, and the angular velocity vector. Given an initial
attitude state, GMAT can propagate spacecraft attitude using one of several kinematic or dynamic attitude
propagation models.
Our notation will be based on a compromise that spans multiple disciplinary fields, from astrodynamics
and aircraft flight simulation to computer graphics, and is informed by the AIAA and CCSDS standards. We
want a consistent definition in the inner core algorithms of GMAT combined with the capability of translating
internal variables into interface variables that are easy for users to understand and work with. For example,
if a user wishes to visualize the attitude of a specific mission spacecraft using quaternions extracted from real
world telemetry, GMAT should be flexible enough for that user to define all four quaternion components,
their locations with respect to each other, and their numerical signs. The user should also be able to specify
the two reference frames the attitude parameterization is relating, and the direction the attitude parameters
take a transformation. In other words, following the CCSDS standard, the user should be able to specify
which is the “from” frame and which is the “to” frame.
We should also point out that the parameters presented in this document can describe not only the
“transformation” of a vector between two reference frames, but also the “rotation” of a vector from one
orientation to another in the same reference frame. The literature uses the definition of “transformation”
and “rotation” quite liberally, and a detailed search has found little agreement on terminology and notation.
Almost all authors agree that the components of the 3×3 matrix relating vectors to each other are “Direction
Cosines”. They are the dot products of the basis axes unit vectors of one reference frame with the basis axes
unit vectors of the other reference frame. They are the cosines of the angles between each of the basis axes.
For now it is suggested that the matrix we use to transform or rotate vectors be labeled R to remain
consistent with the mathematical development earlier in this specification in Chapter 2. The 3×3 matrix
R will relate various reference frames to each other and can be used to rotate vectors between frames such
as in the FK5 reduction process. Meanwhile, if we wish to explicitly model the attitude or orientation
of a spacecraft, we can represent this with the 3×3 matrix A. The letter brings the word “Attitude” to
mind, and is used by several well known attitude dynamics authors including Landis Markley who wrote the
”Parameterization of the Attitude” section of “Spacecraft Attitude Determination and Control” by James
R. Wertz, a very popular text in the field. To be consistent with Chapter 2, we should specify the direction
of the transformation with additional notation.
Meanwhile, if we intentionally keep our notation as clutter free as possible, the definition of A will be as
follows.
b = Ar (4.88)
In this equation b is a vector in the spacecraft body frame, and r is a vector in the reference frame. The
attitude matrix A transforms vectors from the reference frame to the body frame.
The human mind has some difficulty visualizing the orientation of a spacecraft when presented with the
nine component attitude matrix. Likewise, it is difficult to know if an aircraft or spacecraft is “upside-down”
given the four components of a quaternion vector. For human interface purposes, the attitude descriptor
of choice is the set of three Euler Angles, such as the classic “roll”, “pitch”, and “yaw”. The CCSDS
specification avoids mentioning the DC matrix altogether. Meanwhile, GMAT will use it as an intermediate
form of attitude parameterization when transforming from internal attitude propagation equations using
quaternions, and human interpretable Euler Angles. GMAT will also use it for both Coordinate System
Fixed and Spinning Spacecraft modes of attitude propagation.
Draft for Release R2018a
96 CHAPTER 4. DYNAMICS MODELLING
In this chapter, we discuss the attitude parameterizations supported in GMAT, and how to convert
between the different types. We discuss the internal state parameterization that GMAT uses. Next we
investigate the types of attitude modes in GMAT and discuss in detail how GMAT propagates the spacecraft
attitude in all of the Kinematic and Dynamic attitude modes. We conclude the chapter with a discussion of
how GMAT converts between different attitude parameterizations.
attitude profile needed for a specific mission. To begin, let’s look at how GMAT calculates the attitude state
in the Coordinate System Fixed attitude mode (CSFixed).
RiI is the DCM matrix relating FI to Fi and GMAT knows how to calculate this matrix for all allowable
Fi . For details on the calculation of this matrix for all coordinate systems in GMAT see Ch. 2. To calculate
{ωIB }B , we start from Euler’s equation:
where
0 −ω3 ω2
{ω× IB }B ≡ ω3 0 −ω1 ≡ Ω (4.91)
−ω2 ω1 0
and {ωIB }B is the skew symmetric angular velocity “cross product matrix” of FB with respect to FI ,
expressed in FB . Solving Equation 4.90 for {ω×
IB }B we obtain
where
ȦBI = ṘiI (4.93)
where ABi comes from user provided data, and RiI (to ) is calculated by GMAT and is dependent upon Fi .
See Ch. 2 for details on how GMAT calculates RiI for all allowable coordinate systems in GMAT.
Before calculating ABI (t) we must determine the spin axis in the body frame, {ωIB }B . If the user has
chosen to provide the angular velocity vector in body frame coordinates, then we already have what we need.
Otherwise, the user provides {ω IB }i . In spinning mode we assume the rotation rate magnitude is constant
and also that the spin axis direction is constant in inertial space. This assumption is only realistic if the
angular velocity is aligned with either the maximum or minimum primary axis of moment of inertia in the
spacecraft body reference frame. If angular velocity is aligned with the axis of minimum moment of inertia,
then we must also assume there is an active attitude control system holding it there. If there is no control
system, and the spacecraft dissipates rotational kinetic energy (all real bodies will) then the direction of the
angular velocity vector will migrate slowly until it is aligned with the axis of maximum moment of inertia.
Draft for Release R2018a
98 CHAPTER 4. DYNAMICS MODELLING
Understanding these assumptions we can state {ωIB }B (t) = {ωIB }B (to ) = {ωIB }B . We can find the spin
axis in the body frame (if we need to) using ABi as follows
Once calculated, GMAT saves the parameters ABo I and {ωIB }B for use in calculating the attitude and rate
at other epochs.
GMAT calculates ABI (t) using the Euler axis/angle to Attitude matrix conversion algorithm in Sec.4.3.2.
The Euler axis is simply the unitized angular velocity vector or,
{ωIB }B
a= (4.96)
ωIB
where
ωIB = k{ωIB }B k (4.97)
Draft for Release R2018a
4.3. ATTITUDE 99
where a1 , a2 , and a3 are components of the unit vector aligned with the Euler Axis or â. This unit vector
is shown near the spacecraft center of mass in Figure 4.2. In Eq. 4.100 the Euler Angle is denoted using
the symbol φ. There are actually two possible values of φ, since the rotation shown in Figure 4.2 can be
the long way around or the short way around. The two possible values will add to 360 ◦. Our definition of
quaternions assumes the smaller angle.
The subscript “c” on the fourth component of the quaternion comes from the CCSDS standard and
most likely stands for “cosine”. The CCSDS has cleverly avoided specifying whether the cosine “scalar”
component should be placed before or after the vector component. This standard has thus eliminated the
confusion of which component of the quaternion should be defined as q1 and which as q4 . The CCSDS
standard does place its initial definition for qc after the definitions for q1 , q2 , and q3 . This lets us stack the
four components in the vector shown in the second part of the definition in Eq. 4.100. If q4 were substituted
for qc , we would have Landis Markley’s definition from the “Parameterization of the Attitude” section in
“Spacecraft Attitude Determination and Control” by Wertz. The third part of the definition above shows
the 3×1 vector component of the quaternion as a single symbol q, placed above qc to form a second 4×1
matrix or vector. This also parallels Markley’s definition and will conveniently fit into the GMAT equations
relating quaternions to the Attitude matrix shown later in this section. Note that for the final part of the
definition in Eq. 4.100, the CCSDS standard uses e to denote the unit vector aligned with the Euler Axis
instead of a. We have chosen a to represent “axis”, and because that is how GMAT is using it later in the
attitude parameterization conversion Section 4.3.2.
In torque free quaternion attitude propagation mode, the user provides four pieces of information. They
first choose a coordinate system, Fi , in which to define the initial conditions. Secondly, they define the initial
attitude with respect to Fi by providing ABi or an equivalent parameterization that is then converted to
the Attitude matrix. GMAT will then use ABi to calculate ABI using Eq. 4.89. From this Attitude matrix
the parameterization will next be converted by GMAT to the quaternion q Bi . Thirdly, the user provides
the angular velocity of the body axes with respect to the inertial axes expressed in Fi , or {ωIB }i . If it is
more convenient for the user to provide angular velocity expressed in the spacecraft body frame, GMAT will
accept this input as well. If the user provides angular velocity in Fi , GMAT will use Eq. 4.95 to convert it to
{ωIB }B . Fourthly, the user provides the mass moment of inertia properties. These can be in the form of the
three principal moments of inertia Ixx , Iyy , and Izz , or a full inertia tensor with the off-diagonal products
of inertia Ixy , Ixz , and Iyz included. In a future release of GMAT the user will be able to use the GUI or
scripting language to assemble a complex spacecraft model from components. Locating and orienting these
components and describing how those that articulate can move, the user will provide enough information for
GMAT to calculate a dynamic inertia tensor. This future capability will also include dynamically adjusting
the components of the inertia tensor as propellant is consumed from tanks.
Draft for Release R2018a
4.3. ATTITUDE 101
GMAT will assemble the data provided by the user into a state vector that can be propagated numerically.
In this case, GMAT will need to create an initial state, and then provide its numerical integrators with the
state vector derivative equations.
We will define an attitude state variable x such that
T T
x = q T ω T = q1 q2 q3 qc ω1 ω2 ω3 (4.101)
where
1
q̇ = Ω(ω)q (4.103)
2
and where
−[ω×] ω
Ω(ω) = (4.104)
−ω T 0
In Eq. 4.104, [ω×] is the skew symmetric angular velocity cross product matrix originally introduced in
Eq. 4.91. As in Eq. 4.91 the angular velocity used here represents the body with respect to the inertial
frame. If we substitute Eq. 4.91 into Eq. 4.104 we get
0 ω3 −ω2 ω1
−ω3 0 ω1 ω2
Ω(ω) = ω2 −ω1
(4.105)
0 ω3
−ω1 −ω2 −ω3 0
Substituting Eq. 4.105 into Eq. 4.103 and multiplying the terms together we get
1
2 ( ω3 q2 − ω2 q3 + ω1 qc )
1 1 (−ω q + ω q + ω q )
2 3 1 1 3 2 c
q̇ = Ω(ω)q = (4.106)
2 1 ( ω2 q1 − ω1 q2 + ω3 qc )
2
1
2 (−ω 1 q1 − ω 2 q2 − ω 3 q3 )
Next let’s evaluate the time derivative of the body angular velocity terms. These are the last three compo-
nents of the state vector derivative in Equation 4.132. Following the Markley/Wertz convention, if we let L
represent angular momentum we can start with a simple equation for angular momentum measured in the
Inertial reference frame.
L= I·ω (4.107)
Euler’s second law says that, in an inertial reference frame, the time derivative of L is the applied torque,
T. We write this as
d
L̇ = (I · ω) = T (4.108)
dt
where I is the body oriented Inertia Tensor. This is a 3×3 matrix with the principal moments of inertia on
the diagonal and the products of inertia on the off-diagonal. It is written as follows.
I11 I12 I13
I = I21 I22 I23 (4.109)
I31 I32 I33
n
X
I22 ≡ mi (ρ2i3 + ρ2i1 ) (4.111)
i=1
n
X
I33 ≡ mi (ρ2i1 + ρ2i2 ) (4.112)
i=1
n
X
I12 = I21 ≡ − mi ρi1 ρi2 (4.113)
i=1
n
X
I23 = I32 ≡ − mi ρi2 ρi3 (4.114)
i=1
n
X
I31 = I13 ≡ − mi ρi3 ρi1 (4.115)
i=1
The signs for the products of inertia depend on how products of inertia are themselves defined. They
can be positive or negative depending on individual authors. Meanwhile, each regular geometric shape, if
constructed of a uniform solid material, will have an analytic formula for each of its moments and products
of inertia. A spacecraft model composed of multiple elements can sum moments and products of inertia for
all components into a single Inertia Tensor. For the current RigidTorqueFreeQuat mode we will assume ours
is diagonal.
I11 0 0
I = 0 I22 0 (4.116)
0 0 I33
In this initial development, we will assume our spacecraft body frame is aligned with its principal axes of
inertia, and that it is a completely rigid body. This will mean our inertia tensor is both diagonal and has a
time derivative of zero. Let’s apply these facts to Eq. 4.108.
d
(I · ω) = (İ · ω) + (I · ω̇) (4.117)
dt
Since we already stated that the time derivative of I is zero, the first term on the RHS of Eq. 4.117 will drop
out. We can now write Eq. 4.108 as follows.
L̇ = T = (I · ω̇) (4.118)
In Eq. 4.118 the angular momentum term is measured in the inertial frame. Let’s express it now in the
spacecraft body frame. Superscripts to the left will indicate the reference frame.
I B B B
L̇ = L̇ + ω× L (4.119)
Substituting 4.118 for L̇ on the RHS of 4.120, and 4.107 for L on the RHS, we get the following.
B B B
T= (I · ω̇) + ω × BI · ω (4.121)
Assuming our Inertia Tensor is diagonal, if we multiply out the terms on the RHS of Eq. 4.121 we will get
three equations for torque along the principal axes of the spacecraft body.
These equations are equivalent to Equations 16-50a through 16-50c on Page 522 of Wertz.
Solving equations 4.122 through 4.124 for angular acceleration, we get
L ≡ Iω (4.128)
which applies to an inertia tensor with off-diagonal products of inertia. The initial conditions for both
parameters on the RHS of Eq. 4.128 will be provided by the User. Multiplying both sides by the inverse of
I, and then solving for angular velocity we get
ω = I−1 L (4.129)
If GMAT calculates changes in I based on articulation, and for later modes includes propellant mass con-
sumption, and it integrates L̇ to get L, during each integration step we can use Eq. 4.129 to calculate current
angular velocity ω. Solving Eq. 4.120 for L̇, we get
B B B B
L̇ = T− ω× L (4.130)
If the user inputs all the same initial conditions as they did in RigidTorqueFreeQuat mode, with the addition
of a full inertia tensor with products, and GMAT tracks articulation of components and adjusts the inertia
tensor dynamically, the state vector to calculate will now be
T T
x = qT LT = q1 q2 q3 qc L1 L2 L3 (4.131)
where the initial condition of L is calculated from Eq. 4.128. To get angular velocity, rather than integrating
Euler’s Moment Equations, we will use Eq. 4.129 which means we need to invert a 3×3 matrix. Since a full
inertia tensor is still symmetric, we can use Cramer’s rule to invert it with no numerical pathologies. The
time derivative of x, which we need to send to the GMAT numerical integrators will be
T T
ẋ = q̇ T L̇T = q˙1 q˙2 q˙3 q˙c L˙1 L˙2 L˙3 (4.132)
We get q̇ from Eq. 4.106 and L̇ from Eq. 4.130. For this torque free mode we can choose to set the torque
vector in Eq. 4.130 to zero. We now have everything GMAT needs to integrate our quaternion attitude
equations of motion for a torque free articulated tumbling body.
Draft for Release R2018a
104 CHAPTER 4. DYNAMICS MODELLING
0 −q3 q2
q× = q3 0 −q1 (4.134)
−q2 q1 0
1
c= (4.135)
q12 + q22 + q32 + qc2
A = c (qc2 − qT q)I3 + 2qqT − 2qc q× (4.136)
where I3 is a 3×3 identity matrix. Multiplying out Eq. 4.136 we get
2
(qc − q12 − q22 − q32 ) 0 0
A = c 0 (qc2 − q12 − q22 − q32 ) 0 +
0 0 (qc2 − q12 − q22 − q32 )
2
q1 q1 q2 q1 q3 0 −qc q3 qc q2
q2 q1 q22 q2 q3 + qc q3 0 −qc q1 (4.137)
q3 q1 q3 q2 q32 −qc q2 qc q1 0
Draft for Release R2018a
4.3. ATTITUDE 105
If we substitute the traditional symbol q4 in for the CCSDS symbol qc , we will get the exact identity shown
in Equation 12-13a on Page 414 of Wertz, except for the constant term c. That is there to normalize the
Attitude matrix if the quaternion magnitude is not exactly equal to 1.
It may seem a waste of space to multiply out all these terms when the math was so compact in the form
shown above in Eq. 4.136. However, when coding this algorithm, several multiply by zero and add to zero
operations will be avoided if Eq. 4.138 is used instead. So it may be a waste of space, but it is a savings in
time when running GMAT.
if im = 2
A21 + A12
2vim + 1 − trace(A)
q′′ = (4.142)
A23 + A32
A31 − A13
if im = 3
A31 + A13
A32 + A23
q′′ =
2vim + 1 − trace(A) (4.143)
A12 − A21
if im = 4
A23 − A32
A31 − A13
q′′ =
A12 − A21
(4.144)
1 + trace(A)
We normalize q′′ using
q′′
q′ = (4.145)
kq′′ k
Finally,
q = [ q1′ q2′ q3′ ]T (4.146)
and
qc = qc′ (4.147)
Draft for Release R2018a
106 CHAPTER 4. DYNAMICS MODELLING
Continuing to multiply and sum terms, Eq. 4.154 becomes nine separate equations, one for each of the
elements of the Attitude Matrix.
A11 = cos φ + a21 − a21 cos φ
A12 = a1 a2 − a1 a2 cos φ + a3 sin φ
A13 = a1 a3 − a1 a3 cos φ − a2 sin φ
A21 = a2 a1 − a2 a1 cos φ − a3 sin φ
A22 = cos φ + a22 − a22 cos φ (4.155)
A23 = a2 a3 − a2 a3 cos φ + a1 sin φ
A31 = a3 a1 − a3 a1 cos φ + a2 sin φ
A32 = a3 a2 − a3 a2 cos φ − a1 sin φ
A33 = cos φ + a23 − a23 cos φ
It may seem a waste of space to multiply out all these terms when the math was so compact in the form
shown above in Eq. 4.153. However, when coding this algorithm, several multiply by zero operations will be
avoided if Equations 4.155 are used instead. So it may be a waste of space, but it is a savings in time when
running GMAT.
Draft for Release R2018a
4.3. ATTITUDE 107
cos θ2 0 − sin θ2
A2 (θ2 ) = 0 1 0 (4.157)
sin θ2 0 cos θ2
1 0 0
A1 (θ3 ) = 0 cos θ3 sin θ3 (4.158)
0 − sin θ3 cos θ3
Now we can write
1 0 0 c2 0 −s2 c1 s1 0
A321 = A1 (θ3 )A2 (θ2 )A3 (θ1 ) = 0 c3 s3 0 1 0 −s1 c1 0 (4.159)
0 −s3 c3 s2 0 c2 0 0 1
Equation 4.160 is equivalent to the matrix at the bottom of the left hand column of Table E-1 on Page
764 of Wertz. The approach for obtaining the Attitude matrix is similar for the remaining 11 Euler angle
sequences. Rather than derive the Attitude matrices for the remaining 11 sequences, we present them in
Table 4.3.
At first glance, we may choose to calculate θ3 using θ3 = tan−1 (A23 /A33 ). However, in the case that
θ2 = 90◦ , this would result in the indeterminate case, θ3 = tan−1 (A23 /A33 ) = tan−1 (0/0). An improved
method, found in the ADEAS mathematical specifications document, is to determine θ3 using
A31 sin θ1 − A32 cos θ1
θ3 = tan−1 (4.164)
−A21 sin θ1 + A22 cos θ1
Substituting values from Eq. 4.160 into Eq. 4.164, and using abbreviated notation, we see that
−1 s1 (s3 s1 + c3 s2 c1 ) − c1 (−s3 c1 + c3 s2 s1 )
θ3 = tan (4.165)
s1 (c3 s1 − s3 s2 c1 ) + c1 (c3 c1 + s3 s2 s1 )
Now, if θ2 = 90◦ , and we substitute c2 = 0 and s2 = 1 into the above equation, we see we get a determinate
form. Results for all twelve Euler Sequences are shown in Table 4.5.
Note: For all tan−1 we need to use a quadrant check ( equivalent to atan2 ) to make sure the the correct
quadrant is chosen.
Table 4.3: Attitude Matrices for 12 Unique Euler Angle Rotation Sequences
c3 c2 c3 s2 s1 + s3 c1 −c3 s2 c1 + s1 s3
A = R3 (θ3 )R2 (θ2 )R1 (θ1 ) = −s3 c2 −s3 s2 s1 + c3 c1 s3 s2 c1 + c3 s1
s2 −c2 s1 c2 c1
c3 c2 c3 s2 c1 + s1 s3 c3 s2 s1 − s3 c1
A = R2 (θ3 )R3 (θ2 )R1 (θ1 ) = −s2 c2 c1 c2 s1
s3 c2 s3 s2 c1 − c3 s1 s3 s2 s1 + c3 c1
c2 c1 s2 −c2 s1
A = R1 (θ3 )R3 (θ2 )R2 (θ1 ) = −c3 s2 c1 + s3 s1 c3 c2 c3 s2 s1 + s3 c1
s3 s2 c1 + c3 s1 −s3 c2 −s3 s2 s1 + c3 c1
c3 c1 + s3 s2 s1 s3 c2 −c3 s1 + s3 s2 c1
A = R3 (θ3 )R1 (θ2 )R2 (θ1 ) = −s3 c1 + c3 s2 s1 c3 c2 s3 s1 + c3 s2 c1
c2 s1 −s2 c2 c1
c3 c1 − s3 s2 s1 c3 s1 + s3 s2 c1 −s3 c2
A = R2 (θ3 )R1 (θ2 )R3 (θ1 ) = −c2 s1 c2 c1 s2
s3 c1 + c3 s2 s1 s3 s1 − c3 s2 c1 c3 c2
c2 c1 c2 s1 −s2
A = R1 (θ3 )R2 (θ2 )R3 (θ1 ) = −c3 s1 + s3 s2 c1 c3 c1 + s3 s2 s1 s3 c2
s3 s1 + c3 s2 c1 −s3 c1 + c3 s2 s1 c3 c2
c2 s2 s1 −s2 c1
A = R1 (θ3 )R2 (θ2 )R1 (θ1 ) = s3 s2 c3 c1 − s3 c2 s1 c3 s1 + s3 c2 c1
c3 s2 −s3 c1 − c3 c2 s1 −s3 s1 + c3 c2 c1
c2 s2 c1 s2 s1
A = R1 (θ3 )R3 (θ2 )R1 (θ1 ) = −c3 s2 c3 c2 c1 − s3 s1 c3 c2 s1 + s3 c1
s3 s2 −s3 c2 c1 − c3 s1 −s3 c2 s1 + c3 c1
c3 c1 − s3 c2 s1 s3 s2 −c3 s1 − s3 c2 c1
A = R2 (θ3 )R1 (θ2 )R2 (θ1 ) = s2 s1 c2 s2 c1
s3 c1 + c3 c2 s1 −c3 s2 −s3 s1 + c3 c2 c1
c3 c2 c1 − s3 s1 c3 s2 −c3 c2 s1 − s3 c1
A = R2 (θ3 )R3 (θ2 )R2 (θ1 ) = −s2 c1 c2 s2 s1
s3 c2 c1 + c3 s1 s3 s2 −s3 c2 s1 + c3 c1
c3 c1 − s3 c2 s1 c3 s1 + s3 c2 c1 s3 s2
A = R3 (θ3 )R1 (θ2 )R3 (θ1 ) = −s3 c1 − c3 c2 s1 −s3 s1 + c3 c2 c1 c3 s2
s2 s1 −s2 c1 c2
c3 c2 c1 − s3 s1 c3 c2 s1 + s3 c1 −c3 s2
A = R3 (θ3 )R2 (θ2 )R3 (θ1 ) = −s3 c2 c1 − c3 s1 −s3 c2 s1 + c3 c1 s3 s2
s2 c1 s2 s1 c2
Draft for Release R2018a
4.3. ATTITUDE 111
Receiver
The receiver model supports a frequency model and a reception feasibility model. The frequency model
allows the user to specify the frequency capabilities of the receiver using different methods. The feasibility
model determines whether an RF signal sensed at the receiver can feasibly detected given the receivers
capability as defined by the frequency model.
When the frequency model CenterAndBandwidth is selected, the feasibility test is as follows. Define
the frequency transmitted by the originating transmitter as Ft , the receiver’s center frequency as FC , the
bandwidth as ∆F , and the range rate between transmitter and receiver as ρ̇ (which is positive when the
distance ρ is increasing). The frequency at the receiver is calculated using
ρ̇
Fr = Ft (1 − ) (4.168)
c
where c is the speed of light. Define the upper limit of the receiver as Fu = Fc + ∆F/2 and the lower limit
as Fl = Fc − ∆F/2 . If
Fl ≤ Fr ≤ Fu (4.169)
then the received frequency is received by the receiver model. If the above test fails, the receiver does not
receive the signal.
Transmitter
Transponder
Antenna
mf ,Tf ,Pf
Catalyst Bed
ṁe , Pe , ve
ṁo
mr = (4.174)
ṁf
Draft for Release R2018a
4.4. SPACECRAFT MODEL 115
0.8
Thrust
0.6
0.4
Thrust
0.2 Thrust Centroid
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
Time
Figure 4.5: Sample Thrust Pulse Profile
Z tf
t T ′ (t)dt
tc = Z0 tf (4.182)
T ′ (t)dt
0
ṁ ṁ
Ti c∗ = Isp g
Pi Pe
FT
where
ṁ mass flow rate, kg/s
Ti fuel inlet temperature, K◦
Pi fuel inlet pressure, Pa
c∗ characteristic velcocity, m/s
Is p specific impulse, s
go 9.801 m/s2
Pe nozzle exit pressure, Pa
Ae nozzle exit area, m2
FT force due to thrust, N
In practice, ve or Pe are not measured. We’ll assume the tests are performed in a vacuum so Pa = 0. To
understand how we relate the measurements to physical model, let’s define a new quantity Isp , where
FT
Isp = (4.187)
ṁgo
we can rewrite this as
FT = ṁIsp go (4.188)
Comparing Eq.s (4.185) and (4.188) we see that
(Pe − Pa )Ae
c∗ = Isp go = ve − (4.189)
ṁ
Equation (4.189) shows that Isp is a measure of the effective (characteristic) exhaust velocity. Isp contains
information on the energy stored in the fuel and how that energy translates to exit velocity. When Isp is
calculated from measured thrust data, the Isp contains a correction for exhaust velocity for force due to
pressure (Pe − Pa )Ae .
Draft for Release R2018a
4.4. SPACECRAFT MODEL 117
The characteristic velocity, and hence Isp , depend on the type of fuel and the inlet temperature and
pressure of the fuel. Experimental data determines how
FT
Isp (Ti , Pi ) = (4.190)
ṁgo (Ti ,Pi )
ṁ Known
Ti Known
Pi Known
go Known
FT Measured
Is p Calculated
Draft for Release R2018a
118 CHAPTER 4. DYNAMICS MODELLING
u = cT (4.191)
hg = Tg (cg + Rg ) (4.193)
The notation used in tank model development is shown below. After presenting notation, we present the
dynamics model for a pressurant tank.
Nomenclature
Ag , Aℓ , Aw = Heat transfer area
cv , cg = Specific heat at constant volume
D = Tank diameter
d = Liquid surface diameter
Gr = Grashof number
hℓ , hv = Enthalpy
mg , mℓ , mw , mv = Mass
Pg , Pv , Pt = Pressure
Rv , Rg = Gas constant
Tg , Tℓ , Tw , Tv , Ta = Temperature
ug , uℓ , uw , uv = Specific internal energy
Vg , Vℓ , Vt = Volume
Ẇ = Work rate
Q̇g , Q̇v , Q̇l , Q̇w = Heat transfer rate
νl , νg , νv = Specific volume
Subscripts
a = Ambient
g = Pressurant gas
ℓ = Propellant liquid
t = Total
v = Propellant vapor
w = Tank wall
e = Exit-flow
i = In-flow
Draft for Release R2018a
4.4. SPACECRAFT MODEL 119
Pressurant Tank
The pressurant tank model is the simplest of the tank models primarily due to the fact that there is only
one substance, the pressurant gas, contained in the tank. In this section, we develop a state space model for
pressurant tank dynamics. We choose the state variables to be pressurant gas mass and temperature, mg
and Tg respectively, and tank wall temperature Tw .
In Fig.4.11 we see an illustration of a pressurant tank. We divide the tank into two control volumes: the
gas region and the tank wall region. The only mass flow in the system occurs where pressurant gas exits the
tank. Heat transfer occurs between the gas and the wall, and the wall and the ambient surroundings.
2.Tank Wall
mw , T w
1.Gas
Q̇w mg , Pg , Tg
Q̇g
ṁe ,hg
Figure 4.7: Pressurant Tank Diagram
Knowing the volume of the tank and the state variables mg , Tg , and Tw , we calculate pressure from one
of the following two equations of state:
mg Rg Tg
Pg = (4.194)
Vg
or from the Beattie-Bridgeman Eq.
Rg Tg ag bg
Pg = + 2+ 3 (4.195)
Vg Vg Vg
The state variables mg , Tg , and Tw are described by ordinary differential equations found by applying the
first law of thermodynamics and the conservation of mass. The 1st Law applied to the gas control volume
yields
d
(mg ug ) = Q̇g − ṁe hg (4.196)
dt
The 1st Law applied to the wall control volume yields
d
(mw uw ) = Q̇w − Q̇g (4.197)
dt
and finally from conservation of mass we obtain
For these equations to be useful for numerical integration, we need to expand the derivatives, and if necessary,
decouple the equations (as we’ll see, for the pressurant tank, the equations are not coupled).
Expanding the terms in Eq. (4.296) we have
Solving the system of equations yields the following differential equations of state for the pressurant tank
heat transfer model.
The adiabatic model is obtained by setting the terms Q̇g and Q̇w to zero in the above equations. (Note for
the adiabatic model there are only two state variables, mg and Tg , as the wall temperature Tw is removed
from the system of equations.) Similarly, the isothermal model is obtained by setting Ṫg and Ṫw to zero. So,
for the isothermal model there is only one state variable mg .
In summary, for the pressurant tank, all models calculate the tank pressure using
mg Rg Tg
Pg =
Vg
then the specific equations for the heat transfer, adiabatic, and isothermal models, are as follows
Pressurant Tank: Heat Transfer
State Variables: mg , Tg , Tw
ṁg = −ṁe
1
Ṫg = Q̇g − Tg Rg ṁe
mg cg
1
Ṫw = Q̇w − Q̇w
mw cw
Pressurant Tank: Adiabtic
State Variables: mg , Tg
ṁg = −ṁe
Tg Rg
Ṫg = ṁe
mg cg
Blowdown Tank
The blowdown tank model is significantly more complex than the pressurant tank model due to the presence
of liquid fuel and fuel vapor contained in the tank ullage. In this section, we develop a state space model
for a blow down tank. We choose the state variables to be the liquid mass and temperature, mℓ and Tℓ , the
gas temperature Tg , and tank wall temperature Tw .
In Fig.4.12 we see an illustration of a blow down tank. We divide the tank into three control volumes:
the gas region, the liquid region, and the tank wall region. Mass flow occurs where the pressurant gas exits
the tank and at the boundary between the liquid and gas in the form of evaporation. Heat transfer occurs
between all three control volumes as well as with the surroundings. In summary, the physical processes
modelled for a blow down tank are
Draft for Release R2018a
4.4. SPACECRAFT MODEL 121
2.Liquid
mℓ , T ℓ
Q̇ℓ
ṁe ,hl
Figure 4.8: Blow Down Tank Diagram
Assume we are given mg , the tank diameter D, and hence know the total tank volume Vt , and we know
the physical constants associated with the liquid and gas (Rg , cg , νg , cℓ , νℓ (Tℓ ) and Pv (Tℓ )). We choose the
state variables mℓ , Tℓ , Tg , and Tw , all other tank properties can be calculated from these state variables
using the following equations:
To determine the state equations governing mℓ , Tℓ , Tg , and Tw we apply the 1st law of thermodynamics
and the law of conservation of mass. The 1st Law applied to the gas control volume is
d
(mv uv + mg ug ) = Q̇v + Q̇g − Pt V̇g + ṁv hv (4.211)
dt
Draft for Release R2018a
122 CHAPTER 4. DYNAMICS MODELLING
d
(mℓ uℓ ) = Q̇ℓ − Q̇v + Pt V̇g − ṁv hlg − ṁe hℓ (4.212)
dt
The 1st Law applied to the wall control volume yields
d
(mw uw ) = Q̇w − Q̇ℓ − Q̇g (4.213)
dt
and finally from conservation of mass:
ṁℓ = −ṁe − ṁv (4.214)
we also know that
Pv V̇g Pv Vg Ṫg
ṁv = − (4.215)
Rv Tg Rv Tg2
where we assume that
Ṗv ≈ 0 (4.216)
Equations (4.311) - (4.315) are five equations in five unknowns (mv , mℓ , Tℓ , Tg , and Tw ). Our approach
is to use Eq. (4.314) to eliminate ṁv terms. The result is a system of four equations in four unknowns
using Eqs. (4.311), (4.312), (4.313), and (4.315). The result we seek is four decoupled ordinary differential
equations for mℓ , Tℓ , Tg , and Tw .
Let’s continue with Eq. (4.311). We need to rewrite the equation in terms of ṁℓ and Ṫg (T˙w and Ṫℓ don’t
appear explicitly). Expanding the derivatives assuming ṁg = 0 yields
Now, substituting ṁv = −ṁℓ − ṁe and noting that V̇g = −νl ṁℓ if we assume
dνℓ
ν̇ℓ = Ṫℓ ≈ 0
dTℓ
we arrive at
Now continuing with Eq. (4.312) expanding the derivatives and making similar substitutions as we made
previously we obtain
Finally, by eliminating ṁv in the Gas Law shown in Eq. (4.315) we obtain
Equations (4.318), (4.320), (4.321), and (4.323) are four coupled ordinary differential equations that can
be decoupled by casting them in matrix form as follows:
A11 0 A13 0 ṁℓ b1
A21 A22 0 0 Ṫℓ b2
= (4.224)
0 0 0 A34 Ṫg b3
A41 A43 0 Ṫw b4
where
A11 = Tg Rv − Pt νℓ (4.225)
A13 = mv cv + mg cg (4.226)
A21 = cℓ Tℓ + Pt vl − hv (4.227)
A22 = mℓ cℓ (4.228)
A34 = mw cw (4.229)
A41 = 1 − νℓ /νv (4.230)
A43 = −mv /Tg (4.231)
b1 = Q̇v + Q̇g − ṁe Tg Rv (4.232)
b2 = Q̇ℓ − Q̇v + ṁe (hv − cℓ Tℓ ) (4.233)
b3 = Q̇w − Q̇ℓ − Q̇g (4.234)
b4 = −ṁe (4.235)
A43 b1 − A13 b4
ṁℓ = (4.236)
A11 A43 − A41 A13
1 A43 b1 − A13 b4
Ṫℓ = b2 − A21 (4.237)
A22 A11 A43 − A41 A13
A11 b4 − A41 b1
Ṫg = (4.238)
A11 A43 − A41 A13
b3
Ṫw = (4.239)
A34
For the adiabatic model we set all heat transfer rates, Q̇, to zero in Eqs. (4.332)-(4.335) and so there are
only two state variables as Ṫw = 0 and so Tw = constant.
Now let’s develop equations for an isothermal model of a blow down tank. In the isothermal model, we
assume Tℓ = Tg = Tw = T . The only state variable that requires a differential equation is mℓ . Because Tg ,
Tℓ , and hence, Pv are constant, we know that
Pv V̇g
ṁv = (4.240)
Rv Tg
Subtituting this result into Eq.(4.314) and solving for ṁℓ we obtain.
ṁe
ṁℓ = − (4.241)
Pv νℓ
1−
Rv T
Draft for Release R2018a
124 CHAPTER 4. DYNAMICS MODELLING
In summary for the heat transfer model for a blow down tank, we choose mℓ , Tℓ , Tg , and Tw are state
variables. Eqs. (4.305)-(4.310) are used to calculate the remaining tank properties, and Eqs. (4.336)-(4.339)
are used to model the tank states as functions of time.
For the all three models, heat transfer, adiabatic, and isothermal, knowing the state variables mℓ , Tℓ , Tg ,
and Tw we compute the remaining tank properties using
Vℓ = νℓ (Tℓ )mℓ
Vg = Vt − Vℓ
mg Rg Tg
Pg =
Vg
Pv = Pv (Tℓ )
Pv Vg
mv =
Rv Tg
Pt = Pv + Pg
The models differ in the number of state variables and in the state rate equations. A summary is presented
below.
Blow Down Tank: Heat Transfer
State Variables: mℓ , Tℓ , Tg , Tw
A43 b1 − A13 b4
ṁℓ =
A11 A43 − A41 A13
1 A43 b1 − A13 b4
Ṫℓ = b2 − A21
A22 A11 A43 − A41 A13
A11 b4 − A41 b1
Ṫg =
A11 A43 − A41 A13
b3
Ṫw =
A34
where Aij and bi are given by Eqs. (4.325)-(4.335).
Blow Down Tank: Adiabtic
State Variables: mℓ , Tℓ , Tg
A43 b1 − A13 b4
ṁℓ =
A11 A43 − A41 A13
1 A43 b1 − A13 b4
Ṫℓ = b2 − A21
A22 A11 A43 − A41 A13
A11 b4 − A41 b1
Ṫg =
A11 A43 − A41 A13
where Aij and bi are given by Eqs. (4.325)-(4.335). Note that all heat flow rates, Q̇, are set to zero.
Blow Down Tank: Isothermal
State Variables: mℓ
ṁe
ṁℓ = −
Pv νℓ
1−
Rv T
heat transfer or adiabitic model, we must simultaneously solve the equations associated with the pressurant
tank. For the regulated tank model, we choose the state variables to be the liquid mass and temperature,
mℓ and Tℓ , the gas temperature Tg , tank wall temperature Tw , and the incoming pressurant gas mass mi .
In Fig.4.13 we see an illustration of a pressure regulated tank. Like the blow down tank model, we divide
the tank into three control volumes: the gas region, the liquid region, and the tank wall region. Mass flow
occurs where the pressurant gas exits the tank, at the boundary between the liquid and gas in the form of
evaporation, and from the pressurant tank to the ullage of the regulated tank. Heat transfer occurs between
all three control volumes as well as with the surroundings. Hence, the physical processes modelled for a blow
down tank are the same as those listed for the blow down tank, with the added process of mass flow from
the pressurant tank.
Q̇w ṁi , hi
3.Tank Wall
mw , T w 1.Gas/Vapor
mg , mv , Pg , Pv , Tg
Q̇v ṁv , hlg Q̇g
2.Liquid
mℓ , T ℓ
Q̇ℓ
ṁe ,hl
Figure 4.9: Pressure Regulated Tank Diagram
The derivation of the state equations for a pressure regulated tank follows naturally from the derivation
of the blow down tank. The only control volume that differs between the two models is the gas/vapor control
volume. Applying the 1st Law of thermodynamics to the gas/vapor control volume of the pressure regulated
tank gives us
d
(mv uv + mg ug ) = Q̇v + Q̇g − Pt V̇g + ṁv hv + ṁp hp (4.242)
dt
Taking the time derivative of the gas law for the gas contained in the tank ullage yields
Pg V̇g Pg Vg Ṫg
ṁg = − (4.243)
Rg T Rg Tg2
Equations (4.342) and (4.343), together with equations (4.320), (4.321), and (4.323) are a system of 5
equations in 5 unknowns which can be decoupled using simple linear algebra. However, first we must expand
Eqs. (4.342) and (4.343) and write them in terms of the state rate derivatives. Expanding Eq. (4.342) we
arrive at
(Rv Tg − Pt νℓ ) ṁℓ + (mv cv + mg cg ) Ṫg +
(4.244)
(cg T g − hp ) ṁg = Q̇v + Q̇g − ṁe Rv Tg
Similarly, for Eq. (4.343) we obtain
νℓ mg
ṁℓ + Ṫg + ṁg = 0 (4.245)
νg Tg
Draft for Release R2018a
126 CHAPTER 4. DYNAMICS MODELLING
To integrate the state equations we must decouple the equations and this is easily done by casting the
equations in matrix form and solving the system of equations. We can write the equations is state space for
as follows
A11 0 A13 0 A15 ṁℓ b1
Ṫℓ b2
A21 A22 0 0 0
0 0 0 A34 0 Ṫ = b (4.246)
g 3
A41 0 A43 0 0 Ṫw b4
A51 0 A43 0 A55 ṁg 0
where the coefficients Aij and bi are given by
A11 = Tg Rv − Pt νℓ (4.247)
A13 = mv cv + mg cg (4.248)
A15 = cg T g − hp (4.249)
A21 = cℓ Tℓ + Pt vl − hlg (4.250)
A22 = mℓ cℓ (4.251)
A34 = mw cw (4.252)
A41 = 1 − νℓ /νv (4.253)
A43 = −mv /Tg (4.254)
A51 = νℓ /νg (4.255)
A53 = mg /Tg (4.256)
A55 = 1 (4.257)
b1 = Q̇v + Q̇g − ṁe Rv Tg (4.258)
b2 = Q̇ℓ − Q̇v + ṁe (hlg − cℓ Tℓ ) (4.259)
b3 = Q̇w − Q̇ℓ − Q̇g (4.260)
b4 = −ṁe (4.261)
ṁe
ṁℓ = − (4.268)
Pv νℓ
1−
Rv T
Draft for Release R2018a
4.4. SPACECRAFT MODEL 127
Heat Transfer
Heat transfer models are from Ring19 and Incropera2 and Pitts20
Q̇ = hA∆T (4.270)
hL
= N u = c(GrL P r)a (4.271)
k
so
kc
h= (GrL P r)a (4.272)
L
Physiochemical Properties
Hydrazine Properties21
c = 3084J/kg/K
3
ρ (kg/m ) = 1025.6 − 0.87415 T (o C) − 0.45283e−3 T 2 (o C)
3
ρ (kg/m ) = 1230.6 − 0.62677 T (o K) − 0.45283e−3 T 2 (o K)
Some models are from22
2
Pv = C1 e(C2 +C3 Tℓ +C4 Tℓ ) (N/m2 ) (4.275)
dPv
= C1 ln(C2 + C3 Tℓ C4 Tℓ2 ) (C3 + 2C4 Tℓ ) (4.276)
dTℓ
Draft for Release R2018a
128 CHAPTER 4. DYNAMICS MODELLING
2
Tℓ
md = Pg mα
ℓ (4.277)
294
2 2
dmd Tℓ (α−1) Tℓ
= mα
ℓ Ṗg + αPg mℓ ṁℓ
dt 294 294
(4.278)
Tℓ
+2Pg mα
ℓ Ṫℓ
294
ẑ
ŷ
h
1
V = π (3r − h) h2 (4.279)
3
3
− h2 + 3hr − 3r2
cgz = 4 (4.280)
3r − h
Estey16 gives appoximate equations for the area of different portions for a partially filled sphere. The area
of the spherical shell in contact with the gaseous region is given by
0.62376
Vg
Ag = 4.0675 · V 2/3 (4.286)
V
The area of the boundary between the liquid and the gaseous region is given by
1.24752
2/3 Vg
Ab = Ag − 3.4211 · V (4.287)
V
Finally, the area of the spherical shell in contact with the liquid is given by
Al = πD2 − Ag (4.288)
Draft for Release R2018a
4.5. ENVIRONMENT MODELS 131
The body should store the users original input for the state and epoch, and the state and epoch calculated
at the last request for state information. Then, when the next request is made for state information, the
epoch and state from the last request are used as the input state for next calculation.
Value
2 Aten
3 Apollo
4 Amor
5 Object with q < 1.381 AU
6 Object with q < 1.523 AU
7 Object with q < 1.665 AU
8 Hilda
9 Jupiter Trojan
10 Centaur
14 Plutino
15 Other resonant TNO
16 Cubewano
17 Scattered disk
64 Unused
128 Unused
256 Unused
512 Unused
1024 Unused
2048 Unused
4096 Unused
8192 1-opposition object seen at
earlier opposition
Draft for Release R2018a
4.6. FLUX AND GEOMAGNETIC INDEX 133
1. Read in the string in columns 21-25 and decompose into the epoch using the instructions here:
http://www.cfa.harvard.edu/iau/info/PackedDates.html 2. Read in the mean anomaly from columns 27-35
Convert to radians. 3. Read in the argument of periapsis from lines 38-46. Convert to radians. 4. Read in
the longitude of the ascending node from lines 49-57. Convert to radians. 5. Read in the inclination from
columns 60-68. Convert to radians. 6. Read in the eccentricity from lines 71-79. 7. Read in the mean motion
from lines 81-91. 8. Use the algorithm in section 4.3.1 of the math spec to convert from mean anomaly to
true anomaly. 9. Get mu value for central body and convert mean motion to semi-major axis. (I’ll provide
math for this soon) 10. Use the algorithm in section 4.1.3 to covert from Keplerian elements to cartesian
elements.
Jacchia Roberts
MSISE-90
A. E. Hedin, Extension of the MSIS Thermospheric Model into the Middle and Lower Atmosphere, J.
Geophys. Res. 96, 1159, 1991.
Discuss observed vs. adjusted for F10.7 values, also URSI Series D
For testing http://nssdc.gsfc.nasa.gov/space/model/models/msis.html
http://www.agu.org/journals/ja/ja0212/2002JA009430/
go to auxillary material on the left side menu and open the tables-datasets.doc
Other useful models http://nssdc.gsfc.nasa.gov/space/model/
Exponential Atmosphere
data and for the near-term daily predictions. However, for the long-term monthly predictions, the GMAT
SWF contains predictions created by Schatten (NEED REFERENCE).
The SWF is broken down into three sections according to the type of data; historical, daily predicts,
and monthly predicts. The first section contains historical data observed by NOAA and the U.S. Air Force.
The historical data contains the following values for each day: year, month, day of month, the solar cycle
number, 3-hour Kp and Ap values, daily and 81 day averages of both observed and adjusted F10.7 values.
The data is provided from Oct. 1 1957 to the current day with the column format described below.
The daily prediction section of the SWF is constructed from data provided by the U.S. Air Force and
distributed by NOAA. The predictions contain daily Ap and F10.7 values for 45 days from the present day.
3 Hour values for Ap are not provided and the file assumes the 3 hour values are the same as the daily values
for both Ap and Kp.
The long-term monthly section of the file is Schattens 30 year predict containing Ap and F10.7 predictions
for Early, Nominal, and Late cycles, as well as Nominal, +2 Sigma, and -2 Sigma values.
The data in the raw files is used to create a single coherent file containing flux and geomagnetic data from
Oct. 1 1957 to the present day. Each row of the file corresponds to a unique day. For each unique row the
data is organized into colums as follows.
When converting between observed and adjusted F10.7 values, the following relation is used.
F10.7 (Adj)AU 2
F10.7 (Obs) = 2 (4.290)
rE/S
where
NUM_DAILY_PREDICTED_POINTS 44
BEGIN DAILY_PREDICTED
2011 05 27 2426 13 27 27 27 27 27 27 27 27 216 12 12 12 12 12 12 12 12 12 80.0 92.9 106.1 77.9 90.8 105.5
2011 05 28 2426 14 30 30 30 30 30 30 30 30 240 15 15 15 15 15 15 15 15 15 80.0 92.6 105.1 77.9 90.4 104.4
2011 05 29 2426 15 27 27 27 27 27 27 27 27 216 12 12 12 12 12 12 12 12 12 80.0 92.3 104.3 77.9 90.1 103.6
2011 05 30 2426 16 24 24 24 24 24 24 24 24 192 10 10 10 10 10 10 10 10 10 80.0 92.0 103.7 77.8 89.8 102.9
135
2011 05 31 2426 17 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 80.0 92.1 103.2 77.8 89.8 102.4
136
2011 06 01 2426 18 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 80.0 92.1 102.7 77.8 89.8 101.8
2011 06 02 2426 19 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 80.0 92.2 102.3 77.8 89.9 101.4
137
138
----------------------------------------------------------------------------------------------------------------------------------
FORMAT(I4,I3,I3,I5,I3,8I3,I4,8I4,I4,F4.1,I2,I4,F6.1,I2,5F6.1)
u = cT (4.291)
hg = Tg (cg + Rg ) (4.293)
The notation used in tank model development is shown below. After presenting notation, we present the
dynamics model for a pressurant tank.
Nomenclature
Ag , Aℓ , Aw = Heat transfer area
cv , cg = Specific heat at constant volume
D = Tank diameter
d = Liquid surface diameter
Gr = Grashof number
hℓ , hv = Enthalpy
mg , mℓ , mw , mv = Mass
Pg , Pv , Pt = Pressure
Rv , Rg = Gas constant
Tg , Tℓ , Tw , Tv , Ta = Temperature
ug , uℓ , uw , uv = Specific internal energy
Vg , Vℓ , Vt = Volume
Ẇ = Work rate
Q̇g , Q̇v , Q̇l , Q̇w = Heat transfer rate
νl , νg , νv = Specific volume
Subscripts
a = Ambient
g = Pressurant gas
ℓ = Propellant liquid
t = Total
v = Propellant vapor
w = Tank wall
e = Exit-flow
i = In-flow
Draft for Release R2018a
4.6. FLUX AND GEOMAGNETIC INDEX 141
Pressurant Tank
The pressurant tank model is the simplest of the tank models primarily due to the fact that there is only
one substance, the pressurant gas, contained in the tank. In this section, we develop a state space model for
pressurant tank dynamics. We choose the state variables to be pressurant gas mass and temperature, mg
and Tg respectively, and tank wall temperature Tw .
In Fig.4.11 we see an illustration of a pressurant tank. We divide the tank into two control volumes: the
gas region and the tank wall region. The only mass flow in the system occurs where pressurant gas exits the
tank. Heat transfer occurs between the gas and the wall, and the wall and the ambient surroundings.
2.Tank Wall
mw , T w
1.Gas
Q̇w mg , Pg , Tg
Q̇g
ṁe ,hg
Figure 4.11: Pressurant Tank Diagram
Knowing the volume of the tank and the state variables mg , Tg , and Tw , we calculate pressure from one
of the following two equations of state:
mg Rg Tg
Pg = (4.294)
Vg
or from the Beattie-Bridgeman Eq.
Rg Tg ag bg
Pg = + 2+ 3 (4.295)
Vg Vg Vg
The state variables mg , Tg , and Tw are described by ordinary differential equations found by applying the
first law of thermodynamics and the conservation of mass. The 1st Law applied to the gas control volume
yields
d
(mg ug ) = Q̇g − ṁe hg (4.296)
dt
The 1st Law applied to the wall control volume yields
d
(mw uw ) = Q̇w − Q̇g (4.297)
dt
and finally from conservation of mass we obtain
For these equations to be useful for numerical integration, we need to expand the derivatives, and if necessary,
decouple the equations (as we’ll see, for the pressurant tank, the equations are not coupled).
Expanding the terms in Eq. (4.296) we have
Solving the system of equations yields the following differential equations of state for the pressurant tank
heat transfer model.
The adiabatic model is obtained by setting the terms Q̇g and Q̇w to zero in the above equations. (Note for
the adiabatic model there are only two state variables, mg and Tg , as the wall temperature Tw is removed
from the system of equations.) Similarly, the isothermal model is obtained by setting Ṫg and Ṫw to zero. So,
for the isothermal model there is only one state variable mg .
In summary, for the pressurant tank, all models calculate the tank pressure using
mg Rg Tg
Pg =
Vg
then the specific equations for the heat transfer, adiabatic, and isothermal models, are as follows
Pressurant Tank: Heat Transfer
State Variables: mg , Tg , Tw
ṁg = −ṁe
1
Ṫg = Q̇g − Tg Rg ṁe
mg cg
1
Ṫw = Q̇w − Q̇w
mw cw
Pressurant Tank: Adiabtic
State Variables: mg , Tg
ṁg = −ṁe
Tg Rg
Ṫg = ṁe
mg cg
Blowdown Tank
The blowdown tank model is significantly more complex than the pressurant tank model due to the presence
of liquid fuel and fuel vapor contained in the tank ullage. In this section, we develop a state space model
for a blow down tank. We choose the state variables to be the liquid mass and temperature, mℓ and Tℓ , the
gas temperature Tg , and tank wall temperature Tw .
In Fig.4.12 we see an illustration of a blow down tank. We divide the tank into three control volumes:
the gas region, the liquid region, and the tank wall region. Mass flow occurs where the pressurant gas exits
the tank and at the boundary between the liquid and gas in the form of evaporation. Heat transfer occurs
between all three control volumes as well as with the surroundings. In summary, the physical processes
modelled for a blow down tank are
Draft for Release R2018a
4.6. FLUX AND GEOMAGNETIC INDEX 143
2.Liquid
mℓ , T ℓ
Q̇ℓ
ṁe ,hl
Figure 4.12: Blow Down Tank Diagram
Assume we are given mg , the tank diameter D, and hence know the total tank volume Vt , and we know
the physical constants associated with the liquid and gas (Rg , cg , νg , cℓ , νℓ (Tℓ ) and Pv (Tℓ )). We choose the
state variables mℓ , Tℓ , Tg , and Tw , all other tank properties can be calculated from these state variables
using the following equations:
To determine the state equations governing mℓ , Tℓ , Tg , and Tw we apply the 1st law of thermodynamics
and the law of conservation of mass. The 1st Law applied to the gas control volume is
d
(mv uv + mg ug ) = Q̇v + Q̇g − Pt V̇g + ṁv hv (4.311)
dt
Draft for Release R2018a
144 CHAPTER 4. DYNAMICS MODELLING
d
(mℓ uℓ ) = Q̇ℓ − Q̇v + Pt V̇g − ṁv hlg − ṁe hℓ (4.312)
dt
The 1st Law applied to the wall control volume yields
d
(mw uw ) = Q̇w − Q̇ℓ − Q̇g (4.313)
dt
and finally from conservation of mass:
ṁℓ = −ṁe − ṁv (4.314)
we also know that
Pv V̇g Pv Vg Ṫg
ṁv = − (4.315)
Rv Tg Rv Tg2
where we assume that
Ṗv ≈ 0 (4.316)
Equations (4.311) - (4.315) are five equations in five unknowns (mv , mℓ , Tℓ , Tg , and Tw ). Our approach
is to use Eq. (4.314) to eliminate ṁv terms. The result is a system of four equations in four unknowns
using Eqs. (4.311), (4.312), (4.313), and (4.315). The result we seek is four decoupled ordinary differential
equations for mℓ , Tℓ , Tg , and Tw .
Let’s continue with Eq. (4.311). We need to rewrite the equation in terms of ṁℓ and Ṫg (T˙w and Ṫℓ don’t
appear explicitly). Expanding the derivatives assuming ṁg = 0 yields
Now, substituting ṁv = −ṁℓ − ṁe and noting that V̇g = −νl ṁℓ if we assume
dνℓ
ν̇ℓ = Ṫℓ ≈ 0
dTℓ
we arrive at
Now continuing with Eq. (4.312) expanding the derivatives and making similar substitutions as we made
previously we obtain
Finally, by eliminating ṁv in the Gas Law shown in Eq. (4.315) we obtain
Equations (4.318), (4.320), (4.321), and (4.323) are four coupled ordinary differential equations that can
be decoupled by casting them in matrix form as follows:
A11 0 A13 0 ṁℓ b1
A21 A22 0 0 Ṫℓ b2
= (4.324)
0 0 0 A34 Ṫg b3
A41 A43 0 Ṫw b4
where
A11 = Tg Rv − Pt νℓ (4.325)
A13 = mv cv + mg cg (4.326)
A21 = cℓ Tℓ + Pt vl − hv (4.327)
A22 = mℓ cℓ (4.328)
A34 = mw cw (4.329)
A41 = 1 − νℓ /νv (4.330)
A43 = −mv /Tg (4.331)
b1 = Q̇v + Q̇g − ṁe Tg Rv (4.332)
b2 = Q̇ℓ − Q̇v + ṁe (hv − cℓ Tℓ ) (4.333)
b3 = Q̇w − Q̇ℓ − Q̇g (4.334)
b4 = −ṁe (4.335)
A43 b1 − A13 b4
ṁℓ = (4.336)
A11 A43 − A41 A13
1 A43 b1 − A13 b4
Ṫℓ = b2 − A21 (4.337)
A22 A11 A43 − A41 A13
A11 b4 − A41 b1
Ṫg = (4.338)
A11 A43 − A41 A13
b3
Ṫw = (4.339)
A34
For the adiabatic model we set all heat transfer rates, Q̇, to zero in Eqs. (4.332)-(4.335) and so there are
only two state variables as Ṫw = 0 and so Tw = constant.
Now let’s develop equations for an isothermal model of a blow down tank. In the isothermal model, we
assume Tℓ = Tg = Tw = T . The only state variable that requires a differential equation is mℓ . Because Tg ,
Tℓ , and hence, Pv are constant, we know that
Pv V̇g
ṁv = (4.340)
Rv Tg
Subtituting this result into Eq.(4.314) and solving for ṁℓ we obtain.
ṁe
ṁℓ = − (4.341)
Pv νℓ
1−
Rv T
Draft for Release R2018a
146 CHAPTER 4. DYNAMICS MODELLING
In summary for the heat transfer model for a blow down tank, we choose mℓ , Tℓ , Tg , and Tw are state
variables. Eqs. (4.305)-(4.310) are used to calculate the remaining tank properties, and Eqs. (4.336)-(4.339)
are used to model the tank states as functions of time.
For the all three models, heat transfer, adiabatic, and isothermal, knowing the state variables mℓ , Tℓ , Tg ,
and Tw we compute the remaining tank properties using
Vℓ = νℓ (Tℓ )mℓ
Vg = Vt − Vℓ
mg Rg Tg
Pg =
Vg
Pv = Pv (Tℓ )
Pv Vg
mv =
Rv Tg
Pt = Pv + Pg
The models differ in the number of state variables and in the state rate equations. A summary is presented
below.
Blow Down Tank: Heat Transfer
State Variables: mℓ , Tℓ , Tg , Tw
A43 b1 − A13 b4
ṁℓ =
A11 A43 − A41 A13
1 A43 b1 − A13 b4
Ṫℓ = b2 − A21
A22 A11 A43 − A41 A13
A11 b4 − A41 b1
Ṫg =
A11 A43 − A41 A13
b3
Ṫw =
A34
where Aij and bi are given by Eqs. (4.325)-(4.335).
Blow Down Tank: Adiabtic
State Variables: mℓ , Tℓ , Tg
A43 b1 − A13 b4
ṁℓ =
A11 A43 − A41 A13
1 A43 b1 − A13 b4
Ṫℓ = b2 − A21
A22 A11 A43 − A41 A13
A11 b4 − A41 b1
Ṫg =
A11 A43 − A41 A13
where Aij and bi are given by Eqs. (4.325)-(4.335). Note that all heat flow rates, Q̇, are set to zero.
Blow Down Tank: Isothermal
State Variables: mℓ
ṁe
ṁℓ = −
Pv νℓ
1−
Rv T
heat transfer or adiabitic model, we must simultaneously solve the equations associated with the pressurant
tank. For the regulated tank model, we choose the state variables to be the liquid mass and temperature,
mℓ and Tℓ , the gas temperature Tg , tank wall temperature Tw , and the incoming pressurant gas mass mi .
In Fig.4.13 we see an illustration of a pressure regulated tank. Like the blow down tank model, we divide
the tank into three control volumes: the gas region, the liquid region, and the tank wall region. Mass flow
occurs where the pressurant gas exits the tank, at the boundary between the liquid and gas in the form of
evaporation, and from the pressurant tank to the ullage of the regulated tank. Heat transfer occurs between
all three control volumes as well as with the surroundings. Hence, the physical processes modelled for a blow
down tank are the same as those listed for the blow down tank, with the added process of mass flow from
the pressurant tank.
Q̇w ṁi , hi
3.Tank Wall
mw , T w 1.Gas/Vapor
mg , mv , Pg , Pv , Tg
Q̇v ṁv , hlg Q̇g
2.Liquid
mℓ , T ℓ
Q̇ℓ
ṁe ,hl
Figure 4.13: Pressure Regulated Tank Diagram
The derivation of the state equations for a pressure regulated tank follows naturally from the derivation
of the blow down tank. The only control volume that differs between the two models is the gas/vapor control
volume. Applying the 1st Law of thermodynamics to the gas/vapor control volume of the pressure regulated
tank gives us
d
(mv uv + mg ug ) = Q̇v + Q̇g − Pt V̇g + ṁv hv + ṁp hp (4.342)
dt
Taking the time derivative of the gas law for the gas contained in the tank ullage yields
Pg V̇g Pg Vg Ṫg
ṁg = − (4.343)
Rg T Rg Tg2
Equations (4.342) and (4.343), together with equations (4.320), (4.321), and (4.323) are a system of 5
equations in 5 unknowns which can be decoupled using simple linear algebra. However, first we must expand
Eqs. (4.342) and (4.343) and write them in terms of the state rate derivatives. Expanding Eq. (4.342) we
arrive at
(Rv Tg − Pt νℓ ) ṁℓ + (mv cv + mg cg ) Ṫg +
(4.344)
(cg T g − hp ) ṁg = Q̇v + Q̇g − ṁe Rv Tg
Similarly, for Eq. (4.343) we obtain
νℓ mg
ṁℓ + Ṫg + ṁg = 0 (4.345)
νg Tg
Draft for Release R2018a
148 CHAPTER 4. DYNAMICS MODELLING
To integrate the state equations we must decouple the equations and this is easily done by casting the
equations in matrix form and solving the system of equations. We can write the equations is state space for
as follows
A11 0 A13 0 A15 ṁℓ b1
Ṫℓ b2
A21 A22 0 0 0
0 0 0 A34 0 Ṫ = b (4.346)
g 3
A41 0 A43 0 0 Ṫw b4
A51 0 A43 0 A55 ṁg 0
where the coefficients Aij and bi are given by
A11 = Tg Rv − Pt νℓ (4.347)
A13 = mv cv + mg cg (4.348)
A15 = cg T g − hp (4.349)
A21 = cℓ Tℓ + Pt vl − hlg (4.350)
A22 = mℓ cℓ (4.351)
A34 = mw cw (4.352)
A41 = 1 − νℓ /νv (4.353)
A43 = −mv /Tg (4.354)
A51 = νℓ /νg (4.355)
A53 = mg /Tg (4.356)
A55 = 1 (4.357)
b1 = Q̇v + Q̇g − ṁe Rv Tg (4.358)
b2 = Q̇ℓ − Q̇v + ṁe (hlg − cℓ Tℓ ) (4.359)
b3 = Q̇w − Q̇ℓ − Q̇g (4.360)
b4 = −ṁe (4.361)
ṁe
ṁℓ = − (4.368)
Pv νℓ
1−
Rv T
Draft for Release R2018a
4.6. FLUX AND GEOMAGNETIC INDEX 149
Heat Transfer
Heat transfer models are from Ring19 and Incropera2 and Pitts20
Q̇ = hA∆T (4.370)
hL
= N u = c(GrL P r)a (4.371)
k
so
kc
h= (GrL P r)a (4.372)
L
Physiochemical Properties
Hydrazine Properties21
c = 3084J/kg/K
3
ρ (kg/m ) = 1025.6 − 0.87415 T (o C) − 0.45283e−3 T 2 (o C)
3
ρ (kg/m ) = 1230.6 − 0.62677 T (o K) − 0.45283e−3 T 2 (o K)
Some models are from22
2
Pv = C1 e(C2 +C3 Tℓ +C4 Tℓ ) (N/m2 ) (4.375)
dPv
= C1 ln(C2 + C3 Tℓ C4 Tℓ2 ) (C3 + 2C4 Tℓ ) (4.376)
dTℓ
Draft for Release R2018a
150 CHAPTER 4. DYNAMICS MODELLING
2
Tℓ
md = Pg mα
ℓ (4.377)
294
2 2
dmd Tℓ (α−1) Tℓ
= mα
ℓ Ṗg + αPg mℓ ṁℓ
dt 294 294
(4.378)
Tℓ
+2Pg mα
ℓ Ṫℓ
294
Chapter 5
Numerical Integrators
dri
= f (t, r)
dt
(The superscript in this discussion refers to the variables; hence f i is the ith variable, and r(n) refers
to all n variables.) The method takes an integration step, h, by breaking the interval into several stages
(usually of smaller size) and calculating estimates of the integration result at each stage. The later stages
use the results of the earlier stages. The cumulative effect of the integration is an approximate total step δt,
accurate to a given order in the series expansion of the differential equation, for the state variables ri (t + δt)
given the state ri (t).
The time increment for a given stage is given as a multiple ai of the total time step desired; thus for
the ith stage the interval used for the calculation is ai δt; the estimate of the integrated state at this stage is
given by
i−1
X
(n) (n)
ki = δtf (t + ai δt, r(n) (t) + bij kj )
j=1
where bij contains a set of coefficients specific to the Runge-Kutta instance being calculated. Given the
results of the stage calculations, the total integration step can be calculated using another set of coefficients,
cj and the formula
stages
X
(n) (n) (n)
r (t + δt) = r (t) + cj kj
j=1
The error control for these propagators is implemented by comparing the results of two different orders of
integration. The difference between the two steps provides an estimate of the accuracy of the step; a second
set of coefficients corresponding to this second integration scheme can be used to obtain a solution
stages
X ∗(n)
r′(n) (t + δt) = r(n) (t) + c∗j kj
j=1
With care, the stage estimates kj and kj∗ can be selected so that they are the same; in that case, the
(n)
estimate of the error in the integration ∆ can be written
stages
X (n)
∆(n) = (cj − c∗j )kj
j=1
151
Draft for Release R2018a
152 CHAPTER 5. NUMERICAL INTEGRATORS
(The difference between the coefficients cj − c∗j is the array of error estimate coefficients (ee) in this code.)
Once the estimated error has been calculated, the size of the integration step can be adapted to a size
more appropriate to the desired accuracy of the integration. If the step results in a solution that is not
accurate enough, the step needs to be recalculated with a smaller step size. Labeling the desired accuracy α
and the obtained accuracy ǫ (calculated, for instance, as the largest element of the array ∆), the new step
used by the Runge-Kutta integrator is
α 1/(m−1)
δtnew = σδt
ǫ
where m is the order of truncation of the series expansion of the differential equations being solved. The
factor σ is a safety factor incorporated into the calculation to avoid unnecessary iteration over attempted
steps. Common practice is to set this factor to 0.9; that is the default value used in this implementation.
Similarly, if the step taken does not result in the desired accuracy, you may want to increase the step
size parameter for the next integration step. The new estimate for the desired stepsize is given by
α 1/(m)
δtnew = σδt
ǫ
Sometimes you do not want to increase the stepsize in this manner; for example, you may want to keep
the maximum step taken at some fixed value. This implementation provides a mechanism for specifying a
maximum allowed step.
Sometimes it is convenient to request steps of a specified size, regardless of the stepsize control algorithm
or the calculation of the ”best step” described above. This implementation accomplishes that task by taking
multiple error controlled steps is necessary to step across the requested interval.
Both of these features are implemented using the boolean flags described in the base class for the inte-
grators. See the documentation for the Integrator (p. ??) class for more information about these flags.
h h i
∗j
ri+1 = rij + j
55fnj − 59fn−1 j
+ 37fn−2 j
− 9fn−3
24
Draft for Release R2018a
5.4. BULIRSCH-STOER 153
The corrector uses derivative information evaluated for this state, along with the derivative information
at the original state and two preceding states, to tune this state, giving the final, corrected state:
j h h ∗j i
ri+1 = rij +
9fn+1 + 19fnj − 5fn−1j j
+ 1fn−2
24
Bate, Mueller and White give the estimated accuracy of this solution to be
19 ∗j j
ee = ri+1 − ri+1
270
Method used to fire the step refinement (the corrector phase).
5.4 Bulirsch-Stoer
5.5 Stopping Condition Algorithm
5.6 Integrator Coefficients
19 3 243 33 7
cj 200 0 5 − 400 40 80 0
19 431 3 333 243 7857 33 957 7 193 1
ej 200 - 5000 0 5 - 500 − 400 + 10000 40 - 1000 80 - 2000 50
Draft for Release R2018a
154 CHAPTER 5. NUMERICAL INTEGRATORS
Table 5.2: Prince-Dormand 56 Coefficients (Warning: There is an error in the original source for these and
we have not found the correct coefficients yet!!)
ai bij
0 0
1 1
10 10 0
2 2 20
9 − 81 81 0
3 615
7 1372 − 270
343
1053
1372 0
3 3243 54 50949 4998
5 5500 − 55 71500 17875 0
4
5 − 26492
37125
72
55
2808
23375
24206
− 37125 338
495 0
5561 35 24117 899983 5225 3925
1 2376 − 11 − 31603 200772 − 1836 4056 0
465467 2945 10513573 5610201 424325 376225
1 266112 − 1232 3212352 − 14158144 − 205632 454272 0 0
0 0
1 1
6 6 0
4 4 16
15 75 75 0
2 5
3 6 − 38 5
2 0
4
5 − 85 144
25 -4 16
25 0
361
1 320 − 18
5
407
128
11
− 80 55
128 0
11 11 11 11
0 − 640 0 256 − 160 256 0 0
93
1 640 − 18
5
803
256
11
− 160 99
256 0 1 0
7 1125 9 125 5 5
cj 1408 0 2816 32 768 0 66 66
7 31 5 5 5
ej 1408 - 384 0 0 0 0 − 66 66 66
5.6. INTEGRATOR COEFFICIENTS
155
Draft for Release R2018a
156 CHAPTER 5. NUMERICAL INTEGRATORS
Draft for Release R2018a
Chapter 6
Measurement Modeling
This chapter gives the formulation for computed measurement values and their partial derivatives, measure-
ment media corrections, measurement error models, and measurement feasibility and editing criteria. We
begin with a discussion of the general form of the measurement model which is broken down into several con-
tributions including the model for the ideal observable quantity, media corrections, and measurement errors.
The geometry of a generic measurement is presented and the notation used throughout the measurement
model formulation is discussed. For each observable type such as two-way range or one-way Doppler we
present the general model and then discuss specific details of how these measurements are modeled for spe-
cific tracking systems such as TDRSS and DSN. We conclude this chapter with a section on simple geometric
measurement models that neglect media corrections, error modeling, and light time corrections.
y c = y i + e t + δm (6.1)
where yc is the computed measurement value, yi is the model of the ideal measurement observable quantity
including light time correction and sensor delays, et is the total stochastic error contribution from all sources
including sensor and systematic errors, and δm is the sum of media corrections from ionospheric, tropospheric,
general relativistic corrections to name a few.
In the next three sections, we discuss each of the contributions to the measurement computed value in
detail.
157
Draft for Release R2018a
158 CHAPTER 6. MEASUREMENT MODELING
mathematical development is general and is valid for measurement processes that involve different participant
types such as ground stations.
GMAT allows users to input and output orbit states in numerous coordinate systems. However, internal
to GMAT, spacecraft are propagated and estimated with respect to a coordinate system that has a celestial
body as the origin and uses the J2000 axis system. Different spacecraft in a single simulation may have
different reference celestial bodies depending upon the flight regime of a particular application. Ground
station states are defined and estimated in a celestial body fixed system. Below, we express quantities such
as the inertial position and velocity of participants and antennas in terms of the coordinate systems in which
they are internally (propagated/estimated ) represented. These quantities are referenced repeatedly in later
sections.
F A2
FB2
rB
a2
2
F A1 ρa2 /a1
FI2
rIa11
ri1 /i2
rIp11 ri2 /s
FI1 ri1 /s
FS
Define the following objects: the initiating participant, P1 , and its attached antenna A1 , the receiving
participant, P2 , and its attached antenna A2 . Define the following coordinates systems: FS is the solar
system barycentric system, FR1 is the system in which P1 is naturally (internally) represented (propa-
gated/estimated), FB1 is the body-fixed system of P1 , FA1 is the antenna-fixed system for antenna A1 , and
FI1 is the local celestial-body-centered J2000 system for P1 .
Using the definitions above, the system propagates/estimates spacecraft and ground stations using the
representation rRp . This means the position of participant p in coordinate system R. For a spacecraft, R is
the celestial-body-centered J2000 system, for a ground station R is the celestial-body-centered, body-fixed
system. The location of antennas are defined with respect to their parent participant’s attitude coordinate
system and notated rB a.
The measurement models require the expressions for the locations of participants P1 and P2 and the
phase centers of antennas A1 and A2 in the local inertial systems FI1 and FI2 , and in the solar system
barycentric coordinate system, FS . The locations of participants P1 and P2 in their local inertial systems
are calculated using
rIp11 = RI/R1 rR
p1
1
(6.2)
rIp22 = RI/R2 rR
p2
2
(6.3)
If P1 is a spacecraft, RI/R1 = I3x3 because spacecraft are represented with respect J2000 axis system (i.e
. FR1 = FI1 ). If P1 is a ground station, RI/R1 is the body-fixed rotation matrix for the ground station’s
reference central body (i.e. for Earth-based ground systems RI/R1 is the rotation matrix from Earth-fixed
to Earth-J2000 ). The expressions for the locations of participants P1 and P2 in the solar system barycentric
system are
rSp1 = rIp11 + rSi1 (6.4)
Draft for Release R2018a
6.1. GENERAL FORM OF THE MEASUREMENT MODEL 159
where rSi2 is the location of the origin of FI2 expressed in FS . Note that to transform a vector from a local
inertial system to the barycentric system only requires a translation because FI1 and FS both use the J2000
axis system.
The locations of antenna phase centers in local inertial coordinates are
rIa1 = RI/R1 rR
p1 + R
1 I/B1 B1
ra1 (6.6)
rIa2 = RI/R2 rR
p2 + R
2 I/B2 B2
ra2 (6.7)
The locations of antenna phase centers in solar system barycentric coordinates are
rIp2 (tp22 ) ρS
rIp1 (tp21 )
rIp1 (tp21 )
ρI Earth’s
Surface
rSE (tS2 ) rSE (tS1 )
where rIa2 (t2a ) and rIa1 (t1a ) are calculated using Eqs. (6.6) and (6.7). To solve for τ , we find the solution to
the following equation:
cτ − ρa2 /a1 = 0 (6.14)
where ρ = kρk. Depending upon the measurement, we know either time t1a or t2a , and solve for the unknown
time. In the case where t2a is known, τ is found using fixed-point iteration on the following equation10
1 I
τ (i+1) = kr (t2 ) − rIa1 (t2a − τ (i) )k (6.15)
c a2 a
In the case where t1a is known, τ is found using fixed-point iteration on the following equation
1 I
τ (i+1) = kr (t1 + τ (i) ) − rIa1 (t1a )k (6.16)
c a2 a
In either case, the value τ (0) = 0 is used as the initial guess.
If the two participants do not share a common reference celestial body then the range vector is calculated
in the solar system barycentric system using
To simplify the notation, we have assumed that the rotation matrices and position vectors associated with
P1 are evaluated at time t1a and the rotation matrices and position vectors associated with P2 are evaluated
at time t2a . The partial derivative of the norm of a vector a with respect to a dummy variable χ is given by
∂a aT ∂a
= (6.21)
∂χ a ∂χ
where the superscript “T” is the transpose operator. Define tm as the measurement time tag and define
rpI11 (tm ) as the position of participant 1,at time tm , expressed in FR1 .
Above we assume that light time solution is expressed as a distance. Some measurement formulations use
the light time solution expressed as a time duration. The time ∆t for light to travel a distance ρ (in a
vacuum with no gravity) is given by
ρ
∆t = = (t2a − t1a ) (6.32)
c
Draft for Release R2018a
162 CHAPTER 6. MEASUREMENT MODELING
is transmitted from the antenna on participant 1 where the uplink delay of P1 . The electronics delay of P1
is defined as τ1 and such that
t1T = t1E + τ1 (6.34)
At time t2R , the signal arrives at the receiving antenna on P2 . At time t2T the signal is transmitted by the
transmitting antenna on P2 . The transponder delay for P2 is defined as τ2 such that
t2T = t2R + τ2 (6.35)
Finally, at t3R the return signal is received at the antenna on P1 and is stamped and processed at time t3E .
The down-link electronics delay is defined as τ3 such that
t3E = t3R + τ3 (6.36)
According to these definitions, the total elapsed time for a two-participant, two-way range measurement is
given by
ρu ρd
∆t = τ1 + + τ2 + + τ3 (6.37)
c c
where
ρu = c (t2R − t1T ) = ||rC C
2a (t2R ) − r1a (t1T )|| (6.38)
and
ρd = c (t3R − t2T ) = ||rC C
1a (t3R ) − r2 (t2T )|| (6.39)
Eqs. (6.38) and (6.39) are solved using the one-way light time algorithm described in Sec. 6.2.1. The
coordinate system, FC , in which the light time is solved is described in 6.2.1.
Draft for Release R2018a
6.3. COMPUTED VALUE OF TWO-WAY RANGE 163
6.3.2 NASA Ground Network (STDN) and Universal Space Network (USN)
The time tag for two-way range measurements provided by STDN or USN is t3E , the time the downlink
signal is processed by the electronics at the ground station. The NASA ground network performs system
calibration to determine τ1 and τ3 and subtracts these values from the observed quantity before writing to
the tracking data file. τ1 and τ3 values are not provided to the user and therefore cannot be used in the
light time correction. Typical values for τ1 and τ3 are on the order of microseconds, which for LEO results
in about 1 cm of position error in the light time solution. The transponder delay is converted to a distance
by multiplying by the speed of light to yield the two-way range measurement, R2 .
1
R2 = (ρu + cτ2 + ρd ) (6.40)
2
The partial derivatives are shown below:
∂R2
= (not a supported solve-for) (6.41)
∂τ1
∂R2
= (not a supported solve-for) (6.42)
∂τ3
∂R2 1 ∂ρu ∂ρd
= + R1 (6.43)
∂rRp1 (t3e )
1 2 ∂rR p1 (t3e )
1
∂rp1 (t3e )
∂R2 1 ∂ρu ∂ρd
R1
= + (6.44)
∂vp1 (t3e ) 2 ∂vpR11 (t3e ) ∂vpR11 (t3e )
∂R2 1 ∂ρu ∂ρd
R2
= + (6.45)
∂rp2 (t3e ) 2 ∂rR p2 (t3e )
2
∂rR
p2 (t3e )
2
∂R2 1 ∂ρu ∂ρd
= + (6.46)
∂vpR22 (t3e ) 2 ∂vpR22 (t3e ) ∂vpR22 (t3e )
(6.47)
The total range correction, ∆R2 , due to atmospheric effects at the Earth from the troposphere and
ionosphere is calculated using
1
∆R2 = (∆ρu + ∆ρd ) (6.48)
2
where ∆ρu and ∆ρd are the uplink and downlink range corrections respectively. Both ∆ρu and ∆ρd have
contributions from the troposphere and ionosphere given by equations (x) and (x) respectively
ρf ρr
ρu ρd
delay values are not provided to the user and therefore cannot be used in the light time correction. Typical
values for those delays are on the order of 0.1 microseconds, which for LEO results in a few mm of position
error in the light time solution.
The computed two-way range model for TDRSS is given by ( see Long8 et. al. Eq. 7-54):
1
R2 = (ρu + ρf + ρr + ρd + cτ3 ) (6.49)
2
Eq. (6.49) is solved by backwards signal propagation beginning at the measurement time tag, T5E . Given
these definitions, the four light-time transits in Eq. (6.49) are given below and solved in the order shown.
For the purposes of the light-time solutions, we assume that the electronics delays are all zero and drop the
subscripts “R”, “T ”, and “E” from the time variables.
ρd = ||rC C
5a (t5 ) − r4a (t4 )|| (6.50)
ρr = ||rC C
4a (t4 ) − r3a (t3 )|| (6.51)
ρf = ||rC C
3a (t3 ) − r2a (t2 )|| (6.52)
ρu = ||rC C
2a (t2 ) − r1a (t1 )|| (6.53)
The above equations are solved using the one-way light time algorithm discussed in Sec. 6.2.1.
The partial derivatives of the two way range, R2 , are given below. Partials with respect to the user
spacecraft state are:
∂R2 1 ∂ρf ∂ρr
= + (6.54)
∂rR
p3 (t5e )
3 2 ∂rR
p3 (t5e )
3
∂rR
p3 (t5e )
3
∂R2 1 ∂ρf ∂ρr
R3
= + (6.55)
∂vp3 (t5e ) 2 ∂vpR33 (t5e ) ∂vpR33 (t5e )
(6.56)
Draft for Release R2018a
6.3. COMPUTED VALUE OF TWO-WAY RANGE 165
Partials with respect to the ground terminal state are (note: p1 and p5 are the same participant):
∂R2 1 ∂ρu ∂ρd
= + R5 (6.57)
∂rR
p1 (t5e )
1 2 ∂rR p1 (t5e )
1
∂rp5 (t5e )
∂R2 1 ∂ρu ∂ρd
= + (6.58)
∂vpR11 (t5e ) 2 ∂vpR11 (t3e ) ∂vpR55 (t5e )
(6.59)
Partials with respect to the TDRS state are (note: p2 and p4 are the same participant):
∂R2 1 ∂ρu ∂ρf ∂ρr ∂ρd
= + + + (6.60)
∂rpR22 (t5e ) 2 ∂rR p2 (t5e )
2
∂rR
p2 (t5e )
2
∂rR
p4 (t5e )
4
∂rR
p4 (t5e )
4
∂R2 1 ∂ρu ∂ρf ∂ρr ∂ρd
= + + + (6.61)
∂vpR22 (t5e ) 2 ∂vpR22 (t5e ) ∂vpR22 (t5e ) ∂vpR44 (t5e ) ∂vpR44 (t5e )
(6.62)
R2 = F ∆t2 (6.68)
Draft for Release R2018a
166 CHAPTER 6. MEASUREMENT MODELING
∂R2
= (not a supported solve-for) (6.69)
∂τ1
∂R2
= (not a supported solve-for) (6.70)
∂τ2
∂R2
= (not a supported solve-for) (6.71)
∂τ3
∂R2 F ∂ρu ∂ρd
= + (6.72)
∂rRp1 (t3e )
1 c ∂rR p1 (t3e )
1
∂rR
p1 (t3e )
1
∂R2 F ∂ρu ∂ρd
= + (6.73)
∂vpR11 (t3e ) c ∂vpR11 (t3e ) ∂vpR11 (t3e )
∂R2 F ∂ρu ∂ρd
R2
= + R2 (6.74)
∂rp2 (t3e ) c ∂rR p2 (t3e )
2
∂rp2 (t3e )
∂R2 F ∂ρu ∂ρd
R2
= + (6.75)
∂vp2 (t3e ) c ∂vpR22 (t3e ) ∂vpR22 (t3e )
(6.76)
where the partials of the form ∂ρu /∂vpR22 are provided in Sec. (6.2.2).
The total range correction, ∆R2 , due to atmospheric effects at the Earth from the troposphere and
ionosphere is calculated using
1
∆R2 = (∆ρu + ∆ρd ) (6.77)
2
where ∆ρu and ∆ρd are the uplink and downlink range corrections respectively. Both ∆ρu and ∆ρd have
contributions from the troposphere and ionosphere given by equations (x) and (x) respectively.
where FT is the transmitted or reference frequency, ρ̇ is the range rate, and c is the speed of light. The
instantaneous doppler shift, ∆F , is given
ρ̇
∆F = −FT (6.79)
c
Many systems use a constant transmission frequency over the Doppler averaging interval. In this case, for a
¯ is given by
two-participant Doppler measurement, the average Doppler shift ∆F
Z tf
¯ = 1 ρ̇ FT
∆F −FT dt = − (ρ(tf ) − ρ(to )) (6.80)
∆Ta to c c∆Ta
∆Ta ∆Ta
tm − tm +
2 2
ts1E ts1T ts2R ts2T ts3R ts3E tm te1E te1T te2R te2T te3R te3E
∆ts ∆te
Figure 6.5: Two-Way Doppler Measurement Time Line
The computed value of the two-way average Doppler is calculated by differencing two round-trip light
times. Define the starting round trip light time as ∆ts which has a time tag of ts3E and define the ending
round-trip light time as ∆te which has a time tag of te3E . The time tag, tm , for a DSN two-way Doppler
measurement is the center of the averaging interval which results in the following:
∆Ta
te3E = tm + (6.81)
2
∆Ta
ts3E = tm − (6.82)
2
∆ts and ∆te are computed as described in Sec. 6.3.4. The two-way Doppler observable provided by the DSN
is the negative of the classical Doppler frequency shift (see discussion in Moyer24 pg. 13-26 and Eq. 13-47)
MT FT
∆F̄ = (∆te − ∆ts ) (6.83)
∆Ta
where MT is the transponder turn-around ratio and FT is the transmitted frequency.
The rotation matrix RO/I (t2a ) is determined by the sensor type and type of angle measurement. If the
receiving participant is a sensor on a ground station, then RO/I (t2a ) is the rotation from J2000 to station
topocentric coordinates at time t2a . If the receiving participant is a sensor on a spacecraft, then RO/I (t2a )
is the rotation from inertial to body axes at time t2a .
Given the range vector, the elevation is calculated using
ρO
z
sin(δ) = (6.85)
kρO k
where ρO O O O
z is the third component of ρ . If ρx ≥ 1e − 10 and ρy ≥ 1e − 10 the azimuth is calculated using
ρO
y
tan β = (6.86)
−ρO
x
∂δ
R2
= 01x3 (6.91)
∂vp2 (t2e )
(6.92)
where partials of the form ∂ρId /∂rR
p1 (t2e ) are given in Sec. 6.2.2.
1
where ζ is a dummy variable, x = [1 0 0]T , and y = [0 1 0]T . The partial derivatives of the azimuth with
respect to the solve-for variables are:
!
∂β 1 ŷT ρ̂O
d x̂
T
O/I ∂ρId
R1
= O O
− I3x3 R (t 2 ) R
(6.94)
∂rp1 (t2e ) sec2 β x̂T ρ̂d x̂T ρ̂d a
∂rp11 (t2e )
∂β
= 01x3 (6.95)
∂vpR11 (t2e )
!
∂β 1 ŷT ρ̂O
d x̂
T
∂ρId
R2
= − I3x3 RO/I (t2a ) (6.96)
∂rp2 (t2e ) sec2 β x̂T ρ̂O
d x̂T ρ̂O
d ∂rR
p2 (t2e )
2
∂β
= 01x3 (6.97)
∂vpR22 (t2e )
∂δ
= 1 (6.98)
∂Ob
where partials of the form ∂ρId /∂rR
p1 (t2e ) are given in Sec. 6.2.2.
1
Draft for Release R2018a
6.7. GEOMETRIC MEASUREMENTS 169
Fo
ρ
r2 r2
ρ
F2 F2
r1 Fo
r12 r12
r1
F1 F1
There are two basic types of geometric measurement illustrated in Fig. 6.6: vehicle to vehicle in figure (a),
and vehicle to station in figure(b). The primary difference between those two measurement types are the
coordinate systems in which the measurement values are expressed, and the coordinate systems in which the
participant’s states are commonly represented. For example, tracking station locations are usually expressed
in body-centered body-fixed systems, while vehicle states are usually expressed in body-centered inertial.
Draft for Release R2018a
170 CHAPTER 6. MEASUREMENT MODELING
The mathematical models presented below for geometric measurements are valid for any combination of
coordinate systems of the participants and measurement values. The defaults for each measurement type are
chosen according to the convention most commonly used in practice. The models ensure that the proper
transformations are performed when, for example, a ground station and vehicle are not defined with respect
to the same central body or axis system.
ρ = r2 − r21 − r1 + Ob (6.100)
In the above equation, F2 is always the J2000 axes system centered at the second spacecraft’s reference
central body When the first participant is a ground station, F1 is the central-body-fixed system of the
ground station’s central body. When the first participant is a spacecraft, F1 is the J2000 axes system
centered at the spacecraft’s reference central body. The range measurement is computed using.
ρ = k [ρ]I k (6.102)
The geometric range partial derivatives are provided below. We assume the solve for parameters are
expressed in their associated reference frame (i.e. r1 is solved for in F1 ). Partial derivatives are provided
with respect to the position and velocity of both participants as well as the measurement bias.
∂ρ T
= − [ρ̂]I RI,1 (6.103)
∂ [r1 ]1
∂ρ
= 01x3 (6.104)
∂ [v1 ]1
∂ρ T
= [ρ̂]I RI,2 (6.105)
∂ [r2 ]2
∂ρ
= 01x3 (6.106)
∂ [v2 ]2
∂ρ
= 1 (6.107)
∂Ob
[ρ̇]o = Ro,2 [ṙ2 ]2 + Ṙo,2 [r2 ]2 − Ro,J2k [ṙ12 ]J2k − Ṙo,J2k [r12 ]J2k − Ro1 [ṙ1 ]1 − Ṙo1 [r1 ]1 + Ob (6.109)
The geometric range rate partial derivatives have the general form
T
∂ ρ̇ [ρ̇]o ∂ [ρ] ∂ [ρ̇]o Ob
= I3x3 − [ρ̂]o [ρ̂]To o
+ [ρ̂]To + (6.110)
∂ζ ρ ∂ζ ∂ζ ∂ζ
Draft for Release R2018a
6.7. GEOMETRIC MEASUREMENTS 171
where ζ is a dummy variable. We assume the solve for parameters are expressed in their associated reference
frame (i.e. r1 is solved for in F1 ).
T
∂ ρ̇ [ρ̇]o
= − I3x3 − [ρ̂]o [ρ̂]To Ro,1 − [ρ̂]To Ṙo,1 (6.111)
∂ [r1 ]1 ρ
∂ ρ̇
= − [ρ̂]To Ro,1 (6.112)
∂ [ṙ1 ]1
T
∂ ρ̇ [ρ̇]o T
T
= I3x3 − [ρ̂]o [ρ̂]o Ro,2 + [ρ̂]o Ṙo,2 (6.113)
∂ [r2 ]2 ρ
∂ ρ̇ T
= [ρ̂]o Ro,2 (6.114)
∂ [v2 ]2
∂ ρ̇
= 1 (6.115)
∂Ob
∂δ 1 ẑT T
= − I3x3 − [ρ̂]o [ρ̂]o Ro,1 (6.119)
∂ [r1 ]1 cos δ ρ
∂δ
= 01x3 (6.120)
∂ [ṙ1 ]1
∂δ 1 ẑT T
= I3x3 − [ρ̂]o [ρ̂]o Ro,2 (6.121)
∂ [r2 ]2 cos δ ρ
∂δ
= 01x3 (6.122)
∂ [v2 ]2
∂δ
= 1 (6.123)
∂Ob
where ζ is a dummy variable, x = [1 0 0]T , and y = [0 1 0]T . The partial derivatives of the azimuth with
respect to the solve-for variables are:
∂β 1 ŷT [ρ]o x̂T
= I3x3 + T Ro,1 (6.125)
∂ [r1 ]1 sec2 β x̂T [ρ]o x̂ [ρ]o
∂β
= 01x3 (6.126)
∂ [ṙ1 ]1
∂β 1 ŷT [ρ]o x̂T
= − 2 I3x3 + T Ro,2 (6.127)
∂ [r2 ]2 sec β x̂T [ρ]o x̂ [ρ]o
∂β
= 01x3 (6.128)
∂ [v2 ]2
∂δ
= 1 (6.129)
∂Ob
∂δ 1 ẑT
T ∂ [ρ]o
= I3x3 − [ρ̂]o [ρ̂]o (6.132)
∂ζ cos δ ρ ∂ζ
where z = [0 0 1]T and ζ is a dummy variable. The partial derivatives of declination with respect to the
individual solve-for parameters are:
∂δ 1 ẑT
= − I3x3 − [ρ̂]o [ρ̂]To Ro,1 (6.133)
∂ [r1 ]1 cos δ ρ
∂δ
= 01x3 (6.134)
∂ [ṙ1 ]1
∂δ 1 ẑT
= I3x3 − [ρ̂]o [ρ̂]To Ro,2 (6.135)
∂ [r2 ]2 cos δ ρ
∂δ
= 01x3 (6.136)
∂ [v2 ]2
∂δ
= 1 (6.137)
∂Ob
The geometric right ascension partial derivatives have the general form
∂α 1 ŷT [ρ]o x̂T ∂ [ρ]o
=− 2 I3x3 + T (6.138)
∂ζ sec α x̂T [ρ]o x̂ [ρ]o ∂ζ
Draft for Release R2018a
6.7. GEOMETRIC MEASUREMENTS 173
where ζ is a dummy variable, x = [1 0 0]T , and y = [0 1 0]T . The partial derivatives of the right
ascension with respect to the solve-for variables are:
∂α 1 ŷT [ρ]o x̂T
= I3x3 + T Ro,1 (6.139)
∂ [r1 ]1 sec2 α x̂T [ρ]o x̂ [ρ]o
∂α
= 01x3 (6.140)
∂ [ṙ1 ]1
∂α 1 ŷT [ρ]o x̂T
= − 2 I3x3 + T Ro,2 (6.141)
∂ [r2 ]2 sec α x̂T [ρ]o x̂ [ρ]o
∂α
= 01x3 (6.142)
∂ [v2 ]2
∂δ
= 1 (6.143)
∂Ob
Draft for Release R2018a
174 CHAPTER 6. MEASUREMENT MODELING
e=b+v (6.144)
where b models the systematic errors, and v models the measurement noise. We assume that the measurement
noise is a discrete sequence of uncorrelated random numbers. Variables such as v are known as random
variables, and the next subsection describes how to model them. Subsequent subsections describe models
for the systematic errors.
The discussion of systematic errors treats such errors as scalar quantities to simplify the exposition; gen-
eralization to the vector case is straightforward. Note that if the measurement is non-scalar, but the errors
in the component measurements are independent of one another, then we can model each measurement inde-
pendently, so modeling the biases as vector is not required. If the measurement errors are not independent,
then many estimators require that we apply a transformation to the data prior to processing so that the
data input to the estimator have independent measurement errors; the next subsection describes some ways
to accomplish this transformation.
where µ is a vector of mean values for each component of x, and P is a matrix that contains the variances
of each component of x along its diagonal, and the covariances between each component as its off-diagonal
components. The covariances indicate the degree of correlation between the random variables composing
x. The matrix P is thus called the variance-covariance matrix, which we will hereafter abbreviate to just
“covariance matrix,” or “covariance.” Since the normal density is completely characterized by its mean
and covariance, we will use the following notation as a shorthand to describe normally-distributed random
vectors:
x ∼ N (µ, P ) (6.146)
Thus, the model for the measurement noise is
v ∼ N (0, R) (6.147)
For the scalar case, or for the vector case when the covariance is diagonal, we may directly generate
realizations of a normally-distributed random vector from normal random number generators available in
most software libraries. If P has non-zero off-diagonal elements, we must model the specified correlations
when we generate realizations. If P is strictly positive definite, we can factor it as follows:
P = SS ′ (6.148)
where S is a triangular matrix known as a Cholesky factor; this can be viewed as a “matrix square root.”
The Cholesky factorization is available in many linear algebra libraries. We can then use S to generate
correlated realizations of x as follows. Let z be a normally-distributed random vector of the same dimension
as x, with zero mean and unit variance, that is
z ∼ N (0, I) (6.149)
Draft for Release R2018a
6.8. MEASUREMENT ERROR MODELING 175
Then, with
x = Sz (6.150)
we can generate properly correlated realizations of x. We can also use a Cholesky factorization of the mea-
surement noise covariance R, if R is non-diagonal, to transform correlated measurements into uncorrelated
auxiliary measurements for cases in which the estimator cannot handle correlated measurement data.
If P is only non-negative definite, i.e. P ≥ 0 rather than P > 0 as above, the Cholesky factorization does
not exist. In this case, since P ’s eigenvalues are real and distinct, it has a diagonal factorization:
P = V DV ′ (6.151)
where V is a matrix of eigenvectors and D is a diagonal matrix of eigenvalues. Then, with z as above,
√
x = V Dz (6.152)
√
where D implies taking the square roots of each diagonal element.
Random Constant
The simplest type of systematic error is a constant bias on the measurement. There are two types of such
biases: deterministic constants, which are truly constant for all time, and random constants, which are
constant or very nearly so over a particular time of interest. For example, each time a sensor is power-
cycled, a bias associated with it may change in value, but so long as the sensor remains powered on, the bias
will not change.
In some cases, we may have reason to believe that a particular systematic error source truly is a deter-
ministic bias, but due to limited observability, we do not have knowledge of its true value. In such cases, we
may view our estimate of the bias as a random constant, and its variance as a measure of the imprecision of
our knowledge.
Thus, we may view all constants that could be solve-for or consider parameters in orbit determination
as random constants. Our model for a random constant is
Since b(t) is a zero-mean constant, its mean is zero for all time, and its covariance is constant for all time
as well. Thus, to simulate a realization of the random constant, we need only generate a random number
according to N (0, pbo ), as the previous subsection described.
Random Ramp
The random ramp model assumes that the rate of change of the bias is itself a random constant; thus the
random ramp model is
b̈(t) = 0, ḃ(to ) ∼ N (0, pḃo ). (6.154)
Thus, the initial condition ḃ(to ) is a random constant. For a pure random ramp, the initial condition on
b(to ) and its covariance are taken to be zero, but an obvious and common generalization is to allow b(to ) to
also be a random constant.
Draft for Release R2018a
176 CHAPTER 6. MEASUREMENT MODELING
Note that the ensemble of realizations of x(t) has zero-mean for all time. The covariance evolves in time
according to
Px (t) = Φ(t − to )Pxo Φ′ (t − to ) (6.159)
where
1 t p 0
Φ(t) = and Pxo = bo (6.160)
0 1 0 pḃo
which we can also write in recursive form as
Thus, we can generate realizations of the random ramp with either x(t) ∼ N (0, Px (t)) or recursively from
Note that kPx k becomes infinite as t2 becomes infinite. This could lead to an overflow of the representation
of Px in a computer program if the propagation time is large, and could also lead to the representation of
Px losing either its symmetry and/or its positive definiteness due to roundoff and/or truncation.
Random Walk
The random walk is the simplest random process of the type described above. In terms of the “formal
derivatives” mentioned above, the random walk model for a measurement bias is
The input noise process on the right hand side is known as “white noise,” and the Dirac delta function that
appears in the expression for its variance indicates that the white noise process consists of something like
an infinitely-tightly spaced set of impulses. The term q that appears along with the delta function is the
intensity of each impulse1 . The initial condition b(to ) is an unbiased random constant. Since b(to ) and w(t)
are zero-mean, then b(t) is also zero-mean for all time. The variance of b evolves in time according to
Thus, to generate a realization of the random walk at time t, we need only generate a random number accord-
ing to N (0, pb (t)). Equivalently, we could also generate realizations of w∆ (t) ∼ N (0, q∆t), and recursively
add these discrete noise increments to the bias as follows:
Note that pb becomes infinite as t becomes infinite. This could lead to an overflow of the representation
of pb in a computer program if both the propagation time and q are large.
Random Run
The random run model assumes that the rate of change of the bias is itself a random walk; thus the random
run model is
b̈(t) = w(t), w(t) ∼ N (0, qδ(t − s)) (6.167)
The initial condition ḃ(to ) is a random constant. For a pure random run, the initial condition on b(to ) and
its covariance are taken to be zero, but an obvious and common generalization is to allow b(to ) to also be a
random constant.
It is convenient to write this model as a first-order vector system as follows:
ḃ(t) ḃ(t) 0 1 b(t) 0
= ˙ = + w(t) (6.168)
b̈(t) d(t) 0 0 d(t) 1
ẋ(t) = A(t)x(t) + b(t)w(t) (6.169)
The measurement partial is the same as for the random ramp. The initial condition x(to ) is an unbiased
random constant. Since x(to ) and w(t) are zero-mean, then x(t) is also zero-mean for all time. The covariance
evolves in time according to
where
1 t p 0
Φ(t) = and Pxo = bo (6.171)
0 1 0 pḃo
and
t3 /3 t2 /2
Q∆ (t) = q (6.172)
t2 /2 t
which we can also write in recursive form as
Thus, we can generate realizations of the random run with either x(t) ∼ N (0, Px (t)) or recursively from
whose power spectral density, q, is non-zero at all frequencies, which implies infinite bandwidth.
Draft for Release R2018a
178 CHAPTER 6. MEASUREMENT MODELING
Note that kPx k becomes infinite as t3 becomes infinite. This could lead to an overflow of the representation
of Px in a computer program if both the propagation time and q are large, and could also lead to the
representation of Px losing either its symmetry and/or its positive definiteness due to roundoff and/or
truncation.
First-Order Gauss-Markov
The first-order Gauss-Markov (FOGM) process is one of the simplest random processes that introduces time
correlation between samples. In terms of a frequency domain interpretation, we can view it as white noise
passed through a low-pass filter. Since such noise, often called “colored noise,” has finite bandwidth, it is
physically realizable, unlike white noise. In the notation of formal derivatives, the FOGM model is
1
ḃ(t) = − b(t) + w(t), (6.176)
τ
where, as with the random walk, b(to ) ∼ N (0, Pbo ), and w(t) ∼ N (0, qδ(t − s)). The time constant, τ ,
also known as the “half-life,” gives the correlation time, or the time over which the intensity of the time
correlation will fade to half its value.
Since x(to ) and w(t) are zero-mean, then x(t) is also zero-mean for all time. The covariance evolves in
time according to
2
pb (t) = e− τ (t−to ) pbo + q∆ (t − to ) (6.177)
where
qτ 2
q∆ (t − to ) = 1 − e− τ (t−to ) (6.178)
2
which we can also write in recursive form as
2∆t
pb (t + ∆t) = e− τ pb (t) + q∆ (∆t) (6.179)
Thus, to generate a realization of the random walk at time t, we need only generate a random number
according to N (0, pb (t)). Equivalently, we could also generate realizations of w∆ (t) ∼ N (0, q∆ (∆t)), and
recursively add these discrete noise increments to the bias as follows:
∆t
b(t + ∆t) = e− τ b(t) + w∆ (t) (6.180)
Note that pb approaches a finite steady-state value of qτ /2 as t becomes infinite. We can choose the
parameters of the FOGM so that this steady-state value avoids any overflow of the representation of pb in a
computer program.
Clearly, this is an unstable model, as the bias variance increases linearly with elapsed time. If a Gauss-Markov
model is desired because of its stability properties, the following second-order model is available.
Second-Order Gauss-Markov
The model for a second-order Gauss-Markov random process is
b̈(t) = −2ζωn ḃ(t) − ωn2 b(t) + w(t), w(t) ∼ N (0, qδ(t − s)) (6.184)
The initial conditions b(to ) and ḃ(to ) are random constants. It is convenient to write this model as a first-order
vector system as follows:
ḃ(t) ḃ(t) 0 1 b(t) 0
= ˙ = + w(t) (6.185)
b̈(t) d(t) −ωn2 −2ζωn d(t) 1
ẋ(t) = A(t)x(t) + b(t)w(t) (6.186)
The measurement partial is the same as for the random ramp. The initial condition x(to ) is an unbiased
random constant. Since x(to ) and w(t) are zero-mean, then x(t) is also zero-mean for all time.
The covariance evolves in time according to according to
Thus, we can generate realizations of the random run with either x(t) ∼ N (0, Px (t)) or recursively from
and
(1,1) q
Q∆ (t) = 1 − e−2ωn t (1 + 2ωn t + 2ωn2 t2 ) (6.195)
4ωn3
(2,2) q
Q∆ (t) = 1 − e−2ωn t (1 − 2ωn t + 2ωn2 t2 ) (6.196)
4ωn
(2,1) (1,2) qt2 −2ωn t
Q∆ (t) = Q∆ (t) = e (6.197)
2
Note that for any damping ratio, kPx k remains finite, since as t → ∞,
q 1/ωn2 0
Px (t → ∞) = . (6.198)
4ζωn 0 1
Thus, the ratio of the steady-state standard deviations of x and ẋ will be
σd
= ωn , (6.199)
σb
and these are related to the power spectral density by
σd3
q = 4ζ . (6.200)
σb
Hence, we can choose the parameters of the SOGM so that we avoid any overflow, loss of symmetry and/or
positive definiteness of Px due to roundoff and/or truncation.
The measurement partial is the same as for the random ramp. The initial condition x(to ) is an unbiased
random constant. Since x(to ) and w(t) are zero-mean, then x(t) is also zero-mean for all time. The covariance
evolves in time according to
where
1 t p 0
Φ(t) = and Pxo = bo (6.204)
0 1 0 pḃo
Draft for Release R2018a
6.8. MEASUREMENT ERROR MODELING 181
and
qb t + qd t3 /3 qd t2 /2
Q∆ (t) = (6.205)
qd t2 /2 qd t
which we can also write in recursive form as
Thus, we can generate realizations of the random run with either x(t) ∼ N (0, Px (t)) or recursively from
Note that kPx k becomes infinite as t3 becomes infinite. This could lead to an overflow of the representation
of Px in a computer program if both the propagation time and q are large, and could also lead to the
representation of Px losing either its symmetry and/or its positive definiteness due to roundoff and/or
truncation.
Bias, Drift, and Drift Rate Random Walks (Random Walk + Random Run + Random Zoom)
Another model for biases in very-high precision clocks, gyros, and accelerometers is that the bias is driven
by two integrals of white noise in addition to its own white noise input. Such models are often characterized
by Hadamard deviation specifications, which may be heuristically associated with the white noise power
spectral densities. The model is as follows:
ḃ(t) 0 1 0 b(t) 1 0 0 wb (t)
˙ =
d(t) 0 0 1 d(t) + 0 1 0 wd (t) (6.209)
¨
d(t) 0 0 0 d(t)˙ 0 0 1 wd˙(t)
ẋ(t) = A(t)x(t) + B(t)w(t) (6.210)
The initial condition x(to ) is an unbiased random constant. Since x(to ) and w(t) are zero-mean, then x(t)
is also zero-mean for all time. The covariance evolves in time according to
where
1 t t2 /2 pbo 0 0
Φ(t) = 0 1 t and Pxo = 0 pdo 0 (6.214)
0 0 1 0 0 pḋo
and
qb t + qd t3 /3 + qḋ t5 /5 qd t2 /2 + qd˙t4 /8 qd˙t3 /6
Q∆ (t) = qd t2 /2 + qḋ t4 /8 qd t + qd˙t3 /3 qd˙t2 /2 (6.215)
3 2
qd˙t /6 qd˙t /2 qd˙t
which we can also write in recursive form as
Thus, we can generate realizations of the random run with either x(t) ∼ N (0, Px (t)) or recursively from
Note that kPx k becomes infinite as t3 becomes infinite. This could lead to an overflow of the representation
of Px in a computer program if both the propagation time and q are large, and could also lead to the
representation of Px losing either its symmetry and/or its positive definiteness due to roundoff and/or
truncation.
The following model provides a stable alternative to the “Random Walk + Random Run” model3 . Its
transient response can be tuned to approximate the Random Walk + Random Run model, and its stable
steady-state response can be used to avoid computational issues with long propagation times. The model is
as follows.
ḃ(t) −1/τ 1 b(t) 1 0 wb (t)
˙ = + (6.219)
d(t) −ωn2 −2ζωn d(t) 0 1 wd (t)
ẋ(t) = A(t)x(t) + B(t)w(t) (6.220)
The measurement partial is the same as for the random ramp. The initial condition x(to ) is an unbiased
random constant. Since x(to ) and w(t) are zero-mean, then x(t) is also zero-mean for all time. The covariance
evolves in time according to
where
eat b cos bt + (a + 2ζωn ) sin bt sin bt
Φ(t) = (6.222)
b −ωn2 sin bt b cos bt + (a + β) sin bt
where
β = 1/τ, (6.223)
1
a = − (β + 2ζωn ) , (6.224)
r 2
1
b= ωd2 + βζωn − β 2 , (6.225)
4
p
ωd = ωn 1 − ζ 2 , (6.226)
Examining the solution given above, we see that the parameter a governs the rate of decay of all of the
exponential terms. Therefore, we define the “rise time” as that interval within which the transient response
of the covariance will reach a close approximation to the above steady-state value; thus, we define the rise
time as follows:
3
tr = − . (6.230)
a
Next, we note that all of the trigonometric terms are modulated by 2b; thus we may view this value as a
characteristic damped frequency of the coupled system. The period of the oscillation, Π, is then
Π = π/b (6.231)
In the limit as t → ∞, all the exponential terms in the analytical solution die out, so that the steady-state
value of the covariance simplifies to:
1 qd + (2a2 + b2 + c2 − 2ac)qb β(qd + qb ωn2 )
P (∞) = − (6.232)
4a(a2 + b2 ) β(qd + qb ωn2 ) (2a2 + b2 + c2 + 2ac)qd + qb ωn4
Draft for Release R2018a
184 CHAPTER 6. MEASUREMENT MODELING
This test checks to see if a celestial body obstructs the signal path between two objects. There are three
cases that can occur in this test: two spacecraft (case 1), a spacecraft and a participant on the surface of a
celestial body (case 2), and two participants on the surfaces of different celestial bodies (case 3). Below we
address each of these cases starting with case 1.
For all three cases, assume the signal is generated by participant 1 at time t1 and, if no obstruction
occurs, the signal is received by participant 2 at time t2 . Define the location of the first participant at time
t1 , expressed in FI1 as rI1 1 (t1 ) which is calculated using Eq. (6.6). Define the location of participant 1 at
time t1 , expressed in FS , as rS1 (t1 ) which is calculated using Eq. (6.8). Similarly, rI2 2 (t2 ) and rS2 (t2 ) are
calculated using Eqs. (6.7) and (6.9) respectively.
Two Spacecraft
The Line of Sight (LOS) test is a visibility test for inter-spacecraft measurements. The algorithm presented
here is based on Vallado25 (pp. 307-311) with slight modifications to include light time correction when
applicable (i.e. for all measurements except geometric measurements). This test first checks to see if the
intersection of the perpendicular distance vector, d(τmin ), with the ray path, ρ, lies in between the two
participants. It then checks to see if the ray path height, h, is above the minimum allowable ray path
altitude hmin .
The geometry for the LOS test is shown in Fig. (6.7). The variables in Fig. 6.7 are defined as follows.
r1 d
r2
hmin Rb
where the quantities r2 (t2 ) and [r1 (t1 )]1 are determined during light time correction. The ray path parameter,
τ , is a unitless value indicating a point along ρ. The only value of τ that we care about here is τmin , which
is computed from
[r2 (t2 )]1 · [ρ]1
τmin = (6.234)
ρ2
The position vector of τ , d(τ ), is simply
Finally, the criteria for measurement feasibility is when the following statement is true
For geometric measurements, t1 = t2 . For measurements involving participants about different central
bodies, the LOS test is performed twice, once for each central body.
ρ δ
rg rs δm
From inspection of Fig. 6.8, a space-based observer is above the local horizon of a ground-based observer if
δ ≥ δm (6.237)
where ρ = rs −rg . Finally, the horizon check is true if the following statement is satisfied and false otherwise:
ρ · rg
> sin δm (6.239)
ρrg
Chapter 7
7.2.2 min
[minX] = min(X)
X is an nxm array. minX is a 1xm array containing the minumum value contained in each row of X.
7.2.3 abs
[absX] = abs(X)
X is an nxm array. absX is a nxm array where each component is the absolute value of the corresponding
component of X.
7.2.4 mean
[meanX] = mean(X)
X is an nxm array. meanX is a 1xm row vector containing the mean of each column of X.
7.2.5 dot
[dotp] = dot(vec1,vec2)
The dot function calculates the dot (scalar) product of two vectors. vec1 and vec2 must both be vectors
with the same length. dotp is the scalar product.
7.2.6 cross
[crossp] = cross(vec1,vec2)
The cross function calculates the cross product of two vectors. vec1 and vec2 must both be vectors
with the same length. crossp is the cross product.
187
Draft for Release R2018a
188 CHAPTER 7. MATHEMATICS IN GMAT SCRIPTING
7.2.7 norm
[normv] = norm(vec)
The norm function calculates the 2-norm of a vector. vec must both be a vector. normv is the root-sum-
square of the components of vec.
7.2.8 det
[detX] = norm(X)
The det function calculates the determinant of a matrix. X is an nxn array. detX is the determinant of
X.
7.2.9 inv
[invX] = inv(X)
The inv function returns the inverse of a matrix. X must be a square matrix.
7.2.10 eig
7.2.11 sin, cos, tan
7.2.12 asin, acos, atan, atan2
7.2.13 sinh, cosh, tanh
7.2.14 asinh, acosh, atanh
7.2.15 transpose
7.2.16 DegToRad
7.2.17 RadToDeg
7.2.18 log
7.2.19 log10
7.2.20 exp
7.2.21 sqrt
Draft for Release R2018a
Chapter 8
Solvers
189
Draft for Release R2018a
190 CHAPTER 8. SOLVERS
Draft for Release R2018a
Chapter 9
Events
In GMAT, events allow a user to determine when station contacts, eclipses, or spacecraft-to-spacecraft occur
among others. In general, events are dependent upon the orbit dynamics and time dependent parameters,
and therefore can only be determined during or after orbit propagation. The implementation of Events
requires GMAT to find the roots of parametric functions of time. The roots of the parametric equation are
the event times, in the case of a discrete event, or define the event boundaries, in the case of an interval
event.
In this chapter, we’ll look at how GMAT calculates the roots of event functions and hence locates both
discrete and interval events. This includes two subproblems. The first is determining if a root/event has
occurred during a propagation step. The second, is determining the numerical value of the root. We begin
by looking at the mathematical definition of an event function in GMAT.
where t is the current time, x(t) is a vector of time dependent parameters such as spacecraft states, and C
is a vector of constants. f is vector of function values at t, d is a vector describing the or sign change we
wish to track that occurs at the root, and p is a vector that tells GMAT whether a root is possible or not.
Let’s talk about some of the output variables in more detail.
For efficiency and convenience, the user can calculate several different function values, f , inside of a single
event function, F. This is useful when several functions require similar yet expensive calculations. GMAT
allows the user to pass back a vector of function values in the output parameter f , where the components of
f are simply the values of the different functions f , or
191
Draft for Release R2018a
192 CHAPTER 9. EVENTS
The output parameter d allows the user to define which type of roots for GMAT to calculate. For example,
in some cases we might only be interested in roots that occur when the function changes from a negative
value to a positive value. In other situations we may only be interested in roots that occur when the function
passes from positive to negative. Finally, we may be interested in both types of roots. d is a vector that has
the same number of elements as f , and the first element of d corresponds to the first element of f and so on.
Table 9.1 summarizes the allowable choices for components of d and the action GMAT will take depending
upon the selection.
The last output variable in the Event Function output, p, is a flag that allows the user to tell GMAT
whether or not a root is possible. If a component of p is zero, then GMAT will not attempt to try to find a
root of the corresponding function in f . This flag is included to improve the efficiency of the algorithm. It
is often possible to perform a few simple calculations to determine if a root is possible or not. For example,
let’s assume an event function is written to track Earth shadow crossings and that the function is positive
when a spacecraft is not in Earth’s shadow, and negative when it is in Earth shadow. It is a relatively
simple calculation to determine if a spacecraft is on the day-side of Earth by taking the dot product of the
Sun vector and the spacecraft’s position vector. If the quantity is positive, there is no need to continue
calculating the actual function value.
Now that we’ve looked at the definitions of the inputs and outputs of an Event Function, let’s look at
some different approaches to finding the roots of an event function.
when zero-crossings occur. Once a zero-crossing is identified, there are well known ways to calculate the
actual root value.
type of polynomial GMAT uses in RootCheckMethod is the same as it uses in RootFindingMethod and is
discussed in more detail below.
If a zero crossing is detected, there are many ways to determine the numerical value of the root. The
user can select between the different methods by using the RootSolvingMethod option. The two methods
currently implemented in GMAT are called QuadraticPolynomial and CubicSpline in the GMAT script
language. As the name suggests, if the user selects QuadraticPolynomial, then GMAT uses the last three
function values to create a quadratic polynomial. Then, the quadratic equation is used to determine the
root locations. Similarly, if the user selects CubicSpline, GMAT constructs a cubic spline and then uses
interpolation to find the root value.
Allowing the options above requires that care is taken in designing an algorithm to track events. In the
next section we discuss some of the issues that must be addressed in the Event Function algorithm, and
present a flow chart that describes the algorithm in detail
True
RootSolvingMethod =
n_r = 3
{Quadratic,DOQuadratic}
False
RootSolvingMethod = True
{CubicSpline, n_r = 5
DOCubicSpline}
False
True
RootCheckMethod =
n_c = n_r
Polynomial
False
True
RootCheckMethod = n_c = 2
FunctionSignChangel
False
[f,d,p] = F(t,x(t))
F(1,:) = f ’
t(1,1) = t
D(1,:) = d’
P(1,:) = p’
N = size(f)
Startup = ones(N,1)
CheckAll = ones(N,1)
Initialization
[f,d,p] = F(t,x(t))
False
i=1
False
i <= N
True
True
Startup(i) = 1
False
RootCheckMethod = False
FunctionSignChange
True
False
Check for sign Calculate
changes in Polynomial Roots True
Real Roots Update Data
appropriate for Appropriate
segments Segments
True
Sign Change
False
i=i+1
Chapter 10
Graphics
where
p
r= x2 + y 2 + z 2 (10.3)
There are three special cases to consider when plotting a new point on a ground track: (1) the new point
wraps off the right-hand side of the plot, (2) the new point wraps off the left-had side of the plot, and (3)
the new point does not wrap off either plot boundary. When wrapping oocurs as in cases (1) and (2), the
plot algorithm must perform ”Pen Up” and ”Pen Down” commands to avoid connecting points on opposite
ends of the plot with a spurious straight line. Secondly, when wrapping occurs, the system must interpolate
the line segments to plot boundaries.
The test to determine the case depends upon whether the object is moving clockwise or counterclockwise
in the body fixed system of the ground track plot central body. The orbit direction is determined by
evaluating the z component of orbit angular momentum expressed in the body fixed system. Define a
variable d that is positive for clockwise motion in the body fixed system (the spacecraft is moving to the
right on a ground track plot), and negative for counterclockwise motion. (spacecraft is moving to the left on
a ground track plot), and 0 for no motion. The variable d is computed as follows
φi − φi−1
m= (10.5)
λi − λi−1
197
Draft for Release R2018a
198 CHAPTER 10. GRAPHICS
ℓT î ℓT ĵ ℓT k̂
+ 2 + 2 −1=0 (10.8)
Rx2 Ry Rz
where î, î, and î are unit vectors in the x, y, and z directions respectively. Define α∗ as the value of α
that simulteoulsy satisfies both the equation for ray ℓ and the equation for the triaxial ellipoid. Expanding
Draft for Release R2018a
10.2. FOOTPRINT AND LIMB COMPUTATION 199
There are three physical types of solutions for α∗ given by Eq. (10.10). If (B 2 − 4AC) < 0 then ray ℓ does
not intersect the ellipoid. If (B 2 − 4AC) = 0 then ray ℓ is tangent to the ellipsoid (we’ll revisit this relation
when computing the limb curve). In this case,
B
ℓ∗ = p − d̂ (10.14)
2A
Finally, if (B 2 − 4AC) > 0 then ray ℓ intersects the ellipsoid at two locations. For graphics purposes, we
require the smaller value of α∗ given by Eq. (10.10). If we define α∗ as a vector containing the two solutions
for α corresponding to the two intersection points, then, the equation for the nearest intersection point, ℓ∗
is given by
ℓ∗ = p + min(α∗ )d̂ (10.15)
Chapter 11
Numerical Algorithms
For interpolation to be feasible, several conditions must be satisfied. First, x′ must lie between the
minimum and maximum value of x, or at the boundaries ( otherwise we would be extrapolating ):
x′ ≥ min(x) (11.1)
and
x′ ≤ max(x) (11.2)
201
Draft for Release R2018a
202 CHAPTER 11. NUMERICAL ALGORITHMS
Second, there must be enough data points in points in x to support interpolation to the desired order. If the
requested interpolation is of order n, then we require n + 1 data points to perform the interpolation. Hence
the following criteria must be met:
mx ≥ n + 1 (11.3)
If the requested interpolation is feasible, we must choose the subset of x to use for interpolating the data
at x′ . Define x(q) as the q th element of x. Given x′ , we choose q to minimize the difference between x′ and
the mean of x(q) and x(q + n), or:
x(q + n) + x(q)
min − x′ (q ∈ 1, 2, 3, ...mx) (11.4)
q 2
Choosing q in this way places x′ as near to the center of the interpolation interval as possible.
The standard formula for the Lagrange interpolating polynomial for a single function is
n
X
P (x) = Pj (x) (11.5)
k=1
Lagrange interpolation is an efficient method when interpolating multiple data sets available at the same
independent variable points. This is due to the fact that the product term in Eq. (11.6) is only a function
of the values of the independent variables and the desired interpolation point and not on the function being
interpolated. As a result, we can evaluate the product term one time and use it for many functions (which is
what is done when interpolating an ephemeris file). The algorithm for implementing Lagrangian interpolation
for multiple functions is shown below.
Input: x, f , x′ , q, n
Output: f ′
f ′ = 0(1 x mf ) ;
for i = q to q + n do
prod = f (i, :) % The ith row of f ;
for j = q to q + n do
if i 6= j then
% The product in Eq. (11.6);
x′ − x(j)
prod = prod · ;
x(i) − x(j)
end
end
% The summation in Eq. (11.5);
f ′ = f ′ + prod;
end
x = [ x1 x2 x3 ]T (11.7)
y = [ y 1 y 2 y 3 ]T (11.8)
Draft for Release R2018a
11.3. CUBIC SPLINE (NOT-A-KNOT) INTERPOLATION 203
we wish to find a quadratic polynomial that fits the data such that
y = Ax2 + Bx + C (11.9)
x21 y1 1
x22 y2 1
x23 y3 1
B = (11.12)
x21 x1 1
x22 x2 1
x23 x3 1
x = [ x1 x2 x3 x4 x5 ]T (11.14)
y = [ y 1 y 2 y 3 y 4 y 5 ]T (11.15)
pi = ai (x − xi )3 + bi (x − xi )2 + ci (x − xi ) + di (11.16)
hi = xi+1 − xi (11.17)
yi+1 − yi
∆i = (11.18)
hi
AS = B (11.19)
Draft for Release R2018a
204 CHAPTER 11. NUMERICAL ALGORITHMS
and S = [ S1 S3 S5 ]T . We can solve for the components of S using Cramer’s Rule as follows
B11 A12 A13
B21 A22 A23
B31 A32 A33
S1 = (11.32)
|A|
A11 B11 A13
A21 B21 A23
A31 B31 A33
S3 = (11.33)
|A|
h 4 S3 + h 3 S5
S4 = ; (11.36)
h3 + h4
Finally, the coefficients for the ith cubic polynomial are given by
Si+1 − Si
ai = (11.37)
6hi
Si
bi = (11.38)
2
yi+1 − yi 2hi Si + hi Si+1
ci = − (11.39)
hi 6
di = yi (11.40)
Draft for Release R2018a
11.4. ROOT LOCATION USING BRENT’S METHOD 205
NOTE: The implementation used in GMAT’s even locators follows the Algorithm in Numerical Recipes 3rd
edition which slightlyl different than the algorithm presented below.
Brent’s26 method is a root finding algorithm that takes advantage of superlinear convergence properties
of the secant method and inverse quadratic interpolation, and the robustness of the bisection method.
The algorithm is a modification of Dekker’s method which combines the bisection method and the secant
method.27
The algorithm requires as inputs to real numbers that bound the desired root.
Input: f, a, b, tol, N,
Output: xo , i
fa = f (a); fb = f (b);
if fa · fb > 0; error and return; end ;
c = a; fc = fa ; d = b − a; e = d;
if |fc | ≤ |fb | then
a = b; b = c; c = a; fa = fb ; fb = fc ; fc = fa ;
end
t = 2ǫ|b| + tol;
m = 0.5(c − b) ;
i = 1;
while |m| >= t and |fb | >= t and i ≤ N do
if |e| ≤ t or |fa | < |f b| then
d = m; e = m;
else
s = fb /fa ;
if a = c then
p = 2.0 · m · s;
q = 1.0 − s;
else
q = fa /fc ; r = fb /fc ;
p = s(2.0 · m · q(q − r) − (b − a)(r − 1.0));
q = (q − 1.0)(r − 1.0)(s − 1.0);
end
if p >= 0.0 then
q = −q;
else
p = −p;
end
s = e;
e = d;
if (2 · p < 3.0 · m · q − |t · q|) or (p ≤ |0.5 · s · q|) then
d = p/q;
else
d = m; e = m;
end
end
a = b; fa = fb ;
if |d| ≥ t then
b = b + d;
else
if m ≥ 0.0 then
b = b + t;
else
b = b − t;
end
end
fb = f (b);
if ( fb > 0.0 and fc > 0 ) or ( fb < 0.0 and fc < 0 ) then
c = a; fc = f a; d = b − a; e = d;
else
if |fc | ≤ |fb | then
a = b; b = c; c = a; fa = fb ; fb = fc ; fc = fa ;
end
end
t = 2ǫ|b| + tol; m = 0.5(c − b); i = i + 1;
end
xo = b;
Chapter 12
MathSpecAppendices
207
Draft for Release R2018a
208 CHAPTER 12. MATHSPECAPPENDICES
Draft for Release R2018a
Bibliography
[1] Seidelmann, P. K., “Report of the IAU/IAG Working Group on Cartographic Coordinates and Rota-
tional Elements of the Planets and Satellites: 2000,” Celestial Mechanics and Dynamical Astronomy,
Vol. 82, No. 1, 2002, pp. 83 – 111.
[2] Frank P. Incropera, Davit P. Dewitt, T. L. B. and Lavine, A. S., Fundamentals of Heat and Mass
Transfer , John Wiley and Sons, Inc., NJ, 2007.
[3] Vallado, D. A., Fundamentals of Astrodynamics and Applications, 2nd Ed., Microcosm Press, El Se-
gundo, CA, 2001.
[4] P. Kenneth Seidelmann, E., Explanatory Supplement to the Astronomical Almanac, Univesity Science
Books, Mill Valley, CA, 1992.
[5] P. K. Seidelmann, T. F., “Why New Time Scales?” Astronomy and Astrophysics, Vol. 265, 1992, pp. 833
– 838.
[6] Kaplan, G. H., “The IAU Resolutions on Astronomical Reference Systems, Time Scales, and Earth
Rotation Models Explanation and Implementation,” United States Naval Observatory Circular No.
179 , 2005.
[7] V. Coppola, J. S. and Vallado, D., “THE IUA 2000A and IAU 2006 Precession-Nutation Theories and
Their Implementation,” Somewhere.
[8] Long, A. and et. al., J. C., Goddard Trajectory Determination System Mathematical Theory, Revision
1 , Computer Sciences Corporation, Lanham-Seabrook, MD, 1989.
[9] Kizner, W., “A Method of Describing Miss Distances for Lunar and Interplanetary Trajectories,” Jet
Propulsion Laboratory External Publication, , No. 674, 1959.
[10] Montenbruck, O. and Gill, E., Satellite Orbits: Models, Methods, Applications, Springer, Berlin, Ger-
many, 2005.
[11] Szebehely, V., Theory of Orbits, Academic Press Inc., New York, NewYork, 1967.
[12] Vallado, D. A., Fundamentals of Astrodynamics and Applications, McGraw-Hill, New York, 1997.
[13] Pines, S., “A Uniform Representation of the Gravitational Potential and its Derivatives,” AIAA Journal ,
Vol. 11, No. 11, 1973, pp. 1508 – 1511.
[14] John B. Lundberg, B. E. S., “Recursion Formulas of Legender Functions for Use with Nonsingular
Geopotential Models,” Journal of Guidance, Control, and Dynamics, Vol. 11, No. 1, 1988, pp. 31 – 38.
[15] C. Huang, J.C. Ries, B. T. M. W., “Relativisitic Effects for Near-Earth Satellite Orbit Determination,”
Celestial Mechanics and Dynamical Astronomy.
[16] Paul N. Estey, David H. Lewis Jr., M. C., “Prediction of Propellant Tank Pressure History Using State
Space Methods,” Journal of Spacecraft and Rockets, Vol. 20, No. 1, 1983, pp. 49 – 54.
209
Draft for Release R2018a
210 BIBLIOGRAPHY
[17] Hearn, H. C., “Development and Validation of Fluid/Thermodynamic Models for Spacecraft Propulsion
Systems,” Journal of Propulsion and Power , Vol. 17, No. 3, 2001, pp. 527 – 533.
[18] Michael J. Moran, H. S., Fundamentals of Engineering Thermodynamics, John Wiley and Sons, NY,
1992.
[19] Eliot Ring, E., Rocket Propellant and Pressurization Systems, Prentice Hall, Inc., NJ, 1964.
[20] Donald R. Pitts, L. E. S., Shaum’s Outlines, Heat Transfer 2nd Ed., McGraw Hill, NY, 1998.
[21] Hydrazine Handbook , Rocket Research Company.
[22] A. Ricciardi, E. P., “Prediction of the Performance and Thermodynamic Conditions of Bipropellant
Propulsion System During its Lifetime,” AIAA/SAE/ASEE 23rd Joint Propulsion Conference, June.
[23] 1980.
[24] Moyer, T., Formulation for Observed and Computed Values of Deep Space Network Data Types for
Navigation, Jet Propulsion Laboratory, Pasadena, CA, 2000.
[25] Vallado, D. A., Fundamentals of Astrodynamics and Applications, 3rd Ed., Microcosm Press, Hawthorne,
CA, 2007.
[26] Brent, R., Algorithms for Minimization without Derivatives, Prentice Hall, Inc., NJ, 1973.
[27] Dekker, T., “Finding a zero by means of successive linear interpolation,” Constructive Aspects of the
Fundamental Theorem of Algebra.