0% found this document useful (0 votes)
325 views

GMATMath Spec

This document provides a draft of the mathematical specifications for version R2018a of the General Mission Analysis Tool (GMAT). It includes sections on time systems, coordinate systems, spacecraft state representations, and simple parameters. The document contains detailed information on transformations between different time formats, coordinate systems, and spacecraft state representations that will be used in GMAT.

Uploaded by

-wandrian-
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
325 views

GMATMath Spec

This document provides a draft of the mathematical specifications for version R2018a of the General Mission Analysis Tool (GMAT). It includes sections on time systems, coordinate systems, spacecraft state representations, and simple parameters. The document contains detailed information on transformations between different time formats, coordinate systems, and spacecraft state representations that will be used in GMAT.

Uploaded by

-wandrian-
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 210

Draft for Release R2018a

General Mission Analysis Tool


(GMAT)
Mathematical Specifications
DRAFT
February 9, 2018

NASA Goddard Space Flight Center


Greenbelt RD
Greenbelt, MD 20771
Draft for Release R2018a

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.1.2 Cartesian State to Keplerian Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 46


3.1.3 Keplerian Elements to CartesianState . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.1.4 Equinoctial Elements to Cartesian State . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.1.5 Cartesian State to Equinoctial Elements . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.1.6 Cartesian State to SphericalAZFPA State . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.1.7 SphericalAZFPA State to Cartesian State . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.1.8 Cartesian State to SphericalRADEC State . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.1.9 SphericalRADEC State to Cartesian State . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.1.10 Keplerian or Cartesian, to Modified Keplerian Elements . . . . . . . . . . . . . . . . . 56
3.1.11 Modified Keplerian Elements to Keplerian Elements . . . . . . . . . . . . . . . . . . . 56
3.2 Simple Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.2.1 A1Gregorian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.2.2 A1ModJulian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.2.3 Altitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.2.4 AOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.2.5 Apoapsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.2.6 AZI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.2.7 BdotT and BdotR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.2.8 BetaAngle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.2.9 BVectorAngle and BVectorMag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.2.10 C3Energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.2.11 DEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.2.12 DECV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.2.13 ECC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.2.14 FPA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.2.15 EA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.2.16 Energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.2.17 HMAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.2.18 HX,HY, and HZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.2.19 HA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.2.20 INC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.2.21 Latitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.2.22 Longitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.2.23 LST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.2.24 MA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.2.25 MHA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.2.26 MM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.2.27 OrbitPeriod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.2.28 PercentShadow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.2.29 RA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.2.30 RAV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.2.31 RAAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.2.32 RadApo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.2.33 RadPer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.2.34 RLA and DLA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.2.35 RMAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.2.36 SemilatusRectum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.2.37 SMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.2.38 TA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.2.39 TAIModJulian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.2.40 TTModJulian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.2.41 TTGregorian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.2.42 Umbra and Penumbra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.2.43 UTCModJulian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Draft for Release R2018a
4 CONTENTS

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

5 Numerical Integrators 151


5.1 Runge-Kutta Integrators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.1.1 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.2 Prince-Dormand Integrators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.3 Adams Bashforth Moulton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.4 Bulirsch-Stoer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.5 Stopping Condition Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.6 Integrator Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

6 Measurement Modeling 157


6.1 General Form of the Measurement Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.1.1 Ideal Observables: Geometry, Coordinate Systems, and Notation . . . . . . . . . . . . 157
Draft for Release R2018a
CONTENTS 5

6.1.2 One Way Range Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159


6.2 Light-Time Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
6.2.1 One-Way Light Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
6.2.2 Partial Derivatives of the One-Way Light Time . . . . . . . . . . . . . . . . . . . . . . 160
6.3 Computed Value of Two-Way Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
6.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
6.3.2 NASA Ground Network (STDN) and Universal Space Network (USN) . . . . . . . . . 163
6.3.3 NASA Space Network (TDRSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
6.3.4 NASA Deep Space Network (DSN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
6.4 Computed Value of Averaged Two-Way Doppler . . . . . . . . . . . . . . . . . . . . . . . . . 166
6.5 NASA Deep Space Network (DSN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
6.6 Computed Values of Optical Angles Observables . . . . . . . . . . . . . . . . . . . . . . . . . 167
6.7 Geometric Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
6.7.1 Geometric Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
6.7.2 Geometric Range Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
6.7.3 Geometric Az/El . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
6.7.4 Geometric RA/Dec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
6.8 Measurement Error Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
6.8.1 Models and Realizations of Random Variables . . . . . . . . . . . . . . . . . . . . . . . 174
6.8.2 Zero-Input Bias State Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
6.8.3 Single-Input Bias State Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
6.8.4 Multi-Input Bias State Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
6.9 Measurement Editing and Feasibility Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
6.9.1 Line of Site Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
6.9.2 Height of Ray Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
6.9.3 Line of Sight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
6.9.4 Horizon Angle Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
6.9.5 Range Limit Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
6.9.6 Range Rate Limit Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
6.9.7 Solar Exclusion Angle Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

7 Mathematics in GMAT Scripting 187


7.1 Basic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.2 Math Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.2.1 max . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.2.2 min . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.2.3 abs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.2.4 mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.2.5 dot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.2.6 cross . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.2.7 norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.8 det . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.9 inv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.10 eig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.11 sin, cos, tan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.12 asin, acos, atan, atan2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.13 sinh, cosh, tanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.14 asinh, acosh, atanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.15 transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.16 DegToRad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.17 RadToDeg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.18 log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.19 log10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.2.20 exp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Draft for Release R2018a
6 CONTENTS

7.2.21 sqrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

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

11 Numerical Algorithms 201


11.1 Lagrange Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
11.2 Quadratic Polynomial Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
11.3 Cubic Spline (Not-a-Knot) Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
11.4 Root Location using Brent’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

12 MathSpecAppendices 207
12.1 Vector Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Draft for Release R2018a

List of Figures

2.1 Illustration of a Translating and Rotating Coordinate System . . . . . . . . . . . . . . . . . . 18


2.2 General Coordinate System Transformation Approach in GMAT . . . . . . . . . . . . . . . . 20
2.3 Inertial Motion of Earth’s Spin Axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.4 Intermediate Transformations and Coordinate Systems in FK5 Reduction . . . . . . . . . . . 25
2.5 IAU Definition of Pole and Meridian Locations for Planets and Moons . . . . . . . . . . . . . 28
2.6 Diagram of an Object Referenced Coordinate System . . . . . . . . . . . . . . . . . . . . . . . 35
2.7 Coordinate System Transformation Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 43

3.1 The Keplerian Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46


3.2 The Spherical Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.3 Geometry of the B-Plane as Seen From a Viewpoint Perpendicular to the B-Plane . . . . . . 60
3.4 The B-Vector as Seen From a Viewpoint Perpendicular to Orbit Plane . . . . . . . . . . . . . 61
3.5 Geocentric and Geodetic Latitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.6 Local Sidereal Time Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.7 Shadow Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.8 Occultation Geometry in Calculation of PercentShadow . . . . . . . . . . . . . . . . . . . . . 70
3.9 Geometry of Umbra and Penumbra Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.10 Geometry of Libration Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.11 Location of Libration Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

4.1 N-Body Illustration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86


4.2 Euler Axis and Angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.3 Mono-Prop Thruster Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
4.4 Bi-Prop Thruster Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
4.5 Sample Thrust Pulse Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.6 Thrust Stand Illustration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
4.7 Pressurant Tank Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.8 Blow Down Tank Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.9 Pressure Regulated Tank Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
4.10 Geometry For Mass Properties of Partially Filled Spherical Tank . . . . . . . . . . . . . . . . 130
4.11 Pressurant Tank Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
4.12 Blow Down Tank Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
4.13 Pressure Regulated Tank Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

6.1 Measurement Geometry and Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158


6.2 Illustration of Range Vector in Geocentric and Barycentric Systems . . . . . . . . . . . . . . 159
6.3 Two-Way Measurement Time Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
6.4 TDRSS Two-Way Range Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
6.5 Two-Way Doppler Measurement Time Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
6.6 Geometric Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
6.7 Height of Ray Path Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
6.8 Height Angle Test Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

9.1 Sample Event Function Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193


9.2 Initializations for the Event Location Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 195

7
Draft for Release R2018a
8 LIST OF FIGURES

9.3 Event Location Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196


Draft for Release R2018a

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

3.1 The Cartesian State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46


3.2 The Keplerian Elements (also see Fig. 3.1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.3 Keplerian Elements for Special Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.4 The Equinoctial Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.5 The Spherical Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6 The Modified Keplerian Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.7 Location of Libration Points in RLP Frame, with the Origin at the Primary Body . . . . . . 79

4.1 Force Models Available in GMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84


4.2 Thrust and Isp Coefficient Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.3 Attitude Matrices for 12 Unique Euler Angle Rotation Sequences . . . . . . . . . . . . . . . . 110
4.4 Kinematics of Euler Angle Rotation Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . 111
4.5 Computation of Euler Angles from Attitude Matrix . . . . . . . . . . . . . . . . . . . . . . . . 112
4.6 Dimensionless Heat Transfer Terms2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
4.7 Constants for Density Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4.8 Constants for Vapor Pressure Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4.9 Constants for Dissolved Pressurant Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4.10 Dimensionless Heat Transfer Terms2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
4.11 Constants for Density Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
4.12 Constants for Vapor Pressure Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
4.13 Constants for Dissolved Pressurant Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.1 Prince-Dormand 45 Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153


5.2 Prince-Dormand 56 Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
5.3 Runge-Kutta-Fehlberg 56 Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
5.4 Prince-Dormand 78 Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

8.1 Available Commands in an fmincon Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

9.1 Allowable Values for d in Event Function Output . . . . . . . . . . . . . . . . . . . . . . . . . 192


9.2 Variables in Event Function Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

11.1 Example of Data for interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201

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.

1.1 Time Systems


GMAT uses several different time systems in physical models and spacecraft dynamics modelling. The
choice of time system for a particular calculation is determined by which time system is most natural and
convenient, as well as the accuracy required. In general, for determining Earth’s orientation at a given
epoch, we use one of several forms of Universal Time (UT), because universal time is based on the Earth’s
rotation with respect to the Sun. Planetary ephemerides are usually provided with time in a dynamic time
system, because dynamic time is the independent variable in the dynamic theories and ephemerides. The
independent variable in spacecraft equations of motion in GMAT is time expressed in an atomic time system.
Let’s look at each of these three systems, starting with atomic time.

1.1.1 Atomic Time: TAI and A.1


Atomic time (AT) is a highly accurate time system which is independent of the rotation of the Earth.3
Therefore, AT is a natural system for integrating a spacecraft’s equations of motion. AT is defined in terms
of the oscillations of the cesium atom at mean sea level. The duration of the SI second is defined to be
9,192,631,770 oscillations of the cesium nuclide 133Ce. Two atomic times systems are are used in GMAT:
A.1, and international atomic time (TAI). A.1 is in advance of TAI by 0.0343817 seconds.
A.1 = T AI + 0.0343817sec (1.1)
where
T AI = U T C + ∆AT (1.2)
and ∆AT is the number of leap seconds, added since 1972, needed to keep | U T C − U T 1 |≤ 0.9sec. GMAT
reads ∆AT from the file named tai-utc.dat. For times that appear before the first epoch on the file, GMAT
uses the first value found in the file. For times that appear after the last epoch, GMAT uses the last value
contained in the file. Currently, GMAT uses A.1 time as the independent variable in the equations of motion.
TAI is used as a time system for defining spacecraft state information.
Now let’s look at the universal time system.

11
Draft for Release R2018a
12 CHAPTER 1. TIME

1.1.2 Universal Time: UTC and UT1


All of the universal time (UT) scales are based on the Earth’s rotation with respect to a fixed point (sidereal
time) or with respect to the Sun (solar time). The observed universal time (UTO) is determined from
observations of stellar transits to determine mean local sidereal time. UT1 is UTO corrected for the Earth’s
polar motion and is used when the instantaneous orientation of the Earth is needed. UTC is the basis for all
civil time standards. It is also known as Greenwich mean time (GMT) and Zulu time (Z). The UTC time
unit is defined to be an SI second, but UTC is kept within 0.9 seconds of UT1 by occasional leap second
adjustments. The equation relating UTC and UT1 is

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.

1.1.3 Dynamic Time: TT, TDB and TCB


Dynamical time is the independent variable in the dynamical theories and ephemerides. This class of time
scales contains terrestrial time (TT), Barycentric Dynamical time (TDB), and Barycentric Coordinate Time
(TCB). TDB is the independent variable in the equations of motion referred to the solar system barycenter.
It is also the coordinate time in the theory of general relativity. Despite the fact that the Jet Propulsion
Laboratory (JPL) J2000.0 ephemerides are referred to in TDB, TT is frequently used. This is because TT
and TDB always differ by less than 0.002 sec. As higher accuracy or more sensitive missions are planned,
the difference may need to be distinguished. In this section we’ll discuss how to calculate TT, TDB and
TCB, and discuss where each is used in GMAT.
TT is the independent variable in the equations of motion referred to the Earth’s center. It is also the
proper time in the theory of general relativity. The unit of TT is a day of 86400 SI seconds at mean sea
level. In GMAT, TT is used in FK5 reduction, and as an intermediate time system in the calculation of
TDB and TCB. TT can be calculated from the following equation:

T T = T AI + 32.184 sec (1.4)

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

T DB ≈ T T + 0.001658 sin ME + 0.00001385 sin 2ME (1.5)


| {z }
units of seconds
Note that the term in the underbrace has units of seconds, and depending upon the units of T T , which is
usually in days, a conversion of the term may be necessary before performing the addition with T T . ME is
the Earth’s mean anomaly with respect to the sun and is given approximately as

ME ≈ 357.5277233 + 35, 999.05034TT T (1.6)

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:

T CB − T DB = LB (JD − 2443144.5)86400 (1.8)

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.

1.2 Time Formats


There are two time formats that GMAT uses to represent time in the systems discussed above. These
formats are called the Gregorian Date (GD), and the Julian Date (JD). The difference between the GD and
JD formats is how they represent the Year, Month, Day, Hours, Minutes, and Seconds of a given date. The
GD format is well known, and the J2000 epoch is expressed as, 01 Jan 2000 12:00:00.000 TT. The reference
epoch for the GD calendar is the beginning of the Christian Epoch. The JD format represents an epoch as
a continuous number containing the day and the fraction of day.
The J2000 epoch is commonly used in astrodynamics as a reference epoch for planetary and other data.
The J2000 epoch occurred at 01 Jan 2000 12:00:00.000 TT. The time system, TT, is important for precise
applications! While the J2000 epoch is a specific instant in time, the numerical value changes depending
upon which time system you express it in. We can make an analogy with vector algebra where we have an
abstract quantity that is a vector, and can’t write down a set of numbers representing the vector until we
choose a coordinate system. Similarly, the J2000 epoch can be written in any of the different time systems
and formats. All of the following are equivalent definitions of the J2000 Epoch:

2451545.0 TT
2451544.9996274998411 T AI
2451544.9992571294708 U T C
2451544.9999999990686 T DB

01 Jan 2000 12 : 00 : 00.000000000 TT


01 Jan 2000 11 : 59 : 27.815986276 TAI
01 Jan 2000 11 : 58 : 55.815986276 UTC
01 Jan 2000 11 : 59 : 59.999919534 TDB

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.

1.2.1 Julian Date and Modified Julian Date


The Julian date is a time format in which we can express a time known in any of the Atomic, Universal or
Dynamic time systems. The Julian Date is composed of the Julian day number and the decimal fraction
of the current day. Seidelmann4 (pp. 55-56) says “The Julian day number represents the number of days
that has elapsed, at Greenwich noon on the day designated, since ...the epoch noon Jan 1 4713 B.C. in the
Julian proleptic calendar. The Julian date (JD) corresponding to any instant is, by simple extension to this
concept, the Julian day number followed by the fraction of the day elapsed since the preceding noon”.
Draft for Release R2018a
14 CHAPTER 1. TIME

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.

1.2.2 Gregorian Date


The Gregorian Date format is primarily used as a time system in which to enter state information in GMAT.
GD is not a convenient time format for most mathematical calculations. Hence, GMAT often takes input in
the GD format and converts it to a MJD format for use internally. The algorithm for converting from GD
to JD is taken from Vallado3 and reproduced here verbatim.
JD − 2, 415, 019.5
T1900 =
365.25

Y ear = 1900 + TRUNC(T1900 )

LeapY rs = TRUNC((Y ear − 1900 − 1)(0.25))

Days = (JD − 2, 415, 019.5)−


((Y ear − 1900)(365.0) + LeapY rs)

IFDays < 1.0 THEN


Draft for Release R2018a
1.3. CONCLUSIONS 15

Y ear = Y ear − 1

LeapY rs = TRUNC((Y ear − 1900 − 1)(0.25))

Days = (JD − 2, 415, 019.5)−


((Y ear − 1900)(365.0) + LeapY rs)

If (Year Mod 4) = 0 Then

LM onth[2] = 29
Dayof Y r = TRUNC(Days)

Sum days in each month until


LMonth + 1 summation > DayofYr

M on = # of months in summation

Day = Dayof Y r − LM onth summation

τ = (Days − Dayof Y r)24

h = TRUNC(T emp)

min = TRUNC((T emp − h)60)


 
min
s= T emp − h − 3600
60

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

2.1 General Coordinate System


Transformations
GMAT has the capability to take a position and velocity vector in one coordinate system, and convert
them to another coordinate system that may be both translating and rotating with respect to the original
system. In this section we derive the equations governing coordinate system transformations and describe
the algorithm GMAT uses to transform position and velocity vectors.
We start by defining some notation. In Fig. 2.1, we see an illustration of a point “p” and two coordinate
systems FO and FF . Define the the position of p expressed in FO as rO p . Define the position of point p
with respect to frame FF as rF p It is important to note that using this notation, krO 6 krF
p k = p k, because the
transformation defined in the notation contains a translation from the origin of FO to the origin of FF as
well as a coordinate rotation. rf /i is the vector from the origin of Fi to origin of Ff . Define the rotation
matrix that rotates from FI to FF as RF /I . Finally, let’s define the angular velocity ω f /i as the angular
velocity of FI with respect to FF . To simplify the notation, we assume that a vector is expressed in the
frame denoted by the superscript. If need to define a point “p” with respect to FO , but express this result
in FF we use the notation [rO F
p ] curly brackets. In summary, we have

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

From inspection of Figure 2.1 we can write


F /I I
rF
o = R r + rF (2.1)
| {z o} |{z}
i/f
Rot. T rans.

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

Figure 2.1: Illustration of a Translating and Rotating Coordinate System

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.

ṙf = Ṙf i ri + Rf i ṙi + ṙif (2.8)


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

{ṙi }1 = ṘJ2k ,i ri + RJ2k ,i ṙi (2.10)


The second step is to perform a translation from the origin of Fi to the origin of Ff . We define this second
intermediate system as F2 . F2 has the same origin as Ff but has the same axes as FJ2k . From inspection
of Fig.2.2 we can see that
{ri }1 = {rRi }J2k + {rf R }J2k + {rf }2 (2.11)
Solving for rf we obtain
{rf }2 = {ri }1 − {rRi }J2k − {rf R }J2k (2.12)
where {rRi }J2k is the vector from the origin of Fi to the origin of FR expressed in FJ2k . Similarly {rf R }J2k is
the vector from the origin of FR to the origin of Ff expressed in FJ2k . Because the vector {rf }2 is expressed
in an inertial system we can we can take the derivative of Eq .(2.12) to obtain

{vf }2 = {vi }1 − {vRi }J2k − {vf R }J2k (2.13)

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)

ṙf = Ṙf,J2k {rf }2 + Rf,J2k {vf }2 (2.15)

2.2 Pseudo-Rotating Coordinate


Systems
In mission analysis, sometimes it is useful to consider a rotating coordinate system to be inertial at a given
instant in time. In this case, we ignore the effects of rotation on the velocity. Let’s call systems where we
neglect the rotational effects on velocity pseudo-rotating coordinate systems.
To perform transformations to a pseudo-rotating coordinate system, the equations to convert a position
vector do not change and are given by Eqs. (2.9) and (2.14). However, the velocity conversion equations
change because we neglect the terms that contain Ṙ. For pseudo-rotating coordinate systems the velocity
transformations shown in Eqs. (2.10) and (2.15) become
 
dri dri
= RJ2k ,i (2.16)
dt 1 dt

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

Figure 2.2: General Coordinate System Transformation Approach in GMAT

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

2.3 ITRF and ICRF


The computation for the ICRF and ITRF tranformations in GMAT are from Kaplan6 and Capolla7 et.al.
and employ the IAU 2000A nutation IAU 2006 precession models. The transformation is performed using
three intermediate rotations as follows:
R = CT R3 (−θ)W (2.20)

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

and ωe is computed using Eq. (2.98).


W is computed from Eq. 6.15 in Kaplan6 as shown below.

W = R3 (−s′ )R2 (xp )R1 (yp ) (2.23)

The variable s′ is computed from


s′ = (−47µas)TT T (2.24)

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.4 Transformation from ICRT to MJ2000Eq


With the inclusion of ICRF-based systems, GMAT supports two types of axis systems: (1) axis systems that
are based on IAU-1976 theory (called MJ2000Eq in GMAT), and (2) axis systems based on IAU-2000 theory
(called ICRF in GMAT). Rotation from ICRF to MJ2000Eq is performed using the Frame Bias matrix, B,
given by Kaplan.6
 
1 − 0.5(dα20 + ξ02 ) dα0 −ξ0
B= −dα0 − η0 ξ0 1 − 0.5(dα20 + η02 ) −η0  (2.28)
ξ0 − η0 dα0 η0 + ζ0 dα0 1 − 0.5(η02 + ξ02 )

where dα0 = −14.6 mas, ξ0 = −16.6170 mas, and η0 = −6.8192 mas.


The rotation between any two axes, defind here as A1 and A2 , are performed in three steps:

1. Convert from A1 to the base axes for A1 .

2. If A1 and A2 have different base axis systems, use B to convert from A1 to the base axes of A2

3. Convert from the base axes for A2 to A2

2.5 The FJ2k Inertial System and FK5 Reduction


It is well know that Newton’s laws must be applied in an inertial system. The struggle to determine a truly
inertial system has continued since Newton’s time. In reality, the best we can do is approximate a truly
inertial system in which to apply Newton’s laws. In GMAT that system is the FK5 system, here called FJ2k .
The FJ2k system is referenced to the Earth’s equator and the Earth’s orbit about the sun. Because neither
of these two planes are fixed in space, we must pick an epoch and define an inertial system based on the
geometry at that epoch. This epoch is commonly chosen as the J2000 epoch. In this section, we present the
definition of the FJ2k system, and discuss the transformation from FJ2k to the Earth Fixed system. This
transformation is called FK5 reduction. We begin with a conceptual discussion of how the Earth’s spin
axis moves with respect to inertial space. We conclude this section with a presentation of the mathematical
theory of FK5 reduction.

2.5.1 Overview of FK5 Reduction


The inertial system most commonly used in astrodynamics as of this writing is the FK5 system. We call
this system FJ2k . The FJ2k system is used for many calculations in GMAT. The two most important are for
integrating equations of motion, and as an intermediate system for coordinate system transformation. FJ2k
is used throughout the astrodynamics community as the coordinate system to represent time varying data
such as planetary ephemerides and planetary pole and prime meridian locations.
The rigorous mathematical definition of FJ2k is complex. So, let’s start with a simple qualitative explana-
tion. The nominal z-axis of FJ2k is normal to the Earth’s equatorial plane. The nominal x-axis points along
the line formed by the intersection of the Earth’s equatorial plane and the ecliptic plane, in the direction of
Aries. The nominal y-axis completes the right-handed system. Both the equatorial and ecliptic planes move
slowly with respect to inertial space. The rigorous definition of FK5 uses the mean planes of the ecliptic and
equator, at the J2000 epoch. We’ll take a closer look at the mathematical definitions of the mean ecliptic
and equator below.
FK5 reduction is the transformation that rotates a vector expressed in the FJ2k system to the Earth
Fixed coordinate system. To perform this transformation obviously requires an understanding of how the
Earth’s orientation changes with respect to FJ2k . The time varying orientation of the Earth is complex and
is due to complicated interactions between the Earth and it’s external environment and complicated internal
dynamics. In fact, the dynamic orientation of the Earth is so complicated that we can’t model it completely
and FK5 reduction is a combination of dynamics models and empirical observations that are updated daily.
We describe the orientation of the Earth using three types of motion. The first type, including precession
and nutation, describes how the Earth’s principal moment of inertia moves with respect to inertial space.4
Draft for Release R2018a
2.5. THE FJ2K INERTIAL SYSTEM AND FK5 REDUCTION 23

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

Figure 2.3: Inertial Motion of Earth’s Spin Axis

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

2.5.2 Precession Calculations


JDT DB ≈ JDT T (2.29)
JDT DB − 2, 451, 545.0
TT DB = (2.30)
36525
ζ = 2306.2181”TT DB + 0.30188TT2 DB + 0.017998TT3 DB (2.31)

Θ = 2004.3109”TT DB − 0.42665TT2 DB − 0.041833TT3 DB (2.32)

z = 2306.2181”TT DB + 1.09468TT2 DB + 0.018203TT3 DB (2.33)

P = R3 (−z)R2 (Θ)R3 (−ζ) (2.34)

2.5.3 Nutation Calculations


GMAT has the ability to use either the 1980 IAU Theory of Nutation, or the IERS 1996 Theory of Nutation.
There are some calculations that are common to both, so let’s look at them first. The mean obliquity of the
ecliptic at the J2000 epoch, ǭ, is given by

ǭ =84381.448 − 46.8150TT DB − 0.00059TT2 DB


(2.35)
+ 0.001813TT3 DB

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

l′ =357.52910918◦ + (129596581.0481TT DB−


(2.37)
0.5532TT2 DB − 0.000136TT3 DB − 0.00001149TT4 DB )”
F =93.27209062◦ + (1739527262.8478TT DB−
(2.38)
12.7512TT2 DB + 0.001037TT3 DB + 0.00000417TT4 DB )”
D =297.85019547◦ + (1602961601.2090TT DB−
(2.39)
6.3706TT2 DB + 0.006593TT3 DB − 0.00003169TT4 DB)”
Ω =125.04455501◦ + (−6962890.2665TT DB+
(2.40)
7.4722TT2 DB + 0.007702TT3 DB − 0.00005939TT4 DB )”

1980 Nutation Theory


106
X
∆Ψ1980 = (Ai + Bi TT DB ) sin ap (2.41)
i=1
106
X
∆ǫ1980 = (Ci + Di TT DB ) cos ap (2.42)
i=1

ap = a1i l + a2i l′ + a3i F + a4i D + a5i Ω (2.43)


N = R1 (−ǫ)R3 (−∆Ψ)R1 (ǭ) (2.44)

1996 Nutation Theory


The 1996 theory of nutation published by the IERS is a higher fidelity model of Earth nutation. There are
two primary differences between the 1908 IAU theory and the 1996 IERS theory. The first difference is the
1996 theory uses a 263 term series expansion for the effects of the Earth and Moon. The 1980 theory uses
a 106 term series. The second difference is that the 1996 theory has a second series expansion to account
for the effects of nutation caused by the more massive planets. The planetary series expansion is a 118 term
series. Let’s begin with the equations for the Earth and Moon’s effect on Earth nutation, according to the
1996 IERS theory:
263
X
∆Ψ1996 = (Ai + Bi TT DB ) sin ap + Ei cos ap (2.45)
i=1
263
X
∆ǫ1996 = (Ci + Di TT DB ) cos ap + Fi sin ap (2.46)
i=1

ap = a1i M◦ + a2i M⊙ + a3i uM◦ + a4i D⊙ + a5i Ω◦ (2.47)


To calculate the planetary effects on nutation, we begin by calculating the mean heliocentric longitude
of the planets. Only the effects of Venus(V), Mars(M), JupiterJ), and Saturn(S) are included in the theory.
We require the Earth’s (E) mean longitude also. The mean longitudes are calculated using:
λV = 181.979800853◦ + 58, 517.8156748TT DB
λE = 100.466448494◦ + 35, 999.3728521TT DB
λM = 355.433274605◦ + 19, 140.299314TT DB
λJ = 34.351483900◦ + 3, 034.90567464TT DB
λS = 50.0774713998◦ + 1, 222.11379404TT DB
Draft for Release R2018a
2.5. THE FJ2K INERTIAL SYSTEM AND FK5 REDUCTION 27

The general precession in longitude, pa , is calculated using

pa = 1.39697137214◦TT DB + 0.0003086TT2 DB

Finally, the planetary terms are calculated using:


118
X
∆Ψpl = (Ai + Bi TT DB ) sin apl (2.48)
i=1

118
X
∆ǫpl = (Ci + Di TT DB ) cos apl (2.49)
i=1

apl = a1i λV + a2i λE + a3i λM + a4i λJ + a5i λS +


a6i pa + a7i D + a8i F + a9i l + a10i Ω (2.50)

∆Ψ = ∆Ψ1996 + ∆Ψpl (2.51)


| {z }
optional

∆ǫ = ∆ǫ1996 + ∆ǫpl (2.52)


|{z}
optional

ǫ = ǭ + ∆ǫ (2.53)
In GMAT, the planetary terms are optional. If the user has selected to include the planetary terms, the

N = R1 (−ǫ)R3 (−∆Ψ)R1 (ǭ) (2.54)

2.5.4 Sidereal Time Calculations


To calculate the sidereal time of the Earth, we need the current time which is then used to determine the
Greenwich Mean Sidereal Time (GMST) and the equation of the equinoxes. GMST is calculated using:

θGMST =1.00965822615e6 + 4.746600277219299e10TUT 1


2 3
(2.55)
+ 1.396560TUT 1 + 9.3e − 5TUT 1 (arcseconds)

The calculation of the equation of the equinoxes is dependent upon the time. If the Julian date falls after
2450449.5, then we use

EQequinox = ∆Ψ cos ǫ + 0.00264” sin Ω + 0.000063” sin 2Ω (2.56)

If the Julian date falls on or before 2450449.5 we use

EQequinox = ∆Ψ cos ǫ (2.57)

θAST = θGMST + EQequinox (2.58)

ST = R3 (θAST ) (2.59)

2.5.5 Polar Motion Calculations


PM = R2 (−xp )R1 (−yp ) (2.60)
Draft for Release R2018a
28 CHAPTER 2. COORDINATE SYSTEMS

2.6 Deriving RJ2k ,i and ṘJ2k ,i for Various Coordinate Systems


In GMAT, there are numerous coordinate systems that can be used to define variables, stopping conditions,
spacecraft states, and other quantities. Some examples include the Earth centered mean ecliptic of J2000
system, the Earth-fixed system, the Mars equator system, and the Earth-Moon rotating system.
In the following subsections, we determine how RJ2k ,i and ṘJ2k ,i are calculated in GMAT for all of the
coordinate systems available in GMAT. Let’s begin by looking at coordinate systems defined by the equator
of a celestial body.

2.6.1 Equator System


The Equator axis system has the following nominal configuration:

• x-axis: Along the line formed by the intersection of the bodies equator and the ecliptic plane.

• y-axis: Completes the right-handed set.

• z-axis: Normal to the equatorial 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

(αo , δo ) North pole of planet

Υ
Prime Meridian
90◦ + αo

W
90◦ − δo

Equator of FJ2k

Figure 2.5: IAU Definition of Pole and Meridian Locations for Planets and Moons

inspection of Fig. 2.5 we see that

RJ2k ,i = RT3 (90◦ + αo )RT1 (90◦ − δo ) (2.61)


Draft for Release R2018a
2.6. DERIVING RJ2K ,I AND ṘJ2K ,I FOR VARIOUS COORDINATE SYSTEMS 29

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

RJ2k ,i = R3 (θ1 )T R1 (θ2 )T (2.63)


T
ṘJ2k ,i = R3 (θ1 ) ṘT1 (θ2 ) + ṘT3 (θ1 )RT1 (θ2 ) (2.64)

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.

2.6.2 MJ2000 Ecliptic (MJ2000Ec)


The MJ2000 Ecliptic axis system is defined as follows:

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

• y-axis: Completes the right-handed set.

• z-axis: Normal to the mean ecliptic plane at the J2000 Epoch.

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

2.6.3 True of Epoch Equator (TOEEq)


The True of Epoch Equator axis system is defined as follows:
• x-axis: Along the true equinox at the chosen epoch. The axis points in the direction of the first point
of Aries.

• y-axis: Completes the right-handed set.


Draft for Release R2018a
30 CHAPTER 2. COORDINATE SYSTEMS

• 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

RIi = NT (to )PT (to ) (2.69)

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

2.6.4 Mean of Epoch Equator (MOEEq)


The Mean of Epoch Equator axis system is defined as follows:

• x-axis: Along the mean equinox at the chosen epoch. The axis points in the direction of the first point
of Aries.

• y-axis: Completes the right-handed set.

• 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

2.6.5 True of Date Equator (TODEq)


RIi and ṘIi for the TODEq system can be calculated using the following equations Vallado3 Fig. 3-29).

RIi = NT (to )PT (to ) (2.73)

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

2.6.6 Mean of Date Equator (MODEq)


RIi and ṘIi for the MODEq system can be calculated using the following equations

RIi = PT (to ) (2.75)

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

2.6.7 Mean of Date Ecliptic (MODEc)


RIi and ṘIi for the MODEc system can be calculated using the following equations

RIi = PT (to )RT1 (ǭ) (2.77)

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

2.6.8 True of Date Ecliptic (TODEc)


RIi and ṘIi for the TODEc system can be calculated using the following equations

RIi = PT (to )RT1 (ǭ)RT3 (−∆Ψ) (2.79)

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

2.6.9 Topocentric Horizon


The Topocentric coordinate system has its origin at a ground station with the following axes definitions

• x-axis: Completes the right handed set and points south in the local horizon system.

• y-axis: Points due East.

• 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

φgd ≈ atan2(zF , rxy ); (2.81)

The eccentricity of the body is calculated from the flatting f using

e2 = 2f − f 2 (2.82)

Set δ = 1.0 to initialize the loop, then,


While ( δ > 10−11 )

φ′ = φgd (2.83)
R
C = p (2.84)
1 − e2 sin2 φ
 
zF + Ce2 sin φ
φgd = atan (2.85)
rxy

δ = |φgd − φ | (2.86)

EndWhile

The longitude of the station location, λ, is calculated using

λ = 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)

RF T = [x̂ ŷ ẑ] (2.92)

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

RIT = RIF RF T (2.93)


ṘIT = ṘIF RF T (2.94)
Draft for Release R2018a
2.6. DERIVING RJ2K ,I AND ṘJ2K ,I FOR VARIOUS COORDINATE SYSTEMS 33

2.6.10 Celestial Body Fixed


The body fixed coordinate system is referenced to the body equator and the prime meridian of the body. The
body fixed system for Earth is found by using FK5 reduction to the ITRF system as described by Vallado.
The ITRF system is the earth fixed system.
Vallado denotes the four rotation sequences required to transform from the ITRF to the FK5 system as
[PM], the polar motion, [ST], the sidereal time, [NUT], the nutation, and [PREC], the precession. GMAT
calculates these four rotation matrices as described in Vallado. The rotation matrix from ITRF to FK5 can
be written as follows.
RIi = PT NT STT PMT (2.95)
GMAT assumes that the only intermediate rotation that has a significant time derivative is the sidereal time,
[ST]. So, we can write
ṘIi = PT NT ST ˙ T PMT (2.96)
˙ is given by
where ST  
−ωe sin θAST ωe cos θAST 0.0
˙ = −ωe cos θAST
ST −ωe sin θAST 0.0 (2.97)
0.0 0.0 0.0
and ωe is given by  
LOD
ωe = 7.29211514670698e−5 1 − (2.98)
86400
Note that the 2nd edition of Vallado3 has inconsistencies in Eqs. (2.95) and (2.96) and they are discussed in
the errata to the 2nd edition. We have modified equations Eqs. (2.95) and (2.96) according to the errata.
For bodies other than the earth, the IAU gives the spin axis direction as a function of time with respect
to the MJ2000Eq system and rotation of the prime meridian in the MJ2000Eq system. This data for all
of the planets and many moons can be found in “Report of the IAU/IAG Working Group on Cartographic
Coordinates and Rotational Elements of the Planets and Satellites: 2000” Seidelmann1 et.al. Figure 1 in
this document explains the three variables, αo , δo , and W , that are used to define the body spin axis and
prime meridian location w/r/t J2000. The values of αo , δo , and W for the nine planets and the Earth’s
moon are found on pgs. 8 and 9.
Using the notation found in the reference we can write

RIi = RT3 (90◦ + αo )RT1 (90◦ − δo )RT3 (W ) (2.99)

For the derivative we assume that


 
0.0 0.0 0.0
d 
RT3 (90◦ + αo ) = 0.0 0.0 0.0 (2.100)
dt 0.0 0.0 0.0

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

2.6.11 Body Inertial


The BodyInertial axis system is an inertial system based on the equator of the celestial body chosen as
the origin of the system. The origin of a BodyInertial system must be a celestial body, and cannot be a
spacecraft, libration point etc. The axes are defined as follows (except for Earth):
• x-axis: Along the line formed by the intersection of the bodies equator and the x-y plane of the FK5
system, at the J2000 epoch.
• y-axis: Completes the right-handed set.
• z-axis: Along the bodies instantaneous spin axis direction at the J2000 epoch.
For Earth, the BodyInertial axis system is the FK5 system. For all other bodies, the BodyInertial axis
system is based upon the bodies equator and spin axis at the J2000 epoch. So, BodyInertial is essentially
a true-of-epoch system referenced to the chosen central body. The body orientation at the J2000 epoch is
calculated from the IAU Data in Seidelmann1 for the Sun, Mercury, Venus, Mars, Jupiter, Saturn, Uranus,
Neptune, and Pluto. For the Moon, the orientation at the J2000 epoch comes from the DE405 files. Because
the BodyInertial system is an inertial system, the derivative of the rotation matrix is always zero:
 
0.0 0.0 0.0
ṘIi = 0.0 0.0 0.0 (2.104)
0.0 0.0 0.0
The rotation matrix, RIi , is different for each celestial body. We begin by calculating the angles α and δ
used to define the bodies orientation with respect to the FK5 system:
α = αo (TJ2000 ) (2.105)
δ = δo (TJ2000 ) (2.106)
Where TJ2000 = 2451544.9999999990686 TDB and the equations for αo and δo are given by Seidelmann1
and reproduced in Table 2.1. Finally, the rotation matrix is calculated using
RJ2k ,i = RT3 (90◦ + α)RT1 (90◦ − δ) (2.107)
The result is a rotation matrix, that is time invariant, for each celestial body.

2.6.12 Object Referenced


An object referenced system is a coordinate system whose axes are defined by the motion of one object
with respect to another object. GMAT allows the user to define many different types of Object Referenced
system. In Fig. 2.6 we see a diagram that defines the directions a user can choose from in creating an Object
Referenced coordinate system. There are six directions. One is the relative position, denoted here by r, of
the secondary object with respect to the primary object, expressed in an inertial frame. The second is the
the relative velocity, denoted here by v, of the secondary object with respect to the primary, expressed in
an inertial frame. The third direction is the vector normal to the direction of motion which is denoted by n
and is calculated from n = r × v. The remaining three directions are the negative of of the first three.
In GMAT, a user can use the directions described above to define an Object Referenced coordinate
system. In doing so, the user can choose two of the available directions, and define which of the three axes,
x, y, and z, they desire the direction to be aligned with. Given this information, GMAT automatically
constructs an orthogonal coordinate system. For example, if user chooses the x-axis to be in the direction
of r and the z-axis to be in the direction of n, the GMAT completes the right-handed set by setting the
y-axis in the direction of n × r. Obviously there are some choices that not yield an orthogonal system, or
that yield a left handed system. GMAT does not allow the user to select these pairs of axes and throws an
error message.
In general, given the unit vectors that define the axes system of the Object Referenced system, but
expressed in the inertial frame, GMAT uses the following equations to determine RIi and ṘIi .
RIi = [ x̂ ŷ ẑ ] (2.108)
Draft for Release R2018a
2.6. DERIVING RJ2K ,I AND ṘJ2K ,I FOR VARIOUS COORDINATE SYSTEMS 35

v
n

r
Location of Secondary

Location of Primary

Figure 2.6: Diagram of an Object Referenced Coordinate System

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

2.6.13 Geocentric Solar Ecliptic (GSE)


The Geocentric Solar Ecliptic system is a time varying axis system often used to describe and analyze the
Earth’s magnetic field. The coordinate system is defined such that
rsun
x̂ = (2.122)
krsun k

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

Finally, the y-axis completes the right-handed set

ŷ = ẑ × 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

2.6.14 Geocentric Solar Magnetic (GSM)


rsun
x̂ = (2.130)
krsun k
Let’s define the spherical coordinates of the Earth’s dipole in the Earth fixed frame to be λd and φd .
The location of the dipole actually changes with time. Also, the dipole does not actually pass through the
center of the Earth. However, GMAT currently assumes that the dipole direction is constant, and passes
directly through the center of the Earth. If this approximation is not sufficient for future studies, the model
will have to be updated.

λ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

The dipole vector in the Earth Fixed system is simply


 
cos φd cos (−λd )
{rd }F =  cos φd sin (−λd )  (2.133)
sin φd

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

{rd }I = RIF {rd }F (2.134)

Then, the y-axis is defined as


{rd }I × x̂
ŷ = (2.135)
k{rd }I × x̂k
the z-axis is defined as
ẑ = x̂ × ŷ (2.136)
and
RIi = [ x̂ ŷ ẑ ] (2.137)
To calculate the derivative of the rotation matrix, we know that
 
dx̂ vsun vsun
= − x̂ x̂ · (2.138)
dt rsun rsun

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

2.6.15 Body-Spin Sun Coordinates


The body-spin Sun coordinate system is a celestial-body-based coordinate system defined as follows:

• x points from the central body to the sun

• y completes the right-handed set

• 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

Define the body’s spin axis in the body fixed system as


 
0
rIs = 0 (2.146)
1

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)

Then, the y-axis is defined as


rIs × x̂
ŷ = (2.148)
krIs × x̂k
the z-axis is defined as
ẑ = x̂ × ŷ (2.149)
and
RIi = [ x̂ ŷ ẑ ] (2.150)
To calculate the derivative of the rotation matrix, we know that
 
dx̂ vsun vsun
= − x̂ x̂ · (2.151)
dt rsun rsun

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

2.7 Appendix 1: Derivatives of ObjectReferenced Unit Vectors


The derivations of the above quantities are shown below. We start by deriving two derivatives with respect
to n, where n is given by:
n= r×v (2.156)
We need to determine two derivatives of n. First
dn d dr dv
= (r × v) = × v +r × (2.157)
dt dt dt
| {z } ∂t
0

so we know that
dn
=r×a (2.158)
dt
Draft for Release R2018a
2.7. APPENDIX 1: DERIVATIVES OF OBJECTREFERENCED UNIT VECTORS 39

The next useful derivative is


dn dknk d 1/2 nT dn
= = nT n = (2.159)
dt dt dt n dt
So we can write
dn n
= · (r × a) (2.160)
dt n

The following two derivatives are also useful

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

The time derivatives are derived as follows.


∂r̂ ∂  v r r · v
r̂˙ = = rr−1 = − 2 (2.168)
∂t ∂t r r r
which can be rewritten as
dr̂ v r̂
= − (r̂ · v) (2.169)
dt r r

∂ 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

2.7.1 Basic Rotation Matrices


 
1 0 0
R1 =  0 cos θ sin θ  (2.174)
0 − sin θ cos θ
 
cos θ 0 − sin θ
R2 =  0 1 0  (2.175)
sin θ 0 cos θ
 
cos θ sin θ 0
R3 =  − sin θ cos θ 0  (2.176)
0 0 1
Draft for Release R2018a
2.7. APPENDIX 1: DERIVATIVES OF OBJECTREFERENCED UNIT VECTORS 41

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)

Mercury αo = 281.01 − 0.033T


δo = 61.45 − 0.005T
W = 329.548 + 6.1385025d
Ẇ = 6.1385025

Venus αo = 272.76
δo = 67.16
W = 160.20 − 1.4813688d
Ẇ = −1.4813688

Earth αo = 0.00 − 0.641T


δo = 90.00 − 0.557T
W = 190.147 + 360.9856235d
Ẇ = 360.9856235
Earth Data is included for completeness only, GMAT uses FK5 reduction
for the Earth

Mars αo = 317.68143 − 0.1061T


δo = 52.88650 − 0.0609T
W = 176.630 + 350.89198226d
Ẇ = 350.89198226

Jupiter αo = 268.05 − 0.009T


δo = 64.49 + 0.003T
W = 284.95 + 870.5366420d
Ẇ = 870.5366420

Saturn αo = 40.589 − 0.036T


δo = 83.537 − 0.004T
W = 38.90 + 810.7939024d
Ẇ = 810.7939024

Uranus αo = 257.311
δo = −15.175
W = 203.81 − 501.1600928d
Ẇ = −501.1600928

Neptune αo = 299.36 + 0.70 sin N


δo = 43.46 − 0.51 cos N
W = 253.18 + 536.3128492d − 0.48 sin N
Ẇ = 536.3128492 − 0.48Ṅ cos N
N = 357.85 + 52.316T
Ṅ = 6.0551 × 10−4 (deg/day)

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

δo = 66.5392 +0.0130T +1.5419 cos E1 +0.0239 cos E2


−0.0278 cos E3 +0.0068 cos E4 −0.00292 cos E6
+0.0009 cos E7 +.0008 cos E10 −0.0009 cos E13

W = 38.3213 +13.17635815d −1.4 × 10−12 d2 +3.5610 sin E1


+0.1208 sin E2 −0.0642 sin E3 +0.0158 sin E4
+0.0252 sin E5 −0.0066 sin E6 −0.0047 sin E7
−0.0046 sin E8 +0.0028 sin E9 +0.0052 sin E10
+0.0040 sin E11 +0.0019 sin E12 −0.0044 sin E13

Ẇ = +13.17635815 −2.8 × 10−12 d −.18870 cos E1


−.01280 cos E2 −.835 cos E3 +.211 cos E4
+.0248 cos E5 −.17 cos E6 −.061 cos E7
−.0015 cos E8 +.0049 cos E9 −.00083 cos E10
+.00001 cos E11 +.00031 cos E12 −.057 cos 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

* See Sec. 2.2 for Treatment of Pseudo-Rotating Coordinate Systems


Figure 2.7: Coordinate System Transformation Algorithm
Draft for Release R2018a
44 CHAPTER 2. COORDINATE SYSTEMS
Draft for Release R2018a

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 Spacecraft State Representations


There are several state representations that can be used in GMAT to define the state of a spacecraft object.
These include the Keplerian elements, Cartesian state, equinoctial elements, spherical elements, and the
modified Keplerian elements. In the following subsections, we discuss the definitions of these states types,
and show how GMAT converts between the different state representations.

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 ,Υ

Figure 3.1: The Keplerian Elements

Table 3.1: The Cartesian State


Symbol Description
x x-component of position
y y-component of position
z z-component of position
ẋ x-component of velocity
ẏ y-component of velocity
ż z-component of velocity

for this reason. Let’s begin by looking at how GMAT converts from the Cartesian state to the Keplerian
elements.

3.1.2 Cartesian State to Keplerian Elements


The conversion from the Cartesian state to the Keplerian elements has four special cases: elliptic inclined,
circular inclined, elliptic equatorial, and circular equatorial. Certain orbital elements are undefined for some
of the cases. For example, the right ascension of the ascending node, Ω, is undefined for equatorial orbits.
However, computer systems don’t handle undefined values gracefully. In this section, we’ll see how the orbital
elements are defined for each of the special cases, and how GMAT calculates the orbital elements for each
case.?
Given: r, v, and µ

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

Table 3.2: The Keplerian Elements (also see Fig. 3.1)


(See Table 3.3 for definitions of elements for near circular and near equatorial orbits.)
Symbol Name Description
a semimajor axis The semimajor contains information on the type and size
of an orbit. If a > 0 the orbit is elliptic. If a < 0 the orbit
is hyperbolic. a = ∞ for parabolic orbits.
e eccentricity The eccentricity contains information on the shape of an
orbit. If e = 0, then the orbit is circular. If 0 < e < 1 the
orbit is elliptical. If e = 1 the orbit is parabolic. If e > 1
then the orbit is hyperbolic.
i inclination The inclination is the angle between the ẑI axis and the
orbit normal direction h. If i ≤ 90◦ then the orbit is
prograde. If i > 90◦ then the orbit is retrograde.
ω argument of periapsis The argument of periapsis is the angle between a vector
pointing at periapsis and a vector pointing in the direction
of the line of nodes. The argument of periapsis is undefined
for circular orbits.
Ω right ascension of the as- Ω is defined as the angle between x̂I and N measured coun-
cending node terclockwise. N is defined as the vector pointing from
the center of the central body to the spacecraft, when
the spacecraft crosses the bodies equatorial plane from the
southern to the northern hemisphere. Ω is undefined for
equatorial orbits.
ν true anomaly The true anomaly is defined as the angle between a vector
pointing at periapsis and a vector pointing at the space-
craft. The true anomaly is undefined for circular orbits.

Table 3.3: Keplerian Elements for Special Cases


Orbit Type Numerical Threshold Description

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

North
δ ψ

y αf

x
Figure 3.2: The Spherical Elements

A vector pointing in the direction of the line of nodes is

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)

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

if (e ≥ 10−11 ) and (10−11 ≤ i ≤ π − 10−11 ), then


n 
x
Ω = cos−1 (3.12)
n

Fix quadrant for Ω: if ny < 0, then Ω = 2π − Ω


n · e
ω = cos−1 (3.13)
ne

Fix quadrant for ω: if ez < 0, then ω = 2π − ω


e · r
ν = cos−1 (3.14)
er

Fix quadrant for ν: if r · v < 0, then ν = 2π − ν


Special Case 2: Non-circular, Equatorial Orbit
if (e ≥ 10−11 ) and (i < 10−11 )|(i > π − 10−11 ), then

Ω=0 (3.15)

ex
ω = cos−1 (3.16)
e
Fix quadrant for ω: if ey < 0, then ω = 2π − ω
e · r
ν = cos−1 (3.17)
er

Fix quadrant for ν: if r · v < 0, then ν = 2π − ν


Special Case 3: Circular, Inclined Orbit
if (e < 10−11 ) and (10−11 ≤ i ≤ π − 10−11 ), then
n 
x
Ω = cos−1 (3.18)
n

Fix quadrant for Ω: if ny < 0, then Ω = 2π − Ω

ω=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

3.1.3 Keplerian Elements to Cartesian


State
The transformation from the Keplerian elements to the Cartesian state is one of the most common state
transformations in astrodynamics. We previously defined both state types and refer you to Tables 3.1 and 3.2
for their definitions. Below we show the algorithm that GMAT uses to convert from the Keplerian elements
to the Cartesian state.?
Give: a, e, i, Ω, ω, ν, and µ
Find: r and v
First check to ensure the keplerian elements are not singular. If |a(1 − e)| < .001(km) then the following
error message is reported and conversion is aborted: “Warning: A nearly singular conic section was encoun-
tered while converting from the Keplerian elements to the Cartesian state. The radius of periapsis must be
greater than 1 meter.”
Next check that the magnitude of the position vector is not infinite. If (1 + e cos ν < 1e-30) then
the following error message is reported and conversion is aborted: “Warning: A near infinite radius was
encountered while converting from the Keplerian elements to the Cartesian state. ”
Check that the orbit is not parabolic, in which case, p is undefined. If (|1 − e| < 1e − 7 then the following
error message is reported and conversion is aborted: “Warning: A nearly parabolic orbit was encountered
while converting from the Keplerian elements to the Cartesian state. The Keplerian elements are undefined
for a parabolic orbit.”.
Finally, define νM as the true anomaly placed between −π and π. If e > 1 and kνM k ≥ π − acos(1/e)
the following error message is reported and conversion is aborted:
“Error: The TA value is not physically possible for a hyperbolic orbit with the input values of SMA and
ECC.
The allowed values are: −limitT A < T A < limitT A (degrees). or equivalently
The allowed values are T A < limitT A or T A > 360 − limitT A. ” where the text “limitTA”’ is replaced by
the numeric value computed below in degrees:

limitT A = π − acos(1/e) (3.24)

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.

x = r (cos (ω + ν) cos Ω − cos i sin (ω + ν) sin Ω) (3.27)

y = r (cos (ω + ν) sin Ω + cos i sin (ω + ν) cos Ω) (3.28)


z = r (sin (ω + ν) sin i) (3.29)
Before calculating the velocity components we check to ensure the orbit is not parabolic. This avoids
another possible division by zero.
if (kpk < 1e − 30), then error and return: “Warning: GMAT does not support parabolic orbits in conversion
from keplerian to cartesian elements”.
If the orbit is not parabolic, we continue and calculate the velocity components using
r
µ
ẋ = (cos ν + e) (− sin ω cos Ω − cos i sin Ω cos ω) −
p
r (3.30)
µ
sin ν (cos ω cos Ω − cos i sin Ω sin ω)
p
Draft for Release R2018a
3.1. SPACECRAFT STATE REPRESENTATIONS 51

Table 3.4: The Equinoctial Elements


Symbol Description
a The semimajor contains information on the type and size of an orbit. If a > 0 the
orbit is elliptic. If a < 0 the orbit is hyperbolic.
h The projection of the eccentricity vector onto the ŷep axis.
k The projection of the eccentricity vector onto the x̂ep axis.
p The projection of N onto the ŷep axis.
q The projection of N onto the x̂ep axis.
λ The mean longitude.

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.

3.1.4 Equinoctial Elements to Cartesian State


The equinoctial elements used in GMAT are defined in Table 3.4. The algorithm to convert from equinoctial
elements to the cartesian state was taken from the GTDS Mathematical Theory.8
Given: a, h, k, p, q, λ, and µ
Find: r and v
We begin by using the mean longitude, λ, to find the eccentric longitude F . The equation relating the
two is transcendental:
λ = F + h cos F − k sin F (3.33)
We use the Newton-Raphson method to solve for F , using λ as the initial guess. We iterate on the following
equation until |F (i + 1) − F (i)| < 10−10 .

f (F )
F (i + 1) = F (i) − (3.34)
f ′ (F )
where

f (F ) = F + h cos(F ) − k sin(F ) − λ (3.35)


f ′ (F ) = 1 − h sin(F ) − k cos(F ) (3.36)

Once the eccentric longitude is calculated, we continue with


1
β= √ (3.37)
1+ 1 − h2 − k 2
r
µ
n= (3.38)
a3
r = a(1 − k cos F − h sin F ) (3.39)
The cartesian components expressed in the equinoctial coordinate system can be calculated using.
 
X1 = a (1 − h2 β) cos F + hkβ sin F − k (3.40)
 
Y1 = a (1 − k 2 β) sin F + hkβ cos F − h (3.41)
Draft for Release R2018a
52 CHAPTER 3. CALCULATION OBJECTS

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)

v = Ẋ1 f̂ + Ẏ1 ĝ (3.45)


where h i 1
f̂ ĝ ŵ = Q (3.46)
1 + p2 + q 2
and  
1 − p2 + q 2 2pqj  2p
Q= 2pq 1 + p2 − q 2 j −2q   (3.47)
−2pj 2q 1 − p2 − q 2 j
and j = 1 for direct orbits ( 0 ≤ i ≤ 90◦ )
j = -1 for retrograde orbits ( 90 < i ≤ 180◦ )

Currently GMAT sets j = 1 for all input states. Now let’s look at how to calculate the cartesian state
given the equinoctial elements.

3.1.5 Cartesian State to Equinoctial Elements


The equinoctial elements used in GMAT are defined in Table 3.4. The algorithm to convert from the cartesian
state to the equinoctial elements was taken from the GTDS Mathematical Theory.8
Given: r, v, and µ
Find: a, h, k, p, q, λ, and µ
The orbit eccentricity and energy are calculated using

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)

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

λ = F + h cos F − k sin F (3.68)

Now let’s look at transformations involving the spherical elements.

3.1.6 Cartesian State to SphericalAZFPA State


The spherical state, with azimuth, αf , and flight path angle, ψ, is described in Table 3.5 and Fig. 3.2. The
algorithm below shows how GMAT converts from the cartesian state to the spherical state with azimuth and
flight path angle.
Given: r and v
Find: r, λ, δ, v, ψ, and αf
We begin by calculating the right ascension λ, and the declination δ.

r = krk (3.69)

λ = tan−12 (y, x) (3.70)


z
δ = sin−1 ( ) (3.71)
r
The magnitude of the velocity vector is simply

v = kvk (3.72)
Draft for Release R2018a
54 CHAPTER 3. CALCULATION OBJECTS

Table 3.5: The Spherical Elements


Symbol Name Description
r r Magnitude of the position vector, krk
λ Right Ascension The angle between the projection of r into the xy-plane
and the x-axis measured counterclockwise.
δ Declination The angle between r and the xy-plane.
v v Magnitude of the velocity vector, kvk.
ψ Vertical flight path angle The angle measured from a plane normal to r to the ve-
locity vector v, measured in the plane formed by r and
v
αf Flight path azimuth The angle measured from vector perpendicular r and
pointing north, to the projection of v into a plane nor-
mal to r.
λv Right ascension of veloc- The angle between the projection of v into the xy-plane
ity and the x-axis measured counterclockwise.
δv Declination of velocity The angle between the velocity vector and the xy-plane.

We calculate the vertical flight path angle, psi, using


r · v
ψ = cos−1 (3.73)
rv
To calculate the azimuth angle, αz , we begin by calculating the rotation matrix from the frame in which the
cartesian state is expressed in, Fi , to a local frame, Fℓ , where ẑ is a unit vector that points north. The basis
vectors of Fℓ expressed in Fi can be calculated using
 
cos(δ) cos(λ)
x̂ =  cos(δ) sin(λ)  (3.74)
sin(δ)
 
cos(λ + π/2)
ŷ =  sin(λ + π/2)  (3.75)
0
 
− sin(δ) cos(λ)
ẑ =  − sin(δ) sin(λ)  (3.76)
cos(δ)

We can write the tranformation matrix that goes from Fi to Fℓ , Rℓi , as

Rℓi = [ x̂ ŷ ẑ ]T (3.77)

The velocity in the local frame, v′ , can be written as

v′ = Rℓi v (3.78)

Finally, we calculate the azimuth angle using

α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

3.1.7 SphericalAZFPA State to Cartesian State


In this section we present the algorithm used to convert from the spherical state (with ψ and αf ) to the
cartesian state.
Given: r, λ, δ, v, ψ, and αf
Find: r and v
The components of the position vector are calculated using
x = r cos δ cos λ (3.80)
y = r cos δ sin λ (3.81)
z = r sin δ (3.82)
We can write the velocity vector in terms of v, ψ, and αf as,
v = v [cos(ψ)x̂ + sin(ψ) sin(αf )ŷ + sin(ψ) cos(αf )ẑ] (3.83)
where, x̂, ŷ, and x̂ are given in Eqs. (3.74), (3.75), and (3.76) respectively. Breaking down Eq. (3.83) into
components gives us
vx = v[cos ψ cos δ cos λ− sin ψ(sin αf sin λ
(3.84)
+ cos αf sin δ cos λ)]
vy = v[cos ψ cos δ sin λ+ sin ψ(sin αf cos λ
(3.85)
− cos αf sin δ sin λ)]
vz = v[cos ψ sin δ + sin ψ cos αf cosδ] (3.86)

3.1.8 Cartesian State to SphericalRADEC State


The conversion form the Cartesian state to the spherical state with right ascension of velocity, λv , and
declination of velocity, δv , is very similar to the transformation shown in Sec. 3.1.6. The algorithm to
calculate λv and δv is shown below.
Given: r and v
Find: r, λ, δ, v, λv , and δv
To calculate r, λ, δ, and v we use Eqs. (3.69), (3.70), (3.71), and (3.72) respectively. The right ascension
of velocity, λv , and declination of velocity, δv , are calculated using
λv = tan−1
2 (vy , vx ) (3.87)
vz
δv = sin−1 ( ) (3.88)
v
In the next section, we show the the transformation from the spherical state with right ascension of
velocity, λv , and declination of velocity, δv , to the cartesian state.

3.1.9 SphericalRADEC State to Cartesian State


This transformation is similar to the conversion presented in Sec 3.1.7. The primary difference is how the
velocity is represented.
Given: r, λ, δ, v, λv , and δv
Find: r and v
The position components are calculated using Eqs. (3.80), (3.81), and (3.82). The velocity components
are calculated using
vx = v cos λv cos δv (3.89)
vy = vx tan λv (3.90)
vz = v sin δv (3.91)
In the last few subsections, we have looked at transformations involving the spherical elements. Now let’s
look at transformations involving the modified Keplerian elements.
Draft for Release R2018a
56 CHAPTER 3. CALCULATION OBJECTS

Table 3.6: The Modified Keplerian Elements


Symbol Name Description
rp radius of periapsis The radius of periapsis is the radius at the spacecrafts clos-
est approach to the central body. The radius of periapsis
must be greater than zero, parabolic orbits are not cur-
rently supported.
ra radius of apoapsis For an elliptic orbit ra is the radius at the spacecrafts far-
thest distance from the central body and ra > rp . For
hyperbolic orbits, ra < rp and ra < 0
i inclination The inclination is the angle between the ẑI axis and the
orbit normal direction h. If i ≤ 90◦ then the orbit is
prograde. If i > 90◦ then the orbit is retrograde.
ω argument of periapsis The argument of periapsis is the angle between a vector
pointing at periapsis, xp , and a vector pointing at the
spacecraft. The argument of periapsis is undefined for cir-
cular orbits.
Ω right ascension of the as- Ω is defined as the angle between x̂I and N measured coun-
cending node terclockwise. N is defined as the vector pointing from
the center of the central body to the spacecraft, when
the spacecraft crosses the bodies equatorial plane from the
southern to the northern hemisphere. Ω is undefined for
equatorial orbits.
ν true anomaly The true anomaly is defined as the angle between a vec-
tor pointing at periapsis, xp , and a vector pointing at the
spacecraft. The true anomaly is undefined for circular or-
bits.

3.1.10 Keplerian or Cartesian, to Modified Keplerian Elements


The modified Keplerian elements, described in Table 3.6, are similar to the classical Keplerian elements. The
modified Keplerian elements use the radius of apoapsis, ra , and the radius of periapsis, rp , to describe the
size and shape of an orbit. The remaining elements, i, Ω, ω, and ν, are the same for both the Keplerian and
modified Keplerian elements. The modified Keplerian elements, like the Keplerian elements, are undefined
for parabolic orbits. Let’s look at how GMAT calculates the modified
Given: a, e, i, ω, Ω, and ν, or r, v, and µ
Find: rp and ra
If we are given the Cartesian state, we first calculate the orbital elements using the algorithm in Sec.
3.1.3. Knowing the Keplerian elements, we calculate ra and rp using

ra = a(1 + e) (3.92)

rp = a(1 − e) (3.93)
Now let’s look at the inverse transformation.

3.1.11 Modified Keplerian Elements to Keplerian Elements


The conversion from modified Keplerian elements to the Keplerian elements is discussed below. To perform
the conversion, we use relationships that allow us to write the semimajor axis, a, and the eccentricity, e, in
terms of ra and rp .
Given: rp , ra , i, ω, Ω, and ν
Find: a and e
Draft for Release R2018a
3.2. SIMPLE PARAMETERS 57

We begin by calculating the eccentricity using


rp
1−
ra
e= rp (3.94)
1+
ra
The semimajor axis is calculated using
rp
a= (3.95)
1−e
This concludes our discussion of state transformations. In the last few subsections we presented the
algorithms used to convert between different orbit state representations used in GMAT. These include the
Cartesian state, the Keplerian elements, the modified Keplerian elements, and two spherical state parame-
terizations. In the next section, we present the algorithms used to calculate properties such as orbit period,
beta angle, and mean motion to name a few.

3.2 Simple Parameters


Simple parameters, which we will abbreviate as simply “parameters”, are properties of spacecraft or other
objects that are only dependent upon one of the following: CoordinateSystem, CentralBody, or None. An
example of a simple parameter is the magnitude of a spacecrafts velocity vector. The spacecrafts velocity
vector is dependent upon the coordinate system in which it is expressed. Once we have specified a coordinate
system, it is trivial to calculate the velocity vector, and therefore its magnitude, in that coordinate system.
In GMAT, the syntax to specify a simple parameter is
ObjectName.Dependency.ParameterName
So, to calculate the magnitude of the velocity, of a spacecraft named Sat, in the Earth Fixed frame, we
would use
Sat.EarthFixed.VMAG
GMAT has the ability to calculate many parameters in addition to VMAG. In the following subsections,
we present the algorithms used to calculate all parameters in GMAT. We begin each subsection with a
description of the parameter, and then give the type of dependency.

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

Dependency: Central Body.


Given: r in F1
Find: A
Definitions:
• F1 is the coordinate system in which GMAT originally knows r
• FF is body fixed system of the central body selected by the user.
• f is the bodies flattening coefficient
• R is the bodies mean equatorial radius
• φgd is the geodedic latitude of the spacecraft in the body fixed frame.
• h is the Altitude parameter
First we calculate φgd using the algorithm in Sec. 3.2.21. However, to calculate h, GMAT does not
convert to degrees, or use the modulo function.
Then, with r expressed in FF , we perform
p
rxy = x2 + y 2 (3.96)

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

3.2.7 BdotT and BdotR


Description: The “B” vector, B, is only defined for hyperbolic orbits and is the vector from the center of
mass of the central body, to the incoming hyperoblic asysmptote, such that the length of B is a minimum.
Another way to say this is that B is perpendicular to the incoming asymptote. Let’s define S as a unit
vector in the direction of the incoming asymptote. Then, T is a unit vector perpendicular to S, that lies in
the xy-plane of the coordinate system, FB , chosen by the user. R is a unit vector perpendicular to both
S and T. Finally, BdotT is the dot product of B and T, and BdotR is the dot product of B and R. The
method below was adopted from work by Kizner.9
Dependency: Coordinate System.
Given: r, v, and definition of FB
Find: BR and BT
Definitions:
• F1 is the coordinate system in which GMAT originally knows r and v
• FB is the coordinate system in which to perform B-plane calculations. GMAT will place T in the
xy-plane of FB . FB must have a gravitational body at its origin.
Draft for Release R2018a
60 CHAPTER 3. CALCULATION OBJECTS

• µ is the gravitational parameter of the central body at the origin of FB

• BR is the dot product of B and R

• BT is the dot product of B and T

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

if F1 6= FB convert r and v from F1 to FB

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

The incoming asymptote is defined using


s  2
ê 1
S= + 1− n̂
e e

The B-vector, B, is calculated using


s 
 2
1 1
B = b 1− ê − n̂
e e

The remaining vectors, T and R are found using

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

• rs⊕ : Position vector from celestial body, to the sun.

3.2.9 BVectorAngle and BVectorMag


To avoid code reduplication, the magnitude and angle of the B vector, kBk and θB respectively, are calculated
from the outputs of the B-Plane coordinates algorithm. The equations for kBk and θB are
q
kBk = BT2 + BR
2 (3.103)

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

If e > ( 1 - 1e−11 ) then E = 0, return.

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)

3.2.18 HX,HY, and HZ


Description: HX,HY, and HZ are the components of the orbit angular momentum vector.
Dependency: Coordinate System.
Given: r, v, and coordinate system F .
Find: hx , hy , and hz
Begin by converting r and v to F if necessary. Then,

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

If e < ( 1 + 1e−11 ) then H = 0, return.

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

Figure 3.5: Geocentric and Geodetic Latitude

Dependency: Central Body.


Given: r in F1
Find: φgc
Definitions:

• F1 is the coordinate system in which GMAT originally knows r

• FF is body fixed system of the central body selected by the user.

• f is the bodies flattening coefficient

• R is the bodies mean equatorial radius

• φgd is the geodedic latitude of the spacecraft in the body fixed frame.
Draft for Release R2018a
66 CHAPTER 3. CALCULATION OBJECTS

if F1 6= FF convert r from F1 to FF . Then,


p
rxy = x2 + y 2 (3.128)

Calculate the geocentric latitude to use as an initial guess to find the geodetic latitude

φgd ≈ atan2(z, rxy ); (3.129)

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.

• FF is the central body’s fixed system (as described in Sec. 2.6.10)

• λ is the longitude of the object in FF

• θMST is the mean sidereal time of the central body’s prime meridian.

• ti (epoch of spacecraft in internal time system)


Draft for Release R2018a
3.2. SIMPLE PARAMETERS 67

ŷI

x̂F
ŷF
θLST

λ θMHA

θMST x̂I

Figure 3.6: Local Sidereal Time Geometry

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.

• R⊙ = Radius of the Sun

• RB = Radius of occulting body



• R⊙ = Apparent radius of the Sun

• RB = Apparent radius of occulting body

• r⊙ = Vector from central body to Sun

• rB = Vector from central body to occulting body

• r = Vector from central body to s/c


Draft for Release R2018a
3.2. SIMPLE PARAMETERS 69

s⊙

rB

r⊙

Figure 3.7: Shadow Geometry

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

We can calculate the apparent separation of the two bodies, D′ , using


 T 
′ −1 −s (r⊙ − r)
D = cos (3.147)
skr⊙ − rk

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

Figure 3.8: Occultation Geometry in Calculation of PercentShadow

where
′ ′ ′
D 2 + R⊙2 − RB2
c1 = (3.151)
2D′
and
q
R⊙2 − c21

c2 = (3.152)

The percent shadow can be calculated using

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.

3.2.34 RLA and DLA


Description: RLA (λs ) is the right ascenstion of the outgoing asypmptote of a hyperbolic trajectory. DLA
(δs )is the declination of the outgoing asypmptote of a hyperbolic trajectory.
Dependency: Coordinate System.
Given: r and v and desired coordinate system.
Find: λs and δs
Begin by converting r and v to the desired coordinate system (an excpeption is thrown if the origin
of the requested coordinate system is not a celestial body). The eccentricity vector e is computed using
Eq. (3.111). If kek < 1 + tol then RLA = DLA = NaN and return. Otherwise:

h= r×v (3.166)

h = khk (3.167)
Draft for Release R2018a
72 CHAPTER 3. CALCULATION OBJECTS


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
µ

RLA and DLA are computed from


λs = tan−1 (sy , sx ) (3.170)
δs = sin−1 (sz ) (3.171)

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

if |1 − e| > 10−30 , then


µ
a=− (3.179)

otherwise, report error and return. Error: “Warning: Orbit is near parabolic and SMA is undefined”.

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

T T = A1 − 0.0343817sec + 32.184sec (3.193)

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.

3.2.42 Umbra and Penumbra


The Umbra and Penumbra parameters are used to determine if a spacecraft is in the shadow of a celestial
body. The algorithm used in GMAT is adapted from Montenbruck10 pgs. 80-81. For both functions, if the
value is less than 1, then the body is in shadow, if the function is greater than 1, then the body is not in
shadow.

Umbra (Total Eclipse)


Penumbra Penumbra (Annular Eclipse)

d
s
αu
αp

Figure 3.9: Geometry of Umbra and Penumbra Regions

For definitions of see Sec. 3.2.28.


−sT s⊙
ℓ= (3.194)
s⊙
p
d = s2 − l 2 (3.195)
R⊙ + RB
sin αp = (3.196)
s⊙
R⊙ − RB
sin αu = (3.197)
s⊙
Draft for Release R2018a
3.2. SIMPLE PARAMETERS 75

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

U T C = A1 − 0.0343817sec − ∆AT (3.204)

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 Other Calculations


3.3.1 MA to TA
Description: This algorithm shows how to calculate ν given M and e and is taken from Vallado.3
Given: M and e.
Find: ν
The algorithm is different for elliptic and hyperbolic orbits. Let’s first look at what happens for elliptic
orbits.
Elliptic Orbit Case
If e <= 1 then use the following algorithm:
Determine initial guess for the Eccentric anomaly
If ( - π < M < 0 ) or M > π
E =M −e
Else
E =M +e
End
Iterate to determine the eccentric anomaly:
M − En + e sin En
Iterate On: En+1 = En +
1 − e cos En
Until: |En+1 − En | < 1e−8
Finally we convert the eccentric anomaly to the true anomaly using the algorithm given in sec. 3.3.2
Hyperbolic Orbit Case
If e > 1 then use the following algorithm:
We begin by choosing the initial guess for the hyperbolic anomaly. The initial guess depends on the value
of the mean anomaly and the eccentricity:
If e < 1.6
If ( - π < M < 0 ) or M > π
H =M −e
Else
H =M +e
End
Else
If (e < 3.6 & |M | > π )
H = M − sign(M )e
Else
M
H = e−1
End
End
Iterate to determine the Hyperbolic Anomaly:
M + Hn − e sinh Hn
Iterate On: Hn+1 = Hn +
e cosh Hn − 1
Until: |Hn+1 − Hn | < 1e−8
Convert the hyperolic anomaly to the true anomaly using the algorithm given in sec. 3.3.3
Draft for Release R2018a
3.4. LIBRATION POINTS 77

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)

3.4 Libration Points


We begin by assuming that the planets move in circular orbits about the sun, and the mass of a spacecraft
is negligible compared to the mass of the planets. For illustrative purposes, lets consider the Earth and its
orbit about the Sun. In this case, the libration points are locations in space where a spacecraft will stay fixed
with respect to the Earth and Sun. Figure 3.10 shows a simple illustration. We see the Sun, the Earth’s
position with respect to the Sun, and the Libration points L1 and L2 at two different epochs. Notice that
at t1 , the points L1 and L2 are on the Earth-Sun line. At a later time, t2 , although the Earth has moved
with respect to the sun, L1 and L2 still lie on the Earth-Sun line.
The preceding example gives a brief qualitative description of two of the Earth-Sun libration points. In
general, there are five libration points for a given three body system. To determine the locations of the
libration points, it is convenient to work in a rotating coordinate system rather than the inertial system
shown in Fig. 3.10. The system we use is constructed as follows:

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

• Place the origin at center-of-mass of the 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:

γ15 − (3 − µ∗ ) γ14 + (3 − 2µ∗ ) γ13 − µ∗ γ12


(3.214)
+ 2µ∗ γ1 − µ∗ = 0 (For L1)
Draft for Release R2018a
78 CHAPTER 3. CALCULATION OBJECTS

Earth , L1 , L2 at t2

Earth , L1 , L2 at t1

Figure 3.10: Geometry of Libration Points

γ25 + (3 − µ∗ ) γ24 + (3 − 2µ∗ ) γ23 − µ∗ γ22


(3.215)
− 2µ∗ γ2 − µ∗ = 0 (For L2)

γ35 + (2 + µ∗ ) γ34 + (1 + 2µ∗ ) γ33 − (1 − µ∗ ) γ32


(3.216)
− 2 (1 − µ∗ ) γ3 − (1 − µ∗ ) = 0 (For L3)
where
m2
µ∗ = (3.217)
m1 + m2
Equations (3.214)-(3.216) do not have exact analytic solutions.Szebehely11 notes that they are most easily
solved using an iterative method with the following as the initial guesses:
 1/
µ∗ 3
γ1 = γ2 = (3.218)
3 (1 − µ∗ )
γ3 = 1 (3.219)
GMAT uses the Newton-Raphson method to solve for the roots of the equations by iterating on
F (γ(i))
γ(i + 1) = γ(i) − (3.220)
F ′ (γ(i))
until the the difference |γ(i + 1) − γ(i)| < 10−8 . The derivative F ′ (γ) for each libration point is shown below.
F ′ (γ) = 5γ14 − 4 (3 − µ∗ )γ13 + 3 (3 − 2µ∗ ) γ12
(3.221)
− 2µ∗ γ1 + 2µ∗ (For L1)

F ′ (γ) = 5γ24 + 4 (3 − µ∗ )γ23 + 3 (3 − 2µ∗ ) γ22


(3.222)
− 2µ∗ γ2 − 2µ∗ (For L2)
Draft for Release R2018a
3.4. LIBRATION POINTS 79

L5

γ3 γ1 γ2
x

L3 L1 L2
∗ ∗
µ 1−µ
Primary Secondary

L4
Figure 3.11: Location of Libration Points

F ′ (γ) = 5γ34 + 4 (2 + µ∗ ) γ33 + 3 (1 + 2µ∗ ) γ32


(3.223)
− 2 (1 − µ∗ ) γ3 − 2 (1 − µ∗ ) (For L3)

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

we need to determine the rotation matrix and its derivative as follows:


 
x̂1 ŷ1 ẑ1
RIi = x̂2 ŷ2 ẑ2  (3.227)
x̂3 ŷ3 ẑ3

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

ŷ˙ = ẑ˙ × x̂ + ẑ × x̂˙ (3.234)

GMAT currently assumes that the terms rs × as are zero.


We finally arrive at the position of the Libration Point in the FK5 system with the origin at the primary
by performing the calculations:
r = RIi ri (3.235)

v = ṘIi ri + RIi vi (3.236)

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

3.6 Ground Station Model


This section contains algorithms for converting the station location parameters to body fixed and inertial
cartesian coordinates. Ground stations are defined in the body fixed frame of the CentralBody. The user
can define the ground system location using several methods. GMAT internally uses the cartesian location
of the ground station with respect to the body fixed coordinate system. If the user provides the ground
station location in cartesian elements, no transformation is required to obtain the body fixed representation.
For spherical elements with respect to the Geocentric reference, GMAT uses the following transformation to
calculate the cartesian station location in the body fixed frame,
 
cos φ cos λ
rF =  cos φ sin λ  (3.239)
sin φ

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 = (C + heℓℓ ) cos φ (3.242)


rz = (S + heℓℓ ) sin φ (3.243)

 
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.

4.1 Orbit Dynamics


4.1.1 Orbital Equations of Motion
The orbital equations of motion come from an application of Newton’s laws of motion to a spacecraft in
orbit. From Newton’s Second Law we know that

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

Table 4.1 below describes each force in the equation above.

83
Draft for Release R2018a
84 CHAPTER 4. DYNAMICS MODELLING

Table 4.1: Force Models Available in GMAT


Description Term
µ
Central Body Point Mass − 3r
r

Central Body Direct Nonspheri- ∇φosj


cal
nb  
X rks
Direct Third Body Point Mass G mk 3
k=1
rks
k6=j

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

Geodesic Precession 2(Ω × v)


 
µ 3
Lense-Thirring Precession 2 (r × v)(r · J) + (v × J)
c r3
2 r2

4.1.2 Coordinate Systems for Integration of the Equations of Motion


4.1.3 Orbit Variational Equations and the State Transition Matrix
Estimation and optimization problems require first derivatives of the solution to the orbit final value problem
with respect to orbital initial conditions. Those derivatives are provided by the orbit variational equations.
The variatial equations are obtained by expanding the orbital equations of motion in a Taylor series and
retaining only the linear terms. Assume the nonlinear dynamics have the following form

ẋ = 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

δx(tf ) = Φ(t, to )δx(to ) (4.10)

where Φ̇ is governed by the following set of 36 differential equations:

Φ̇ = 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

subject to the initial conditions


Φ(to , to ) = I6×6 (4.13)
To perform the integration in Eq. (4.12) we require the partial derivatives contained in the matrix A:
 
∂v ∂v
∂ ẋ  ∂r ∂v 
A= =  (4.14)
∂x  ∂a ∂a 
∂r ∂v
Two of the derivatives are trivial:
∂v
= 03x3 (4.15)
∂r
∂v
= I3x3 (4.16)
∂v
The remaining two terms, ∂a/∂r and ∂a/∂v, are dependent upon the specific perturbations included in the
force model. The partial derivatives of perturbations are provided in the sections containing the specific
formulation of the perturbing force.

4.1.4 Multiple Spacecraft Propgation and Coupled Propagation of the Equa-


tions of Motion

4.2 Force Modelling


4.2.1 n-Body Point Mass Gravity
The gravitational perturbation due to n point masses is well know. However, we will derive the governing
differential equation here, as well as the componenents of the sensitivity matrix. Let’s begin by defining
some notation referring to Fig.4.1. Assume the j th body is the central body of the integration.
• r̃s is the position of the spacecraft with respect a hypothesized inertial frame.
• r̃j is the position of the central body with respect a hypothesized inertial frame.
• r̃k is the position of the k th gravitational body with respect a hypothesized inertial frame.
• r is the position of the spacecraft with respect to the central body of integration (j th body).
• rk is the position of the k th gravitational body with respect to the central body.
Draft for Release R2018a
86 CHAPTER 4. DYNAMICS MODELLING

k th Body
Central Body
rk

rsk
r
xxxxxx
xxxxxx
xxxxxx
xxxxxx
xxxxxx
r̃j xxxxx
xxxxx
xxxxx
xxxxx

r̃s

ŷI

x̂I

Figure 4.1: N-Body Illustration

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

r̈ = ¨r̃s − ¨r̃j (4.18)

We can apply Newton’s 2nd Law to the spacecraft and obtain


n n
X X ms mk
ms ¨r̃s = Fk = G (rk − r) (4.19)
krk − rk3
k=1 k=1

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

We can apply Newton’s 2nd Law to the j th body and obtain


n
Gms mj X mj mk
mj ¨r̃j = r + G rk (4.21)
r3 k=1
krk k3
k6=j

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

Substituting Eq. (4.20) and (4.22) into (4.18) we get


n n
X mk Gms X mk
r̈ = G (rk − r) − r − G r
3 k
(4.23)
krk − rk3 r3 krkk
k=1 k=1
k6=j

Finally, collecting terms yields


 
n
µj  rk − r
X rk 
apm = r̈ = − 3 r +G mk  − 
 krk − rk3 krk k3  (4.24)
r }
| {z k=1 | {z } | {z }
k6=j
1 2 3

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

Combining similar terms we can express the result as


   
n n
!
T
 µj X µk   rrT X (rk − r) (rk − r) 
Cpm = −  3 +  I3 + 3 µ j + µk  (4.30)
r k=1
krk − rk3 r5 k=1
(krk − r) k5
k6=j k6=j

4.2.2 Non-Spherical Gravity


GMAT integrates all spacecraft equations of motion using the Earth’s Mean J2000 axis system. However,
the user can choose central bodies other than the Earth as the origin of the coordinate system of integration.
Gravitational forces are conservative and only a function of position. To calculate the gravitational force
due to a non-spherical body, we need to determine the position of the spacecraft in the body fixed frame
FF . However, the equations of motion are expressed in terms of the position of the spacecraft in the inertial
frame.
Draft for Release R2018a
88 CHAPTER 4. DYNAMICS MODELLING

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

s = x/r, t = y/r, u = z/r = sin φ

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

The partial derivatives in Eq. (4.46) can be written as


∂U s ∂U t ∂U u ∂U
− − − =
∂r r ∂s r ∂t r ∂u

X ρn+1 X n (4.50)
− cn+1,m+1 Ān+1,m+1 D̄nm
n=0
R⊗ m=0
∞ n
1 ∂U X ρn+1 X
= Ānm (u)mĒnm (4.51)
r ∂s n=0
R⊗ m=0
∞ n
1 ∂U X ρn+1 X
= Ānm (u)mF̄nm (4.52)
r ∂t n=0
R⊗ m=0
∞ n
1 ∂U X ρn+1 X
= cn,m+1 Ān,m+1 (u)D̄nm (4.53)
r ∂s n=0
R⊗ m=0
where
cn,m+1 = [(n − m)(n + m + 1)]1/2
 1/2
(n + m + 2)(n + m + 1)
cn+1,m+1 =
(2n + 3)(2n + 2)
To calculate the nonzero portion of the sensitivity matrix, we begin by calcluting the following 9 terms:
∞ n
X ρn+2 X
a11 = 2 m(m − 1)Ānm Ḡnm (4.54)
n=0
R⊗ m=0
∞ n
X ρn+2 X
a12 = 2 m(m − 1)Ānm H̄nm (4.55)
n=0
R⊗ m=0
∞ n
X ρn+2 X
a13 = 2 mcn,m+1 Ān,m+1 Ēnm (4.56)
n=0
R⊗ m=0
∞ n
X ρn+2 X
a14 = − 2 mcn+1,m+1 Ān+1,m+1 Ēnm (4.57)
n=0
R⊗ m=0
∞ n
X ρn+2 X
a23 = 2 mcn,m+1 Ān,m+1 F̄nm (4.58)
n=0
R⊗ m=0
∞ n
X ρn+2 X
a24 = − 2 mcn+1,m+1 Ān+1,m+1 F̄nm (4.59)
n=0
R⊗ m=0
∞ n
X ρn+2 X
a33 = 2 cn,m+2 Ān,m+2 D̄nm (4.60)
n=0
R⊗ m=0
∞ n
X ρn+2 X
a34 = − 2 cn+1,m+2 Ān+1,m+2 D̄nm (4.61)
n=0
R⊗ m=0
∞ n
X ρn+2 X
a44 = 2 cn+2,m+2 Ān+2,m+2 D̄nm (4.62)
n=0
R⊗ m=0

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

c11 = a11 + s2 a44 + a4 /r + 2sa14 (4.64)


c12 = c21 = a12 + sta44 + sa24 + ta14 (4.65)
c13 = c31 = a13 + sua44 + sa34 + ua14 (4.66)
c22 = −a11 + t2 a44 + a4 /r + 2ta24 (4.67)
c23 = c32 = a23 + tua44 + ua24 + ta34 (4.68)
c33 = a33 + u2 a44 + a4 /r + 2 ∗ u ∗ a34 (4.69)

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

4.2.3 Atmospheric Drag


The acceleration due to drag is given by

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

4.2.4 Solar Radiation Pressure


CR A
as = −PSR ŝ (4.75)
ms
where ŝ is a unitized vector pointing from the spacecraft to the sun

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

4.2.5 Relativistic Corrections


The form of the relativitic correction to the Newtonian equations of motion depends upon the coordinate
system in which they are expressed. The treatment in GMAT follows Huang15 et. al.. For celestial-body-
centered motion (not sun or solarsystem barycenter) expressed in the local J2000 axis system, the relativistic
correction takes the following form:
 
µ  µ 2
  µ 3
ar = 2 3 4 − v r + 4(r · v)v + 2(Ω × v) + 2 2 3 (r × v)(r · J) + (v × J) (4.81)
c r r c r r2
where !
3 −µrB/S
Ω = vB/S × 3 (4.82)
2 c2 rB/S
and
• µ is the gravitational parameter of the central body expressed in the local celestial body J2000 frame
• c is the speed of light
• J is the central body’s angular momentum per unit mass.
• r is the vehicle’s position in the local J000 system.
• v is the vehicle’s velocity in the local J000 system.
• rB/S is the central body’s position with respect to the Sun.
• vB/S is the central body’s velocity with respect to the Sun.
The first term in Eq. 4.81 is the Schwarzschild solution, the second term is geodesic precesion, and the third
term is Lense-Thirring precession. The vector J is computed using
 T
I/F 2 2
J = RB 0 0 R ωB (4.83)
5 B
I/F
where RB is the central body’s mean equatorial radius,ωB is the spin rate, and RB is the body’s fixed to
inertial rotation matrix.
Eq. 4.81 is used for all bodies except the sun. In the case that the sun is the central body, the geodesic
precesion term is omitted from the correction.

4.2.6 Spacecraft Thrust


FT (T, P ) = C1 + C2 P + (C3 + C4 P + C5 P 2 + C6 P C7
 1+C15 +C16 P (4.84)
T
+C8 P C9 + C10 P C11 + C12 (C13 )C14 P )
Tref

Isp (T, P ) = K1 + K2 P + (K3 + K4 P + K5 P 2 + K6 P K7


 1+K15 +K16 P (4.85)
T
+K8 P K9 + K10 P K11 + K12 (K13 )K14 P )
Tref

FT (T, P )
ṁ = fd (4.86)
Isp (T, P )g

T = fs fd FT (T, P )RiT T̂d (4.87)


where FT (T, P ) is given in equation 4.84, fs and fd are the thrust scale factor and duty cycle respectively,
RiT is the rotation matrix from the thruster coordinate system to the EarthMJ2000 equatorial system, and
T̂d is the unitized thrust direction in the thruster coordinate system.
Draft for Release R2018a
4.2. FORCE MODELLING 93

Table 4.2: Thrust and Isp Coefficient Units


Coeff. Unit
C1 N K1 s
C2 N/kPa K2 s/kPa
C3 N K3 s
C4 N/kPa K4 s/kPa
C5 N/kPa2 K5 s/kPa2
C6 N/kPaC7 K6 s/kPaC7
C7 None K7 None
C8 N/kPaC9 K8 s/kPaC9
C9 None K9 None
C10 N/kPaC11 K10 s/kPaC11
C11 None K11 None
C12 N K12 s
C13 None K13 None
C14 1/kPa K14 1/kPa
C15 None K15 None
C16 1/kPa K16 1/kPa

VNB Thruster System


It is possible to specify thrust with respect to rotating coordinates systems. Then, during integration
of the equations of motion, GMAT uses the coordinate system definition to determine the thrust in the
inertial system being used for numerical integration of the equations of motion. One of the coordinate
systems useful in mission analysis is the Velocity-Normal-Binormal (VNB) system based on the motion of
a spacecraft with respect to a reference origin. One way to configure a thruster to use a local VNB system
is to set CoordinateSystem to local. Internally, GMAT creates a coordinate system based on the Axes
and Origin specified chosen for the thruster. We illustrate this below by example. The thruster named
Thruster1 is configured to use a local VNB coordinate system based on the motion of the owner-spacecraft
and the Earth.
Create Thruster Thruster1
Thruster1.CoordinateSystem = Local;
Thruster1.Origin = Earth;
Thruster1.Axes = VNB;

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

LVLH Thruster System

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.

4.3.1 Attitude Propagation


Given a set of initial conditions that define the attitude, GMAT can propagate the attitude using several
methods. Currently, GMAT supports both Kinematic attitude and Dynamic attitude propagation. In
Kinematic mode, the attitude is defined by describing the desired orientation with respect to other objects
such as spacecraft or celestial bodies. With this information, GMAT can calculate the required attitude to
satisfy the desired geometrical configuration. In Dynamic mode, the user must also supply spacecraft body
inertial mass properties, and tell GMAT how to apply torques dynamically to the spacecraft. With these
conditions specified, GMAT will numerically integrate quaternion attitude equations of motion combined
with Euler’s moment equations. The resulting attitude motion will display basic physics-based phenomena
such as precession and nutation. Dynamic mode will allow a user to model the implementation of attitude
control laws, as well as the effects of asymmetric propellant mass depletion and dynamic spacecraft component
articulation. It will also eventually support the modeling of attitude perturbations such as Gravity Gradient,
Aerodynamic Drag and Solar Photon Pressure Torques, and spacecraft magnetic interaction with planetary
magnetic fields. This section presents the different Kinematic and Dynamic attitude modes, and how GMAT
calculates the attitude state in each mode. Let’s begin by looking at the internal attitude state representations
and how the user can define initial conditions.

Internal State Representation and Attitude Initial Conditions


As mentioned in the introduction, certain attitude parameterizations are more useful for attitude propaga-
tion, while other attitude parameterizations are more intuitive for providing attitude initial conditions or
output. GMAT uses different internal parameterizations of the attitude depending on the attitude mode.
The type of parameterization is chosen to make the attitude propagation algorithms natural and convenient.
For the Kinematic modes, GMAT uses the Direction Cosine Matrix (DCM) or ”Attitude” matrix that rep-
resents the rotation from the inertial reference frame to the body frame. The notation for the Attitude
matrix, including the direction of the rotation it parameterizes is ABI . The subscripts denote the direction
of the rotation from Inertial to Body frames. For Dynamic mode, six degree of freedom (6DOF) attitude
propagation, GMAT uses the quaternion that represents the rotation from the inertial reference frame to the
body frame. The notation for the quaternion, including the direction of the rotation it parameterizes, is q BI .
Once again, the subscripts denote the direction of the rotation from Inertial to Body frames. GMAT uses
the angular velocity of the body with respect to the inertial frame, expressed in the body frame, {ωIB }B ,
as the rate portion of the state vector.
For convenience, the user can choose a coordinate system in which to define the initial attitude state.
Let’s call this system Fi . The user can define the initial attitude with respect to Fi using Euler angles, the
DCM or attitude matrix A, or quaternions. The user can define the body rate with respect to Fi by defining
the angular velocity in Fi , {ωIB }i , by defining the angular velocity in the inertial frame as measured in
body coordinates {ωIB }B or by defining the Euler angle rates. Note that not all attitude modes require
these three pieces of information. The specific inputs for each attitude mode are discussed below, along with
details about how attitude propagation is performed in each mode.

Kinematic Attitude Propagation


The Kinematic attitude mode allows a user to define a geometrical configuration based on the relative
position of a spacecraft with respect to other spacecraft or celestial bodies, and with respect to different
coordinate systems. In Kinematic mode, GMAT does not integrate the attitude equations of motion, but
rather calculates the attitude based on the geometrical definition provided by the user. There are two
Kinematic modes to choose from. These are Coordinate System Fixed and Spinning Spacecraft. The
different modes allow the user to conveniently define the spacecraft attitude depending on the type of
Draft for Release R2018a
4.3. ATTITUDE 97

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

Coordinate System Fixed Mode


In the CSFixed attitude mode, the user specifies a coordinate system Fi in which to fix the attitude. Fi
can be any of the default coordinate systems or any user defined coordinate system. GMAT calculates the
attitude matrix of Fi using the following equation.

ABI = RiI (4.89)

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:

ȦBI = −{ω× IB }B ABI (4.90)

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

{ω× IB }B = −ȦBI ATBI (4.92)

where
ȦBI = ṘiI (4.93)

Spinning Spacecraft Mode


In spinning spacecraft mode, GMAT propagates the attitude by assuming the spin axis direction is fixed in
inertial space. The spacecraft attitude at some time, t, is kinematically propagated from the attitude initial
conditions. The user defines the initial attitude with respect to Fi by providing ABI (to ) or an equivalent
parameterization that is then converted to the Attitude matrix. The user also provides the angular velocity
of the body axes with respect to the inertial axes expressed in Fi , {ωIB }i .
To calculate ABI (t) where t is an arbitrary epoch, we begin by calculating ABo I , understanding that
ABo I = ABI (to ). We calculate ABo I using

ABo I = ABi RiI (to ) (4.94)

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

{ωIB }B = ABi {ωIB }i (4.95)

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

The Euler angle φ is calculated using


φ(t) = ωIB (t − to ) (4.98)
where t is the current epoch, and to is the spacecraft’s initial epoch. Let’s define the Attitude matrix that
results from the Euler axis/angle to Attitude matrix conversion algorithm using a and φ(t), as ABBo (t). We
can calculate ABI (t) using
ABI (t) = ABBo (t)ABo I (4.99)
To summarize, in spinning mode the user provides ABi and {ωIB }i or {ωIB }B . GMAT assumes that that
the spin axis direction is constant in both inertial and body space, and uses the Euler axis/angle method to
propagate the attitude to find ABI . Now let’s look at dynamic attitude propagation in GMAT.

Dynamic Attitude Propagation


In Dynamic mode, GMAT propagates quaternion attitude equations of motion along with Euler’s moment
equations. This allows the user to provide detailed mass moment of inertia properties, and to model spacecraft
attitude control and environmental perturbing torques. The resulting numerically integrated attitude will
exhibit basic dynamics properties such as precession and nutation. Detailed tracking of the dynamic inertia
tensor will also allow the user to properly model the effect on the attitude trajectory of propellant mass
depletion, articulation of various components, and implementation of attitude control laws. For modes
where control laws cause the spacecraft to slew to a targeted pointing direction, GMAT will model line of
sight angular acceleration, deceleration, overshoot, settling, and drift behavior. There are several Dynamic
modes to choose from. The different modes allow the user to conveniently define the spacecraft attitude and
controlled pointing depending on the type of attitude profile needed for a specific mission. To begin, let’s
look at how GMAT calculates the attitude state in the simplest possible dynamic mode, Rigid Torque Free
attitude mode (RigidTorqueFreeQuat).

Figure 4.2: Euler Axis and Angle


Draft for Release R2018a
100 CHAPTER 4. DYNAMICS MODELLING

Rigid Torque Free (Quaternion) Mode


The fundamental equations of attitude motion run most efficiently using the four component quaternion.
There are equations of motion for Euler Angles, but these have singularities that cause problems in imple-
mentation. There are also equations of motion for the nine components of the Attitude matrix. Numerically
integrating nine equations for the Attitude matrix is not as efficient as four equations for the quaternion.
The quaternion is the most popular attitude parameterization in use today for propagating attitude using
numerical integration schemes. Let’s begin by defining the quaternion.
As shown above in Figure 4.2, any spacecraft attitude can be described as the rotation about a single
axis via a fixed angle from an inertial frame orientation to the current body orientation. The single axis is
called the Euler Axis, and the angle is the Euler Angle. In the figure, the Euler Axis is given the vector
label ~e. This is not the same as the three Euler Angles used as another of our attitude parameterizations.
We will use the CCSDS Attitude Data Message standard to define the GMAT quaternion. The definition is
based on the Euler Axis/Angle parameterization and is
   
q1   a1 sin φ2
q2  q a2 sin φ 
q≡ 2
q3  ≡ qc ≡ a3 sin φ  (4.100)
 
2
qc cos φ 2

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)

then taking the derivative we arrive at


 T  T
ẋ = q̇ T ω̇ T = q˙1 q˙2 q˙3 q˙c ω˙1 ω˙2 ω˙3 (4.102)

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

where the moments and products of inertia are defined as follows.


n
X
I11 ≡ mi (ρ2i2 + ρ2i3 ) (4.110)
i=1
Draft for Release R2018a
102 CHAPTER 4. DYNAMICS MODELLING

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)

Combining Equations 4.108 and 4.119 gives us


B B B B
T= L̇ + ω× L (4.120)

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.

T1 = I11 ω˙1 + (I22 − I33 )ω2 ω3 (4.122)

T2 = I22 ω˙2 + (I33 − I11 )ω3 ω1 (4.123)


T3 = I33 ω˙3 + (I11 − I22 )ω1 ω2 (4.124)
Draft for Release R2018a
4.3. ATTITUDE 103

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

T1 − (I22 − I33 )ω2 ω3


ω˙1 = (4.125)
I11

T2 − (I33 − I11 )ω3 ω1


ω˙2 = (4.126)
I22
T3 − (I11 − I22 )ω1 ω2
ω˙3 = (4.127)
I33
These are the three angular velocity time derivative terms we needed for the state derivative vector in
Equation 4.132. They are also known as Euler’s Moment Equations. As long as we are rotating torque free,
we will set the torque T terms in Equations 4.125 through 4.127 to zero. We now have everything GMAT
needs to integrate our quaternion attitude equations of motion for a torque free rigid tumbling body.
These equations will model several types of rotational motion. They are “motionless hang”, “flat spin”,
“spin with precession”, and “spin with precession and nutation” which is the same as a full 3-axis tumble.
Next, let’s add a level of complexity and look at Articulated Torque Free attitude mode.

Articulated Torque Free (Quaternion) Mode


Let’s assume our spacecraft is still rotating without the influence of control or environmental torques, but
now it is moving articulated appendages. We can no longer assume our inertia tensor I is constant. It is also
unlikely, now that objects are moving, that I will remain diagonal. Let’s develop new equations to handle
our dynamic inertia tensor. The definition of angular momentum is

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

Attitude Hold Mode


Under Construction

Seek Coordinate System Fixed Mode


Under Construction

Target Pointing Slew Mode


Under Construction

Torque Perturbations Mode


Torque Perturbations are higher order terms that model environmental torques or torques applied as the
result of human operator control inputs. These can be attitude maneuvers selected by a ground controller
from a mouse activated GUI menu, or input through joysticks by an astronaut pilot. Full 6DOF maneuvering
involved in manual or automated rendezvous, proximity operations, and docking will involve translational
forces and equations of motion and is covered in Ch. TBD. Simple environmental torques include Gravity
Gradient, Aerodynamic Drag and Solar Photon Pressure Torques, and spacecraft magnetic interaction with
planetary magnetic fields. These torques can be added to the basic Euler Moment Equations presented
above in the Torque Free Mode section.

4.3.2 Attitude Parameterizations and Conversions


This section details how GMAT converts between different attitude parameterizations. For each conversion
type, any singularities that may occur are addressed. The orientation parameterizations in GMAT include the
DCM or A Matrix, Euler Angles, quaternions, and Euler axis/angle. The body rate parameterizations include
Euler angle rates and angular velocity. We begin with the algorithm to transform from the quaternions to
the Attitude matrix.

Conversion: Quaternions to Attitude Matrix


Given: q, qc
Find: A
Name: QuatsToAMat
T
q = [q1 q2 q3 ] (4.133)

 
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

Adding terms in Eq. 4.137 we get


 2 
q1 − q22 − q32 + qc2 2(q1 q2 + q3 qc ) 2(q1 q3 + q2 qc )
A=c  2(q1 q2 − q3 qc ) −q12 + q22 − q32 + qc2 2(q2 q3 + q1 qc )  (4.138)
2(q1 q3 + q2 qc ) 2(q2 q3 − q1 qc ) −q12 − q22 + q32 + qc2

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.

Conversion: Attitude Matrix to Quaternions


Given: A
Find: q, qc
Name: AMatToQuats
Define following vector
v = [ A11 A22 A33 trace(A) ] (4.139)
where the trace of A is
trace(A) = A11 + A22 + A33 (4.140)
Define im as the index of the maximum component of v. Then use the following logic if im = 1
 
2vim + 1 − trace(A)
 A12 + A21 
q′′ =   (4.141)
 A13 + A31 
A23 − A32

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

Conversion: Attitude Matrix to Euler Axis/Angle


Given: A
Find: a, φ
Name: AMatToEulAxisAngle
 
A11 A12 A13
A = A21 A22 A23  (4.148)
A31 A32 A33
 
−1 1
φ = cos (trace(A) − 1) (4.149)
2
 
A − A32
1  23
a= A31 − A13  (4.150)
2 sin φ
A12 − A21
If k sin φk < 10−14 , then we assume
T
a=[ 1 0 0 ] (4.151)
−14
Note that if k sin φk < 10 then cos φ ≈ 1 and we arrive at an Attitude matrix of I3 .

Conversion: Euler Axis/Angle to Attitude Matrix


Given: a, φ
Find: A
Name: EulAxisAngleToAMat  
0 −a3 a2
a× =  a3 0 −a1  (4.152)
−a2 a1 0

A = cos φI3 + (1 − cos φ)aaT − sin φa× (4.153)


Multiplying out the terms in Eq. 4.153 we get
   2   
cos φ 0 0 a1 a1 a2 a1 a3 0 −a3 a2
A= 0 cos φ 0  + (1 − cos φ) a2 a1 a22 a2 a3  − sin φ  a3 0 −a1  (4.154)
0 0 cos φ a3 a1 a3 a2 a23 −a2 a1 0

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

Conversion: Euler Angles to Attitude Matrix


Given: Sequence order ( i.e. 123, 121, ...321,...313), θ1 , θ2 , θ3
Find: A
Name: EulerAnglesToAMat
We’ll give an example for a 321 rotation, and then present results for the remaining 11 Euler angle
sequences. First, let’s define A3 (θ1 ), A2 (θ2 ), and A1 (θ3 ).
 
cos θ1 sin θ1 0
A3 (θ1 ) = − sin θ1 cos θ1 0 (4.156)
0 0 1

 
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

where c1 = cos θ1 , s1 = sin θ1 etc. We can rewrite A321 as


 
c2 c1 c2 s1 −s2
A321 = −c3 s1 + s3 s2 c1 c3 c1 + s3 s2 s1 s3 c2  (4.160)
s3 s1 + c3 s2 c1 −s3 c1 + c3 s2 s1 c3 c2

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.

Conversion: Attitude Matrix to Euler Angles


Given: Sequence order ( i.e. 123, 121, ...321,...313), A
Find: θ1 , θ2 , θ3
Name: AMatToEulerAngles
We’ll give an example for a 321 rotation, and then present results for the remaining 11 Euler angle
sequences. Examining, Eq. 4.160, we see that

A21 cos θ2 sin θ1


= (4.161)
A11 cos θ2 cos θ1

From this we can see that


A21
θ1 = tan−1 (4.162)
A11
Further inspection of Eq. 4.160 shows us that

θ2 = sin−1 A13 (4.163)


Draft for Release R2018a
108 CHAPTER 4. DYNAMICS MODELLING

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.

Conversion: Angular Velocity to


Euler Angles Rates
Given: Sequence ( i.e. 123, 121, .... 313), θ2 , θ3 ω
Find: θ̇1 , θ̇2 , θ̇3
Name: AngVelToEulerAngles  
θ̇1
θ̇2  = S−1 (θ2 , θ3 )ω (4.166)
θ̇3
S−1 (θ2 , θ3 ) is dependent upon the Euler sequence. Table 4.4 contains the different expressions for S−1 (θ2 , θ3 )
for each of the 12 unique Euler sequences.
Note: Each of the forms of S−1 have a possible singularity due to the appearance of either sin θ2 or cos θ2
in the denominator. If GMAT encounters a singularity, an error message is thrown, and the zero vector is
returned.

Conversion: Euler Angles Rates to Angular Velocity


Given: Sequence ( i.e. 123, 121, .... 313), θ2 , θ3 , θ̇1 , θ̇2 , θ̇3
Find: ω
Name: EulerAnglesToAngVel  
θ̇1
ω = S(θ2 , θ3 ) θ̇2  (4.167)
θ̇3
S(θ2 , θ3 ) is dependent upon the Euler sequence. Table 4.4 contains the different expressions for S−1 (θ2 , θ3 )
for each of the 12 unique Euler sequences.
Draft for Release R2018a
4.3. ATTITUDE 109

Conversion: Quaternions to Euler Angles


Given: q, q4 , Euler Sequence
Find: θ1 , θ2 , and θ3
Name: QuatsToEulerAngles
There is not a direct transformation to convert from the quaternions to the Euler Angles. GMAT first
converts from the quaternion to the Attitude matrix using the algorithm presented above called “QuatsToA-
Mat”. The Attitude matrix is then used to calculate the Euler Angles for the given Euler angle sequence
using the algorithm called “AMatToEulerAngles:.

Conversion: Euler Angles to Quaternions


Given: θ1 , θ2 , and θ3 , Euler Sequence
Find: q, q4
Name: EulerAnglesToQuats
There is not a direct transformation to convert from Euler Angles to quaternions. GMAT first converts
from the Euler Angles to the Attitude matrix using the algorithm above called “EulerAnglesToAMat”. The
Attitude matrix is then used to calculate the quaternions using the algorithm called “AMatToQuats”.
Draft for Release R2018a
110 CHAPTER 4. DYNAMICS MODELLING

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

Table 4.4: Kinematics of Euler Angle Rotation Sequences

Euler Sequence S(θ2 , θ3 ) S−1 (θ2 , θ3 )


   
c3 c2 s3 0 c3 /c2 −s3 /c2 0
R3 (θ3 )R2 (θ2 )R1 (θ1 ) −s3 c2 c3 0  s3 c3 0 
s2 0 1 −s2 c3 /c2 s3 s2 /c2 1
   
c3 c2 −s3 0 c3 /c2 0 s3 /c2
R2 (θ3 )R3 (θ2 )R1 (θ1 )  −s2 0 1  −s3 0 c3 
s3 c2 c3 0 s2 c3 /c2 1 s3 s2 /c2
   
s2 0 1 0 c3 /c2 −s3 /c2
R1 (θ3 )R3 (θ2 )R2 (θ1 )  c3 c2 s3 0  0 s3 c3 
−s3 c2 c3 0 1 −s2 c3 /c2 s3 s2 /c2
   
s3 c2 c3 0 s3 /c2 c3 /c2 0
R3 (θ3 )R1 (θ2 )R2 (θ1 )  c3 c2 −s3 0  c3 −s3 0 
−s2 0 1 s3 s2 /c2 s2 c3 /c2 1
   
−s3 c2 c3 0 −s3 /c2 0 c3 /c2
R2 (θ3 )R1 (θ2 )R3 (θ1 )  s2 0 1  c3 0 s3 
c3 c2 s3 0 s3 s2 /c2 1 −s2 c3 /c2
   
−s2 0 1 0 s3 /c2 c3 /c2
R1 (θ3 )R2 (θ2 )R3 (θ1 ) s3 c2 c3 0  0 c3 −s3 
c3 c2 −s3 0 1 s3 s2 /c2 s2 c3 /c2
   
c2 0 1 0 s3 /s2 c3 /s2
R1 (θ3 )R2 (θ2 )R1 (θ1 ) s3 s2 c3 0  0 c3 −s3 
c3 s2 −s3 0 1 −s3 c2 /s2 −c3 c2 /s2
   
c2 0 1 0 −c3 /s2 s3 /s2
R1 (θ3 )R3 (θ2 )R1 (θ1 ) −c3 s2 s3 0  0 s3 c3 
s3 s2 c3 0 1 c3 c2 /s2 −s3 c2 /s2
   
s3 s2 c3 0 s3 /s2 0 −c3 /s2
R2 (θ3 )R1 (θ2 )R2 (θ1 )  c2 0 1  c3 0 s3 
−c3 s2 s3 0 −s3 c2 /s2 1 c3 c2 /s2
   
c3 s2 −s3 0 c3 /s2 0 s3 /s2
R2 (θ3 )R3 (θ2 )R2 (θ1 )  c2 0 1  −s3 0 c3 
s3 s2 c3 0 −c3 c2 /s2 1 −s3 c2 /s2
   
s3 s2 c3 0 s3 /s2 c3 /s2 0
R3 (θ3 )R1 (θ2 )R3 (θ1 )  c3 s2 −s3 0  c3 −s3 0 
c2 0 1 −s3 c2 /s2 −c3 c2 /s2 1
   
−c3 s2 s3 0 −c3 /s2 s3 /s2 0
R3 (θ3 )R2 (θ2 )R3 (θ1 )  s3 s2 c3 0  s3 c3 0 
c2 0 1 c3 c2 /s2 −s3 c2 /s2 1
112
Table 4.5: Computation of Euler Angles from Attitude Matrix

Draft for Release R2018a


Euler Sequence Euler Angle Computations
 
A13 sin θ1 + A12 cos θ1
R3 (θ3 )R2 (θ2 )R1 (θ1 ) θ1 = tan−1 (−A32 /A33 ) θ2 = sin−1 (A31 ) θ3 = tan−1
A23 sin θ1 + A22 cos θ1
 
A12 sin θ1 − A13 cos θ1
R2 (θ3 )R3 (θ2 )R1 (θ1 ) θ1 = tan−1 (A23 /A22 ) θ2 = sin−1 (−A21 ) θ3 = tan−1
−A32 sin θ1 + A33 cos θ1
 
A21 sin θ1 + A23 cos θ1
R1 (θ3 )R3 (θ2 )R2 (θ1 ) θ1 = tan−1 (−A13 /A11 ) θ2 = sin−1 (A12 ) θ3 = tan−1
A31 sin θ1 + A33 cos θ1
 
A23 sin θ1 − A21 cos θ1
R3 (θ3 )R1 (θ2 )R2 (θ1 ) θ1 = tan−1 (A31 /A33 ) θ2 = sin−1 (−A32 ) θ3 = tan−1
−A13 sin θ1 + A11 cos θ1
 
A32 sin θ1 + A31 cos θ1
R2 (θ3 )R1 (θ2 )R3 (θ1 ) θ1 = tan−1 (−A21 /A22 ) θ2 = sin−1 (A23 ) θ3 = tan−1
A12 sin θ1 + A11 cos θ1
 
A31 sin θ1 − A32 cos θ1
R1 (θ3 )R2 (θ2 )R3 (θ1 ) θ1 = tan−1 (A12 /A11 ) θ2 = sin−1 (−A13 ) θ3 = tan−1
−A21 sin θ1 + A22 cos θ1
 
−A33 sin θ1 − A32 cos θ1
R1 (θ3 )R2 (θ2 )R1 (θ1 ) θ1 = tan−1 (A12 / − A13 ) θ2 = cos−1 (A11 ) θ3 = tan−1
A23 sin θ1 + A22 cos θ1

CHAPTER 4. DYNAMICS MODELLING


 
−A22 sin θ1 + A23 cos θ1
R1 (θ3 )R3 (θ2 )R1 (θ1 ) θ1 = tan−1 (A13 /A12 ) θ2 = cos−1 (A11 ) θ3 = tan−1
−A32 sin θ1 + A33 cos θ1
 
−A33 sin θ1 + A31 cos θ1
R2 (θ3 )R1 (θ2 )R2 (θ1 ) θ1 = tan−1 (A21 /A23 ) θ2 = cos−1 (A22 ) θ3 = tan−1
−A13 sin θ1 + A11 cos θ1
 
−A11 sin θ1 − A13 cos θ1
R2 (θ3 )R3 (θ2 )R2 (θ1 ) θ1 = tan−1 (A23 / − A21 ) θ2 = cos−1 (A22 ) θ3 = tan−1
A31 sin θ1 + A33 cos θ1
 
−A22 sin θ1 − A21 cos θ1
R3 (θ3 )R1 (θ2 )R3 (θ1 ) θ1 = tan−1 (A31 / − A32 ) θ2 = cos−1 (A33 ) θ3 = tan−1
A12 sin θ1 + A11 cos θ1
 
−A11 sin θ1 + A12 cos θ1
R3 (θ3 )R2 (θ2 )R3 (θ1 ) θ1 = tan−1 (A32 /A31 ) θ2 = cos−1 (A33 ) θ3 = tan−1
−A21 sin θ1 + A22 cos θ1
Draft for Release R2018a
4.4. SPACECRAFT MODEL 113

4.4 Spacecraft Model


4.4.1 RF Hardware Models
The RF Hardware models in GMAT include transmitters, receiver, and transponders. For each type of RF
Hardware there are models for signal transmission/reception feasibility, received frequency, and transmitted
frequency to name a few. In the sections below we present these models for each type of RF Hardware.

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

4.4.2 Thruster Models


GMAT supports several thruster models. The thruster models employ physics and empirical data provided
by the thruster manufacturer to model thrust and mass flow rate used in orbit and attitude equations of
motion. The thrust magnitude and Isp are assumed to be functions of thruster inlet flow conditions including
pressure, temperature, and for bi-propellant thrusters, the oxidizer to fuel ratio.
In the following subsections we present models for thrust magnitude and mass flow rates for several
thruster types. All thrusters have a location and orientation. The location is described in the spacecraft
body system. The orientation can be described with respect to any coordinate system known to GMAT.
Let’s define the rotation matrix from the thruster frame FT to Earth’s MJ2000 Equator as RT . Then, the
thrust used in the orbit equations of motion is
FT = FT RT T̂ (4.170)
where FT is the thrust magnitude and is thruster dependent, and T̂
Now let’s look at how to calculate the thrust magnitude for a mono-propellant chemical thruster.

Mono-Propellant Chemical Thruster


temperature. The specific form of Eqs. (4.171) and (4.172) are determined by fitting test data to approximate
thrust and Isp as function Ti and Pi . The user can supply this relationship via a scripte
We assume thruster data is given as a function of thruster inlet properties (as opposed to thrust chamber
properties), and thrust magnitude and Isp are modelled using
FT = f (Pi , Ti ) (4.171)
Draft for Release R2018a
114 CHAPTER 4. DYNAMICS MODELLING

mf ,Tf ,Pf

Catalyst Bed

ṁc ,Tc ,Pc

ṁe ,Pe ,ve


Figure 4.3: Mono-Prop Thruster Diagram

Isp = f (Pi , Ti ) (4.172)


where Pi and Ti are the thruster inlet pressure and temperature. The specific form of Eqs. (4.171) and
(4.172) are determined by fitting test data to approximate thrust and Isp as function Ti and Pi . The user
can supply this relationship via a scripted equation or by providing a function name. After calculating FT
and Isp , we calculate the mass flow rate using
FT
ṁe = (4.173)
Isp

Bi-Propellant Chemical Thruster

mo ,To ,Po mf ,Tf ,Pf

ṁc ,mr ,Tc ,Pc

ṁe , Pe , ve

Figure 4.4: Bi-Prop Thruster Diagram

ṁo
mr = (4.174)
ṁf
Draft for Release R2018a
4.4. SPACECRAFT MODEL 115

ṁc = ṁo + ṁf (4.175)


ṁo To + ṁf Tf
T′ = (4.176)
ṁo + ṁf
ṁo Po + ṁf Pf
P′ = (4.177)
ṁo + ṁf
F = f (Pc , Tc , of ) (4.178)
Isp = f (Pc , Tc , of ) (4.179)
FT
ṁe = (4.180)
Isp

Thruster Pulse Modelling


 2
 t (t − tsi )2

 t ≤ tsi
T (t)

 t4si

T = = 1 tsi < t < tsf (4.181)
Tmax   (t − 2tsf + tf )2 (t − tf )2


 tsf ≤ t ≤ tf
(tf − tsf )4
The time to the thrust centroid, tc , is calculated using

Sample Thruster Pulse Profile


1

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

performing the integral yields


−4t2si + 4t2sf + 6tsf tf + 5t2f
tc = (4.183)
−14tsi + 14tsf + 16tf

Thruster Hot Fire Test Data


and Thruster Models
Thruster hot fire test data is used to develop empirical models that describe thruster performance as a
function of inlet conditions such as fuel pressure and temperature. In this section we’ll discuss how the
empirical models are developed and discuss how the empirical models are consistent with the physical models.
First we present the physics model for a thruster test stand experiment. Next we present what is measured
during a thrust stand test, and show how the measurements are used in combination with the physics model
to generate a model of thruster performance over a given range of thruster inlet conditions.
In Fig. 4.6 we see an illustration of a simple thrust test setup. The thruster is mounted to a rigid surface.
The force due to thrust, FT , can be written as
Draft for Release R2018a
116 CHAPTER 4. DYNAMICS MODELLING

ṁ ṁ
Ti c∗ = Isp g
Pi Pe

FT

Figure 4.6: Thrust Stand Illustration

FT = ṁve − (Pe − Pa )Ae (4.184)

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

we can rewrite this as  


(Pe − Pa )Ae
FT = ṁ ve − (4.185)

From this equation we define the characteristic velocity, c∗ , using
 
∗ (Pe − Pa )Ae
c = ve − (4.186)

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

4.4.3 Tank Models


Accurately modelling tank pressure changes is essential for accurate maneuver modelling and reconstruction.
The following sections discuss three types of tank models: pressurant tank, regulated fuel tank, and blowdown
fuel tank. For each tank there are three models: isothermal, heat transfer, and adiabatic.
The models used in GMAT are based on work by Estey16 , Hearn17 and Moran.18 For each tank, we
select a set of state variables that when defined, allow us to determine all remaining properties of the tank.
For the state variables, we provide differential equations that describe how the state variables change with
respect to time. The number of state variables varies between different tanks, and with the model type such
as isothermal and heat transfer.
For each of the three tanks, we develop a heat transfer model, an adiabatic model, and an isothermal
model. The heat transfer model is derived using the laws of conservation of energy and the conservation of
mass. An adiabatic model is provided by setting the heat transfer rates to zero in the heat transfer model.
The isothermal model for each tank is developed separately. Each ot these models is useful for certain classes
of maneuvers. Isothermal models are useful for maneuvers with low mass flow rates, adiabatic models are
useful for short maneuvers with high mass flow rates. Heat transfer models are useful for long maneuvers
with large mass flow rates.
When developing heat transfer models, we’ll assume that specific internal energy is given by

u = cT (4.191)

specific enthalpy for a liquid is given by


h ℓ = cℓ T ℓ (4.192)
and specific enthalpy for a gas is given by

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

ṁg = −ṁe (4.198)

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

ṁg cg Tg + mg cg Ṫg = Q̇g − ṁe Tg (cg + Rg ) (4.199)


Draft for Release R2018a
120 CHAPTER 4. DYNAMICS MODELLING

Similarly, expanding Eq. (4.297) we obtain

mw cw Ṫw = Q̇w − Q̇g (4.200)

Solving the system of equations yields the following differential equations of state for the pressurant tank
heat transfer model.

ṁg = −ṁe (4.201)


1  
Ṫg = Q̇g − Tg Rg ṁe (4.202)
mg cg
1  
Ṫw = Q̇w − Q̇g (4.203)
mw cw

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

Pressurant Tank: Isothermal


State Variables: mg
ṁg = −ṁe (4.204)
Now let’s look at a model for a fuel tank operating in blow down mode.

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

1. Vapor pressure is a function of liquid temperature.


2. Liquid density is a function of liquid temperature.
3. Heat transfer between the liquid and gas.
4. Heat transfer between the tank wall and gas.
5. Heat transfer between the tank wall and liquid.
6. Heat transfer between the surroundings and tank. wall.
The assumptions made in the tank model are
1. Pressurant does not dissolve in liquid (mg = C).
2. Vapor and gas temperatures are equal.
3. Vapor and gas volumes are equal.
Q̇w
3.Tank Wall
mw , T w 1.Gas/Vapor
mg , mv , Pg , Pv , Tg
Q̇v ṁv , hv Q̇g

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:

Vℓ = νℓ (Tℓ )mℓ (4.205)


Vg = Vt − Vℓ (4.206)
mg Rg Tg
Pg = (4.207)
Vg
Pv = Pv (Tℓ ) (4.208)
Pv Vg
mv = (4.209)
Rv Tg
Pt = Pv + Pg (4.210)

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

The 1st Law applied to the liquid control volume is

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

ṁv cv Tg + mv cv Ṫg + mg cg Ṫg = Q̇v + Q̇g − Pt V̇g + ṁv hv (4.217)

Now, substituting ṁv = −ṁℓ − ṁe and noting that V̇g = −νl ṁℓ if we assume

dνℓ
ν̇ℓ = Ṫℓ ≈ 0
dTℓ
we arrive at

(Tg Rv − Pt νℓ ) ṁℓ + (mv cv + mg cg ) Ṫg =


(4.218)
Q̇v + Q̇g − ṁe Tg Rv

Now continuing with Eq. (4.312) expanding the derivatives and making similar substitutions as we made
previously we obtain

ṁℓ cℓ Tℓ + mℓ cℓ Ṫℓ = Q̇ℓ − Q̇v + Pt (−νℓ ṁℓ )−


(4.219)
(−ṁℓ − ṁe )hv − ṁe cℓ Tℓ

Grouping terms we obtain

(cℓ Tℓ + Pt vl − hv )ṁℓ + (mℓ cℓ )Ṫℓ =


(4.220)
Q̇ℓ − Q̇v + ṁe (hv − cℓ Tℓ )

For the wall region, described by Eq. (4.313), we arrive at

(mw cw )Ṫw = Q̇w − Q̇ℓ − Q̇g (4.221)

Finally, by eliminating ṁv in the Gas Law shown in Eq. (4.315) we obtain

Pv (−νℓ ṁℓ ) Pv Vg Ṫg


− ṁℓ − ṁe = − (4.222)
Rv Tg Rv Tg2
Draft for Release R2018a
4.4. SPACECRAFT MODEL 123

Grouping terms yields the result


 
Pv νℓ Pv Vg
1− ṁℓ − Ṫg = −ṁe (4.223)
Rv Tg Rv Tg2

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)

The solution to the equations is

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

Pressure Regulated Tank


The pressure regulated fuel tank model is the most complex tank model supported in GMAT. The model
complexity is due to the presence of liquid fuel and fuel vapor contained in the tank ullage, and due to mass
and energy transfer from the pressurant tank to the ullage of the regulated fuel tank. In this section, we
develop a state space model for a pressure regulated tank. Note, to model a pressure regulated tank using a
Draft for Release R2018a
4.4. SPACECRAFT MODEL 125

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)

A55 A43 b1 − b4 A13 A55 + b4 A15 A53


ṁℓ = (4.262)
D
b2 − A21 ṁℓ
Ṫℓ = (4.263)
A22
−A41 A55 b1 + b4 A11 A55 − b4 A51 A15
Ṫg = (4.264)
D
b3
Ṫw = (4.265)
A34
−b1 A51 A43 + b1 A41 A53 − b4 A11 A53 + b4 A51 A13
ṁg = (4.266)
D
where
D = A55 A43 A11 − A43 A51 A15 + A41 A15 A53 − A41 A13 A55 (4.267)
For the adiabatic model we set all heat transfer rates, Q̇, to zero in Eqs. (4.358)-(4.361). For the adiabatic
model there is only four state variables as Ṫw = 0 and so Tw = constant.
Now let’s develop equations for an isothermal model of a pressure regulated tank. In the isothermal
model, we assume Tℓ = Tg = Tw = T . The only state variables that require differential equations are mℓ
and mg . Because Tg = constant, and hence, Pv = constant, we know that

ṁe
ṁℓ = −   (4.268)
Pv νℓ
1−
Rv T
Draft for Release R2018a
4.4. SPACECRAFT MODEL 127

Similarly, for mg we obtain


νℓ ṁe
ṁg =   (4.269)
νg Pv νℓ
1−
Rv T

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

Table 4.6: Dimensionless Heat Transfer Terms2


Parameter Definition Interpretation
Grashof Measure of the ratio of
number gβ(Ts − T∞ )L3 buoyancy forces to vis-
(GrL ) ν2 cous forces.

Prandtl Ratio of the momen-


cµ µ
number = tum and thermal diffu-
k α
(P r) sivities.

Nusselt Ratio of convection to


number hL pure conduction heat
(N uL ) kf transfer.

Reynolds Ratio of inertia and vis-


number VL cous forces.
(ReL ) ν

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

ρℓ (Tℓ ) = K1 + K2 Tℓ + K3 Tℓ2 (kg/m3 ) (4.273)


dρℓ
= K2 + 2K3 Tℓ (kg/m3 ) (4.274)
dTℓ

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

Table 4.7: Constants for Density Equations


Const. N2 04 CH3 N2 H3
3
K1 (kg/m ) 2066 1105.3
K2 (kg/m3 /K ) -1.979 -0.9395
K3 (kg/m3 /K2 ) -4.826e-4 0

Table 4.8: Constants for Vapor Pressure Equations


Const. N2 04 CH3 N2 H3
C1 (kg/m3 ) 6895 6895
C2 (kg/m3 /K ) 18.6742 12.4293
C3 (kg/m3 /K2 ) -5369.57 2543.37
C4 (kg/m3 /K2 ) 194721 0

 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

Table 4.9: Constants for Dissolved Pressurant Equations


Const. N2 04 CH3 N2 H3
α 3.335e-11 2.059e-11
Draft for Release R2018a
4.4. SPACECRAFT MODEL 129

4.4.4 Mass Properties


Spherical Tank
Draft for Release R2018a
130 CHAPTER 4. DYNAMICS MODELLING


h

(x̂ is out of the page)


Figure 4.10: Geometry For Mass Properties of Partially Filled Spherical Tank

1
V = π (3r − h) h2 (4.279)
3

3
− h2 + 3hr − 3r2
cgz = 4 (4.280)
3r − h

cgx = cgy = 0 (4.281)


 
πρ 1 5 2 3 8
Izz = (h − r) − r2 (h − r) + r4 (h − r) + r5 (4.282)
2 5 3 15
 
πρ 3 5 1 2 3 1 4 8 5
Ixx = − (h − r) + r (h − r) + r (h − r) + r (4.283)
2 10 3 2 15

Iyy = Ixx (4.284)


 
Ixx 0 0
I′ = RTbt  0 Iyy 0  Rbt (4.285)
0 0 Izz

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

4.5 Environment Models


4.5.1 Ephemerides
Analytic Ephemeris Model
• For a new body, the user must input the central body by choosing from the 9 Planets or the sun.
• The user must provide the epoch.
• The user must provide the keplerian elements, in the central body centered, MJ2000Eq axis system.
• The user can provide a µ value for use in the solution of the equations of motion.

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.

Generation of Ephemeris from Minor Planet Center Data


GMAT allows the user to import initial state data for minor planets from the Minor Planet Center’s (MPC)
orbit database. The MPC datafile is a flat file available at here: http://www.cfa.harvard.edu/iau/MPCORB.html.
GMAT reads state information from the MPCORB file, and converts the data to the format used inter-
nally by GMAT’s two-body ephemeris propagator. The two-body propagator is based on universal variables
appraoch using f and g functions and requires an initial cartesian state with respect to the planet’s cental
body (in this case the sun), the central body µ value.
The file format for the MPCORB file is described on the MPC web site (http://www.cfa.harvard.edu/iau/info/MPOrbitFor
and is shown below:

Columns F77 Use

1 - 7 a7 Number or provisional designation


(in packed form)
9 - 13 f5.2 Absolute magnitude, H
15 - 19 f5.2 Slope parameter, G

21 - 25 a5 Epoch (in packed form, .0 TT)


27 - 35 f9.5 Mean anomaly at the epoch, in degrees

38 - 46 f9.5 Argument of perihelion, J2000.0 (degrees)


49 - 57 f9.5 Longitude of the ascending node, J2000.0
(degrees)
60 - 68 f9.5 Inclination to the ecliptic, J2000.0 (degrees)

71 - 79 f9.7 Orbital eccentricity


81 - 91 f11.8 Mean daily motion (degrees per day)
93 - 103 f11.7 Semimajor axis (AU)

106 i1 Uncertainty parameter, U


If this column contains ‘E’ it indicates
that the orbital eccentricity was assumed.
For one-opposition orbits this column can
also contain ‘D’ if a double (or multiple)
designation is involved or ‘F’ if an e-assumed
double (or multiple) designation is involved.

108 - 116 a10 Reference


Draft for Release R2018a
132 CHAPTER 4. DYNAMICS MODELLING

118 - 122 i5 Number of observations


124 - 126 i3 Number of oppositions

For multiple-opposition orbits:


128 - 131 i4 Year of first observation
132 a1 ’-’
133 - 136 i4 Year of last observation

For single-opposition orbits:


128 - 131 i4 Arc length (days)
133 - 136 a4 ’days’

138 - 141 f4.2 r.m.s residual (")


143 - 145 a3 Coarse indicator of perturbers
(blank if unperturbed one-opposition object)
147 - 149 a3 Precise indicator of perturbers
(blank if unperturbed one-opposition object)
151 - 160 a10 Computer name

There may sometimes be additional information beyond column 160


as follows:

162 - 165 z4.4 4-hexdigit flags


The bottom 6 bits are used to encode a
value representing the orbit type (other
values are undefined):

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

Additional information is conveyed by


adding in the following bit values:

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

16384 Critical list numbered object


32768 Object is PHA

167 - 194 a Readable designation

195 - 202 i8 Date of last observation included in


orbit solution (YYYYMMDD format)

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.

4.5.2 Atmospheric Density


 
28Kp + 0.03eKp = Ap + 100 1 − e(−0.08Ap ) (4.289)

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

4.6 Flux and Geomagnetic Index


The density models discussed above require as inputs solar flux values and geomagnetic data. Those data
are provided by several organizations and include historic observations, near term predictions (45 days),
and long term predictions (1 value per month for 10+ years). Vallado and Kelso? give a good overview of
the available data and how it can be conveniently combined from multiple sources into a single coherent
Space Weather File (SWF). The SWF file that GMAT reads is identical to Vallado’s format for historic data
and for the daily predictions. However, for the long-term monthly predictions, the GMAT SWF contains
predictions created by Schatten (NEED REFERENCE).

4.6.1 File Overview


The density models in GMAT require as inputs solar flux values and geomagnetic data. Those data are
provided by several organizations and include historic observations, near term predictions (45 days), and
long term predictions (1 value per month for 30 years). Vallado and Kelso? give a good overview of the
available data and how it can be conveniently combined from multiple sources into a single coherent Space
Weather File (SWF). The SWF file that GMAT reads is identical to Vallado’s suggested format for historic
Draft for Release R2018a
134 CHAPTER 4. DYNAMICS MODELLING

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.

4.6.2 Historical (Observed) data


Vallado? identifies four files provide by NOAA that can used to assemble historic flux and geomagnetic data:
1) ftp://ftp.ngdc.noaa.gov/STP/GEOMAGNETIC_DATA/INDICES/KP_AP/yyyy.vm
2) ftp://fdf.gsfc.nasa.gov/generalProducts/database/
3) ftp://ftp.ngdc.noaa.gov/STP/SOLAR_DATA/SOLAR_RADIO/FLUX/DAILYPLT.OBS
4) http://www.swpc.noaa.gov/ftpdir/indices/quar_DSD.txt

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

F10.7 (Obs) Observed F10.7 value at station on Earth.


F10.7 (Adj) Adjusted value F10.7 to 1 AU
AU Astonomical unit.
rE/S Distance from Earth to Sun.

4.6.3 Near Term Daily Predictions


The
Near term predictions are updated daily and provided at the following location. The file contains a 45
day prediction of Ap and F10.7 values.
1) http://www.swpc.noaa.gov/ftpdir/latest/45DF.txt

4.6.4 Long Term Monthly Predictions


4.6. FLUX AND GEOMAGNETIC INDEX
DATATYPE Space Weather File
VERSION 1.0

Draft for Release R2018a


UPDATED 2010 Sep 21 15:35:06 UTC
#
# This file contains three sections: historic data, daily predictions for 45 days, and monthly predictions for 30 years.
# The historic and daily sections are identical in format to that proposed in Ref (1) and made publicly available
# here: http://celestrak.com/SpaceData/. The monthly predictions contained in the file are described in Ref (2).
#
# REFERENCES:
#
# (1) Vallado, D., and Kelso, T. S., "Using EOP and Solar Weather Data for Satellite Operations", AIAA/AAS Astrodynamics
# Specialist Conference, Lake Tahoe, CA, Aug. 7-11, 2005.
# (2) Vallado, D., and Kelso, T.S., Space Weather File, http://celestrak.com/SpaceData/sw20060101.txt.
# (2) Schatten, K. NEED REFERENCE
#
# FORMAT(I4,I3,I3,I5,I3,8I3,I4,8I4,I4,F4.1,I2,I4,F6.1,I2,5F6.1)
# --------------------------------------------------------------------------------------------------------------------------------
# Adj Adj Adj Obs Obs Obs
# yy mm dd BSRN ND Kp Kp Kp Kp Kp Kp Kp Kp Sum Ap Ap Ap Ap Ap Ap Ap Ap Avg Cp C9 ISN F10.7 Q Ctr81 Lst81 F10.7 Ctr81 Lst81
# --------------------------------------------------------------------------------------------------------------------------------
#
NUM_OBSERVED_POINTS 10
BEGIN OBSERVED
2011 05 17 2426 3 20 20 30 30 20 30 30 30 210 7 7 15 15 7 15 15 15 12 57 92.0 0 96.2 110.1 90.0 94.3 110.0
2011 05 18 2426 4 20 20 10 10 10 20 10 20 120 7 7 4 4 4 7 4 7 5 65 91.0 0 95.8 110.1 88.9 93.9 109.9
2011 05 19 2426 5 10 0 10 10 10 10 0 10 60 4 0 4 4 4 4 0 4 3 36 84.0 0 95.5 110.1 82.1 93.6 109.8
2011 05 20 2426 6 10 10 0 0 0 10 10 10 50 4 4 0 0 0 4 4 4 2 33 84.0 0 95.3 109.9 82.0 93.4 109.7
2011 05 21 2426 7 0 10 10 0 10 10 10 30 80 0 4 4 0 4 4 4 15 4 44 84.0 0 95.1 109.6 82.0 93.1 109.3
2011 05 22 2426 8 20 20 0 0 10 10 10 10 80 7 7 0 0 4 4 4 4 3 47 85.0 0 94.9 109.3 82.9 92.9 108.9
2011 05 23 2426 9 10 0 0 10 20 10 10 20 80 4 0 0 4 7 4 4 7 3 37 84.0 0 94.6 108.9 81.9 92.6 108.5
2011 05 24 2426 10 20 10 10 10 20 20 10 20 120 7 4 4 4 7 7 4 7 5 23 82.0 0 94.2 108.4 80.0 92.1 107.9
2011 05 25 2426 11 10 10 10 0 10 10 10 20 80 4 4 4 0 4 4 4 7 3 23 80.0 0 93.8 107.7 78.0 91.7 107.2
2011 05 26 2426 12 20 20 10 0 20 22 22 22 136 7 7 4 0 7 8 8 8 6 80.0 0 93.3 107.0 77.9 91.2 106.4
END OBSERVED

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

Draft for Release R2018a


2011 06 03 2426 20 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 92.1 102.1 87.5 89.8 101.1
2011 06 04 2426 21 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 92.1 102.0 87.4 89.8 101.0
2011 06 05 2426 22 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 85.0 92.2 101.8 82.6 89.8 100.7
2011 06 06 2426 23 22 22 22 22 22 22 22 22 176 8 8 8 8 8 8 8 8 8 85.0 92.3 101.7 82.5 89.9 100.6
2011 06 07 2426 24 22 22 22 22 22 22 22 22 176 8 8 8 8 8 8 8 8 8 85.0 92.4 101.7 82.5 90.0 100.5
2011 06 08 2426 25 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 92.5 101.7 87.4 90.1 100.5
2011 06 09 2426 26 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 92.6 101.7 87.3 90.1 100.5
2011 06 10 2426 27 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 92.7 101.6 87.3 90.2 100.3
2011 06 11 2427 1 27 27 27 27 27 27 27 27 216 12 12 12 12 12 12 12 12 12 90.0 92.9 101.5 87.3 90.4 100.1
2011 06 12 2427 2 27 27 27 27 27 27 27 27 216 12 12 12 12 12 12 12 12 12 95.0 93.0 101.3 92.1 90.5 100.0
2011 06 13 2427 3 22 22 22 22 22 22 22 22 176 8 8 8 8 8 8 8 8 8 90.0 93.1 101.1 87.3 90.6 99.7
2011 06 14 2427 4 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 85.0 93.3 100.8 82.4 90.7 99.4
2011 06 15 2427 5 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 85.0 93.4 100.4 82.4 90.9 99.0
2011 06 16 2427 6 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 85.0 93.6 100.1 82.4 91.1 98.6
2011 06 17 2427 7 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 85.0 93.9 99.7 82.4 91.3 98.1
2011 06 18 2427 8 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 80.0 94.1 99.2 77.5 91.5 97.6
2011 06 19 2427 9 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 80.0 94.2 98.8 77.5 91.6 97.1
2011 06 20 2427 10 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 80.0 94.5 98.4 77.5 91.9 96.7
2011 06 21 2427 11 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 85.0 94.8 98.1 82.3 92.2 96.4
2011 06 22 2427 12 27 27 27 27 27 27 27 27 216 12 12 12 12 12 12 12 12 12 85.0 95.1 97.8 82.3 92.5 96.1
2011 06 23 2427 13 37 37 37 37 37 37 37 37 296 22 22 22 22 22 22 22 22 22 85.0 95.5 97.4 82.3 92.8 95.7
2011 06 24 2427 14 33 33 33 33 33 33 33 33 264 18 18 18 18 18 18 18 18 18 80.0 95.8 97.0 77.4 93.2 95.2
2011 06 25 2427 15 33 33 33 33 33 33 33 33 264 18 18 18 18 18 18 18 18 18 80.0 96.1 96.7 77.4 93.4 94.8
2011 06 26 2427 16 30 30 30 30 30 30 30 30 240 15 15 15 15 15 15 15 15 15 80.0 96.4 96.2 77.4 93.8 94.3

CHAPTER 4. DYNAMICS MODELLING


2011 06 27 2427 17 22 22 22 22 22 22 22 22 176 8 8 8 8 8 8 8 8 8 80.0 96.8 95.8 77.4 94.1 93.9
2011 06 28 2427 18 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 85.0 97.1 95.5 82.2 94.4 93.6
2011 06 29 2427 19 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 97.5 95.3 87.1 94.9 93.4
2011 06 30 2427 20 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 98.0 95.1 87.1 95.3 93.1
2011 07 01 2427 21 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 98.4 94.9 87.1 95.7 92.9
2011 07 02 2427 22 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 85.0 98.9 94.6 82.2 96.2 92.6
2011 07 03 2427 23 22 22 22 22 22 22 22 22 176 8 8 8 8 8 8 8 8 8 85.0 99.3 94.2 82.2 96.6 92.1
2011 07 04 2427 24 22 22 22 22 22 22 22 22 176 8 8 8 8 8 8 8 8 8 85.0 99.8 93.8 82.2 97.1 91.7
2011 07 05 2427 25 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 100.3 93.3 87.1 97.6 91.2
2011 07 06 2427 26 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 100.8 92.9 87.1 98.1 90.8
2011 07 07 2427 27 13 13 13 13 13 13 13 13 104 5 5 5 5 5 5 5 5 5 90.0 101.3 92.6 87.1 98.7 90.4
2011 07 08 2428 1 27 27 27 27 27 27 27 27 216 12 12 12 12 12 12 12 12 12 90.0 101.8 92.3 87.1 99.2 90.1
2011 07 09 2428 2 27 27 27 27 27 27 27 27 216 12 12 12 12 12 12 12 12 12 90.0 102.4 92.0 87.1 99.7 89.8
END DAILY_PREDICTED

# NOMINAL TIMING EARLY TIMING LATE TIMING


4.6. FLUX AND GEOMAGNETIC INDEX
#mo. yr. mean +2sig -2sig ap mean +2sig -2sig ap mean +2sig -2sig ap
NUM_MONTHLY_PREDICTED_POINTS 10
BEGIN MONTHLY_PREDICTED
8 2011 101 121 82 10 112 135 90 11 87 101 73 9
9 2011 103 123 83 10 113 136 90 11 89 104 74 9
10 2011 104 125 84 10 114 138 91 11 91 106 75 9

Draft for Release R2018a


11 2011 106 127 85 10 115 139 91 11 92 108 76 9
12 2011 107 129 86 10 115 140 92 11 94 110 77 9
1 2012 108 131 87 10 116 141 93 11 96 113 79 9
2 2012 110 132 88 10 117 142 93 11 98 115 80 9
3 2012 111 134 89 10 117 143 94 11 99 117 81 9
4 2012 112 136 90 10 118 144 94 11 101 120 82 10
5 2012 113 137 91 11 119 145 94 11 102 122 83 10
END MONTHLY_PREDICTED

137
138
----------------------------------------------------------------------------------------------------------------------------------
FORMAT(I4,I3,I3,I5,I3,8I3,I4,8I4,I4,F4.1,I2,I4,F6.1,I2,5F6.1)

Draft for Release R2018a


----------------------------------------------------------------------------------------------------------------------------------
Columns Description
001-004 Year
006-007 Month (01-12)
009-010 Day
012-015 Bartels Solar Rotation Number. A sequence of 27-day intervals counted continuously from 1832 Feb 8.
017-018 Number of Day within the Bartels 27-day cycle (01-27).
020-021 Planetary 3-hour Range Index (Kp) for 0000-0300 UT.
023-024 Planetary 3-hour Range Index (Kp) for 0300-0600 UT.
026-027 Planetary 3-hour Range Index (Kp) for 0600-0900 UT.
029-030 Planetary 3-hour Range Index (Kp) for 0900-1200 UT.
032-033 Planetary 3-hour Range Index (Kp) for 1200-1500 UT.
035-036 Planetary 3-hour Range Index (Kp) for 1500-1800 UT.
038-039 Planetary 3-hour Range Index (Kp) for 1800-2100 UT.
041-042 Planetary 3-hour Range Index (Kp) for 2100-0000 UT.
044-046 Sum of the 8 Kp indices for the day expressed to the nearest third of a unit.
048-050 Planetary Equivalent Amplitude (Ap) for 0000-0300 UT.
052-054 Planetary Equivalent Amplitude (Ap) for 0300-0600 UT.
056-058 Planetary Equivalent Amplitude (Ap) for 0600-0900 UT.
060-062 Planetary Equivalent Amplitude (Ap) for 0900-1200 UT.
064-066 Planetary Equivalent Amplitude (Ap) for 1200-1500 UT.
068-070 Planetary Equivalent Amplitude (Ap) for 1500-1800 UT.
072-074 Planetary Equivalent Amplitude (Ap) for 1800-2100 UT.
076-078 Planetary Equivalent Amplitude (Ap) for 2100-0000 UT.

CHAPTER 4. DYNAMICS MODELLING


080-082 Arithmetic average of the 8 Ap indices for the day.
084-086 Cp or Planetary Daily Character Figure. A qualitative estimate of overall level of magnetic activity for the day
determined from the sum of the 8 Ap indices. Cp ranges, in steps of one-tenth, from 0 (quiet) to 2.5 (highly disturbed).
088-088 C9. A conversion of the 0-to-2.5 range of the Cp index to one digit between 0 and 9.
090-092 International Sunspot Number. Records contain the Zurich number through 1980 Dec 31 and the International Brussels
number thereafter. 094-098 10.7-cm Solar Radio Flux (F10.7) Adjusted to 1 AU. Measured at Ottawa at 1700 UT daily from 1947
Feb 14 until 1991 May 31 and measured at Penticton at 2000 UT from 1991 Jun 01 on. Expressed in units of 10-22 W/m2/Hz.
100-100 Flux Qualifier.
0 indicates flux required no adjustment;
1 indicates flux required adjustment for burst in progress at time of measurement;
2 indicates a flux approximated by either interpolation or extrapolation;
3 indicates no observation; and
4 indicates CSSI interpolation of missing data.
102-106 Centered 81-day arithmetic average of F10.7 (adjusted).
108-112 Last 81-day arithmetic average of F10.7 (adjusted).
114-118 Observed (unadjusted) value of F10.7.
4.6. FLUX AND GEOMAGNETIC INDEX
120-124 Centered 81-day arithmetic average of F10.7 (observed).
126-130 Last 81-day arithmetic average of F10.7 (observed).

Draft for Release R2018a


139
Draft for Release R2018a
140 CHAPTER 4. DYNAMICS MODELLING

4.6.5 Tank Models


Accurately modelling tank pressure changes is essential for accurate maneuver modelling and reconstruction.
The following sections discuss three types of tank models: pressurant tank, regulated fuel tank, and blowdown
fuel tank. For each tank there are three models: isothermal, heat transfer, and adiabatic.
The models used in GMAT are based on work by Estey16 , Hearn17 and Moran.18 For each tank, we
select a set of state variables that when defined, allow us to determine all remaining properties of the tank.
For the state variables, we provide differential equations that describe how the state variables change with
respect to time. The number of state variables varies between different tanks, and with the model type such
as isothermal and heat transfer.
For each of the three tanks, we develop a heat transfer model, an adiabatic model, and an isothermal
model. The heat transfer model is derived using the laws of conservation of energy and the conservation of
mass. An adiabatic model is provided by setting the heat transfer rates to zero in the heat transfer model.
The isothermal model for each tank is developed separately. Each ot these models is useful for certain classes
of maneuvers. Isothermal models are useful for maneuvers with low mass flow rates, adiabatic models are
useful for short maneuvers with high mass flow rates. Heat transfer models are useful for long maneuvers
with large mass flow rates.
When developing heat transfer models, we’ll assume that specific internal energy is given by

u = cT (4.291)

specific enthalpy for a liquid is given by


h ℓ = cℓ T ℓ (4.292)
and specific enthalpy for a gas is given by

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

ṁg = −ṁe (4.298)

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

ṁg cg Tg + mg cg Ṫg = Q̇g − ṁe Tg (cg + Rg ) (4.299)


Draft for Release R2018a
142 CHAPTER 4. DYNAMICS MODELLING

Similarly, expanding Eq. (4.297) we obtain

mw cw Ṫw = Q̇w − Q̇g (4.300)

Solving the system of equations yields the following differential equations of state for the pressurant tank
heat transfer model.

ṁg = −ṁe (4.301)


1  
Ṫg = Q̇g − Tg Rg ṁe (4.302)
mg cg
1  
Ṫw = Q̇w − Q̇g (4.303)
mw cw

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

Pressurant Tank: Isothermal


State Variables: mg
ṁg = −ṁe (4.304)
Now let’s look at a model for a fuel tank operating in blow down mode.

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

1. Vapor pressure is a function of liquid temperature.


2. Liquid density is a function of liquid temperature.
3. Heat transfer between the liquid and gas.
4. Heat transfer between the tank wall and gas.
5. Heat transfer between the tank wall and liquid.
6. Heat transfer between the surroundings and tank. wall.
The assumptions made in the tank model are
1. Pressurant does not dissolve in liquid (mg = C).
2. Vapor and gas temperatures are equal.
3. Vapor and gas volumes are equal.
Q̇w
3.Tank Wall
mw , T w 1.Gas/Vapor
mg , mv , Pg , Pv , Tg
Q̇v ṁv , hv Q̇g

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:

Vℓ = νℓ (Tℓ )mℓ (4.305)


Vg = Vt − Vℓ (4.306)
mg Rg Tg
Pg = (4.307)
Vg
Pv = Pv (Tℓ ) (4.308)
Pv Vg
mv = (4.309)
Rv Tg
Pt = Pv + Pg (4.310)

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

The 1st Law applied to the liquid control volume is

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

ṁv cv Tg + mv cv Ṫg + mg cg Ṫg = Q̇v + Q̇g − Pt V̇g + ṁv hv (4.317)

Now, substituting ṁv = −ṁℓ − ṁe and noting that V̇g = −νl ṁℓ if we assume

dνℓ
ν̇ℓ = Ṫℓ ≈ 0
dTℓ
we arrive at

(Tg Rv − Pt νℓ ) ṁℓ + (mv cv + mg cg ) Ṫg =


(4.318)
Q̇v + Q̇g − ṁe Tg Rv

Now continuing with Eq. (4.312) expanding the derivatives and making similar substitutions as we made
previously we obtain

ṁℓ cℓ Tℓ + mℓ cℓ Ṫℓ = Q̇ℓ − Q̇v + Pt (−νℓ ṁℓ )−


(4.319)
(−ṁℓ − ṁe )hv − ṁe cℓ Tℓ

Grouping terms we obtain

(cℓ Tℓ + Pt vl − hv )ṁℓ + (mℓ cℓ )Ṫℓ =


(4.320)
Q̇ℓ − Q̇v + ṁe (hv − cℓ Tℓ )

For the wall region, described by Eq. (4.313), we arrive at

(mw cw )Ṫw = Q̇w − Q̇ℓ − Q̇g (4.321)

Finally, by eliminating ṁv in the Gas Law shown in Eq. (4.315) we obtain

Pv (−νℓ ṁℓ ) Pv Vg Ṫg


− ṁℓ − ṁe = − (4.322)
Rv Tg Rv Tg2
Draft for Release R2018a
4.6. FLUX AND GEOMAGNETIC INDEX 145

Grouping terms yields the result


 
Pv νℓ Pv Vg
1− ṁℓ − Ṫg = −ṁe (4.323)
Rv Tg Rv Tg2

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)

The solution to the equations is

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

Pressure Regulated Tank


The pressure regulated fuel tank model is the most complex tank model supported in GMAT. The model
complexity is due to the presence of liquid fuel and fuel vapor contained in the tank ullage, and due to mass
and energy transfer from the pressurant tank to the ullage of the regulated fuel tank. In this section, we
develop a state space model for a pressure regulated tank. Note, to model a pressure regulated tank using a
Draft for Release R2018a
4.6. FLUX AND GEOMAGNETIC INDEX 147

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)

A55 A43 b1 − b4 A13 A55 + b4 A15 A53


ṁℓ = (4.362)
D
b2 − A21 ṁℓ
Ṫℓ = (4.363)
A22
−A41 A55 b1 + b4 A11 A55 − b4 A51 A15
Ṫg = (4.364)
D
b3
Ṫw = (4.365)
A34
−b1 A51 A43 + b1 A41 A53 − b4 A11 A53 + b4 A51 A13
ṁg = (4.366)
D
where
D = A55 A43 A11 − A43 A51 A15 + A41 A15 A53 − A41 A13 A55 (4.367)
For the adiabatic model we set all heat transfer rates, Q̇, to zero in Eqs. (4.358)-(4.361). For the adiabatic
model there is only four state variables as Ṫw = 0 and so Tw = constant.
Now let’s develop equations for an isothermal model of a pressure regulated tank. In the isothermal
model, we assume Tℓ = Tg = Tw = T . The only state variables that require differential equations are mℓ
and mg . Because Tg = constant, and hence, Pv = constant, we know that

ṁe
ṁℓ = −   (4.368)
Pv νℓ
1−
Rv T
Draft for Release R2018a
4.6. FLUX AND GEOMAGNETIC INDEX 149

Similarly, for mg we obtain


νℓ ṁe
ṁg =   (4.369)
νg Pv νℓ
1−
Rv T

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

Table 4.10: Dimensionless Heat Transfer Terms2


Parameter Definition Interpretation
Grashof Measure of the ratio of
number gβ(Ts − T∞ )L3 buoyancy forces to vis-
(GrL ) ν2 cous forces.

Prandtl Ratio of the momen-


cµ µ
number = tum and thermal diffu-
k α
(P r) sivities.

Nusselt Ratio of convection to


number hL pure conduction heat
(N uL ) kf transfer.

Reynolds Ratio of inertia and vis-


number VL cous forces.
(ReL ) ν

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

ρℓ (Tℓ ) = K1 + K2 Tℓ + K3 Tℓ2 (kg/m3 ) (4.373)


dρℓ
= K2 + 2K3 Tℓ (kg/m3 ) (4.374)
dTℓ

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

Table 4.11: Constants for Density Equations


Const. N2 04 CH3 N2 H3
3
K1 (kg/m ) 2066 1105.3
K2 (kg/m3 /K ) -1.979 -0.9395
K3 (kg/m3 /K2 ) -4.826e-4 0

Table 4.12: Constants for Vapor Pressure Equations


Const. N2 04 CH3 N2 H3
C1 (kg/m3 ) 6895 6895
C2 (kg/m3 /K ) 18.6742 12.4293
C3 (kg/m3 /K2 ) -5369.57 2543.37
C4 (kg/m3 /K2 ) 194721 0

 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

Table 4.13: Constants for Dissolved Pressurant Equations


Const. N2 04 CH3 N2 H3
α 3.335e-11 2.059e-11
Draft for Release R2018a

Chapter 5

Numerical Integrators

5.1 Runge-Kutta Integrators


The Runge-Kutta integration scheme is a single step method used to solve differential equations for n coupled
variables of the form

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.

5.1.1 Constructor & Destructor Documentation


RungeKutta::RungeKutta (int st, int order)
Provides the greatest relative error in the state vector.
This method takes the state vector and calculates the error in each component. The error is then divided
by the change in the component. The function returns the largest of the resulting relative errors.
Override this method if you want a different error estimate for the stepsize control. For example, we are
using
 
∆i (t + δt)
errori =
ri (t + δt) − ri (t)
Another popular approach is to divide the estimated error ∆i by the norm of the corresponding 3-vector;
for instance, divide the error in x by the magnitude of the displacement in position for the step.

5.2 Prince-Dormand Integrators


5.3 Adams Bashforth Moulton
Implementation of the Adams-Bashford-Moulton Predictor-Corrector.
This code implements a fourth-order Adams-Bashford predictor / Adams-Moulton corrector pair to inte-
grate a set of first order differential equations. The algorithm is found at http://chemical.caeds.eng.uml.edu/onlinec/whi
or in Bate, Mueller and White, pp. 415-417.
The predictor step extrapolates the next state ri+1 of the variables using the the derivative information
(f ) at the current state and three previous states of the variables, by applying the equation

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

Table 5.1: Prince-Dormand 45 Coefficients


ai bij
0 0
2 2
9 9 0
1 1 1
3 12 4 0
5 55 25 50
9 324 − 108 81 0
2 83 13 61 9
3 330 − 22 66 110 0
1 − 19
28
9
4
1
7 − 27
7
22
7 0
19 3 243 33 7
1 200 0 5 − 400 40 80 0

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

61 98415 16807 1375 1375 37 1


cj 864 0 321776 146016 7344 5408 − 1120 10
61 821 98415 19683 16807 175273 1375 395 1375 785 37 3 1
ej 864 - 10800 0 321776 - 71825 146016 - 912600 7344 - 3672 5408 - 2704 − 1120 - 50 10

Table 5.3: Runge-Kutta-Fehlberg 56 Coefficients


ai bij

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

Draft for Release R2018a


Table 5.4: Prince-Dormand 78 Coefficients
ai bij
0 0
1 1
18 18
1 1 1
12 48 16
1 1 3
8 32 0 32
5 5 75 75
16 16 0 − 64 64
3 3 3 3
8 80 0 0 16 20
59 29443841 77736538 28693883 23124283
400 614563906 0 0 692538347 - 1125000000 1800000000
93 16016141 61564180 22789713 545815736 180193667
200 946692911 0 0 158732637 633445777 2771057229 − 1043307555
5490023248 39632708
9719169821 573591083 0 0 − 433636366
683701615
421739975
− 2616292301 100302831
723423059
790204164
839813087
800635310
3783071287
13 246121993
20 1340847787 0 0 − 37695042795
15268766246
309121744
− 1061227803 12992083
− 490766935 6005943493
2108947869
393006217
1396673457
123872331
1001029789
1201146811
1299019798 − 1028468189
846180014 0 0 8478235783
508512852
1311729495
1432422823 − 10304129995
1701304382 − 48777925059
3047939560
15336726248
1032824649 − 45442868181
3398467696
3065993473
597172653
185892177
1 718116043 0 0 − 3185094517
667107341
477755414
− 1098053517 − 703635378
230739211
5731566787
1027545527
5232866602
850066563 − 4093664535
808688257
3962137247
1805957418
65686358
487910083
403863854
1 491063109 0 0 − 5068492393
434740067
411421997
− 543043805 652783627
914296604
11173962825
925320556 − 13158990841
6184727034
3936647629
1978049680
160528059
− 685178525 248638103
1413531060 0

14005451 59238493 181606767 561292985 1041891430 760417239 118820643 528747749


cj 335480064 0 0 0 0 − 1068277825 758867731 797845732 − 1371343529 1151165299 751138087 − 2220607170
13451932
ĉj 455176623 0 0 0 0 − 808719846
976000145
1757004468
5645159321
656045339
265891186.0
3867574721
− 1518517206 465885868
322736535
53011238
667516719
2.0
45.0

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.

6.1 General Form of the Measurement Model


Spacecraft tracking measurements are produced by complex interactions between the measurement partici-
pants, their associated sensors, and the space environment. Examples of measurement participants include
spacecraft with antennas and transponders, tracking stations, quasars, and other celestial bodies such as
Earth.
The measurement model in GMAT divides the computed measurement value into three terms

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.

6.1.1 Ideal Observables: Geometry, Coordinate Systems, and Notation


The ideal measurement observable, yi , accounts for the deterministic portion of the measurement-given the
current best estimate. This portion of the computed measurement value contains the model for (1) the
specific measurement data type, (2) the dynamics of the participants during the measurement process, and
(3) the sequence of events that occur during the taking of a measurement (i.e. light time delays, sensor
delays, and averaging intervals). The ideal measurement quantity does not contain stochastic errors such as
bias or exponentially correlated noise. Nor does the ideal measurement quantity contain media corrections
due to the properties of the space environment such as ionospheric delays or general relativistic corrections.
We use a basic one-way measurement model, shown in Fig. (6.1), to aid in defining our notation. For
the purposes of illustration, we have assumed that both participants are spacecraft and that their states
are known – being propagated or estimated – with respect to different coordinate systems. The subsequent

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

FB1 rIa22 rIp22


rB
a1
1

FI2
rIa11
ri1 /i2

rIp11 ri2 /s

FI1 ri1 /s
FS

Figure 6.1: Measurement Geometry and Notation

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

rSp2 = rIp22 + rSi2 (6.5)

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

rSa1 = rIa1 + rSi1 (6.8)

rSa2 = rIa2 + rSi2 (6.9)

6.1.2 One Way Range Example

Geocentric Perspective Barycentric Perspective

rIp2 (tp22 ) ρS

rIp1 (tp21 )

rIp1 (tp21 )
ρI Earth’s
Surface
rSE (tS2 ) rSE (tS1 )

rIp2 (tp22 ) Earth’s Orbit

Earth’s Surface Orbit Path

Figure 6.2: Illustration of Range Vector in Geocentric and Barycentric Systems

The range vector as seen from the geocentric inertial observer is

ρI = rIp2 (tp22 ) − rIp1 (tp21 ) (6.10)

The range vector as seen by a barycentric inertial observer is

ρS = (rSE (tS2 ) + rIp2 (tp22 )) − (rSE (tS1 ) + rIp1 (tp21 ) (6.11)

Note the two ranges are not the same

ρS = ρI + (rSE (tS2 ) − rSE (tS1 )) (6.12)


Draft for Release R2018a
160 CHAPTER 6. MEASUREMENT MODELING

6.2 Light-Time Solution


6.2.1 One-Way Light Time
The definition of the one-way light time is the time duration for light to travel from a transmitting antenna
to a receiving antenna in a vacuum with no gravity. The center of mass location is used for a spacecraft
or ground station that does not have an antenna model. Atmospheric corrections such as Tropospheric and
Ionospheric delays, as well as relativistic corrections due to gravity, are additive corrections discussed in
detail in later sections.
Define the time duration for the light transit as τ = t2a − t1a where t1a and t2a are the signal transmission
and receive times at antennas A1 and A2 respectively. It two participants share the same reference celestial
body, the range vector from A1 to A2 is given by
ρI = rIa2 (t2a ) − rIa1 (t1a ) (6.13)

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

ρS = rSa2 (t2a ) − rSa1 (t1a ) (6.17)


where rSa1 (t1a ) and rSa2 (t2a ) are calculated using Eqs. (6.8) and (6.9) respectively. When t2a is known, τ is
found using fixed-point iteration on the following equation10
1 S
τ (i+1) = kr (t2 ) − rSa1 (t2a − τ (i) )k (6.18)
c a2 a
When t1a is known, τ is found using fixed-point iteration on the following equation
1 S
τ (i+1) = kr (t1 + τ (i) ) − rSa1 (t1a )k (6.19)
c a2 a

6.2.2 Partial Derivatives of the One-Way Light Time


In this section, we derive the partial derivatives of the one-way light time with respect to the solve-for
parameters. Partial derivatives of the one-way light time appear in most partial derivatives for computed
observations in later sections. The light time solution can be solved in the local inertial system or the solar
system barycentric system. Furthermore, the light time solution can be expressed as a time duration or a
distance. We begin by formulating the expressions for the partial derivatives of the light time solution in the
local inertial system expressed as a distance. Next we formulate the partials of the barycentric light time
solution expressed as a distance. Finally, we show the relationship between the partials for the distance-based
and time-based formulations.
From the light time solution, we know the range vector in either the local inertial or solar system
barycenter as shown below, which are Eqs. (6.17) and (6.13), repeated here for convenience.
ρS = rSa2 (t2a ) − rSa1 (t1a )
Draft for Release R2018a
6.2. LIGHT-TIME SOLUTION 161

ρI = rIa2 (t2a ) − rIa1 (t1a )


If the two participants are referenced to the same celestial body we use the local inertial expression, otherwise
we use the solar system barycentric expression. Let’s look at the local inertial formulation first. Writing ρI
in terms of the solve-for parameters we obtain:
   
ρI = RI/R2 rRp2 + R
2
ra2 − RI/R1 rR
I/B2 B2
p1 + R
1 I/B1 B1
ra1 (6.20)

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 .

∂ρI (ρI )T I/R1


= − R (t1a )AR
p1 (t1a , tm )
1
(6.22)
∂rR
p1 (tm )
1 ρI

∂ρI (ρI )T I/R1


=− R (t1a )BR
p1 (t1a , tm )
1
(6.23)
∂vpR11 (tm ) ρI
∂ρI (ρI )T I/R2
= R (t2a )AR
p2 (t2a , tm )
2
(6.24)
∂rR
p2 (tm )
2 ρI
∂ρI (ρI )T I/R2
= R (t2a )BR
p2 (t2a , tm )
2
(6.25)
∂vpR22 (tm ) ρI
Writing ∂ρS /∂χ in terms of the solve-for parameters:
    
ρS = RI/R2 rR p2 + R
2
ra2 − RI/R1 rR
I/B2 B2
p1 + R
1 I/B1 B1
ra1 + rSi1 (t2a ) − rSi1 (t1a ) (6.26)

The partial derivatives are

∂ρS (ρS )T I/R1


=− R (t1a )AR
p1 (t1a , tm )
1
(6.27)
∂rpR11 (tm ) ρS

∂ρS (ρS )T I/R1


= − R (t1a )BR
p1 (t1a , tm )
1
(6.28)
∂vpR11 (tm ) ρS
∂ρS (ρS )T I/R2
= R (t2a )AR
p2 (t2a , tm )
2
(6.29)
∂rR
p2 (tm )
2 ρS
∂ρS (ρS )T I/R2
= R (t2a )BR
p2 (t2a , tm )
2
(6.30)
∂vpR22 (tm ) ρS
In the derivatives above, Ap1 is the upper left 3x3 partition of the state transition matrix for P1 and Bp1 is
the upper right 3x3 partition.
!
AR R1
p1 (tf , ti ) Bp1 (tf , ti )
1
R1
Φp1 (tf , ti ) = (6.31)
CR R1
p1 (tf , ti ) Cp1 (tf , ti )
1

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

The partial derivative of ∆t with respect to a dummy variable χ is given by


∂∆t 1 ∂ρ
= (6.33)
∂χ c ∂χ
Partial derivatives of the light time solution expressed in terms of a time duration are calculate using
Eq. (6.33) along with the appropriate expression from Eqs.(6.22 - 6.25) and (6.27 - 6.30).

6.3 Computed Value of Two-Way Range


6.3.1 Overview
The computed value of two-way range is a measure of the round trip signal time between a set of two or
more participants and uses a single clock on the initiating participant to determine the elapsed time of signal
transit. While the basic model is common to many two-way tracking systems, different systems handle time
delays and precision differently. Also, if and how the round trip signal time delay is converted to a range
or distance unit varies among tracking systems. Below we develop a general formulation of the two-way
range observable for two participants and then present how the model applies to different tracking systems
including what transponder delays are put on the tracking data file or subtracted from the observed quantity,
and how the different systems handle conversion to distance units.
The geometry, definitions, and notation for a two-way measurement are simple extensions of those il-
lustrated in Fig. 6.1. For the initial development, assume we have two participants, each with an attached
sensor and antenna. A time-line for a two-participant, two-way measurement is shown in Fig. 6.3 where t1E
is the time the signal is generated by the electronics on the first participant. Time t1T is the time the signal

t1E t1T t2R t2T t3R t3E

Figure 6.3: Two-Way Measurement Time Line

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

6.3.3 NASA Space Network (TDRSS)


The geometry for the TDRSS two-way range model is shown in Fig. 6.4. TDRSS provides two-way range
observations by using a single relay spacecraft to perform the forward and return link to the user spacecraft.
There are four one-way light time transits resulting in four ranges: the uplink range ρu , the forward link
range, ρf , the return link range, ρr , and the downlink range, ρd . Define the following variables for the time
sequence of events. t1E is the time the signal is generated by the electronics of the initiating ground terminal.
Time t1T = t1E + τ1 is the time the signal is transmitted from the antenna at the ground station. At time
t2R , the signal is received at the antenna on the TDRS. At time t2T = t2R + τ2 the signal is broadcast from
the forward link antenna to the antenna on the user spacecraft. At t3R the signal is received at the antenna
on the user spacecraft. At time t3T = t3R + τ3 the signal is broadcast from the antenna on the user spacecraft
back to the TDRS. At time t4R the signal is received at the antenna on the TDRS. At time t4T = t4R + τ4
the signal is broadcast from the antenna on the TDRS to the the ground terminal. At time t5R the signal
is received at the antenna on the ground terminal. Finally, at time t5E = t5R + τ5 the signal is processed by
the electronics at the ground terminal.
The TDRSS network performs system calibration to determine the uplink delay, τ1 , the TDRSS forward
delay, τ2 , the TDRSS return link delay,τ4 , and the down-link delay, τ5 . These values are subtracted from
the observed quantity before writing to the tracking data file (Phung23 et. al., pg. 4-9). The transponder
Draft for Release R2018a
164 CHAPTER 6. MEASUREMENT MODELING

ρf ρr

ρu ρd

Figure 6.4: TDRSS Two-Way Range Geometry

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)

6.3.4 NASA Deep Space Network (DSN)


The NASA Deep Space Network performs system calibration to determine τ1 and τ3 and these values are
provided in the records on the tracking data file (Moyer,24 pg. 11-12). The ideal value for the two-way
measurement time duration is given by
ρu ρd
∆t2 = τ1 + + τ2 + + τ3 (6.63)
c c
It is worth at this time comparing the above equation to Eq. 11-7 of Moyer. In Moyer’s formulation RLT12
and RLT23 are the general relativistic corrections to the light transit time between antennas. These are
treated as media corrections in GMAT, and so do not appear in 6.63. The terms of the form (ET − T AI)t3
are also treated as corrections that can be optionally applied and when implemented will be discussed in
the media corrections section. The same is true of the sensor corrections terms of the form ∆A and ∆sc .
Finally, the term labelled Rc in Moyer is the range bias (in meters). In GMAT, this term is handled via the
measurement error model.
The DSN converts the observed value in units of time to a range unit by integrating a conversion factor,
F , that is dependent upon the uplink station’s carrier frequency (Moyer,24 pg. 13-64). For an S-band uplink
transmitter, the conversion factor F is
1
F = FT (S) (6.64)
2
where FT (S) may be defined by a frequency ramp table described in section xxx, or could be a constant.
For S-Band, one range unit is equivalent to two cycles of the transmitter frequency. For X-Band uplink
transmitters, the conversion factor is given by
11
F = FT (X,HEV) (6.65)
75
for stations prior to conversion to Block 5 exciters (BVE), and for a BVE transmitter F is given by
221
F = FT (S,BVE) (6.66)
741x2
The measurement time duration, ∆t, is converted to a distance unit by integrating the conversion factor, F ,
over the duration of the precision light time solution (Moyer,24 pg. 13-72).
Z t3
R2 = F dt (6.67)
t1

In the case of constant frequency transmission, the range conversion simplifies to

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.

6.4 Computed Value of Averaged Two-Way Doppler


Computed values of two-way Doppler measurements are measures of the average Doppler shift over some
time interval. The average is used because it is not physically possible to take instantaneous Doppler
measurements. The Doppler shifted received frequency, FR is
 
ρ̇
FR = FT 1 − (6.78)
c

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

where ∆Ta is the averaging interval given by tf − to .


Many tracking systems provide two-way doppler observations. The primary differences in the observables
are how the integration in Eq. (6.80) is performed, the frequency used as the reference frequency, and the
measurement time tag. For example, STDN, USN, and TRDSS all uses constant values of FT , while DSN
often uses ramped values. TDRSS uses Tf as the measurement time tag tt , while DSN uses the center of the
averaging interval to + ∆t/2 as the measurement time tag.
Draft for Release R2018a
6.5. NASA DEEP SPACE NETWORK (DSN) 167

6.5 NASA Deep Space Network (DSN)


Fig. 6.5 shows a time-line for an averaged two-way doppler measurement. ts1E is the time the initial signal
is generated by the electronics on participant 1 (superscript “s” is described shortly). At time ts1E + τ1 the
signal is broadcast from the antenna on participant 1. At time ts2R the signal is received at the antenna
on participant 2. At time ts2T the signal is rebroadcast by the antenna on participant 2. At time ts3R , the
signal is received at the antenna at the participant performing the Doppler count. At time ts3E , the signal is
processed by the electronics on participant 1 and the phase counting begins. Phase counting continues for
an interval ∆Ta in local station time.

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

6.6 Computed Values of Optical Angles Observables


The computed values of optical azimuth and elevation are calculated using the one-way transit of reflected
light from one participant to an optical sensor on the second participant. The mathematical model shares
much in common with the one-way range model and the geometry for optical ra/dec is illustrated in Fig. (6.1).
Again, for the purposes of illustration, we have assumed that both participants are spacecraft and that
their states are known – being propagated or estimated – with respect to different coordinate systems.
The subsequent mathematical development is general and is valid for measurement processes that involve
different participant types. Optical angles are calculated using the range vector corrected for light time delays
as described in Sec. (6.2.1). To determine the angles, we first represent the range vector in the appropriate
coordinate system using either Eqs. (6.13) or (6.17) which are repeated below for convenience
ρId = rIa2 (t2a ) − rIa1 (t1a )

ρSd = rSa2 (t2a ) − rSa1 (t1a )


Eq. (6.13) is used if both participants are referenced to the same celestial body and Eq. (6.17) is used
otherwise. The only difference between FS and FI is a translation so RO/I = RO/S . As a result, we can
write
ρO
d = R
O/I
(t2a )ρId (6.84)
Draft for Release R2018a
168 CHAPTER 6. MEASUREMENT MODELING

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

otherwise the azimuth is undefined, and the measurement is infeasible.


The elevation partial derivatives have the general form
  T  ∂ρO
∂δ 1 ẑT
= I3x3 − ρ̂O ρ̂O d
(6.87)
∂χ cos δ ρ ∂χ
where z = [0 0 1]T and χ is a dummy variable. The partial derivatives of elevation with respect to the
individual solve-for parameters are:
∂δ 1 ẑT  O O T
 ∂ρI
R1
= I3x3 − ρ̂ (ρ̂ ) RO/I (t2a ) R1 d (6.88)
∂rp1 (t2e ) cos δ ρ ∂rp1 (t2e )
∂δ
= 01x3 (6.89)
∂vpR11 (t2e )
∂δ 1 ẑT  O O T

O/I ∂ρId
= I3x3 − ρ̂ (ρ̂ ) R (t 2 ) (6.90)
∂rR ∂rR
a
p2 (t2e )
2 cos δ ρ p2 (t2e )
2

∂δ
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

The azimuth partial derivatives have the general form


!
∂β 1 ŷT ρ̂O
d x̂
T
∂ ρ̂O
d
= − I3x3 (6.93)
∂ζ sec β x̂T ρ̂O
2
d x̂T ρ̂O
d
∂ζ

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

6.7 Geometric Measurements


GMAT supports several geometric measurement models including range, range rate, azimuth/elevation pairs,
and right ascension/declination pairs. Geometric measurement models are based purely on kinematics and
do not model real-world phenomenon such as light time delay, sensor delays, or atmospheric effects. Hence,
these models are primarily used in error analysis and tracking data scheduling.
The general form of the geometric measurement model is given by

Oc = fk (r1 (t), ṙ1 (t), r2 (t), ṙ2 (t)) + Ob (6.99)

and illustrated in Fig. 6.6 where


fk The kinematic model
r1 Location of participant 1
ṙ1 Velocity of participant 1
r2 Location of participant 2
ṙ2 Velocity of participant 2
r12 Vector from origin of F2 to origin of F1
t Measurement time tag
Ob Measurement bias
F1 Coordinate system in which participant 1 is expressed
F2 Coordinate system in which participant 2 is expressed
Fo Coordinate system in which the observation is expressed
ρ Range vector
ρ Range
ρ̇ Range rate
β Azimuth angle
δ Elevation angle
α Right ascension
δ Declination

Fo
ρ
r2 r2
ρ

F2 F2
r1 Fo
r12 r12
r1

F1 F1

(a) Vehicle to Vehicle Measurement (b) Vehicle to Station Measurement

Figure 6.6: Geometric Measurements

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.

6.7.1 Geometric Range


The geometric range measurement is simply the geometric distance between the two measurement partici-
pants. Referring to Fig. 6.6, assume that the participant labeled “2” is a space vehicle, and the participant
numbered “1” may be either a space vehicle or a ground station. In general, the range vector is

ρ = r2 − r21 − r1 + Ob (6.100)

The inertial representation of ρ is used to evaluate the range measurement.

[ρ]I = RI,2 [r2 ]2 − [r12 ]I − RI,1 [r1 ]1 + Ob (6.101)

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

6.7.2 Geometric Range Rate


The geometric range rate measurement is the component of velocity of participant 2 with respect to par-
ticipant 1, expressed in the observation coordinate system, along the range vector, also expressed in the
measurement coordinate system:
ρ̇ = [ρ̇]To [ρ̂]o + Ob (6.108)
where [ρ]o is given by ?? and [ρ̇]o is given by:

[ρ̇]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

6.7.3 Geometric Az/El


The azimuth angle is the angle between an observer’s local North and a line of sight vector to a space object.
The elevation angle is a measure of the angle between the local horizon plane of the observer and the line
of sight vector to a space object. For Az/El measurements, Fo , is the topocentric system ground station,
and FJ2k for inter-spacecraft measurements. The geometric azimuth and elevation model is calculated using
vector geometry and ignores signal propagation, atmospheric distortion, and other error sources.
Elevation is calculated using
[ρz ]o
sin(δ) = (6.116)
k [ρ]o k
where [ρ]z is the third component of [ρ]o which is given by Eq. ??. Provided that |[ρx ]o | >= 1e − 8, the
azimuth is calculated using
[ρy ]o
tan β = (6.117)
− [ρx ]o
When |[ρx ]o | < 1e − 8 the measurement is infeasible. The geometric elevation partial derivatives have the
general form
∂δ 1 ẑT  T ∂ [ρ]o

= I3x3 − [ρ̂]o [ρ̂]o (6.118)
∂ζ cos δ ρ ∂ζ
where z = [0 0 1]T and ζ is a dummy variable. The partial derivatives of elevation with respect to the
individual solve-for parameters are:

∂δ 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

The geometric azimuth partial derivatives have the general form


 
∂β 1 ŷT [ρ]o x̂T ∂ [ρ]o
=− 2 I3x3 + T (6.124)
∂ζ sec β x̂T [ρ]o x̂ [ρ]o ∂ζ
Draft for Release R2018a
172 CHAPTER 6. MEASUREMENT MODELING

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

6.7.4 Geometric RA/Dec


The declination angle is the angle between the line of site vector expressed in Fo , and the xy plane of Fo . The
right ascension is the angle between the x̂ axis of Fo and the projection of the line of site vector in the x − y
plane of Fo . For RA/Dec measurements, Fo , is the celestial body’s body-fixed frame for ground station, and
FJ2k for inter-spacecraft measurements.The geometric right ascension and declination are calculated using
vector geometry and signal propagation, atmospheric distortion, and other error sources are not included.
The declination is calculated using
[ρz ]o
sin(δ) = (6.130)
k [ρ]o k
where [ρ]z is the third component of [ρ]o which is given by Eq. ??. Provided that |[ρx ]o | >= 1e − 8, the
right ascension is calculated using
[ρy ]o
tan α = (6.131)
− [ρx ]o
When |[ρx ]o | < 1e − 8, the measurement is infeasible.
The geometric declination partial derivatives have the general form

∂δ 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

6.8 Measurement Error Modeling


The general model of a measurement error is as follows:

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.

6.8.1 Models and Realizations of Random Variables


A continuous random variable is a function that maps the outcomes of random events to the real line.
Realizations of random variables are thus real numbers. A vector of n random variables maps outcomes
of random events to Rn . For our purposes, random variables will always be associated with a probability
density function that indicates the likelihood that a realization occurs within a particular interval of the real
line, or within a particular subspace of Rn for the vector case. Currently, all of our models assume that this
density is the normal or Gaussian density. For the vector case, the normal probability density function is
1 1 ′ −1
f (x) = e− 2 (x−µ) P (x−µ) (6.145)
2π|P |

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.

6.8.2 Zero-Input Bias State Models


The simplest non-zero measurement error consists only of measurement noise. The next simplest class of
measurement errors consists of biases which are either themselves constant, or are the integrals of constants.
We can view such biases as the output of a system which has zero inputs, and which may have internal
states. In the sequel, we will consider cases where there are random inputs to the system.
In cases were the bias is the output of a system with internal states, the estimator may treat the internal
states as solve-for or consider parameters. In such cases, the estimator requires a measurement partials
matrix. Otherwise, the “measurement partial” is just H = ∂b/∂b = 1.

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

ḃ(t) = 0, b(to ) ∼ N (0, pbo ). (6.153)

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

It is convenient to write this model as a first-order vector system as follows:


      
ḃ(t) ḃ(t) 0 1 b(t)
= ˙ = (6.155)
b̈(t) d(t) 0 0 d(t)
ẋ(t) = A(t)x(t) (6.156)

The resulting output equation is


 
e = 1 0 x+v (6.157)
= Hx + v (6.158)

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

Px (t + ∆t) = Φ(∆t)Px (t)Φ′ (∆t) (6.161)

Thus, we can generate realizations of the random ramp with either x(t) ∼ N (0, Px (t)) or recursively from

x(t + ∆t) = Φ(∆t)x(t) (6.162)

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.

Higher-Order Derivatives of Random Constants


In principle, a random constant may be associated with any derivative of the bias in a straightforward
extension of the models above. In practice, it is rare to need more than two derivatives. Conventional
terminology does not appear in the literature for derivatives of higher order than the random ramp. The
slope of the bias is most commonly described as the “bias drift,” so that a “drift random ramp” would be
one way to describe a bias whose second derivative is a random constant. The measurement partials matrix
needs to be accordingly padded with trailing zeros for the derivatives of the bias in such cases.

6.8.3 Single-Input Bias State Models


The simplest non-constant systematic errors are systems with a single input that is a random process. We can
think of a random process as the result of some kind of limit in which the intervals between an uncorrelated
sequence of random variables get infinitesimally small. In this limit, each random increment instantaneously
perturbs the sequence, so that the resulting process is continuous but non-differentiable. We call this kind
of a random input “process noise.”
Although such random processes are non-differentiable, there are various techniques for generalizing
the concept of integration so that something like integrals of the process noise exist, and hence so do the
differentials that appear under the integral signs. It turns out that so long as any coefficients of the process
noise are non-random, these differentials behave for all practical purposes as if they were differentiable.

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

ḃ(t) = w(t), w(t) ∼ N (0, qδ(t − s)) (6.163)


Draft for Release R2018a
6.8. MEASUREMENT ERROR MODELING 177

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

pb (t) = pbo + q(t − to ) (6.164)

which we can also write in recursive form as

pb (t + ∆t) = pb (t) + q∆t (6.165)

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:

b(t + ∆t) = b(t) + w∆ (t) (6.166)

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

Px (t) = Φ(t − to )Pxo Φ′ (t − to ) + Q∆ (t − to ) (6.170)

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

Px (t + ∆t) = Φ(∆t)Px (t)Φ′ (∆t) + Q∆ (∆t) (6.173)

Thus, we can generate realizations of the random run with either x(t) ∼ N (0, Px (t)) or recursively from

x(t + ∆t) = Φ(∆t)x(t) + w∆ (t) (6.174)


1 Another way to imagine the input sequence, in terms of a frequency domain interpretation, is that it is a noise process

whose power spectral density, q, is non-zero at all frequencies, which implies infinite bandwidth.
Draft for Release R2018a
178 CHAPTER 6. MEASUREMENT MODELING

where w∆ (t) ∼ N (0, Q∆ (∆t)). Note that a Cholesky decomposition of Q∆ (t) is


√ 
p 3t3 /3 √0
C
Q∆ (t) = √ (6.175)
3t/2 t/2

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.

Higher-Order Derivatives of Random Walks


In principle, a random walk may be associated with any derivative of the bias in a straightforward extension
of the models above. In practice, it is rare to need more than two derivatives. Conventional terminology
does not appear in the literature for derivatives of higher order than the random run. A “drift random run”
would be one way to describe a bias whose second derivative is a random walk. Below, we will refer to such
a model as a “random zoom.”

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.

Integrated First-Order Gauss-Markov Model


As with the random walk and random constant models, any number of derivatives of the bias may be
associated with a FOGM process. However, integation of the FOGM destroys its stability. For example, the
singly integrated first-order Gauss-Markov model is given by
      
ḃ(t) 0 1 b(t) 0
˙ = + , (6.181)
d(t) 0 −1/τ d(t) w(t)
Draft for Release R2018a
6.8. MEASUREMENT ERROR MODELING 179

which leads to the following state transition matrix,


  
1 τ 1 − e−t/τ
Φ(t) = , (6.182)
0 e−t/τ

and process noise covariance,


" n 2 o 2 #
qτ τ 2 1 − e−2t/τ + 2t/τ + 4 1 − e−t/τ τ 1 − e−t/τ
Q∆ (t) = 2  . (6.183)
2 τ 1 − e−t/τ 1 − e−2t/τ

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

Px (t) = Φ(t − to )Pxo Φ′ (t − to ) + Q∆ (t − to ) (6.187)

which we can also write in recursive form as

Px (t + ∆t) = Φ(∆t)Px (t)Φ′ (∆t) + Q∆ (∆t) (6.188)

Thus, we can generate realizations of the random run with either x(t) ∼ N (0, Px (t)) or recursively from

x(t + ∆t) = Φ(∆t)x(t) + w∆ (t) (6.189)

where w∆ (t) ∼ N (0, Q∆ (∆t)).


For the underdamped case (ζ < 1), the state transition matrix and discrete process noise covariance are
given by2 :  
e−ζωn t (ωd cos ωd t + ζωn sin ωd t) sin ωd t
Φ(t) = (6.190)
wd −ωn2 sin ωd t (ωd cos ωd t − ζωn sin ωd t)
and
 
(1,1) q e−2ζωn t 2 2 2 2
Q∆ (t) = 1− (ωd + 2ζωn ωd cos ωd t sin ωd t + 2ζ ωn sin ωd t) (6.191)
4ζωn3 wd2
 
(2,2) q e−2ζωn t 2 2 2 2
Q∆ (t) = 1− (ω d − 2ζω n ω d cos ω d t sin ω d t + 2ζ ω n sin ω d t) (6.192)
4ζωn wd2
(2,1) (1,2) q −2ζωn t 2
Q∆ (t) = Q∆ (t) = e sin ωd t (6.193)
2ωd2
2 M. C. Wang and G. E. Uhlenbeck. On the theory of brownian motion ii. In N. Wax, editor, Selected Papers on Noise and

Stochastic Processes, pages 113–132. Dover, 1954.


Draft for Release R2018a
180 CHAPTER 6. MEASUREMENT MODELING
p
where ωd = ωn 1 − ζ 2 . In the over-damped case (ζ > 1), replace sin and cos with sinh and cosh, respectively.
In the critically-damped case,
 −ω t 
e n (1 + ωn t) te−ωn t
Φ(t) = (6.194)
−ωn2 te−ωn t e−ωn t (1 − ωn t)

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.

6.8.4 Multi-Input Bias State Models


We may combine any of the above models to create multi-input bias models; for example the bias could be
a second-order Gauss-Markov, and the bias rate could be a first-order Gauss-Markov. In practice, the most
useful have been found to be the following.

Bias and Drift Random Walks (Random Walk + Random Run)


A common model for biases in clocks, gyros, and accelerometers is that the bias is driven by both its own
white noise input, and also by the integral of the white noise of its drift. Such models derive from observations
that the error magnitudes of these devices depend on the time scale over which the device is observed. They
are often characterized by Allan deviation specifications, which may be heuristically associated with the
white noise power spectral densities. The model is as follows:
       
ḃ(t) 0 1 b(t) 1 0 wb (t)
˙ = + (6.201)
d(t) 0 0 d(t) 0 1 wd (t)
ẋ(t) = A(t)x(t) + B(t)w(t) (6.202)

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

Px (t) = Φ(t − to )Pxo Φ′ (t − to ) + Q∆ (t − to ) (6.203)

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

Px (t + ∆t) = Φ(∆t)Px (t)Φ′ (∆t) + Q∆ (∆t) (6.206)

Thus, we can generate realizations of the random run with either x(t) ∼ N (0, Px (t)) or recursively from

x(t + ∆t) = Φ(∆t)x(t) + w∆ (t) (6.207)

where w∆ (t) ∼ N (0, Q∆ (∆t)). Note that a Cholesky decomposition of Q∆ (t) is


p 
p
C t + qd t3 /12
qbp 0
Q∆ (t) = √ (6.208)
qd t3 /2 qd t

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 resulting output equation is


 
e = 1 0 0 x+v (6.211)
= Hx + v (6.212)

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

Px (t) = Φ(t − to )Pxo Φ′ (t − to ) + Q∆ (t − to ) (6.213)

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

Px (t + ∆t) = Φ(∆t)Px (t)Φ′ (∆t) + Q∆ (∆t) (6.216)


Draft for Release R2018a
182 CHAPTER 6. MEASUREMENT MODELING

Thus, we can generate realizations of the random run with either x(t) ∼ N (0, Px (t)) or recursively from

x(t + ∆t) = Φ(∆t)x(t) + w∆ (t) (6.217)

where w∆ (t) ∼ N (0, Q∆ (∆t)). Note that a Cholesky decomposition of Q∆ (t) is


p 
p qd t3 /12 + qd˙t5 /720 p
qb t +p 0 0
C
Q∆ (t) =  t/2 qd t p + qd˙t3 /12 qd t +pqd˙t3 /12 p0  (6.218)
2
t /6 qd˙t t/2 qd˙t qd˙t

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 and Drift Coupled First- and Second-Order Gauss-Markov

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

Px (t) = Φ(t − to )Pxo Φ′ (t − to ) + Q∆ (t − to ) (6.221)

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)

and we assume that b2 > 0. Let


β
c=− + ζωn ;
2
3 R. Carpenter and T. Lee. A stable clock error model using coupled first- and second-order gauss-markov processes. In

Astrodynamics 2008, Advances in the Astronautical Sciences. Univelt, 2008.


Draft for Release R2018a
6.8. MEASUREMENT ERROR MODELING 183

then, the process noise covariance is given by the following:


 2at    
(1,1) e −1 c2 e2at sin 2bt b2 − c2 + 2ac
Q∆ (t) = qb 1+ 2 +
4a b 4(a2 + b2 ) b
2at
 2 2 2

e cos 2bt − 1 ab − ac + 2b c
+ (6.227)
4(a2 + b2 ) b2
 2at 
qd e − 1 e2at (b sin 2bt + a cos 2bt) − a
+ 2 −
b 4a 4(a2 + b2 )
 2at  2
  
(2,2) e −1 c 2at
e sin 2bt b2 − c2 + 2ac
Q∆ (t) = qd 1+ 2 +
4a b 4(a2 + b2 ) b
2at
 2 2 2

e cos 2bt − 1 ab − ac + 2b c
+ (6.228)
4(a2 + b2 ) b2
4
 2at 2at

qb ωn e − 1 e (b sin 2bt + a cos 2bt) − a
+ 2 −
b 4a 4(a2 + b2 )
"   #
(1,2) qb ωn2 c 2at
 e2at (bc − ab) sin 2bt + (ac − b2 ) cos 2bt − (ac − b2 )
Q∆ (t) = 2 1−e +
b 4a 4(a2 + b2 )
"   # (6.229)
qd c 2at
 e2at (ab + bc) sin 2bt + (ac − b2 ) cos 2bt − (ac − b2 )
+ 2 1−e + .
b 4a 4(a2 + b2 )

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

6.9 Measurement Editing and Feasibility Criteria

6.9.1 Line of Site Test

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

6.9.2 Height of Ray Path

6.9.3 Line of Sight

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

Figure 6.7: Height of Ray Path Geometry


Draft for Release R2018a
6.9. MEASUREMENT EDITING AND FEASIBILITY CRITERIA 185

r1 (t1 ) Position vector of participant 1 at time of signal transmission, t1


r2 (t2 ) Position vector of participant 2 at time of signal reception, t2
ρ Vector from location of particpant 1 at signal transmission to location
of participant 2 at signal reception
ρ Magnitude of ρ
Rb Central body radius
hmin Minimum acceptable ray path height
τ Ray path parameter defined as the fraction of the unit distance along ρ
d(τ ) Position vector of τ
τmin Value of τ minimizing the distance between ρ and the central body
d(τmin ) Distance from central body origin to ray path (measured perpendicular)

The ray path vector, ρ, is computed from

[ρ]1 = [r2 (t2 )]1 − [r1 (t1 )]1 (6.233)

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

d(τ ) = [r2 (t2 )]1 − [ρ]1 τ (6.235)

Finally, the criteria for measurement feasibility is when the following statement is true

T 2 − T > 0 or d(τmin )2 − Rb2 >= 0 (6.236)

For geometric measurements, t1 = t2 . For measurements involving participants about different central
bodies, the LOS test is performed twice, once for each central body.

6.9.4 Horizon Angle Test


The horizon angle test checks to see if a space-based observer is above the local horizon for a ground-based
observer. The space-based observer can be a spacecraft or ground based observer on another celestial body.
The geometry for this test is shown in Fig. 6.8 where the nomenclature is defined below.

ρ δ

rg rs δm

Figure 6.8: Height Angle Test Geometry


Draft for Release R2018a
186 CHAPTER 6. MEASUREMENT MODELING

rg Position vector of the ground-based observer at time tg


tg Time the signal is at the receiving electronics of the ground-based observer
rs Position vector of the space-based observer at time ts
ts Time the signal is at the receiving electronics of the space-based observer
ρ Vector from location of ground-based observer to space-based observer
of participant 2 at signal reception
δm Minimum elevation angle above local horizon of ground-based observer

From inspection of Fig. 6.8, a space-based observer is above the local horizon of a ground-based observer if

δ ≥ δm (6.237)

From manipulation of the inner product we know


ρ · rg
sin δ = (6.238)
ρrg

where ρ = rs −rg . Finally, the horizon check is true if the following statement is satisfied and false otherwise:
ρ · rg
> sin δm (6.239)
ρrg

6.9.5 Range Limit Test


6.9.6 Range Rate Limit Test
6.9.7 Solar Exclusion Angle Test
Draft for Release R2018a

Chapter 7

Mathematics in GMAT Scripting

7.1 Basic Operators

7.2 Math Functions


7.2.1 max
[maxX] = max(X)
X is an nxm array. maxX is a 1xm row vector containing the maximum value in each column of X.

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

8.1 Differential Correction


8.2 Broyden’s Method
8.3 Newton’s Method
8.4 Matlab fmincon
The user first creates a solver and names it. An example is
Create fminconOptimizer SPQfmincon
The user creates an optimization sequence by issuing an optimize command, followed by the name of the
optimizer to use
Optimize SQPfmincon
EndOptimize

8.5 The Vary Command


The user defines the independent variables by the vary command,

Table 8.1: Available Commands in an fmincon Loop


Value Command
Xi Vary
Upper Bound on Xi Vary
Lower Bound on Xi Vary
Nondimensionalization Vary
Factor 1
Nondimensionalization Vary
Factor 2
Nonlinear constraint NonLinearConstraint
function
Linear constraint func- LinearConstraint
tion
Cost Function OptimizerName.Cost =

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.

9.1 Overview of Events


We begin by defining two types of events: (1) discrete events that occur at an instant of time, such as the
epoch of an impulsive maneuver, and (2) an interval event that occurs over some finite time span, such as a
spacecraft eclipse. Events are located using root finding methods.
Let’s proceed using an example event. Assume we wish to determine when a tracking station will next
be able to take measurements of a spacecraft’s range and Doppler. The conditions that must be satisfied,
called the event functions, are that the spacecraft must be 5 degrees above the horizon, and that the relative
range rate of the spacecraft must be less than 3 km/s.
1) Feasible 2) If not feasible, what condition causes infeasiblity 3) Ordered for efficiency 4) Event location
of for discrete event

∆te < ∆ts (9.1)


An Event Function in GMAT has three outputs. The general form of an Event Function is

[ f , d, p ] = F(t, x(t), C) (9.2)

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

f = [ f1 (t, x(t), C), f2 (t, x(t), C)...fn (t, x(t), C) ]T (9.3)

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.

Table 9.1: Allowable Values for d in Event Function Output


Value Action
d=1 Find roots when the function is moving in
the positive direction.
d = -1 Find roots when the function is moving in
the negative direction.
d=2 Find both types of roots

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.

9.2 Issues in Locating Zero Crossings


Before discussing the practical issues in finding roots of Event Functions, let’s take a look at a hypothetical
function to illustrate some of the issues that must be addressed. Figure 9.1 shows a sample event function.
The smooth line represents the locus of points of the function itself, and the large “X” marks represent the
function values at the integration time steps. The smaller tick marks indicate the function values at the
internal integrator stages, which may be available if we use a dense output numerical integrator.
In general, we don’t have continuous time expressions for the inputs to event functions. We only know the
inputs to Event Functions at discrete points in time, so we only know the Event Function values at discrete
points in time. Since these discrete times come from the numerical integration of a differential equation,
we can only calculate Event Function values at the integration time steps, or at the internal stages if the
information is available. This fact can cause a significant problem because an Event Function may vary
rapidly and the discrete times at which we know the Event Function may not give an accurate picture of the
function.
Let’s consider a few ways in which we can determine if a root has occurred, given a set of times and
Event Function values. The most obvious method is to simply look for sign changes in the function values. If
the function changes sign, then we know we have bracketed a root. This approach will incorrectly conclude
that a zero crossing did not occur, if there is an even number of zero crossings between two function values.
Another approach is to fit a polynomial through the data, and see if the polynomial has any real roots.
While this approach may be more accurate than looking for sign changes in some cases, it still does not
guarantee a zero crossing is missed. A third approach might be to force the integrator to select step sizes
based on the rate of change of the Event Function. We will not investigate this method further here though.
In short, there is no way to guarantee that a root crossing is missed. However, by having an understanding
of the Event Function, having control over the maximum integration step size, and having access to the
internal integrator stages when using a dense output integrator, we can do a acceptably good job determining
Draft for Release R2018a
9.3. ROOT FINDING OPTIONS IN GMAT 193

when zero-crossings occur. Once a zero-crossing is identified, there are well known ways to calculate the
actual root value.

Figure 9.1: Sample Event Function Output

F = F(t, x(t), C) (9.4)


We want to find all t such that
F(t, x(t), C) = 0 (9.5)

9.3 Root Finding Options in GMAT


In implementing a root finding approach, we need to balance accuracy and the need to find every root,
with speed and performance. One way to do this is to allow the user to select between different approaches
depending upon the accuracy needed for a particular application. The user has several controls to tell GMAT
how to determine if a zero crossing has occurred, and how to calculate the numerical value of a root if one
has been detected. Let’s look at the choices implemented in GMAT, and discuss some options that can be
included if a more robust method is required.
The first group of controls available to the user are related to how or if GMAT tries to determine if a root
has occurred. The user can provide a flag in the output of an Event Function that tells GMAT whether it is
possible that a root has occurred during the last integration step. This flag is notated as p and is discussed
in section 9.1. If an element of p is zero, then GMAT will not use more sophisticated and therefore more
computationally intensive methods to determine if a zero crossing for the particular component of the event
function has occurred. p can be either zero or one, and can change value during propagation. If p changes
from zero to one, GMAT begins using a root checking method specified by the user to determine if a zero
crossing has occurred, and begins storing function data in case it is needed to interpolate a root location.
The second control that determines if a zero crossing has occurred is called RootCheckMethod in the
GMAT script language. There are several RootCheckMethod options available and the user can currently
select between FunctionSignChange and PolynomialFit. If the user selects FunctionSignChange, then
GMAT looks for sign changes in the function output to determine if a zero crossing has occurred. If the
user selects PolynomialFit, then GMAT fits a polynomial to the Event Function data, and checks to see if
the polynomial has any real roots. If the polynomial has real roots, then a zero crossing has occurred. The
Draft for Release R2018a
194 CHAPTER 9. EVENTS

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

9.4 Algorithm for Event Functions

Table 9.2: Variables in Event Function Algorithm


VariableDefinition
nr Number of data points required to use the
requested RootSolvingMethod option
nc Number of data points required to use the
requested RootCheckMethod option
f A vector of function values provided by
the user defined Event Function
N The length of f , which is the number func-
tion values contained in the output of a
user defined Event Function.
d A vector of flags (length N ) that defines
which type of roots to track. (negative to
positive, positive to negative, or both)
p A vector of flags (length N ) that tells
whether or not a zero crossing is possi-
ble. A component of p is one if a root is
possible, otherwise it is zero.
Startup A vector of flags of lenght N . The compo-
nents of Startup correspond to the com-
ponents of f . A component of Startup is
one, if there is less than max(nr ,nc ) data
points saved for use in root finding. Oth-
erwise, a component of Startup is zero.
Draft for Release R2018a
9.4. ALGORITHM FOR EVENT FUNCTIONS 195

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

Figure 9.2: Initializations for the Event Location Algorithm


Draft for Release R2018a
196 Propagator Takes CHAPTER 9. EVENTS
One Step

[f,d,p] = F(t,x(t))

False

True Update Data


Take a step and
Update F, t, and P LastStep Structures if
Update data.
Needed

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

Figure 9.3: Event Location Algorithm

i=i+1

Loop over the number of elements in Event Function output


Draft for Release R2018a

Chapter 10

Graphics

10.1 Ground Track Plotting


A ground track plot displays spherical latitude and longitude over a Poincare (unwrapped cylinder) projection
of a body’s surface geography. The algormithm used to generate a ground track plot ensures that line
wrapping at the plot boundaries is handled correctly, and that when wrapping occurs, the plot is interpolated
to the plot boundary.
Longitude is computed by converting position and velocity of the object to the body fixed system of the
ground track plot central body. Define x, y, and z as the body fixed coordinates of the object. The longitude
is calculated using
λ = atan2(y, x) (10.1)

and the latitude is calculate using


z
φ = asin (10.2)
r

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

d = sign(xẏ − ẋy) (10.4)

φi − φi−1
m= (10.5)
λi − λi−1

197
Draft for Release R2018a
198 CHAPTER 10. GRAPHICS

Input: λi , λi−1 , φi , φi−1 , di , di−1


Output: Updated Ground Track Plot
mλ+i = mod(λi , 2π);
mλ+i−1 = mod(λi−1 , 2π);
mλ−i = mod(λi , −2π);
mλ−i−1 = mod(λi−1 , −2π);
% New point wraps off RHS border;
if di = di−1 = 1 And mλ+ +
i−1 < π And mλi > π then
φi − φi−1
m= + ;
mλ+i − mλi−1
φb = m(π − mλ+ i ) + φi ;
Plot line segment from (λi−1 , φi−1 ) to (π, φb );
Plot line segment from (−π, φb ) to (λi , φi );
% New point wraps off LHS border;
else if di = di−1 = −1 And mλ− −
i < −π And mλi−1 > −π then
φi − φi−1
m= − ;
mλ−i − mλi−1
φb = m(−π − mλ− i ) + φi ;
Plot line segment from (λi−1 , φi−1 ) to (−π, φb );
Plot line segment from (π, φb ) to (λi , φi );
% New does not wrap off plot border ;
else
Plot line segment from (λi−1 , φi−1 ) to (λi , φi );
end

Algorithm 1: Algorithm for Updating A Ground Track Plot

10.2 Footprint and Limb Computation


10.2.1 Overview
Computing an instrument footprint or the Earth Limb as viewed from a spacecraft involves essentially three
related problems: (1) Determining the intersection of a given line with a given ellipsoid, (2) determination of
a line tangent to a known ellipsoid, and (3) determining how to select the points along the footprint or limb
curve to provide a smooth plot in the graphics. These problems are related and discussed in order below
starting with the problem of computing the intersection of a line and an ellipsoid.

10.2.2 Intersection of Line and Ellipsoid


Begin by defining a ray ℓ such that
ℓ = p + αd̂ (10.6)
where p (in this context the usually location of a spacecraft) is the the starting location of ray ℓ, d̂ is the unit
vector in the direction of the ray, and α is the distance from coordinates p in the direction. The equation
for a tri-axial ellipoid is defined as
x2 y2 z2
2
+ 2 + 2 −1=0 (10.7)
Rx Ry Rz
where Rx , Ry , and Rz are the ellipsoid radii in the x, y, and z directions respectively. For simplicity of
notation, we’ll assume all coordinates such x, y, and z, and ray ℓ are expressed in the body coordinates of
the ellipsoid. Subtituting Eq. (10.6) into Eq. (10.7) results in

ℓ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

Eq. (10.8) and grouping terms by powers of α∗ yields


!   !
d2x d2y d2z dx px dy py dz pz p2x p2y p2
α ∗2
+ + + 2α∗
+ + + + + z2 − 1 =0 (10.9)
Rx2 Ry2 Rz2 Rx2 Ry2 Rz2 Rx2 Ry2 Rz

This is a quadratic equation and the solution is



∗ −B ± B 2 − 4AC
α = (10.10)
2A
where
!
d2x d2y d2z
A = + 2 + 2 (10.11)
Rx2 Ry Rz
 
dx px dy py dz pz
B = 2 + 2 + 2 (10.12)
Rx2 Ry Rz
!
2 2 2
px py pz
C = + 2 + 2 −1 (10.13)
Rx2 Ry Rz

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)

10.2.3 Determining the Limb Region


10.2.4 Selecting Points for Accurate Graphics
Draft for Release R2018a
200 CHAPTER 10. GRAPHICS
Draft for Release R2018a

Chapter 11

Numerical Algorithms

11.1 Lagrange Interpolation


Below we describe the algorithm used for lagrange interpolation. This includes specifying how points from
the known data are chosen for interpolation, and how interpolation is performed for multiple function values
(i.e. position and velocity) at the desired interpolation point.
Assume we have m functions to interpolate and that each function is known at ℓ values of the independent
variable x (in ephemeris interpolation this is time) as illustrated in Table 11.1. Given some point, say x′ ,
we desire the interpolated values of the functions, or f ′ ≈ P(x′ ) where P is the Lagrange interpolating
polynomial.

Table 11.1: Example of Data for interpolation


x f1 f2 ... fm
x1 f1 (x1 ) f2 (x1 ) ... fm (x1 )
x2 f1 (x2 ) f2 (x2 ) ... fm (x2 )
x3 f1 (x3 ) f2 (x3 ) ... fm (x3 )
x4 f1 (x4 ) f2 (x4 ) ... fm (x4 )
.. .. .. .. ..
. . . . .
xℓ−1 f1 (xℓ−1 ) f2 (xℓ−1 ) ... fm (xℓ−1 )
xℓ f1 (xℓ ) f2 (xℓ ) ... fm (xℓ )

Before proceeding we define the following variables:


x mx x 1 Known values of the independent variable (monotonically increasing or decreasing)
x′ Value of independent variable a the required interpolation point
fi mx x mf Array of dependent variable values for the ith function
f′ 1 x mf Array of interpolated function values at x′
n Order of interpolation
mx Number of points in x and fi
mf Number of functions to be interpolated

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

where Pj (x) is given by


n
Y x − xj
Pj (x) = yj (11.6)
xj − xk
k=1,k6=j

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

Algorithm 2: Algorithm for Lagrangian Interpolation

11.2 Quadratic Polynomial Interpolation


We are given three data points defined by a vector of independent variables

x = [ x1 x2 x3 ]T (11.7)

and a vector of corresponding dependent variables

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)

We begin by forming the system of linear equations


    
x21 x1 1 A y1
 x22 x2 1   B  =  y2  (11.10)
x23 x3 1 C y3

We can solve for the coefficients using




y1 x1 1


y2 x2 1

y3 x3 1
A = (11.11)
x21 x1 1


x22 x2 1

x23 x3 1



x21 y1 1


x22 y2 1

x23 y3 1
B = (11.12)
x21 x1 1


x22 x2 1

x23 x3 1

C = y3 − Ax23 − Bx3 (11.13)

11.3 Cubic Spline (Not-a-Knot) Interpolation


We are given five data points defined by a vector of independent variables

x = [ x1 x2 x3 x4 x5 ]T (11.14)

and a vector of corresponding dependent variables

y = [ y 1 y 2 y 3 y 4 y 5 ]T (11.15)

we wish to find the four cubic polynomials, i = 1, 2, 3, 4, such that

pi = ai (x − xi )3 + bi (x − xi )2 + ci (x − xi ) + di (11.16)

where the values for xi are known from the inputs.


To calculate the coefficients ai , bi , ci , and di we start by calculating the eight quantities

hi = xi+1 − xi (11.17)
yi+1 − yi
∆i = (11.18)
hi

Next we solve the following system of linear equations

AS = B (11.19)
Draft for Release R2018a
204 CHAPTER 11. NUMERICAL ALGORITHMS

where the components of A are given by

A11 = 2h2 + h1 (11.20)


A12 = 2h1 + h2 (11.21)
A13 = 0 (11.22)
A21 = 0 (11.23)
A22 = h3 + 2h4 (11.24)
A23 = 2h3 + h4 (11.25)
h22
A31 = (11.26)
h1 + h2
h1 h2 h3 h4
A32 = + 2(h2 + h3 ) + (11.27)
(h1 + h2 ) (h3 + h4 )
h23
A33 = (11.28)
h3 + h4

the components of B are

B11 = 6(∆2 − ∆1 ) (11.29)


B21 = 6(∆4 − ∆3 ) (11.30)
B31 = 6(∆3 − ∆2 ) (11.31)

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|

B31 − A31 S1 − A32 S3


S5 = (11.34)
A33
Now we can calculate S2 and S4 using
h 2 S1 + h 1 S3
S2 = ; (11.35)
h1 + h2

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

11.4 Root Location using Brent’s Method

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.

f Function whose root is desired


a Initial guess for independent variable (a and b must bound the desired root)
b Initial guess for independent variable (a and b must bound the desired root)
tol Convergence tolerance.
N Maximum number of iterations
xo Root value
i Number of iterations
ǫ Machine precision
Draft for Release R2018a
206 CHAPTER 11. NUMERICAL ALGORITHMS

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;

Algorithm 3: Brent’s Method for Root Finding


Draft for Release R2018a

Chapter 12

MathSpecAppendices

12.1 Vector Identities


∂aT a ∂a
= 2aT (12.1)
∂x ∂x
∂a ∂ 1/2 aT ∂a
= aT a = (12.2)
∂x ∂x a ∂x
∂a−1 ∂  −1/2 aT ∂a
= aT a =− 3 (12.3)
∂x ∂x a ∂x
  T
∂ a 1 ∂a aa ∂a
= 3 −3 5 (12.4)
∂x a3 a ∂x a ∂x

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.

You might also like