NASA. GMAT User Guide
NASA. GMAT User Guide
User Guide
R2020a
General Mission Analysis Tool (GMAT): User Guide
Table of Contents
Documentation Overview ........................................................................................... vii
Using GMAT ................................................................................................................ 1
Welcome to GMAT .............................................................................................. 3
Milestones and Accomplishments ............................................................... 3
Features Overview ....................................................................................... 3
Heritage ........................................................................................................ 5
Licensing ...................................................................................................... 5
Platform Support .......................................................................................... 5
Component Status ....................................................................................... 5
Contributors .................................................................................................. 6
Getting Started .................................................................................................... 9
Installation .................................................................................................... 9
Running GMAT .......................................................................................... 10
Sample Missions ........................................................................................ 10
Getting Help ............................................................................................... 10
Tour of GMAT ................................................................................................... 13
User Interfaces Overview .......................................................................... 13
Resources Tree ......................................................................................... 18
Mission Tree .............................................................................................. 21
Command Summary .................................................................................. 30
Output Tree ................................................................................................ 33
Script Editor ............................................................................................... 33
Configuring GMAT ............................................................................................. 39
File Structure ............................................................................................. 39
Configuring Data Files ............................................................................... 42
Tutorials ..................................................................................................................... 45
Simulating an Orbit ............................................................................................ 47
Objective and Overview ............................................................................. 47
Configure the Spacecraft ........................................................................... 47
Configure the Propagator .......................................................................... 49
Configure the Propagate Command .......................................................... 51
Run and Analyze the Results .................................................................... 53
Simple Orbit Transfer ........................................................................................ 55
Objective and Overview ............................................................................. 55
Configure Maneuvers, Differential Corrector, and Graphics ...................... 55
Configure the Mission Sequence .............................................................. 56
Run the Mission ......................................................................................... 62
Target Finite Burn to Raise Apogee ................................................................. 65
Objective and Overview ............................................................................. 65
Create and Configure Spacecraft Hardware and Finite Burn .................... 65
Create the Differential Corrector and Target Control Variable ................... 71
Configure the Mission Sequence .............................................................. 71
Run the Mission ......................................................................................... 77
Mars B-Plane Targeting .................................................................................... 79
Objective and Overview ............................................................................. 79
iii
General Mission Analysis Tool
(GMAT)
iv
General Mission Analysis Tool
(GMAT)
v
vi
Documentation Overview
Welcome, and thank you for using GMAT! This User Guide contains a wealth of material
to introduce you to GMAT and how it works. It also provides an extensive Reference
Guide that contains data on every Resource, Command, and major subcomponent in
the system.
Using GMAT
The Using GMAT chapter contains high level and introductory information on the sytem.
If you need information on how to install and run the system, would like a tour of the
system, want know how to configure data files, or how GMAT is organized, start here.
The Using GMAT section provides general information on GMAT and how to use the
software.
The Welcome to GMAT contains a brief project and software overview, including project
status, licensing, and contributors.
The Getting Started section describes how to get and install GMAT, how to run the
provided samples, and where to turn for further help.
The Tour of GMAT is an in-depth guide through some of the key interface features,
including the Resources tree, Mission tree, Command Summary, and Script Editor.
Note
We consider the User Interfaces Overview section to be essential reading,
as it describes some fundamental aspects of how GMAT works.
Tutorials
The Tutorials section contains in-depth tutorials that show you how to use GMAT for
end-to-end analysis. The tutorials are designed to teach you how to use GMAT in the
context of performing real-world analysis and are intended to take between 30 minutes
and several hours to complete. Each tutorial has a difficulty level and an approximate
duration listed with any prerequisites in its introduction, and are arranged in a general
order of difficulty.
Here is a summary of selected Tutorials. For a complete list of tutorials see the Tutorials
chapter.
The Simulating an Orbit tutorial is the first tutorial you should take to learn how to use
GMAT to solve mission design problems. You will learn how to specify an orbit and
propagate to orbit periapsis.
The Mars B-Plane Targeting tutorial shows how to perform targeting by application to a
Mars transfer trajectory where you will target desired B-plane conditions at Mars.
vii
Documentation Overview
The Target Finite Burn to Raise Apogee tutorial shows how to use finite maneuvers with
an application to orbit apogee raising.
The Finding Eclipses and Station Contacts tutorial shows how to use GMAT to locate
elipses and station contacts.
The Electric Propulsion tutorial shows how to configure GMAT to model electric propul-
sion systems.
The Mars B-Plane Targeting Using GMAT Functions tutorial shows how to use GMAT
functions to extend your analysis.
Reference Guide
The Reference Guide contains individual topics that describe each of GMAT's resources
and commands. When you need detailed information on syntax or application-specific
examples for specific features, go here. It also includes system-level references that
describe the script language syntax, parameter listings, external interfaces, and config-
uration files.
Note
This document uses two typographical conventions throughout:
viii
Using GMAT
The Using GMAT chapter contains high level and introductory information on the sytem. If you
need information on how to install and run the system, would like a tour of the system, want know
how to configure data files, or how GMAT is organized, start here.
The Using GMAT section provides general information on GMAT and how to use the software.
The Welcome to GMAT contains a brief project and software overview, including project status,
licensing, and contributors.
The Getting Started section describes how to get and install GMAT, how to run the provided
samples, and where to turn for further help.
The Tour of GMAT is an in-depth guide through some of the key interface features, including the
Resources tree, Mission tree, Command Summary, and Script Editor.
Note
We consider the User Interfaces Overview section to be essential reading, as it de-
scribes some fundamental aspects of how GMAT works.
Using GMAT
Welcome to GMAT
The General Mission Analysis Tool (GMAT) is the world’s only enterprise, multi-mission,
open source software system for space mission design, optimization, and navigation.
The system supports missions in flight regimes ranging from low Earth orbit to lunar,
libration point, and deep space missions. GMAT is developed by a team of NASA, private
industry, public, and private contributors and is used for real-world mission support,
engineering studies, as a tool for education, and public engagement. See the R2020a
Release Notes for a complete list of changes in R2020a.
• On May 1, 2018, the Lunar Reconnaissance Orbiter (LRO) project held an Operational
Readiness Review (ORR) to evaluate GMAT as a replacement for GTDS as the pri-
mary operational orbit determination (OD) tool for LRO. GMAT was approved for this
purpose at this ORR and LRO began using GMAT for operational OD in June 2018.
• In April 2018, the Transiting Exoplanet Survey Satellite (TESS) mission launched.
TESS used GMAT as its primary tool for mission design and maneuver planning from
proposal development through operations. For more information about TESS, includ-
ing a discussion of how GMAT was used, see the published paper.
• The GMAT team is currently developing an Extended Kalman Filter Smoother (EK-
FS) orbit determination capability for future release. In late 2020, a low Earth NASA
mission that uses the GPS point solution data type will help operationally test our new
EKFS capability. A publicly available version of GMAT, with EKFS capabilities for all
data types supported by GMAT, is planned for the R2021a release.
• The GMAT team is currently integrating CSALT into GSFC's Core Flight System
(CFC) to demonstrate the ability to perform optimal control onboard.
Features Overview
GMAT is a feature rich system containing high fidelity space system models, optimiza-
tion and targeting, built in scripting and programming infrastructure, and customizable
plots, reports and data products, to enable flexible analysis and solutions for custom
and unique applications. GMAT can be driven from a fully featured, interactive GUI or
from a custom script language. Here are some of GMAT’s key features broken down
by feature group.
3
Using GMAT Welcome to GMAT
• Solar System modeling including high fidelity ephemerides, custom celestial bodies,
libration points, and barycenters
• Rich set of coordinate systems including J2000, ICRF, fixed, rotating, topocentric, and
many others
• Propagation using CCSDS, SPICE, STK, and Code 500 ephemeris files
• Propagators that naturally synchronize epochs of multiple vehicles and avoid fixed
step integration and interpolation
Programming Infrastructure
• User defined variables, arrays, and strings
• User defined equations using MATLAB syntax. (i.e. overloaded array operation)
• Control flow such as If, For, and While loops for custom applications
• Matlab interface
• Python interface
• User-defined functions (sub-routines)
• Built in parameters and calculations in multiple coordinate systems
Interfaces
• Fully featured, interactive GUI that makes simple analysis quick and easy
4
Welcome to GMAT Using GMAT
Heritage
GMAT has enabled and enhanced missions in nearly every NASA flight regime including
enabling new mission types, extending the life of existing missions, and enabling new
science observations. GMAT has supported 8 NASA missions and 10+ NASA proposal
efforts. The system has experienced broad application and adoption around the world.
To date, GMAT has been used by over 30 organizations, with 15 universities and 12
commercial firms publishing results in the open literature.
Licensing
GMAT is licensed under the Apache License 2.0.
Platform Support
GMAT has been rigorously tested on the Windows 10 platform and we perform nightly
regression tests running almost 15,000 test cases for the system core and over 4000
test cases for the GUI interface. The Mac and Linux console versions are rigorously
tested, but the GUI is provided in Beta form on those platforms. On Mac, the minimum
OS version is OSX 10.14 (Mohave).
Note
Installing GMAT on a Mac requires some extra steps to handle "transloca-
tion". This is because we build GMAT with GCC and not with Apple tools.
Please see the README file in the GMAT bin directory for instructions on
installing GMAT on Mac.
The following plugin modules do not run under this release of GMAT on Mac and Linux
platforms:
• Optimizer libFmincon
and the Mac release does not support the following plugin:
• libMsise86
Component Status
GMAT is distributed with production and Alpha/Beta components. Components that are
in Alpha/Beta status are turned off by default. The status of plugin components is shown
below.
5
Using GMAT Welcome to GMAT
• libDataInterface
• libEphemPropagator
• libEventLocator
• libFormation
• libGmatFunction
• libNewParameters
• libPythonInterface
• libStation
• libGmatEstimation
• libMatlabInterface
• libFminconOptimizer
• libProductionPropagators
• libScriptTools
• libYukonOptimizer
• libOpenFramesInterface
• libCInterface
• libGeometricMeasurements
• libExtraPropagators
• libPolyhedronGravity
• libSaveCommand
• libThrustFile
• libEKF
• proprietary/libMarsGRAM
• proprietary/libMsise86
• proprietary/libNRLMsise00
• proprietary/libSNOptimizer
• proprietary/libVF13Optimizer
• proprietary/libEMTGModels
• proprietary/libCSALTInterface
Contributors
The Navigation and Mission Design Branch at NASA’s Goddard Space Flight Center
performs project management activities and is involved in most phases of the devel-
opment process including requirements, algorithms, design, and testing. The Ground
Software Systems Branch performs design, implementation, and integration testing. Ex-
ternal particpants contribute to design, implementation, testing and documentation. We
use a collaborative development model that enables innovation and actively involves
6
Welcome to GMAT Using GMAT
the public and private sector having seen contributions from 12 commercial firms. Ex-
ternal participants for R2019a include:
The NASA Jet Propulsion Laboratory (JPL) has provided funding for integration of
the SPICE toolkit into GMAT. Additionally, the European Space Agency’s (ESA) Ad-
vanced Concepts team has developed optimizer plug-ins for the Non-Linear Program-
ming (NLP) solvers SNOPT (Sparse Nonlinear OPTimizer) and IPOPT (Interior Point
OPTimizer).
7
8
Using GMAT
Getting Started
Installation
Installers and application bundles are available on the GMAT SourceForge project page,
located at https://sourceforge.net/projects/gmat.
Installer
By default, GMAT installs to the %LOCALAPPDATA% folder in your user directory, and
does not require elevated privileges to install. On Windows Vista and Windows 7, this
generally corresponds to the C:\Users\username\AppData\Local folder. You are free
to choose another install location during the installation process, but elevated privileges
may be required to do so.
Binary Bundle
A binary bundle is available on Windows as a .zip archive. To use it, unzip it anywhere
in your file system, making sure to keep the folder structure intact. To run GMAT, run
the GMAT\bin\GMAT.exe executable in the extracted folder.
Source Code
GMAT is available as a platform-independent source code bundle. Note that all testing
is performed on Windows, so on other platforms it is considered a beta release. See the
GMAT Wiki for compiling instructions.
Rather than compiling from the source bundle, however, we generally recommend
checking out a snapshot from the Subversion repository:
svn://svn.code.sf.net/p/gmat/code
9
Using GMAT Getting Started
Running GMAT
Starting GMAT
On Microsoft Windows platforms there are several ways to start a GMAT session. If you
used the GMAT installer, you can click the GMAT R2020a item in the Start menu. If
you installed GMAT from a .zip file or by compiling the system, locate the GMAT bin
directory double-click GMAT.exe.
To start GMAT from the command line, run GMAT.exe. Various command-line parame-
ters are availabe; see Command-Line Usage for details.
Note
Installing GMAT on a Mac requires some extra steps to handle "transloca-
tion". This is because we build GMAT with GCC and not with Apple tools.
Please see the README file in the GMAT bin directory for instructions on
installing GMAT on Mac.
Exiting GMAT
To end a GMAT session on Windows or Linux, in the menu bar, click File, then click
Exit. On Mac OS X, in the menu bar, click GMAT, then click Quit GMAT, or type
Command+Q.
Sample Missions
The GMAT distribution includes more than 30 sample missions. These samples show
how to apply GMAT to problems ranging from the Hohmann transfer to libration point
station-keeping to trajectory optimization. To locate and run a sample mission:
1. Open GMAT.
2. On the toolbar click Open.
3. Navigate to the samples folder located in the GMAT root directory.
4. Double-click a script file of your choice.
5. Click Run ( ).
To run optimization missions, you will need MATLAB and the MATLAB Optimization
Toolbox or the internal libVF13Optimizer plugin. These are proprietary libraries and
are not distributed with GMAT. MATLAB connectivity is not yet fully supported in the
Mac and Linux, and therefore you cannot run optimization missions that use MATLAB’s
fmincon optimizer on those platforms. See MATLAB Interface for details on configuring
the MATLAB optimizer.
Getting Help
This User Guide provides documentation and tutorials for all of GMAT's feature. But
if you have further questions, or want to provide feedback, here are some additional
resources:
10
Getting Started Using GMAT
• Homepage: http://gmat.gsfc.nasa.gov
• Wiki: http://gmatcentral.org
• User forums: http://forums.gmatcentral.org
• Downloads and source code: http://sourceforge.net/projects/gmat
• Submit bug reports and feature requests: http://bugs.gmatcentral.org
• Official contact: <[email protected]>
11
12
Using GMAT
Tour of GMAT
User Interfaces Overview
GMAT offers multiple ways to design and execute your mission. The two primary inter-
faces are the graphical user interface (GUI) and the script interface. These interfaces are
interchangeable and each supports most of the functionality available in GMAT. When
you work in the script interface, you are working in GMAT’s custom script language.
To avoid issues such as circular dependencies, there are some basic rules you must
follow. Below, we discuss these interfaces and then discuss the basic rules and best
practices for working in each interface.
GUI Overview
When you start a session, the GMAT desktop is displayed with a default mission already
loaded. The GMAT desktop has a native look and feel on each platform and most desk-
top components are supported on all platforms.
Windows GUI
When you open GMAT on Windows and click Run in the Toolbar, GMAT executes
the default mission as shown in the figure below. The tools listed below the figure are
available in the GMAT desktop.
13
Using GMAT Tour of GMAT
Menu Bar The menu bar contains File, Edit, Window and Help functionality.
GMAT allows you to simultaneously edit the raw script file repre-
sentation of your mission and the GUI representation of your mis-
sion. It is possible to make inconsistent changes in these mission
representations. The GUI/Script Sync Status indicator located in
the toolbar shows you the state of the two mission representations.
See the the section called “GUI/Script Interactions and Synchro-
nization” section for further discussion.
Resources Tab The Resources tab brings the Resources tree to the foreground
of the desktop.
Resources Tree The Resources tree displays all configured GMAT resources and
organizes them into logical groups. All objects created in a GMAT
script using a Create command are found in the Resources tree
in the GMAT desktop.
Mission Tab The Mission tab brings the Mission Tree to the foreground of the
desktop.
Mission Tree The Mission tree displays GMAT commands that control the time-
ordered sequence of events in a mission. The Mission tree con-
tains all script lines that occur after the BeginMissionSequence
command in a GMAT script. You can undock the Mission tree as
shown in the figure below by right-clicking on the Mission tab and
dragging it into the graphics window. You can also follow these
steps:
1. Click on the Mission tab to bring the Mission Tree to the fore-
ground.
2. Right-click on the Mission Sequence folder in the Mission tree
and select Undock Mission Tree in the menu.
14
Tour of GMAT Using GMAT
The GMAT script editor is a textual interface that lets you directly edit your mission in
GMAT's built-in scripting language. In Figure 3 below, the script editor is shown maxi-
mized in the GMAT desktop and the items relevant to script editing are labeled.
15
Using GMAT Tour of GMAT
Scripts Folder The GMAT desktop allows you to have multiple script files
open simultaneously. Open script files are displayed in
the Scripts folder in the Resources tree. Double click on
a script in the Scripts folder to open it in the script ed-
itor. The GMAT desktop displays each script in a sepa-
rate script editor. GMAT indicates the script currently rep-
resented in the GUI with a boldface name. Only one script
can be loaded into the GUI at a time.
Script Status Box The Script Status box indicates whether or not the script
being edited is loaded in the GUI. The box says Active
Script for the script currently represented in the GUI and
Inactive Script for all others.
Save,Sync Button The Save,Sync button saves any script file changes to
disk, makes the script active, and synchronizes the GUI
with the script.
Save,Sync,Run Button The Save,Sync,Run button saves any script file changes
to disk, makes the script active, synchronizes the GUI with
the script, and executes the script.
Save As Button When you click Save As, GMAT displays the Choose A
File dialog box and allows you to save the script using a
new file name. After saving, GMAT loads the script into
the GUI, making the new file the active script.
16
Tour of GMAT Using GMAT
Caution
GMAT will not attempt to merge or resolve simultaneous changes in the
Script and GUI and you must choose which representation to save if you
have made changes in both interfaces.
The Save button in the toolbar saves the GUI representation over the script. The
Save,Sync button on the script editor saves the script representation and loads it into
the GUI.
Caution
If you have a script file that has custom formatting such as spacing and data
organization, you should work exclusively in the script. If you load your script
into the GUI, then click Save in the toolbar, you will lose the formatting of
your script. (You will not, however, lose the data.)
17
Using GMAT Tour of GMAT
Clicking the Save,Sync button on the script editor saves the script representation and
loads it into the GUI. When you work in a GMAT script, you work in the raw file that
GMAT reads and writes. Each script file must contain a command called BeginMis-
sionSequence. Script lines that appear before the BeginMissionSequence command
create and configure models and this data will appear in the Resources tree in the GUI.
Script lines that appear after the BeginMissionSequence command define your mis-
sion sequence and appear in the Mission tree in the GUI. Here is a brief script example
to illustrate:
The line Sat.X = 3000 sets the x-component of the Cartesian state to 3000; this value
will appear on the Orbit tab of the Spacecraft dialog box. However, because the line
Sat.X = 1000 appears after the BeginMissionSequence command, the line Sat.X =
1000 will appear as an assignment command in the Mission tree in the GUI.
• Each script file must contain one and only one BeginMissionSequence command.
• GMAT commands are not allowed before the BeginMissionSequence command.
• You cannot use inline math statements (equations) before the BeginMissionSe-
quence command in a script file. (GMAT considers in-line math statements to be an
assignment command. You cannot use equations in the Resources tree, so you also
cannot use equations before the BeginMissionSequence command.)
• In the GUI, you can only use in-line math statements in an assignment command. So,
you cannot type 3000 + 4000 or Sat.Y - 8 in the text box for setting a spacecraft’s
dry mass.
• GMAT’s script language is case-sensitive.
For a more complete discussion of GMAT's script language, see the Script Language
documentation.
Resources Tree
The Resources tree displays GMAT resources and organizes them into logical groups
and represents any objects that might be used or called in the Mission tree. This tree
allows a user to add, edit, rename, or delete most available resources. The Resources
tree can be edited either in the GMAT GUI or by loading or syncing a script file. All
objects created in a GMAT script using a Create command are found in the Resources
tree in the GMAT desktop. The default Resource tree is displayed below (Figure 4).
18
Tour of GMAT Using GMAT
Organization
The Resources tree displays created resources organized into folders by object cate-
gory. The SolarSystem and Solvers folders contain more specific folders which can be
found by clicking the expand (+) icon. Conversely, folders can be collapsed by clicking
the minimize (-) icon.
Folder Menus
Resources can be added by right clicking the folder of the resource and clicking the
resource type from the available menu. Most folders have only one available resource
type; for example if the Spacecraft folder is right-clicked, the user can only click “Add
Spacecraft” (Figure 5). Other folders have multiple objects that can be added and the
user must first select the “Add” menu before selecting the object; for example to add a
ChemicalTank, right click the “Hardware” folder, select “Add”, then the list of available
resource types is displayed and the user can click “Fuel Tank” (Figure 6). User-defined
solar system resources are added by right-clicking either Sun or a default Celestial-
Body resource. By right-clicking Sun the user can add a Planet, Comet, or Asteroid
to the solar system. By right-clicking a Planet the user can add a Moon to that Planet.
19
Using GMAT Tour of GMAT
Resource Menus
Resources can be edited by right-clicking on the resources and selecting one of the
options from the menu (Figure 7).
Open/Close
To open a resource, you can either right-click the resource and select “Open”, or you
can double click the resource. Conversely, the resource can be closed either by options
in the resource properties window or selecting “Close” from the resource menu. When a
resource is opened and the name is right-clicked in the Resource tree, the only options
in the object menu are “Open” and “Close”.
Rename
Once a resource has been created, the user can rename it to any valid name. Valid
names must begin with a letter and may be followed by any combination of letters digits
and underscores. Invalid names include:
20
Tour of GMAT Using GMAT
Delete
Resources can be deleted by right clicking the object and selecting “Delete”. Resources
cannot be deleted if they are used by another resource or command and an error with be
thrown. For example, a Spacecraft resource cannot be deleted if one of its properties
(eg. DefaultSC.A1ModJulian) is being used by the Report command. Some default
objects cannot be deleted. In such cases, the Delete menu item will not be shown. They
include:
Clone
Objects can be cloned by selecting the “Clone” option in the menu. A cloned object will
be an exact copy of the original object with a different name. Some objects cannot be
cloned. In such cases, the Clone menu item will not be available. The only objects that
cannot be cloned are:
Mission Tree
The Mission Tree is an ordered, hierarchical, display of your GMAT script command
mission sequence (everything after the BeginMissionSequence in your script). It rep-
resents the ordered list of commands to be executed to model your mission. The hier-
21
Using GMAT Tour of GMAT
archical grouping in the mission tree represent commands that are executed inside a
control logic command, e.g., If, For, While, etc. The mission tree allows you to add,
edit, delete and rename commands. It allows you to configure or filter the display of the
commands in the Mission Tree to make the command execution easier to understand
or modify. An example Mission Tree screenshot is below. The Mission Tree window is
made up of 2 elements: the Mission Sequence on the left and the view filters toolbar
on the right.
Warning
Edits to the Mission Tree will be reflected in your script after it is synchro-
nized and vice-versa. If you edit the Mission Tree, you need to synchronize
with the script to see it in the script editor. If you edit the script, you need to
synchronize with the GUI to see your changes reflected in the Mission Tree.
22
Tour of GMAT Using GMAT
Commands that are grouped under control logic commands (e.g. If, For, and While)
only execute if that control logic command is successfully executed (e.g., if the local
expression evaluates to true for If command, or the loop condition evaluates to true for
For and While commands).
In general, commands are executed only once. However, child commands grouped un-
der the loop commands (e.g. For and While) may execute multiple times. These com-
mands will execute for each time the loop command evaluates to true. Commands under
the If commands are only executed if the If condition evaluates to true; otherwise, they
are skipped. For the If-Else command, child commands grouped under the If portion
of the command execute if the conditional statement evaluates to true; otherwise, the
child commands grouped under the Else portion of the command execute.
Note
Note that all commands in the Mission Tree are grouped under a special
Mission Sequence home item. This home item is always present as the first
item in the Mission Tree and cannot be deleted.
The Mission Tree may display a subset of the commands of the full mission sequence
based on your view filter options. There are 3 basic filtering options available within
GMAT:
The view filters activate by clicking one of the view filter buttons to the right of the Mis-
sion Tree. The pressed (pushed in) button indicates which filter is currently enabled.
The four buttons on the top are the Filter by branch level buttons. The next four buttons
in the middle are the inclusive filter-by-command-types buttons, and the four buttons on
the bottom are the exclusive filter-by-command-types buttons. The button at the very
bottom of the view filters toolbar allows you to define a custom filter. You cannot com-
bine filter-by-branch-level filters with the filter-by-command-type filters nor combine in-
clusive and exclusive command type filters. However, multiple inclusive command type
filters can be combined (e.g., filter both physics related and solver related commands)
or multiple exclusive command type filters can be combined.
Note
Note that all parents of a viewable command are displayed, even if the parent
command is not part of the viewable command set.
Also note that the Mission Tree automatically reconfigures to show all com-
mands when the user Appends or Inserts a new command.
23
Using GMAT Tour of GMAT
Filtering by branch level causes GMAT to not display commands in the mission tree that
are below a certain level. To select the number of levels you wish to display, click the
buttons on the top. The four buttons correspond to (from top to bottom):
Only one filter-by-branch-level button may be active at a time. The default GMAT be-
havior is to display all branches of a mission tree.
GMAT allows you to filter what commands are displayed by their command type. You
may select to only display commands that are in a filter command type set (inclusive)
or only display commands that are not in a filter command type set (exclusive). GMAT
provides both pre-configured command type sets (e.g., physics related or output related)
and custom command type sets that you define
The four middle buttons in the View Options toolbar are pre-configured inclusive com-
mand filters, e.g., only display commands that are in the desired command set. The four
inclusive filter buttons correspond to (from top to bottom):
Multiple inclusive command type filters can be active at once. For example, to filter both
physics related and solver related commands, click both the physics-related and solver-
related filter buttons so that they appear pressed down. This option will show all physics
related and solver related commands and hide all other commands (except Parents of
the viewable commands)).
The four buttons at the bottom in the View Options toolbar are pre-configured exclusive
command filters, e.g., only display commands that are not in the command set. The four
exclusive filter buttons correspond to (from top to bottom):
• Report
• Equation
• Output-related (Report, Toggle, PenUp, PenDown, MarkPoint, and ClearPlot)
• Function calls (CallMatlabFunction)
Multiple exclusive command type filters can be active at once. For example, to show
everything but Report and output-related commands, click both the Report and out-
put-related filter buttons so that they appear pressed down.
24
Tour of GMAT Using GMAT
Note
Note that the Mission Tree shows an ellipsis (…) after a command name if the
command is followed by items not graphically displayed in the tree because
of filter options.
Mission Sequence menu options are always available and active in the menu list.
This menu option collapses all the branches in the Mission Tree so that you only see the
top-level commands. To show branches, click the plus (+) button next to a command or
select Expand All from the Mission Sequence popup menu.
Expand All
This menu option expands all the branches and sub-branches in the Mission Tree so
that you see every command in the mission sequence. To hide branches, click the minus
(-) button next to a command or select Collapse All from the Mission Sequence popup
menu.
25
Using GMAT Tour of GMAT
Append
The Append menu option displays the submenu of commands that can be appended to
the mission sequence. This menu is not available when the Mission Tree view is filtered.
Run
The Run menu option executes the mission command sequence. This menu option is
always available.
Show Detail
The Show Detail menu option toggles an option to display the mission tree with short
or verbose text. When the show detail menu option is checked, each command is dis-
played with the script line for the command (e.g. what appears in “Show Script” for the
command). When the show detail menu option is unchecked, the mission tree shows
only the label for the command which will be your custom label if you have provided one
and a system provided label if you have not labelled the command. This menu option
is always available.
The Show Mission Sequence menu option displays a streamlined text view of the mis-
sion sequence in text window. This view shows a hierarchical view of every command
(similar to a script view) in the mission sequence. Unlike the script editor, this view only
includes the command names and labels. This menu option is always available.
Show Script
The Show Script menu option displays the script associated with the GUI version of
the current mission script. This is the complete script that would be saved to a file if you
clicked the GUI save button. Note that when the GUI is unsynchronized with the script
editor (please see Script Editor for more details), this mission script is different than the
script displayed in the script editor. This menu option is always available
The Mission Summary - All menu option displays a mission simulation summary for the
all commands in the mission sequence. This summary information includes spacecraft
state information, spacecraft physical properties, time information, planetodetic proper-
ties, and other orbit data for each command. This information is only available after a
mission simulation is run and the data shows state information after the execution of the
command. Showing Mission Summary data for a ScriptEvent command is equivalent
to showing summary data for the last command in that ScriptEvent. If commands are
nested in control flow or solver branches, the summary data that is displayed is for the
last pass through the sequence. This menu option is always available.
The Mission Summary - Physics menu option displays a mission simulation summa-
ry for physics related commands in the mission sequence. This summary information
26
Tour of GMAT Using GMAT
The Dock Mission Tree menu option docks the Mission Tree window in the notebook
containing the Resources tree and Output tree. This option is only selectable if the Mis-
sion Tree is currently floating or undocked. Please see the Docking/Undocking/Place-
ment section for more information.
The Undock Mission Tree menu option undocks, or makes floating, the Mission Tree
window from the Resources tree and Output tree. The undocked Mission Tree window
may be resized, moved, maximized, minimized, and restored. This option is only selec-
table if the Mission Tree is currently docked. Please see the the section called “Dock-
ing/Undocking/Placement” section for more information.
Command Menu
The Command popup menu allows you to add, edit, or delete the commands in the
Mission Tree by using the right mouse button. This displays a context sensitive menu
for adding and modifying commands as well as viewing your command sequence and
command summary. To add commands to the Mission Tree, right click a command
and select Append, Insert Before, or Insert After. To edit commands, double click the
command name or right click and select Open.
Most commands in GMAT can appear anywhere in the mission sequence. However,
there are some exceptions and the Command popup menu is context sensitive, meaning
the options available under the menu change based on what command is selected and
where in the tree the command occurs. Here is a complete list of context sensitivities:
• Insert and Append are not available unless the mission tree filter is set to show all
levels.
• Achieve commands can only appear inside of a Target sequence.
• Vary commands can only appear in a Target or Optimize sequence,
• NonlinearConstraint and Minimize commands can only appear in an Optimize se-
quence.
27
Using GMAT Tour of GMAT
Open
This menu option opens the command editor window for the selected command. The
Open menu option is always active in the menu list. If the window is already open, the
Open option brings the window to the front and makes it the active window.
Close
This menu options closes the command editor window for the selected command. The
Close menu option is always active in the menu list.
Append
The Append menu option displays the submenu of commands that can be appended
as the last sub-item of the selected command in the Mission Tree. As such, the Ap-
28
Tour of GMAT Using GMAT
pend menu option only appears when the selected tree item can contain sub-items,
e.g., the Mission Sequence home item, control logic commands, and Optimize and
Target commands. Note that the Append submenu is context-sensitive and will only
show commands that may be appended to the selected command. Finally, this menu is
not available when the Mission Tree view is filtered.
Insert After
The Insert After menu option displays the submenu of commands that can be insert-
ed after the selected command (and any child commands, if any) in the Mission Tree.
Nominally, the new command is inserted at the same level as the selected command.
However, if the selected command is the “End” command of a control logic or Optimize
or Target command (e.g., End For, End If, End Optimize, etc), the new command is
inserted after the End command and on the same level (e.g., the next level up) as the
parent command. The Insert After menu option is always active in the menu list except
when the Mission Sequence home item is selected. Note that the Insert After submenu
is context-sensitive and will only show commands that may be added after the selected
command. Finally, this menu is not available when the Mission Tree view is filtered.
Insert Before
The Insert Before menu option displays the submenu of commands that can be inserted
before the selected command (and any child commands, if any) in the Mission Tree. The
new command is always inserted at the same level as the selected command. The Insert
Before menu option is always active in the menu list except when the Mission Sequence
Home item is selected. Note that the Insert Before submenu is context-sensitive and
will only show commands that may be added before the selected command. Finally, this
menu is not available when the Mission Tree view is filtered.
Rename
The Rename menu option displays a dialog box where you can rename the selected
command. A command name may contain any characters except the single quote. Note
that, unlike resources, command names do not have to be unique. The Rename menu
option is always active in the menu list except when the Mission Sequence home item
is selected.
Delete
The Delete menu option deletes the selected command. GMAT does not confirm the
option before deletion occurs. The Delete menu option is always active in the menu list
except when the Mission Sequence home item is selected.
Command Summary
The Command Summary menu option displays a mission simulation summary for the
selected command, including spacecraft state information, time information, planetodet-
ic properties, and other orbit data. This information is only available after a mission sim-
ulation run. This menu option is always available. However, command summary data
is not available for Propagate command in single step mode. The button is available
but no data is displayed.
29
Using GMAT Tour of GMAT
Docking/Undocking/Placement
The Mission Tree window may be used as a floating window or docked with the Re-
source tree. GMAT remembers the placement and docking status of the Mission Tree
even after you quit. The undocked Mission Tree window may be resized, moved, or
minimized. When the Mission Tree is undocked, and the user opens a dialog box for a
GUI component, the dialog box does not cover the Mission Tree.
• Right click and drag the Mission tab out of the Resource Tree window.
• Right click the Mission Sequence home item and select Undock Mission Tree.
• Left click the close button (x) of the undocked Mission Tree window.
• RIght click the Mission Sequence home item and select Dock Mission Tree.
Command Summary
The Command Summary is a summary of orbit and spacecraft state information after
execution of a command. For example, if the command is a Propagate command, the
Command Summary contains state data after propagation is performed.
To view the Command Summary, right-click on the desired command, and select Com-
mand Summary. Or alternatively, double-click on the desired command, and click the
Command Summary icon located near the lower left corner of the panel. You must run
the mission before viewing Command Summary data.
30
Tour of GMAT Using GMAT
Data Availability
To view a Command Summary, you must first run the mission. If the mission has not
been run during the current session, the Command Summary will be empty. If changes
are made to your configuration, you must rerun the mission for those changes to take
effect in the Command Summary.
Data Contents
The Command Summary contains several types of data. Orbit state representations
include Cartesian, spherical, and Keplerian. For hyperbolic orbits, B-Plane coordinates,
DLA and RLA are provided. Planetodetic information includes Longitude and Latitude
among others. For a Maneuver command, the Maneuver properties are displayed in
the CoordinateSystem specified on the ImpulsiveBurn resource. See the Coordinate
31
Using GMAT Tour of GMAT
Systems subsection below for more information on the command summary contents
when some data is undefined.
In the event when the orbit is nearly singular conic section and/or any of the keplerian
elements are undefined, an abbreviated Command Summary is displayed as shown
in the Coordinate Systems subsection below.
Supported Commands
For performance reasons, propagation in step mode does not write out a command
summary. Additionally, if a command is nested in control logic and that command does
not execute as a result, no command summary data is available.
Coordinate Systems
The Coordinate System menu at the top of the Command Summary dialog allows you
to select the desired coordinate system for the state data. When the Coordinate System
has a celestial body at the origin, the Command Summary shows all supported data
including Cartesian, Spherical, Keplerian, Other OrbitData, and Planetodetic properties
as shown in the GUI screenshot above. When the Coordinate System does not have a
celestial body at the origin, the CommandSummary contains an abbreviated command
summary as shown below.
Note: GMAT currently requires that the selected CoordinateSystem cannot reference
a spacecraft.
Propagate Command: Propagate1
Spacecraft : DefaultSC
Coordinate System: EarthMJ2000Eq
Spacecraft Properties
------------------------------
Cd = 2.200000
32
Tour of GMAT Using GMAT
Output Tree
The Output tree contains data files and plots after a mission is executed. Files consist
of output from ReportFile and EphemerisFile resources. Plots consist of graphical Or-
bitView, GroundTrackPlot, and XYPlots windows.
To display the contents of an output file, double-click the name in the Output tree. A
simple text display window will appear with the contents of the file.
Graphical output is automatically displayed during the mission run, but double-clicking
the name of the output window in the Output tree will bring that display to the front. If
you close the display window, however, you must rerun the mission to display it again.
Script Editor
A GMAT mission can be created in either the graphical user interface (GUI), or in a text
script language. When a mission is loaded into the GUI from a script, or when it is saved
from the GUI, there is a script file that can be accessed from the Scripts folder in the
resources tree. When you open this script, it opens in a dedicated editor window called
the Script Editor. While a GMAT script can be edited in any text editor, the GMAT script
editor offers more features, such as:
• GUI/script synchronization
• Mission execution from the editor
• Syntax highlighting
• Comment/uncomment or indent blocks of text
33
Using GMAT Tour of GMAT
The following figure shows a basic script editor session with the major features labeled.
Active Script
When you load a script into the GMAT GUI, it is added to the script list in the resources
tree. GMAT can have many scripts loaded at any one time, but only one can be syn-
chronized with the GUI. This script is called the active script, and is distinguished by a
bolded name in the script list. The editor status indicator in the script editor for the active
script shows “Active Script” as well. All other scripts are inactive, but can be viewed
and edited in the script editor.
34
Tour of GMAT Using GMAT
To synchronize with the GUI, you must make an inactive script active by clicking either of
the synchronization buttons (described in the next section). This will change the current
script to active, synchronize the GUI, and change the the previously active script to
inactive. Alternately, you can right-click the script name in the resources tree and click
Build.
GUI/Script Synchronization
GMAT provides two separate representations of a mission: a script file and the GUI
resources and mission trees. As shown in Figure 8, you can have both representations
open and active at the same time, and can make changes in both places. The GUI/Script
Sync Status indicator shows the current status of the two representations relative to
each other. The following states are possible:
Synchro- The GUI and script representations are synchronized (they contain the
nized same data).
Script The mission has been modified in the script representation, but has not
Modified been synchronized to the GUI. Use the synchronization buttons in the script
editor to perform this synchronization. To revert the modifications, close
the script editor without saving your changes.
GUI Modi- The mission has been modified in the GUI, but has not been synchronized
fied to the script. To perform this synchronization, click the Save button in the
GMAT toolbar. To revert the modifications, use the synchronization buttons
in the script editor, or restart GMAT itself.
Unsyn- The mission has been modified both in the GUI and in the script. The
chronized changes cannot be merged; you have a choice of whether to save the
modifications in either representations, or whether to revert either of them.
See the notes above for instructions for either case.
Script Er- There is an error in the script. This puts the GUI in a minimal safe state.
ror The error must be corrected before continuing.
Warning
Saving modifications performed in the GUI will overwrite the associated
script. The data will be saved as intended, but with full detail, including fields
and settings that were not explicitly listed in the original script. A copy of
the original script with the extension “.bak” will be saved alongside the new
version.
The script editor provides two buttons that perform synchronization from the script to the
GUI. Both the Save,Sync and the Save,Sync,Run buttons behave identically, except
that the Save,Sync,Run button runs the mission after synchronization is complete. The
following paragraphs describe the behavior of the Save,Sync button only, but the de-
scription applies to both buttons. If you right-click the name of a script in the resources
tree, a context menu is displayed with the items Save, Sync and Save, Sync, Run.
These are identical to the Save,Sync and Save,Sync,Run buttons in the script editor.
35
Using GMAT Tour of GMAT
If the GUI has existing modifications, a confirmation prompt will be displayed. If con-
firmed, the GUI modifications will be overwritten.
If the script is not active, a confirmation prompt will be displayed. If confirmed, the script
will be made active before the steps above are performed.
If the script has errors, the GUI will revert to an empty base state until all errors are
corrected and the script is synchronized successfully.
Scripts List
The scripts folder in the Resources tree contains items for each script that has been
loaded into GMAT. Individual scripts can be added to the list by right-clicking the Scripts
folder and clicking Add Script.
Edit Window
The edit window displays the text of the loaded script and provides tools to edit it. The
edit window provides the following features:
• Line numbering: Line numbers along the left side of the window
• Syntax highlighting: Certain elements of the GMAT script language are colored for
immediate recognition.
• Folding: Script blocks (like For loops, Target sequences, etc.) can be collapsed by
clicking the black downward-pointing triangle to the left of the command that begins
the block.
If you right-click anywhere in the edit window, GMAT will display a context menu with
the following options:
• Undo/Redo: Undo or redo any number of changes since the last time the script was
saved
36
Tour of GMAT Using GMAT
• Cut/Copy/Paste: Cut, copy, or paste over the current selection, or paste the current
clipboard contents at the location of the cursor
• Delete: Delete the current selection
• Select All: Select the entire script contents
When the script editor is active in the GMAT GUI, the Edit menu is also available with
the following options:
• Undo/Redo: Undo or redo any number of changes since the last time the script was
saved
• Cut/Copy/Paste: Cut, copy, or paste over the current selection, or paste the current
clipboard contents at the location of the cursor
• Comment/Uncomment: Add or remove a comment symbol (%) at the beginning of
the current selection
• Select All: Select the entire script contents
• Find/Replace: Starts the Find & Replace utility (see below)
• Show line numbers: When selected (default), the editor window displays line num-
bering to the left of the script contents.
• Goto: Place the cursor on a specific line number
• Indent more/less: Adds or removes an indentation from the current line or selection.
The default indentation is three space characters.
See the Keyboard Shortcuts reference page for the list of keyboard shortcuts that are
available when working in the script editor:
To find text within the active script, type the text you wish to find in the Find What
box and click Find Next or Find Previous. Find Next (F3) will start searching forward
(below) the current cursor position, while Find Previous will start searching backward
(above). If a match is found, the match will be highlighted. You can continue clicking
Find Next or Find Previous to continue searching. The search text (in the Find What
box) can be literal text only; wildcards are not supported. To replace found instances
with different text, type the replacement text in the Replace With box. Click Replace to
replace the currently-highlighted match and highlight the next match, or click Replace
All to replace all matches in the file at once. The Find & Replace utility saves a history of
37
Using GMAT Tour of GMAT
text previously entered in the Find What and Replace With boxes in the current session.
Click the down arrow in each box to choose a previously-entered value.
File Controls
The Save button saves the current script without checking syntax or synchronizing with
the GUI, and without switching the active script. The Save As button is identical, but
allows you to save to a different file.
The Close button closes the script editor, and prompts you to save any unsaved
changes.
38
Using GMAT
Configuring GMAT
Below we discuss the files and data that are distributed with GMAT and are required for
GMAT execution. GMAT uses many types of data files, including planetary ephemeris
files, Earth orientation data, leap second files, and gravity coefficient files. This section
describes how these files are organized and the controls provided to customize them.
File Structure
The default directory structure for GMAT is broken into eight main subdirectories, as
shown in Figure 10. These directories organize the files and data used to run GMAT,
including binary libraries, data files, texture maps, and 3D models. The only two files
in the GMAT root directory are license.txt, which contains the text of the Apache
License 2.0, and README.txt, which contains user information for the current GMAT
release. A summary of the contents of each subdirectory is provided in the sections
below.
bin
The bin directory contains all binary files required for the core functionality of GMAT.
These libraries include the executable file (GMAT.exe on Windows, GMAT.app on the
Mac, and GMAT on Linux) and platform-specific support libraries. The bin directory al-
so contains two text files: gmat_startup_file.txt and gmat.ini. The startup file is
discussed in detail in a separate section below. The gmat.ini file is used to configure
some GUI panels, set paths to external web links, and define GUI tooltip messages.
39
Using GMAT Configuring GMAT
Note
Installing GMAT on a Mac requires some extra steps to handle "transloca-
tion". This is because we build GMAT with GCC and not with Apple tools.
Please see the README file in the GMAT bin directory for instructions on
installing GMAT on Mac.
data
The data directory contains all required data files to run GMAT and is organized ac-
cording to data type, as shown in Figure 11 and described below.
The gravity directory contains gravity coefficient files for each body with a default non-
spherical gravity model. Within each directory, the coefficient files are named according
to the model they represent, and use the extension .cof.
The gui_config directory contains files for configuring some of the GUI dialog boxes
for GMAT resources and commands. These files allow you to easily create a GUI panel
for a user-provided plugin, and are also used by some of the built-in GUI panels.
The planetary_coeff directory contains the Earth orientation parameters (EOP) pro-
vided by the International Earth Rotation Service (IERS) and nutation coefficients for
different nutation theories.
The planetary_ephem directory contains planetary ephemeris data in both DE and SPK
formats. The de directory contains the binary digital ephemeris DE405 files for the 8
40
Configuring GMAT Using GMAT
planets, the Moon, and Pluto developed and distributed by JPL. The spk directory con-
tains the DE421 SPICE kernel and kernels for selected comets, asteroids and moons.
All ephemeris files distributed with GMAT are in the little-endian format.
The time directory contains the JPL leap second kernel naif0010.tls and the GMAT
leap second file tai-utc.dat.
The vehicle directory contains ephemeris data and 3D models for selected spacecraft.
The ephem directory contains SPK ephemeris files, including orbit, attitude, frame, and
time kernels. The models directory contains 3D model files in 3DS or POV format for
use by GMAT’s OrbitView visualization resource.
docs
The docs directory contains end-user documentation, including draft PDF versions of
the Mathematical Specification, Architectural Specification, and Estimation Specifica-
tion. The GMAT User’s Guide is available in the help directory in PDF and HTML for-
mats, and as a Windows HTML Help file.
extras
The extras directory contains various extra convenience files that are helpful for work-
ing with GMAT but aren't part of the core codebase. The only file here so far is a syntax
coloring file for the GMAT scripting language in the Notepad++ text editor.
matlab
The matlab directory contains M-files required for GMAT’s MATLAB interfaces, includ-
ing the interface to the fmincon optimizer. All files in the matlab directory and its subdi-
rectories must be included in your MATLAB path for the MATLAB interfaces to function
properly.
output
The output directory is the default location for file output such as ephemeris files and
report files. If no path information is provided for reports or ephemeris files created during
a GMAT session, then those files will be written to the output folder.
plugins
The plugins directory contains optional plugins that are not required for use of GMAT.
The proprietary directory is used for for third-party libraries that cannot be distributed
freely and is an empty folder in the open source distribution.
samples
The samples directory contains sample missions and scripts, ranging from a Hohmann
transfer to libration point station-keeping to Mars B-plane targeting. Example files begin
41
Using GMAT Configuring GMAT
with "Ex_" and files that correspond to GMAT tutorials begin with "Tut_". These files
are intended to demonstrate GMAT’s capabilities and to provide you with a potential
starting point for building common mission types for your application and flight regime.
Samples with specific requirements are located in subdirectories such as NeedMatlab
and NeedVF13ad.
userfunctions
The userfunctions directory contains MATLAB, Python, and GMAT functions that are
included in the GMAT distribution. You can also store your own custom functions in
the subdirectories named GMAT, Python, and MATLAB. GMAT includes those subdi-
rectories in its search path to locate functions referenced in GMAT scripts and GMAT
functions.
42
Configuring GMAT Using GMAT
Custom plugins are loaded by adding a line to the startup file (bin/
gmat_startup_file.txt) specifying the name and location of the plugin file. In order
for a plugin to work with GMAT, the plugin library must be placed in the folder referenced
in the startup file. For all details, see the Startup File reference.
43
Using GMAT Configuring GMAT
MATLAB_FUNCTION_PATH = ../userfunctions/matlab
If you wish to organize your custom functions in multiple folders, you can add multiple
search paths to the startup file. For example,
MATLAB_FUNCTION_PATH = ../MyFunctions/utils
MATLAB_FUNCTION_PATH = ../MyFunctions/StateConversion
MATLAB_FUNCTION_PATH = ../MyFunctions/TimeConversion
GMAT will search the paths in the order specified in the startup file and will use the first
function with a matching name.
44
Tutorials
The Tutorials section contains in-depth tutorials that show you how to use GMAT for end-to-end
analysis. The tutorials are designed to teach you how to use GMAT in the context of performing
real-world analysis and are intended to take between 30 minutes and several hours to complete.
Each tutorial has a difficulty level and an approximate duration listed with any prerequisites in its
introduction, and are arranged in a general order of difficulty.
Here is a summary of selected Tutorials. For a complete list of tutorials see the Tutorials chapter.
The Simulating an Orbit tutorial is the first tutorial you should take to learn how to use GMAT
to solve mission design problems. You will learn how to specify an orbit and propagate to orbit
periapsis.
The Mars B-Plane Targeting tutorial shows how to use GMAT to design a Mars transfer trajectory
by targeting desired B-plane conditions at Mars.
The Target Finite Burn to Raise Apogee tutorial shows how to raise orbit apogee using finite
maneuver targeting.
Tutorials
Simulating an Orbit
Audience Beginner
Length 30 minutes
Prerequisites None
Script File Tut_SimulatingAnOrbit.script
Note
The most fundamental capability of GMAT is to propagate, or simulate the
orbital motion of, spacecraft. The ability to propagate spacecraft is used
in nearly every practical aspect of space mission analysis, from simple or-
bital predictions (e.g. When will the International Space Station be over my
house?) to complex analyses that determine the thruster firing sequence re-
quired to send a spacecraft to the Moon or Mars.
This tutorial will teach you how to use GMAT to propagate a spacecraft. You will learn
how to configure Spacecraft and Propagator resources, and how to use the Propagate
command to propagate the spacecraft to orbit periapsis, which is the point of minimum
distance between the spacecraft and Earth. The basic steps in this tutorial are:
1. In the Resources tree, double-click Sat. Click the Orbit tab if it is not already selected.
47
Tutorials Simulating an Orbit
2. In the Epoch Format list, select UTCGregorian. You’ll see the value in the Epoch
field change to the UTC Gregorian epoch format.
3. In in the Epoch box, type 22 Jul 2014 11:29:10.811. This field is case-sensitive,
and must be entered in the exact format shown.
4. Click Apply or press the ENTER key to save these changes.
1. In the StateType list, select Keplerian. In the Elements list, you will see the GUI
reconfigure to display the Keplerian state representation.
2. In the SMA box, type 83474.318.
3. Set the remaining orbital elements as shown in the table below.
Field Value
ECC 0.89652
INC 12.4606
RAAN 292.8362
AOP 218.9805
TA 180
4. Click OK.
5. Click Save ( ). If this is the first time you have saved the mission, you’ll be prompted
to provide a name and location for the file.
48
Simulating an Orbit Tutorials
49
Tutorials Simulating an Orbit
5. Click the Select button next to the Point Masses box. This opens the CelesBodyS-
electDialog window.
6. In the Available Bodies list, click Sun, then click -> to add Sun to the Selected
Bodies list.
7. Add the moon (named Luna in GMAT) in the same way.
8. Click OK to close the CelesBodySelectDialog.
9. Select Use Solar Radiation Pressure to toggle it on. Your screen should now match
Figure 13.
10.Click OK.
Now you will configure an OrbitView plot so you can visualize Sat and its trajectory.
The orbit of Sat is highly eccentric. To view the entire orbit at once, we need to adjust
the settings of DefaultOrbitView.
50
Simulating an Orbit Tutorials
51
Tutorials Simulating an Orbit
52
Simulating an Orbit Tutorials
You will see GMAT propagate the orbit and stop at orbit periapsis. Figure 17 illustrates
what you should see after correctly completing this tutorial. Here are a few things you
can try to explore the results of this tutorial:
1. Manipulate the DefaultOrbitView plot using your mouse to orient the trajectory so
that you can to verify that at the final location the spacecraft is at periapsis. See the
OrbitView reference for details.
2. Display the command summary:
53
Tutorials Simulating an Orbit
54
Tutorials
In this tutorial, we will use GMAT to perform a Hohmann transfer from a low-Earth park-
ing orbit to a geosynchronous mission orbit. This requires a targeting sequence to de-
termine the required maneuver magnitudes to achieve the desired final orbit conditions.
In order to focus on the configuration of the targeter, we will make extensive use of the
default configurations for spacecraft, propagators, and maneuvers.
The target sequence employs two velocity-direction maneuvers and two propagation
sequences. The purpose of the first maneuver is to raise orbit apoapsis to 42,165 km,
the geosynchronous radius. The purpose of the second maneuver is to nearly circularize
the orbit and yield a final eccentricity of 0.005. The basic steps of this tutorial are:
55
Tutorials Simple Orbit Transfer
DefaultProp is configured to use Earth as the central body with a nonspherical gravity
model of degree and order 4. You may want to open the dialog boxes for these objects
and inspect them more closely as we will leave them at their default settings.
56
Simple Orbit Transfer Tutorials
1. In the Mission tree, right-click Prop To Periapsis, point to Insert After, and click
Target. This will insert two separate commands: Target1 and EndTarget1.
2. Right-click Target1 and click Rename.
3. Type Hohmann Transfer and click OK.
4. Right-click Hohmann Transfer, point to Append, and click Vary.
5. Rename Vary1 to Vary TOI.
6. Complete the Target sequence by appending the commands in Table 3.
57
Tutorials Simple Orbit Transfer
Note
Let’s discuss what the Target sequence does. We know that two maneuvers
are required to perform the Hohmann transfer. We also know that for our
current mission, the final orbit radius must be 42,165 km and the final orbital
eccentricity must be 0.005. However, we don’t know the size (or #V magni-
tudes) of the maneuvers that precisely achieve the desired orbital conditions.
You use the Target sequence to solve for those precise maneuver values.
You must tell GMAT what controls are available (in this case, two maneu-
vers) and what conditions must be satisfied (in this case, a specific orbital
radius and eccentricity). You accomplish this using the Vary and Achieve
commands. Using the Vary command, you tell GMAT what to solve for—in
this case, the #V values for TOI and GOI. You use the Achieve command
to tell GMAT what conditions the solution must satisfy—in this case, the final
orbital conditions.
1. In the Mission tree, right-click End Hohmann Transfer, point to Insert After, and
click Propagate. A new Propagate3 command will appear.
2. Rename Propagate3 to Prop One Day.
3. Double-click Prop One Day to edit its properties.
4. Under Condition, replace the value 12000.0 with 86400, the number of seconds
in one day.
5. Click OK to save these changes.
58
Simple Orbit Transfer Tutorials
Now that the structure is created, we need to configure the various parts of the Target
sequence to do what we want.
1. Double-click Vary TOI to edit its properties. Notice that the variable in the Variable
box is TOI.Element1, which by default is the velocity component of TOI in the local
Velocity-Normal-Binormal (VNB) coordinate system. That’s what we need, so we’ll
keep it.
2. In the Initial Value box, type 1.0.
3. In the Max Step box, type 0.5.
4. Click OK to save these changes.
1. Double-click Perform TOI to edit its properties. Notice that the command is already
set to apply the TOI burn to the DefaultSC spacecraft, so we don’t need to change
anything here.
2. Click OK.
59
Tutorials Simple Orbit Transfer
60
Simple Orbit Transfer Tutorials
61
Tutorials Simple Orbit Transfer
62
Simple Orbit Transfer Tutorials
If you were to continue developing this mission, you can store the final solution of the
Target sequence as the initial conditions of the TOI and GOI resources themselves,
so that if you make small changes, the subsequent runs will take less time. To do this,
follow these steps:
63
64
Tutorials
Note
One of the most common operational problems in space mission design is
the design of a finite burn that achieves a given orbital goal. A finite burn
model, as opposed to the idealized impulsive burn model used for preliminary
design, is needed to accurately model actual spacecraft maneuvers.
In this tutorial, we will use GMAT to perform a finite burn for a spacecraft in low Earth
orbit. The goal of this finite burn is to achieve a certain desired apogee radius. Since
the most efficient orbital location to affect apoapsis is at periapsis, the first step in this
tutorial is to propagate the spacecraft to perigee.
To calculate the duration of the perigee burn needed to achieve a desired apogee radius
of 12000 km, we must create the appropriate targeting sequence. The main portion
of the target sequence employs a Begin/End FiniteBurn command pair, for a velocity
direction maneuver, followed by a command to propagate the spacecraft to orbit apogee.
65
Tutorials Target Finite Burn to Raise
Apogee
To model thrust and fuel use associated with a finite burn, we must create a Chemi-
calThruster and a ChemicalTank and then attach the newly created ChemicalTank
to the ChemicalThruster.
1. In the Resources tree, right-click on the Hardware folder, point to Add, and click
ChemicalThruster. A resource named ChemicalThruster1 will be created.
2. In the Resources tree, right-click on the Hardware folder, point to Add, and click
ChemicalTank. A resource named ChemicalTank1 will be created.
3. Double-click ChemicalThruster1 to edit its properties.
4. Select the Decrement Mass box so that GMAT will model fuel use associated with
a finite burn.
5. Use the drop down menu to the right of the Tank field to select ChemicalTank1 as
the fuel source for ChemicalThruster1. Click OK.
Figure 29 below shows the default ChemicalTank1 configuration that we will use and
Figure 30 shows the finished ChemicalThruster1 configuration.
66
Target Finite Burn to Raise Tutorials
Apogee
Note that the default Thruster1 Coordinate System, as shown in Figure 30, is Earth-
based Velocity, Normal, Bi-normal (VNB) and that the default Thrust Vector of (1,0,0)
represents our desired velocity oriented maneuver direction.
For a general finite burn, if desired, we can specify how both the thrust and the fuel use
depend upon fuel tank pressure. The user does this by inputting coefficients of certain
pre-defined polynomials. To view the values for the thrust coefficients, click the Edit
Thruster Coef. button and to view the ISP coefficients which determine fuel use, click
the Edit Impulse Coef. button. For this tutorial, we will use the default ISP polynomial
coefficient values but we will change the ChemicalThruster1 polynomial coefficients
as follows.
67
Tutorials Target Finite Burn to Raise
Apogee
The exact form of the pre-defined Thrust polynomial, associated with the coefficients
above, are given in the ChemicalThruster help. We note that, by default, all of the
Thrust coefficients associated with terms that involve tank pressure are zero. We have
kept the default zero values for all of these coefficients. We simply changed the constant
term in the Thrust polynomial from 10 to 1000 which is much larger than the thrust for
a typical chemical thruster. The Thrust and ISP polynomials used in this tutorial are
shown below.
68
Target Finite Burn to Raise Tutorials
Apogee
2. Select the Tanks tab. In the Available Tanks column, select ChemicalTank1.
Then click the right arrow button to add ChemicalTank1 to the SelectedTanks list.
Click Apply.
3. Select the Actuators tab. In the Available Thrusters column, select Chemi-
calThruster1. Then click the right arrow button to add ChemicalThruster1 to the
SelectedThrusters list. Click OK.
69
Tutorials Target Finite Burn to Raise
Apogee
1. In the Resources tree, right-click the Burns folder and add a FiniteBurn. A re-
source named FiniteBurn1 will be created.
2. Double-click FiniteBurn1 to edit its properties.
3. Use the menu to the right of the Thruster field to select ChemicalThruster1 as the
thruster associated with FiniteBurn1. Click OK.
70
Target Finite Burn to Raise Tutorials
Apogee
The Target sequence we will later create uses the Vary command to adjust a user de-
fined target control variable in order to achieve the desired orbital goal of raising apogee
to 12000 km. We must first create this variable which we will name BurnDuration.
71
Tutorials Target Finite Burn to Raise
Apogee
1. In the Mission tree, right-click Prop To Perigee, point to Insert After, and click
Target. This will insert two separate commands: Target1 and EndTarget1.
2. Right-click Target1 and click Rename. Type Raise Apogee and click OK.
3. Right-click Raise Apogee, point to Append, and click Vary. Rename the newly
created command as Vary Burn Duration.
4. Right-click Vary Burn Duration, point to Insert After, and click BeginFiniteBurn.
Rename the newly created command as Turn Thruster On.
72
Target Finite Burn to Raise Tutorials
Apogee
1. Double-click Vary Burn Duration to edit its properties. We want this command to
adjust (or “Vary”) the finite burn duration represented by the previously created
control variable, BurnDuration. To accomplish this, click on the Edit button to bring
up the ParameterSelectDialog. Use the ObjectType menu to select the Variable
object type. The ObjectList menu will then display a list of user defined variables.
Double-click on the variable, BurnDuration, so that BurnDuration appears in the
SelectedValues(s) menu. Click the OK button to save the changes and return to
the Vary Burn Duration command menu.
73
Tutorials Target Finite Burn to Raise
Apogee
1. Double-click Turn Thruster On to edit its properties. Notice that the command is
already set to apply FiniteBurn1 to the DefaultSC spacecraft, so we don’t need
to change anything here.
2. Click OK.
74
Target Finite Burn to Raise Tutorials
Apogee
75
Tutorials Target Finite Burn to Raise
Apogee
76
Target Finite Burn to Raise Tutorials
Apogee
As shown below, we inspect the output message window to determine the number of
iterations it took the DifferentialCorrector to converge and the final value of the control
variable, BurnDuration. Verify that you obtained a similar value for BurnDuration.
BurnDuration = 1213.19316329
77
Tutorials Target Finite Burn to Raise
Apogee
1. In the Mission tree, select Prop To Perigee, then right-click to open the associat-
ed Command Summary which describes the state of DefaultSC after the Prop
To Perigee command has been performed. We verify perigee has indeed been
achieved by finding the mean anomaly value of DefaultSC. To do this, we look at
the value of MA under the Keplerian State. As expected, the mean anomaly is zero.
2. View the Turn Thruster On command summary. Note that, as expected, prior to
the start of the maneuver, the fuel mass is 756 kg.
3. View the Turn Thruster Off command summary.
a. Note that the mean anomaly at the end of the maneuver is 25.13 degrees.
Thus, as the burn occurred, the mean anomaly increased from 0 to 25.13 de-
grees. By orbital theory, we know that an apogee raising burn is best performed
at perigee. Thus, we may be able to achieve our orbital goal using less fuel if
we “center” the burn. For example, we could try starting our burn at a mean
anomaly of –(25.13/2) instead of 0 degrees.
b. Note that, at the end of the maneuver, the fuel mass is 343.76990815648 kg.
Thus, this finite burn used approximately 756 – 343.8 = 412.2 kg of fuel.
4. View the Prop To Apogee command summary.
a. We note that the mean anomaly is 180 degrees which proves that we are in-
deed at apogee.
b. We note that the orbital radius (RMAG) is 11999.999998192 km which proves
that we have achieved our desired 12000 km apogee radius to within our de-
sired tolerance of 0.1 km.
78
Tutorials
Note
One of the most challenging problems in space mission design is to design
an interplanetary transfer trajectory that takes the spacecraft within a very
close vicinity of the target planet. One possible approach that puts the space-
craft close to a target planet is by targeting the B-Plane of that planet. The
B-Plane is a planar coordinate system that allows targeting during a gravity
assist. It can be thought of as a target attached to the assisting body. In ad-
dition, it must be perpendicular to the incoming asymptote of the approach
hyperbola. Figure 46 and Figure 47 show the geometry of the B-Plane and
B-vector as seen from a viewpoint perpendicular to orbit plane. To read more
on B-Planes, please consult the GMATMathSpec document. A good exam-
ple involving the use of B-Plane targeting is a mission to Mars. Sending a
spacecraft to Mars can be achieved by performing a Trajectory Correction
Maneuver (TCM) that targets Mars B-Plane. Once the spacecraft gets close
to Mars, then an orbit insertion maneuver can be performed to capture into
Mars orbit.
79
Tutorials Mars B-Plane Targeting
In this tutorial, we will use GMAT to model a mission to Mars. Starting from an out-going
hyperbolic trajectory around Earth, we will perform a TCM to target Mars B-Plane. Once
we are close to Mars, we will adjust the size of the maneuver to perform a Mars Orbit
Insertion (MOI) to achieve a final elliptical orbit with an inclination of 90 degrees. Meeting
these mission objectives requires us to create two separate targeting sequences. In
order to focus on the configuration of the two targeters, we will make extensive use of
the default configurations for spacecraft, propagators, and maneuvers.
The first target sequence employs maneuvers in the Earth-based Velocity (V), Normal
(N) and Bi-normal (B) directions and includes four propagation sequences. The purpose
of the maneuvers in VNB directions is to target BdotT and BdotR components of the B-
vector. BdotT is targeted to 0 km and BdotR is targeted to a non-zero value to generate
a polar orbit that has inclination of 90 degrees. BdotR is targeted to -7000 km to avoid
having the orbit intersect Mars, which has a radius of approximately 3396 km.
The second target sequence employs a single, Mars-based anti-velocity direction (-V)
maneuver and includes one propagation sequence. This single anti-velocity direction
maneuver will occur at periapsis. The purpose of the maneuver is to achieve MOI by
targeting position vector magnitude of 12,000 km at apoapsis. The basic steps of this
tutorial are:
1. Modify the DefaultSC to define spacecraft’s initial state. The initial state is an out-
going hyperbolic trajectory that is with respect to Earth.
2. Create and configure a Fuel Tank resource.
3. Create two ImpulsiveBurn resources with default settings.
4. Create and configure three Propagators: NearEarth, DeepSpace and NearMars
5. Create and configure DifferentialCorrector resource.
6. Create and configure three DefaultOrbitView resources to visualize Earth, Sun
and Mars centered trajectories.
80
Mars B-Plane Targeting Tutorials
7. Create and configure three CoordinateSystems: Earth, Sun and Mars centered.
8. Create first Target sequence to target BdotT and BdotR components of the B-
vector.
9. Create second Target sequence to implement MOI by targeting position magnitude
at apoapsis.
10. Run the mission and analyze the results.
We need to create a fuel tank in order to see how much fuel is expended after each
impulsive burn. We will modify DefaultSC resource later and attach the fuel tank to the
spacecraft.
1. In the Resources tree, right-click the Hardware folder, point to Add and click
ChemicalTank. A new resource called ChemicalTank1 will be created.
2. Right-clickChemicalTank1 and click Rename.
3. In theRename box, type MainTank and click OK.
4. Double click onMainTank to edit its properties.
5. Set the values shown in the table below.
Field Value
Fuel Mass 1718
Fuel Density 1000
Pressure 5000
Volume 2
1. In the Resources tree, under Spacecraft folder, right-click DefaultSC and click
Rename.
2. In the Rename box, type MAVEN and click OK.
81
Tutorials Mars B-Plane Targeting
3. Double-click on MAVEN to edit its properties. Make sure Orbit tab is selected.
4. Set the values shown in the table below.
Field Value
Epoch Format UTCGregorian
Epoch 18 Nov 2013 20:26:24.315
Coordinate System EarthMJ2000Eq
State Type Keplerian
SMA under Elements -32593.21599272796
ECC under Elements 1.202872548116185
INC under Elements 28.80241266404142
RAAN under Elements 173.9693759331483
AOP under Elements 240.9696529532764
TA under Elements 359.9465533778069
We’ll need two ImpulsiveBurn resources for this tutorial. Below, we’ll rename the de-
fault ImpulsiveBurn and create a new one. We’ll also select the fuel tank that was cre-
ated earlier in order to access fuel for the burns.
1. In the Resources tree, under the Burns folder, right-click DefaultIB and click Re-
name.
2. In the Rename box, type TCM, an acronym for Trajectory Correction Maneuver and
click OK to edit its properties.
3. Double-Click TCM to edit its properties to edit its properties.
4. Check Decrement Mass under Mass Change.
5. For Tank field under Mass Change, select MainTank from drop down menu.
6. Click OK to save these changes.
7. Right-click theBurns folder, point to Add, and click ImpulsiveBurn. A new resource
called ImpulsiveBurn1 will be created.
8. Rename the new ImpulsiveBurn1 resource to MOI, an acronym for Mars Orbit
Insertion and click OK.
9. Double-click MOI to edit its properties.
82
Mars B-Plane Targeting Tutorials
We’ll need to add three propagators for this tutorial. Below, we’ll rename the default
DefaultProp and create two more propagators.
1. In the Resources tree, under the Propagators folder, right-click DefaultProp and
click Rename.
2. In the Rename box, type NearEarth and click OK.
3. Double-click on NearEarth to edit its properties.
4. Set the values shown in the table below.
Field Value
Initial Step Size under Integrator 600
Accuracy under Integrator 1e-013
Min Step Size under Integrator 0
Max Step Size under Integrator 600
Model under Gravity JGM-2
Degree under Gravity 8
Order under Gravity 8
Atmosphere Model under Drag None
Point Masses under Force Model Add Luna and Sun
Use Solar Radiation Pressure under Force Model Check this field
83
Tutorials Mars B-Plane Targeting
84
Mars B-Plane Targeting Tutorials
Two Target sequences that we will create later need a DifferentialCorrector resource
to operate, so let’s create one now. We'll leave the settings at their defaults.
The BdotT and BdotR constraints that we will define later under the first Target se-
quence require us to create a coordinate system. Orbit View resources that we will cre-
ate later also need coordinate system resources to operate. We will create Sun and
Mars centered coordinate systems. So let’s create them now.
1. In the Resources tree, right-click the Coordinate Systems folder and click Add
Coordinate System. A new Dialog box is created with a title New Coordinate
System.
2. Type SunEcliptic under Coordinate System Name box.
3. Under Origin field, select Sun.
4. For Type under Axes, select MJ2000Ec.
5. Click OK to save these changes. You’ll see that a new coordinate system SunEclip-
tic is created under Coordinate Systems folder.
6. Right-click the Coordinate Systems folder and click Add Coordinate System. A
new Dialog Box is created with a title New Coordinate System.
7. Type MarsInertial under Coordinate System Name box.
8. Under Origin field, select Mars.
9. For Type under Axes, select BodyInertial.
10. Click OK to save these changes. You’ll see that a new coordinate system MarsIn-
ertial is created under Coordinate Systems folder.
We’ll need three DefaultOrbitView resources for this tutorial. Below, we’ll rename the
default DefaultOrbitView and create two new ones. We need three graphics windows
in order to visualize spacecraft’s trajectory centered around Earth, Sun and then Mars
1. In the Resources tree, under Output folder, right-click DefaultOrbitView and click
Rename.
2. In the Rename box, type EarthView and click OK.
3. In the Output folder, delete DefaultGroundTrackPlot.
4. Double-click EarthView to edit its properties.
5. Set the values shown in the table below.
85
Tutorials Mars B-Plane Targeting
Field Value
View Scale Factor under View Definition 4
View Point Vector boxes, under View Definition 0, 0, 30000
Field Value
From Celestial Object under View Object, add fol- Mars, Sun (Do not remove
lowing objects to Selected Celestial Object box Earth)
Coordinate System under View Definition SunEcliptic
View Point Reference under View Definition Sun
View Point Vector boxes, under View Definition 0, 0, 5e8
View Direction under View Definition Sun
Coordinate System under View Up Definition SunEcliptic
Field Value
From Celestial Object under View Object, add fol- Mars (You don’t have to re-
lowing object to Selected Celestial Object box move Earth)
Coordinate System under View Definition MarsInertial
View Point Reference under View Definition Mars
View Point Vector boxes, under View Definition 22000, 22000, 0
View Direction under View Definition Mars
Coordinate System under View Up Definition MarsInertial
86
Mars B-Plane Targeting Tutorials
The second Target sequence will perform the MOI maneuver so that the spacecraft can
orbit around Mars, but that sequence will be created later.
87
Tutorials Mars B-Plane Targeting
Command Name
Propagate Prop 12 Days to TCM
Vary Vary TCM.V
Vary Vary TCM.N
Vary Vary TCM.B
Maneuver Apply TCM
Propagate Prop 280 Days
Propagate Prop to Mars Periapsis
Achieve Achieve BdotT
Achieve Achieve BdotR
Note
Let’s discuss what the first Target sequence does. We know that a maneu-
ver is required to perform the B-Plane targeting. We also know that the de-
sired B-Plane coordinate values for BdotT and BdotR are 0 and -7000 km,
resulting in a polar orbit with 90 degree inclination. However, we don’t know
the size (or #V magnitude) and direction of the TCM maneuver that will pre-
cisely achieve the desired orbital conditions. We use the Target sequence
to solve for those precise maneuver values. We must tell GMAT what con-
trols are available (in this case, three controls associated with three compo-
nents of the TCM maneuver) and what conditions must be satisfied (in this
case, BdotT and BdotR values). You accomplish this by using the Vary and
Achieve commands. Using the Vary command, you tell GMAT what to solve
for—in this case, the #V value and direction for TCM. You use the Achieve
command to tell GMAT what conditions the solution must satisfy—in this
case, BdotT and BdotR values that result in a 90 degree inclination.
88
Mars B-Plane Targeting Tutorials
89
Tutorials Mars B-Plane Targeting
1. Double-click Vary TCM.V to edit its properties. Notice that the variable in the Vari-
able box is TCM.Element1, which by default is the velocity component of TCM in
the local Velocity-Normal-Binormal (VNB) coordinate system. That’s what we need,
so we’ll keep it.
2. In the Initial Value box, type 1e-005.
3. In the Perturbation box, type 0.00001.
4. In the Lower box, type -10e300.
5. In the Upper box, type 10e300.
6. In the Max Step box, type 0.002.
7. Click OK to save these changes.
90
Mars B-Plane Targeting Tutorials
1. Double-click Vary TCM.N to edit its properties. Notice that the variable in the Vari-
able box is still TCM.Element1, which by default is the velocity component of TCM
in the local VNB coordinate system. We need to insert TCM.Element2 which is the
normal component of TCM in the local VNB coordinate system. So let’s do that.
2. Next to Variable, click the Edit button..
3. Under Object List, click TCM.
4. In the Object Properties list, double-click Element2 to move it to the Selected
Value(s) list. See the image below for results.
5. Click OK to close the ParameterSelectDialog window.
6. Notice that the variable in the Variable box is now TCM.Element2.
7. In the Initial Value box, type 1e-005.
8. In the Perturbation box, type 0.00001.
9. In the Lower box, type -10e300.
10. In the Upper box, type 10e300.
11. In the Max Step box, type 0.002.
12. Click OK to save these changes.
91
Tutorials Mars B-Plane Targeting
92
Mars B-Plane Targeting Tutorials
93
Tutorials Mars B-Plane Targeting
• Double-click Apply TCM to edit its properties. Notice that the command is already
set to apply the TCM burn to the MAVEN spacecraft, so we don’t need to change
anything here.
94
Mars B-Plane Targeting Tutorials
95
Tutorials Mars B-Plane Targeting
96
Mars B-Plane Targeting Tutorials
97
Tutorials Mars B-Plane Targeting
98
Mars B-Plane Targeting Tutorials
99
Tutorials Mars B-Plane Targeting
1. In the Mission tree, double-click Target desired B-plane Coordinates to edit its
properties.
2. Click Apply Corrections.
3. Click OK to save these changes.
4. Now re-run the mission. If you inspect the results in the message window, you will
see that the first Target sequence converges in one iteration. This is because you
stored the solution as the initial conditions.
100
Mars B-Plane Targeting Tutorials
5. In the Mission tree, double-click Vary TCM.V, Vary TCM.N and Vary TCM.B, you
will notice that the values in Initial Value box have been updated to the final solution
of the first Target sequence.
If you want to know TCM maneuver’s delta-V vector values and how much fuel was
expended during the maneuver, do the following steps:
1. In the Mission tree, right-click Apply TCM, and click on Command Summary.
2. Scroll down and under Maneuver Summary heading, values for delta-V vector are:
Delta V Vector:
Just to make sure that the goals of first Target sequence were met successfully, let us
access command summary for Prop to Mars Periapsis command by doing the following
steps:
1. In the Mission tree, right-click Prop to Mars Periapsis, and click on Command
Summary.
2. Under Coordinate System, select MarsInertial.
3. Under Hyperbolic Parameters heading, see the values of BdotT and BdotR.
Under Keplerian State, see the value for INC. You can see that the desired B-
Plane coordinates were achieved which result in a 90 degree inclined trajectory:
BdotT = -0.0000053320678 km
BdotR = -7000.0000019398 km
Now let’s create the commands necessary to perform the second Target sequence.
Figure 65 illustrates the configuration of the Mission tree after you have completed the
101
Tutorials Mars B-Plane Targeting
steps in this section. Notice that in Figure 65, the second Target sequence is created
after the first Target sequence. We’ll discuss the second Target sequence after it has
been created.
Command Name
Maneuver Apply MOI
Propagate Prop to Mars Apoapsis
Achieve Achieve RMAG
102
Mars B-Plane Targeting Tutorials
Note
Let’s discuss what the second Target sequence does. We know that a ma-
neuver is required for the Mars capture orbit. We also know that the desired
radius of capture orbit at apoapsis must be 12,000 km. However, we don’t
know the size (or #V magnitude) of the MOI maneuver that will precisely
achieve the desired orbital conditions. You use the second Target sequence
to solve for that precise maneuver value. You must tell GMAT what controls
are available (in this case, a single maneuver) and what conditions must
be satisfied (in this case, radius magnitude value). Once again, just like in
the first Target sequence, here we accomplish this by using the Vary and
Achieve commands. Using the Vary command, you tell GMAT what to solve
for—in this case, the #V value for MOI. You use the Achieve command to tell
GMAT what conditions the solution must satisfy—in this case, RMAG value
of 12,000 km.
We need a Propagate command after the second Target sequence so that we can see
our final orbit.
1. In the Mission tree, right-click End Mars Capture, point to Insert After, and click
Propagate. A new Propagate6 command will appear.
2. Right-click Propagate6 and click Rename.
3. Type Prop for 1 day and click OK.
4. Double-click Prop for 1 day to edit its properties.
5. Under Propagator, replace NearEarth with NearMars.
6. Under Parameter, replace MAVEN.ElapsedSeconds with MAVEN.ElapsedDays.
7. Under Condition, replace the value 0.0 with 1.
8. Click OK to save these changes
103
Tutorials Mars B-Plane Targeting
104
Mars B-Plane Targeting Tutorials
1. Double-click Vary MOI.V to edit its properties. Notice that the variable in the Vari-
able box is TCM.Element1. We want MOI.Element1 which is the velocity compo-
nent of MOI in the local VNB coordinate system. So let’s change that.
2. Next to Variable, click the Edit button.
3. Under Object List, click MOI.
4. In the Object Properties list, double-click Element1 to move it to the Selected
Value(s) list. See the image below for results.
5. Click OK to close the ParameterSelectDialog window.
6. In the Initial Value box, type -1.0.
7. In the Perturbation box, type 0.00001.
8. In the Lower box, type -10e300.
9. In the Upper box, type 10e300.
10. In the Max Step box, type 0.1.
11. Click OK to save these changes.
105
Tutorials Mars B-Plane Targeting
106
Mars B-Plane Targeting Tutorials
107
Tutorials Mars B-Plane Targeting
As the mission runs, you will see GMAT solve the second Target sequence’s targeting
problem. Each iteration and perturbation is shown in MarsView windows in light blue,
and the final solution is shown in red. After the mission completes, the MarsView 3D
view should appear as in the image shown below. EarthView and SolarSystemView
3D views are same as before. You may want to run the mission several times to see
the targeting in progress.
108
Mars B-Plane Targeting Tutorials
If you were to continue developing this mission, you can store the final solution of the
second Target sequence as the initial condition of MOI resource. This is so that when
109
Tutorials Mars B-Plane Targeting
you make small changes, the subsequent runs will take less time. To do this, follow
these steps:
If you want to know MOI maneuver’s delta-V vector values and how much fuel was
expended during the maneuver, do the following steps:
1. In the Mission tree, right-click Apply MOI, and click on Command Summary.
2. Scroll down and under Maneuver Summary heading, values for delta-V vector are:
Delta V Vector:
Just to make sure that the goal of second Target sequence was met successfully, let us
access command summary for Achieve RMAG command by doing the following steps:
1. In the Mission tree, right-click Achieve RMAG, and click on Command Summary.
2. Under Coordinate System, select MarsInertial.
3. Under Keplerian State and and Spherical State headings, see the values of
TA and RMAG. You can see that the desired radius of the capture orbit at apoapsis
was achieved successfully:
TA = 180.00000241484 deg
RMAG = 12000.019889021 km
110
Tutorials
Note
For highly elliptic earth orbits (HEO), it is often cheaper to use the Moon’s
gravity to raise periapsis or to perform plane changes, than it is to use
the spacecraft’s propulsion resources. However, designing lunar flyby’s to
achieve multiple specific mission constraints is non-trivial and requires mod-
ern optimization techniques to minimize fuel usage while simultaneously sat-
isfying trajectory constraints. In this tutorial, you will learn how to design flyby
trajectories by writing a GMAT script to perform multiple shooting optimiza-
tion. As the analyst, your goal is to design a lunar flyby that provides a mis-
sion orbit periapsis of TBD km and changes the inclination of the mission
orbit to TBD degrees. (Note: There are other mission constraints that will be
discussed in more detail below.)
To efficiently solve the problem, we will employ the Multiple Shooting Method
to break down the sensitive boundary value problem into smaller, less sen-
sitive problems. We will employ three trajectory segments. The first segment
will begin at Transfer Orbit Insertion (TOI) and will propagate forward; the
second segment is centered at lunar periapsis and propagates both forward
and backwards. The third segment is centered on Mission Orbit Insertion
(MOI) and propagates forwards and backwards. See figures 1 and 2 that
illustrate the final orbit solution and the “Control Points” and “Patch Points”
used to solve the problem.
To begin this tutorial we start with a several views of the solution to provide a physical
understanding of the problem. In Fig. 1, an illustration of a lunar flyby is shown with the
trajectory displayed in red and the Moon’s orbit displayed in yellow. The Earth is at the
center of the frame. We require that the following constraints are satisfied at TOI:
111
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
At lunar flyby, we only require that the flyby altitude is greater than 100 km. This con-
straint is satisfied implicitly so we will not explicitly script this constraint. An insertion
maneuver is performed at earth perigee after the lunar fly to insert into the mission orbit.
The following constraints must be satisfied after MOI.
Note: (Phasing with the moon is important for these orbits but design considerations for
lunar phasing are beyond the scope of this tutorial)
112
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
Figure 3 illustrates the mission timeline and how control points and patch points are
defined. Control points are drawn using a solid blue circle and are defined as locations
where the state of the spacecraft is treated as an optimization variable. Patch points
are drawn with an empty blue circle and are defined as locations where position and/
or velocity continuity is enforced. For this tutorial, we place control points at TOI, the
lunar flyby and MOI. At each control point, the six Cartesian state elements, and the
epoch are varied for a total of 18 optimization variables. At the MOI control point, there
is an additional optimization variable for the delta V (in the velocity direction) to insert
into the mission orbit.
Notice that while there are only three control points, we have 5 segments (which will
result in 5 spacecraft). The state at the lunar flyby, which is defined as a control point, is
propagated backwards to a patch point and forwards to a patch point. The same occurs
for the MOI control point. To design this trajectory, you will need to create the following
GMAT resources.
113
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
After creating the resources using script snippets you will construct the optimization
sequence using GMAT script. Pseudo-code for the optimization sequence is shown
below.
After constructing the basic optimization sequence we will perform the following steps:
%----------------------------------------------------
% Configure coordinate systems
%----------------------------------------------------
114
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
MoonMJ2000Eq.Axes = MJ2000Eq
%----------------------------------------------------
% Configure spacecraft
%----------------------------------------------------
115
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
bation. The ForceModel named NearMoonForceModel is similar but uses point mass
gravity for all bodies. Note that the integrators are configured for performance and not for
accuracy to improve run times for the tutorial. There are times when integrator accuracy
can cause issues with optimizer performance due to noise in the numerical solutions.
%----------------------------------------------------
% Configure propagators and force models
%----------------------------------------------------
%----------------------------------------------------
% Configure maneuvers
%----------------------------------------------------
116
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
MOI.CoordinateSystem = Local
MOI.Origin = Earth
MOI.Axes = VNB
%----------------------------------------------------
% Create user data: variables, arrays, strings
%----------------------------------------------------
%----------------------------------------------------
% Configure solvers
%----------------------------------------------------
117
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
NLPOpt.ReportStyle = Normal
NLPOpt.ReportFile = 'VF13adVF13ad1.data'
NLPOpt.MaximumIterations = 200
NLPOpt.Tolerance = 1e-004
NLPOpt.UseCentralDifferences = false
NLPOpt.FeasibilityTolerance = 0.1
%----------------------------------------------------
% Configure plots, reports, etc.
%----------------------------------------------------
Create XPPlots/Reports
Below we create several XYPlots and a ReportFile. We will use XYPlots to monitor
the progress of the optimizer in satisfying constraints. PositionError1 plots the position
error at the first patch point... VelocityError2 plots the velocity error at the second patch
118
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
point, and so on. OrbitDimErrors plots the errors in the periapsis and apoapsis radii
for the mission orbit. When optimization is proceeding as expected, these plots should
show errors driven to zero.
Create a ReportFile to allow reporting useful information to a text file for review after
the optimization process is complete.
119
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
debugData.WriteHeaders = Off
debugData.LeftJustify = On
debugData.ZeroFill = Off
debugData.ColumnWidth = 20
debugData.WriteReport = false
The time variables launchEpoch, flybyEpoch and moiEpoch are the TAI modified
Julian epochs of the launch, flyby, and MOI. It is not obvious yet that these are
TAI modified Julian epochs, but later we use statements like this to set the epoch:
satTOI.Epoch.TAIModJulian = launchEpoch. Recall that we previously set up the
spacecraft to used coordinate systems appropriate to the problem. Setting satTOI.X
sets the quantity in EarthMJ2000Eq and satFlyBy_Forward.X sets the quantity in
MoonMJ2000Eq because of the configuration of the spacecraft.
BeginMissionSequence
120
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
EndScript
Initialize Variables
The script below is used to define some constants and to define the values for vari-
ous constraints applied to the trajectory. Pay particular attention to the constraint val-
ues and time values. For example, the variable conTOIPeriapsis defines the periap-
sis radius at launch constraint to be at about 285 km (geodetics will cause altitude to
vary slightly). The variable conMOIApoapsis defines the mission orbit apoapsis to be
60 earth radii. The variables patchOneElapsedDays, patchTwoElapsedDays, and
refEpoch are particularly important as they define the epochs of the patch points lat-
er in the script using lines like this patchOneEpoch = refEpoch + patchOneElapsed-
DayspatchOneEpoch. The preceding line defines the epoch of the first patch point
to be one day after refEpoch (refEpoch is set to launchEpoch). Similarly, the epoch
of the second patch point is defined as 13 days after refEpoch. Note, the patch point
epochs can be treated as optimization variables but that was not done to reduce com-
plexity of the tutorial.
% Some constants
earthRadius = 6378.1363
121
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
EndScript
% Loop initializations
loopIdx = loopIdx + 1
EndOptimize
Caution
In the above script snippet, we have included the EndOptimize command
so that your script will continue to build while we construct the optimization
sequence. You must paste subsequence script snippets inside of the opti-
mization loop.
that you are telling the optimizer to vary launchEpoch (the RHS of the equal sign), and
to use as the initial guess the value contained in launchEpoch when the command is
first executed. This will allow us to easily change initial guess values and perform “Apply
Corrections” via the script interface which will be shown later. Continuing with the script
explanation, the last five lines below set the epochs of the spacecraft according to the
optimization variables and set up the patch point epochs.
122
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
tells GMAT to vary the X Cartesian value of satTOI using as the initial guess the value of
satTOI.X at initial command execution. The Perturbation used to compute derivatives
is 0.00001 and the optimizer will not take steps larger than 100 for this variable. Note:
units of settings like Perturbation are the same as the unit for the optimization variable.
Notice the lines at the bottom of this script snippet that look like this:
satFlyBy_Backward = satFlyBy_Forward
This line assigns an entire Spacecraft to another Spacecraft. Because we are varying
one control point in the middle of a segment, this assignment allows us to conveniently
set the second Spacecraft without independently varying its state properties.
123
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
124
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
These lines are used to clean up discontinuities in the OrbitView that occur because
we are making discontinuous changes to time in this complex script.
125
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
PenDown EarthView
Propagate BackProp NearMoonProp(satMOI_Backward)...
{satMOI_Backward.TAIModJulian = patchTwoEpoch, StopTolerance = 1e-005}
126
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
NonlinearConstraint NLPOpt(satMOI_Backward.EarthMJ2000Eq.VZ=...
satFlyBy_Forward.EarthMJ2000Eq.VZ)
Stop
127
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
128
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
You can use the mouse to manipulate the OrbitView to see that the patch points are
indeed discontinuous for the initial guess as shown below in the two screen captures.
If your configuration does not provide you with similar graphics, compare your script to
the one provided for this tutorial and address any differences.
129
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
1. Near the bottom of the script, comment out the Stop command.
2. In the configuration of EarthView, change ShowPlot to false.
3. Click Save Sync Run.
After a few optimizer iterations you should see “NLPOpt converged to within target ac-
curacy" displayed in the GMAT message window and your XY plot graphics should ap-
pear as shown below. Let’s discuss the content of these windows. The upper left window
shows the RSS history of velocity error at the two patch points during the optimization
process. The lower left window shows the RSS history of the position error. The upper
right window shows error in mission orbit inclination, and the lower right window shows
error mission orbit apogee and perigee radii. You can see that in all cases the patch
point discontinuities were driven to zero, but since other constraints were not applied
there are still errors in some mission constraints.
Before proceeding to the next step, go to the message window and copy and paste the
final values of the optimization variables to a text editor for later use:
At this point in the tutorial, your script is configured to eliminate the patch point discon-
tinuities but does not apply constraints. We need to make a few small modifications to
the script to find an solution that meets the constraints.
130
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
1. Remove the “%” sign from the all NonlinearConstraint commands and the Minimize
command:
NonlinearConstraint NLPOpt(satTOI.INC=conTOIInclination)
NonlinearConstraint NLPOpt(satTOI.RadPer=conTOIPeriapsis)
NonlinearConstraint NLPOpt(satMOI_Backward.RadPer = conMOIPeriapsis)
NonlinearConstraint NLPOpt(launchRdotV=0)
NonlinearConstraint NLPOpt(satMOI_Forward.EarthMJ2000Eq.INC =. . .
NonlinearConstraint NLPOpt(satMOI_Forward.RadApo=conMOIApoapsis)
Minimize NLPOpt(Cost)
2. Click Save Sync Run.
The screen capture below shows the plots after optimization has been completed. Notice
that the constraint errors have been driven to zero in the plots
Another way to verify that the constraints have been satisfied is to look in the message
window where the final constraint variances are displayed as shown below. We could
further reduce the variances by lowering the tolerance setting on the optimizer.
131
Tutorials Optimal Lunar Flyby using Mul-
tiple Shooting
Finally, let’s look at the delta-V of the solution. In this case the delta-V is simply the value
of MOI.Element1 which is displayed in the message window with a value of -0.09171
km/s.
In Step 2 above, you saved the final solution for the smooth trajectory run. Let’s use
those values as the initial guess and see if we find a similar solution as found in the
previous step. In the ScriptEvent that defines the initial guess, paste the values be-
low, below the values already there. (don’t overwrite the old values!). Once you have
changed the guess, run the mission again.
launchEpoch = 27698.2503232
flybyEpoch = 27703.7774182
moiEpoch = 27723.6487435
satTOI.X = -6651.63393843
satTOI.Y = -229.372171037
satTOI.Z = -168.481408909
satTOI.VX = 0.244028352166
satTOI.VY = -9.56544906767
satTOI.VZ = 5.11103080924
satFlyBy_Forward.X = 869.368923086
satFlyBy_Forward.Y = -6284.53685414
satFlyBy_Forward.Z = -3598.94426638
satFlyBy_Forward.VX = 1.14614444527
satFlyBy_Forward.VY = -0.726070354598
satFlyBy_Forward.VZ = -0.617780594192
satMOI_Backward.X = -53541.9714485
satMOI_Backward.Y = -68231.6304631
satMOI_Backward.Z = -1272.77554803
satMOI_Backward.VX = 2.0799329871
satMOI_Backward.VY = -1.89082570193
satMOI_Backward.VZ = -0.284385092038
We see in this case the optimization converged and found essentially the same solution
of -0.0907079 km/s
132
Optimal Lunar Flyby using Mul- Tutorials
tiple Shooting
133
134
Tutorials
Note
One of the most challenging problems in space mission design is to design
an interplanetary transfer trajectory that takes the spacecraft within a very
close vicinity of the target planet. One possible approach that puts the space-
craft close to a target planet is by targeting the B-Plane of that planet. The
B-Plane is a planar coordinate system that allows targeting during a gravity
assist. It can be thought of as a target attached to the assisting body. In ad-
dition, it must be perpendicular to the incoming asymptote of the approach
hyperbola. Figure 83 and Figure 84 show the geometry of the B-Plane and
B-vector as seen from a viewpoint perpendicular to orbit plane. To read more
on B-Planes, please consult the GMATMathSpec document. A good exam-
ple involving the use of B-Plane targeting is a mission to Mars. Sending a
spacecraft to Mars can be achieved by performing a Trajectory Correction
Maneuver (TCM) that targets Mars B-Plane. Once the spacecraft gets close
to Mars, then an orbit insertion maneuver can be performed to capture into
Mars orbit.
135
Tutorials Mars B-Plane Targeting Using
GMAT Functions
In this tutorial, we will use GMAT to model a mission to Mars with the emphasis of how to
use GMAT functions. Starting from an out-going hyperbolic trajectory around Earth, we
will perform a TCM to target Mars B-Plane. Once we are close to Mars, we will adjust the
size of the maneuver to perform a Mars Orbit Insertion (MOI) to achieve a final elliptical
orbit with an inclination of 90 degrees. Meeting these mission objectives requires us to
create two separate targeting sequences. In order to focus on the configuration of the
two targeters, we will make extensive use of the default configurations for spacecraft,
propagators, and maneuvers.
The first target sequence employs maneuvers in the Earth-based Velocity (V), Normal
(N) and Bi-normal (B) directions and includes four propagation sequences. The purpose
136
Mars B-Plane Targeting Using Tutorials
GMAT Functions
of the maneuvers in VNB directions is to target BdotT and BdotR components of the B-
vector. BdotT is targeted to 0 km and BdotR is targeted to a non-zero value to generate
a polar orbit that has inclination of 90 degrees. BdotR is targeted to -7000 km to avoid
having the orbit intersect Mars, which has a radius of approximately 3396 km. The en-
tire first target sequence will be created inside a GMAT function. In the Mission tree,
this function will be called through GMAT's CallGmatFunction command. Additionally,
we'll go ahead and declare pertinent objects (e.g. spacecraft, force models, subscribers,
impulsive burns etc.) as global in both the main script and inside the function through
GMAT's Global command.
The second target sequence employs a single, Mars-based anti-velocity direction (-V)
maneuver and includes one propagation sequence. This single anti-velocity direction
maneuver will occur at periapsis. The purpose of the maneuver is to achieve MOI by
targeting position vector magnitude of 12,000 km at apoapsis. Unlike the first target
sequence, the second target sequence will not be created inside a function.
The purpose behind this tutorial is to demonstrate how GMAT functions are created,
populated, called-upon and used as part of practical mission design. In this tutorial, we'll
deliberately put the entire first target sequence inside a GMAT function. Next in the
Mission tree, we'll call and execute the function, then continue with the design of the
second target sequence outside of the function. Key objects such as the spacecraft,
force models, subscribers etc. will be declared global in order to assure continuous flow
of data is plotted and reported to all the subscribers. The basic steps of this tutorial are:
1. Modify the DefaultSC to define spacecraft’s initial state. The initial state is an out-
going hyperbolic trajectory that is with respect to Earth.
2. Create and configure a Fuel Tank resource.
3. Create two ImpulsiveBurn resources with default settings.
4. Create and configure three Propagators: NearEarth, DeepSpace and NearMars
5. Create and configure DifferentialCorrector resource.
6. Create and configure three DefaultOrbitView resources to visualize Earth, Sun
and Mars centered trajectories.
7. Create and configure single ReportFile resource that will be used in reporting data.
8. Create and configure three CoordinateSystems: Earth, Sun and Mars centered.
9. Create and configure single GmatFunction resource that will be called and exe-
cuted in the Mission tree.
10. Create first Target sequence inside the GMAT function. This sequence will be used
to target BdotT and BdotR components of the B-vector.
11. Create second Target sequence to implement MOI by targeting position magnitude
at apoapsis.
12. Run the mission and analyze the results.
137
Tutorials Mars B-Plane Targeting Using
GMAT Functions
We need to create a fuel tank in order to see how much fuel is expended after each
impulsive burn. We will modify DefaultSC resource later and attach the fuel tank to the
spacecraft.
1. In the Resources tree, right-click the Hardware folder, point to Add and click
ChemicalTank. A new resource called ChemicalTank1 will be created.
2. Right-clickChemicalTank1 and click Rename.
3. In theRename box, type MainTank and click OK.
4. Double click onMainTank to edit its properties.
5. Set the values shown in the table below.
Field Value
Fuel Mass 1718
Fuel Density 1000
Pressure 5000
Volume 2
1. In the Resources tree, under Spacecraft folder, right-click DefaultSC and click
Rename.
2. In the Rename box, type MAVEN and click OK.
3. Double-click on MAVEN to edit its properties. Make sure Orbit tab is selected.
4. Set the values shown in the table below.
138
Mars B-Plane Targeting Using Tutorials
GMAT Functions
Field Value
Epoch Format UTCGregorian
Epoch 18 Nov 2013 20:26:24.315
Coordinate System EarthMJ2000Eq
State Type Keplerian
SMA under Elements -32593.21599272796
ECC under Elements 1.202872548116185
INC under Elements 28.80241266404142
RAAN under Elements 173.9693759331483
AOP under Elements 240.9696529532764
TA under Elements 359.9465533778069
1. In the Resources tree, under the Burns folder, right-click DefaultIB and click Re-
name.
2. In the Rename box, type TCM, an acronym for Trajectory Correction Maneuver and
click OK to edit its properties.
3. Double-Click TCM to edit its properties.
4. Check Decrement Mass under Mass Change.
5. For Tank field under Mass Change, select MainTank from drop down menu.
6. Click OK to save these changes.
7. Right-click theBurns folder, point to Add, and click ImpulsiveBurn. A new resource
called ImpulsiveBurn1 will be created.
8. Rename the new ImpulsiveBurn1 resource to MOI, an acronym for Mars Orbit
Insertion and click OK.
9. Double-click MOI to edit its properties.
10. For Origin field under Coordinate System, select Mars.
11. Check Decrement Mass under Mass Change.
139
Tutorials Mars B-Plane Targeting Using
GMAT Functions
12. For Tank field under Mass Change, select MainTank from the drop down menu.
13. Click OK to save these changes.
We’ll need to add three propagators for this tutorial. Below, we’ll rename the default
DefaultProp and create two more propagators.
1. In the Resources tree, under the Propagators folder, right-click DefaultProp and
click Rename.
2. In the Rename box, type NearEarth and click OK.
3. Double-click on NearEarth to edit its properties.
4. Set the values shown in the table below.
Field Value
Initial Step Size under Integrator 600
Accuracy under Integrator 1e-013
Min Step Size under Integrator 0
Max Step Size under Integrator 600
Model under Gravity JGM-2
Degree under Gravity 8
Order under Gravity 8
Atmosphere Model under Drag None
Point Masses under Force Model Add Luna and Sun
Use Solar Radiation Pressure under Force Model Check this field
140
Mars B-Plane Targeting Using Tutorials
GMAT Functions
141
Tutorials Mars B-Plane Targeting Using
GMAT Functions
Two Target sequences that we will create later need a DifferentialCorrector resource
to operate, so let’s create one now. We'll leave the settings at their defaults.
The BdotT and BdotR constraints that we will define later under the first Target se-
quence require us to create a coordinate system. Orbit View resources that we will cre-
ate later also need coordinate system resources to operate. We will create Sun and
Mars centered coordinate systems. So let’s create them now.
1. In the Resources tree, right-click the Coordinate Systems folder and click Add
Coordinate System. A new Dialog box is created with a title New Coordinate
System.
2. Type SunEcliptic under Coordinate System Name box.
3. Under Origin field, select Sun.
4. For Type under Axes, select MJ2000Ec.
5. Click OK to save these changes. You’ll see that a new coordinate system SunEclip-
tic is created under Coordinate Systems folder.
6. Right-click the Coordinate Systems folder and click Add Coordinate System. A
new Dialog Box is created with a title New Coordinate System.
7. Type MarsInertial under Coordinate System Name box.
8. Under Origin field, select Mars.
9. For Type under Axes, select BodyInertial.
10. Click OK to save these changes. You’ll see that a new coordinate system MarsIn-
ertial is created under Coordinate Systems folder.
We’ll need three DefaultOrbitView resources for this tutorial. Below, we’ll rename the
default DefaultOrbitView and create two new ones. We need three graphics windows
in order to visualize spacecraft’s trajectory centered around Earth, Sun and then Mars
1. In the Resources tree, under Output folder, right-click DefaultOrbitView and click
Rename.
2. In the Rename box, type EarthView and click OK.
3. In the Output folder, delete DefaultGroundTrackPlot.
4. Double-click EarthView to edit its properties.
5. Set the values shown in the table below.
142
Mars B-Plane Targeting Using Tutorials
GMAT Functions
Field Value
View Scale Factor under View Definition 4
View Point Vector boxes, under View Definition 0, 0, 30000
Field Value
From Celestial Object under View Object, add fol- Mars, Sun (Do not remove
lowing objects to Selected Celestial Object box Earth)
Coordinate System under View Definition SunEcliptic
View Point Reference under View Definition Sun
View Point Vector boxes, under View Definition 0, 0, 5e8
View Direction under View Definition Sun
Coordinate System under View Up Definition SunEcliptic
Field Value
From Celestial Object under View Object, add fol- Mars (You don’t have to re-
lowing object to Selected Celestial Object box move Earth)
Coordinate System under View Definition MarsInertial
View Point Reference under View Definition Mars
View Point Vector boxes, under View Definition 22000, 22000, 0
View Direction under View Definition Mars
Coordinate System under View Up Definition MarsInertial
143
Tutorials Mars B-Plane Targeting Using
GMAT Functions
We’ll need a single ReportFile resource for this tutorial that we'll use to report data to.
1. Right-click the Output folder, point to Add, and click ReportFile. A new resource
called ReportFile1 will be created.
2. Rename the new ReportFile1 resource to rf and click OK.
3. Double-Click rf to edit its properties.
4. Empty the Parameter List by clicking on the Edit button.
5. Click OK to save these changes.
We’ll need a single GMATFunction resource for this tutorial. The first target sequence
will be implemented inside this function.
1. Right-click the Functions folder, point to Add, point to GMAT Function and click
New.
2. A new GMAT function panel will open. Type the following name for the function
TargeterInsideFunction and click OK to save these changes.
3. Now open TargeterInsideFunction resource and paste the below shown first tar-
geter sequence snippet into this function.
4. After pasting of the below snippet is done, click on Save As button and save your
function. After saving your function, close TargeterInsideFunction resource by
clicking on the Close button.
function TargeterInsideFunction()
BeginMissionSequence
144
Mars B-Plane Targeting Using Tutorials
GMAT Functions
Reminder that the first target sequence will target desired B-Plane coordinates which will
get the spacecraft MAVEN close to Mars. Note that we have declared all the pertinent
objects as global at the beginning of the function. These same objects will also be de-
clared global in the Mission Sequence as well. Notice that in this first target sequence,
spacecraft MAVEN props for 3 days using NearEarth propagator. Next using the Deep-
Space propagator, we propagate for 12 days and execute TCM impulsive maneuver.
Again using the DeepSpace propagator, we propagate for another 280 days and finally
propagate to Mars Periapsis. The desired constraints of the B-Plane coordinates are to
be met at the Mars periapsis. The three components of the TCM impulsive burn are the
controls that will help us achieve these two constraints. Note that the tolerances on the
two B-Plane constraints are relatively tight.
The second target sequence employs a single, Mars-based anti-velocity direction (-V)
maneuver and includes one propagation sequence. This single anti-velocity direction
maneuver will occur at periapsis. The purpose of the maneuver is to achieve MOI by
targeting position vector magnitude of 12,000 km at apoapsis. The basic steps of this
tutorial are:
145
Tutorials Mars B-Plane Targeting Using
GMAT Functions
Now that the structure is created, we need to configure various parts of the first Target
sequence to do what we want.
146
Mars B-Plane Targeting Using Tutorials
GMAT Functions
1. Double-click Target Desired B-Plane Coord. From Inside Function to edit its
properties.
2. Under Function, select TargeterInsideFunction from drop down menu. In this
particular example, since we're not passing any input(s) or receiving any output(s)
to and from the function, hence we won't be editing Input/Output menu.
3. Click OK to save these changes.
147
Tutorials Mars B-Plane Targeting Using
GMAT Functions
148
Mars B-Plane Targeting Using Tutorials
GMAT Functions
149
Tutorials Mars B-Plane Targeting Using
GMAT Functions
150
Mars B-Plane Targeting Using Tutorials
GMAT Functions
Now go back to Mission tree and right click on Target Desired B-Plane Coord. From
Inside Function command and click on Command Summary option. Under Coordi-
nate System drop down menu, select MarsIntertial and study the command summary.
This command summary corresponds to the very last Propagate command (i.e. 'Prop to
Mars Periapsis') from inside the GMAT function. Under Hyperbolic Parameters, notice
the values of BdotT and BdotR. These are the constraints that have been achieved on
the very last 'Prop to Mars Periapsis' Propagate command from the first targeter which
was set up inside the GMAT function.
Now let’s create the commands necessary to perform the second Target sequence.
Figure 92 illustrates the configuration of the Mission tree after you have completed the
steps in this section. Notice that in Figure 92, the second Target sequence is created
after the first Target sequence which was called via the CallGmatFunction command.
We’ll discuss the second Target sequence after it has been created.
151
Tutorials Mars B-Plane Targeting Using
GMAT Functions
Command Name
Maneuver Apply MOI
Propagate Prop to Mars Apoapsis
Achieve Achieve RMAG
152
Mars B-Plane Targeting Using Tutorials
GMAT Functions
Note
Let’s discuss what the second Target sequence does. We know that a ma-
neuver is required for the Mars capture orbit. We also know that the desired
radius of capture orbit at apoapsis must be 12,000 km. However, we don’t
know the size (or #V magnitude) of the MOI maneuver that will precisely
achieve the desired orbital conditions. You use the second Target sequence
to solve for that precise maneuver value. You must tell GMAT what controls
are available (in this case, a single maneuver) and what conditions must
be satisfied (in this case, radius magnitude value). Once again, just like in
the first Target sequence, here we accomplish this by using the Vary and
Achieve commands. Using the Vary command, you tell GMAT what to solve
for—in this case, the #V value for MOI. You use the Achieve command to tell
GMAT what conditions the solution must satisfy—in this case, RMAG value
of 12,000 km.
We need a Propagate command after the second Target sequence so that we can see
our final orbit.
1. In the Mission tree, right-click End Mars Capture, point to Insert After, and click
Propagate. A new Propagate3 command will appear.
2. Right-click Propagate6 and click Rename.
3. Type Prop for 1 day and click OK.
4. Double-click Prop for 1 day to edit its properties.
5. Under Propagator, replace NearEarth with NearMars.
6. Under Parameter, replace MAVEN.ElapsedSeconds with MAVEN.ElapsedDays.
7. Under Condition, replace the value 0.0 with 1.
8. Click OK to save these changes
153
Tutorials Mars B-Plane Targeting Using
GMAT Functions
154
Mars B-Plane Targeting Using Tutorials
GMAT Functions
1. Double-click Vary MOI.V to edit its properties. Notice that the variable in the Vari-
able box is TCM.Element1. We want MOI.Element1 which is the velocity compo-
nent of MOI in the local VNB coordinate system. So let’s change that.
2. Next to Variable, click the Edit button.
3. Under Object List, click MOI.
4. In the Object Properties list, double-click Element1 to move it to the Selected
Value(s) list. See the image below for results.
5. Click OK to close the ParameterSelectDialog window.
6. In the Initial Value box, type -1.0.
7. In the Perturbation box, type 0.00001.
8. In the Lower box, type -10e300.
9. In the Upper box, type 10e300.
10. In the Max Step box, type 0.1.
11. Click OK to save these changes.
155
Tutorials Mars B-Plane Targeting Using
GMAT Functions
156
Mars B-Plane Targeting Using Tutorials
GMAT Functions
157
Tutorials Mars B-Plane Targeting Using
GMAT Functions
As the mission runs, you will see GMAT solve the second Target sequence’s targeting
problem. Each iteration and perturbation is shown in MarsView windows in light blue,
and the final solution is shown in red. After the mission completes, the MarsView 3D
view should appear as in the image shown below. EarthView and SolarSystemView
3D views are same as before. You may want to run the mission several times to see
the targeting in progress.
If you want to know MOI maneuver’s delta-V vector values and how much fuel was
expended during the maneuver, do the following steps:
1. In the Mission tree, right-click Apply MOI, and click on Command Summary.
2. Scroll down and under Maneuver Summary heading, values for delta-V vector are:
Delta V Vector:
158
Mars B-Plane Targeting Using Tutorials
GMAT Functions
Just to make sure that the goal of second Target sequence was met successfully, let us
access command summary for Achieve RMAG command by doing the following steps:
1. In the Mission tree, right-click Achieve RMAG, and click on Command Summary.
2. Under Coordinate System, select MarsInertial.
3. Under Keplerian State and and Spherical State headings, see the values of
TA and RMAG. You can see that the desired radius of the capture orbit at apoapsis
was achieved successfully:
TA = 180.00000085377 deg
RMAG = 12000.017390989 km
159
160
Tutorials
1. Open GMAT.
2. Click Open in the toolbar and navigate to the GMAT samples directory.
3. Select Tut_SimpleOrbitTransfer.script and click Open.
4. Click Run ( ) to run the mission.
161
Tutorials Finding Eclipses and Station
Contacts
By default, GMAT offers general consistency between both configurations. But, it's use-
ful to verify that the appropriate parameters are correct, and it's necessary for precise
applications.
First, let's verify that the SolarSystem resource is configured properly for both configu-
rations.
1. On the Resources tab, double-click the SolarSystem folder. This will display the
SolarSystem configuration.
2. Scroll to the end of each input box to see the actual filenames being loaded.
162
Finding Eclipses and Station Tutorials
Contacts
• Ephemeris Source: This is set to use the DE405 planetary ephemeris, the default
in GMAT. If you switch to another ephemeris version, the fields below will update
accordingly.
• Ephemeris Filename: This is the DE-format ephemeris file used for propagation and
parameter calculations in GMAT itself.
• SPK Kernel: This is the SPICE SPK file used for planetary ephemeris for SPK prop-
agation and for event location. Note that this is set consistent with Ephemeris File-
name (both DE405)
• Leap Second Kernel: This is the SPICE LSK file used to keep track of leap seconds
in the UTC time system for the SPICE subsystem. This is kept consistent with GMAT's
internal leap seconds file (tai-utc.dat) specified in the GMAT startup file.
• Planetary Constants Kernel: This is the SPICE PCK file used for default configura-
tion for all the default celestial bodies. This file contains planetary shape and orien-
tation information, similar to but independent from the settings in GMAT's Celestial-
Body resources (Earth, Luna, etc.).
These are already configured correctly, so we don't need to make any changes.
Next, let's configure the Earth model for precise usage with the ContactLocator re-
source. By default, the Earth size and shape differ by less than 1 m in equatorial and
polar radii between the two subsystems But we can make them match exactly by mod-
ifying GMAT's Earth properties.
163
Tutorials Finding Eclipses and Station
Contacts
• Equatorial Radius and Flattening define the Earth shape for GMAT itself. PCK
Files lists additional SPICE PCK files to load, in addition to the file shown above
in the SolarSystem Planetary Constants Kernel box. In this case, these files
provide high-fidelity Earth orientation parameters (EOP) data.
• On the Orientation tab, Spice Frame Id indicates the Earth-fixed frame to use for
the SPICE subsystem, and FK Files provides additional FK files that define the
frame. In this case, Earth is using the built-in ITRF93 frame, which is different but
very close to GMAT's EarthFixed coordinate system. See the CoordinateSystem
reference for details on that system.
4. Set Equatorial Radius to 6378.1366.
5. Set Flattening to 0.00335281310845547.
6. Click OK.
These two values were taken from the pck00010.tpc file referenced in the SolarSystem
configuration. Setting them for Earth ensures that the position of the GroundStation we
create later will be referenced to the exact same Earth definition throughout the mission.
Note that the exact position may still differ between the two based on the different body-
fixed frame definition and the different EOP data sources, but this residual difference
is small.
Your Earth panel should look like this after these steps are complete:
164
Finding Eclipses and Station Tutorials
Contacts
search by running the FindEvents command, but GMAT does this automatically at the
end of the mission unless you configure it otherwise. In this case, we will use the auto-
matic option.
• On the Resources tab, right-click the Event Locators folder, point to Add, and
click EclipseLocator.
165
Tutorials Finding Eclipses and Station
Contacts
Now it's time to run the mission and look at the results.
The eclipse search will take a few seconds. As it progresses, you'll see the following
message in the message window at the bottom of the screen:
166
Finding Eclipses and Station Tutorials
Contacts
Three eclipses were found, all part of a single "total" eclipse event totalling about 35
minutes. A total event consists of all adjacent and overlapping portions, such as penum-
bra eclipses occuring adjacent to umbra eclipses as in this case.
• Click Close to close the report. The report text is still available as
EclipseLocator1.txt in the GMAT output folder.
Let's create a ground station that will be in view from the final geostationary orbit. By
looking at the DefaultGroundTrackPlot window, our spacecraft is positioned over the
Indian Ocean. A ground station in India should be in view. We can choose the Hyderabad
facility, which has the following properties:
1. First, close all graphics and solver windows, to allow full manipulation of resources.
2. On the Resources tab, right-click the Ground Station folder and click Add Ground
Station. This will create a new resource called GroundStation1.
167
Tutorials Finding Eclipses and Station
Contacts
• Min. Elevation: This is the minimum elevation angle from the ground station for
a valid contact. The current value (7 deg) is appropriate for this case.
• Central Body: Earth is the only allowed value at this time.
5. In the State Type list, select Spherical. This allows input in latitude, longitude, and
altitude.
6. In the Horizon Reference list, select Ellipsoid.
7. In the Latitude box, type 17.0286.
8. In the Longitude box, type 78.1883.
9. In the Altitude box, type 0.541.
10. Click OK to accept these changes.
If you add the GroundStation to the DefaultGroundTrackPlot, you can see the location
visually:
168
Finding Eclipses and Station Tutorials
Contacts
Now we can create a ContactLocator that will search for contact times between our
spacecraft and the Hyderabad station.
1. On the Resources tab, right-click the Event Locators folder, point to Add, and
click ContactLocator. This will create ContactLocator1.
2. Double-click ContactLocator1 to edit the configuration.
Many of the default values are identical to the EclipseLocator, so we don't need
to explain them again. There are a couple new properties that we'll note, but won't
change:
• Occulting Bodies: These are celestial bodies that GMAT will search for occulta-
tions of the line of sight between the spacecraft and the ground station. Since our
spacecraft is orbiting the Earth, we don't need to choose any occulting bodies.
Note that Earth is considered automatically because it is the central body of the
ground station.
• Light-time direction: This is the signal sense of the ground station. You can
choose to calculate light-time delay as if the ground station is transmitting, or if
it is receiving.
3. In the Observers list, enable Hyderabad. This will cause GMAT to search for con-
tacts to this station.
4. In the Step size box, type 600. Since we're not using third-body occultations, this
step size can be increased significantly without missing events. See the Contact-
Locator documentation for details.
5. Click OK to accept the changes.
169
Tutorials Finding Eclipses and Station
Contacts
When fully configured, the GroundStation1 window will look like the following screen-
shot:
Now it's time to run the mission again and look at these new results.
The contact search will take much less time than the eclipse search, since we're
using a larger step size. As it progresses, you'll see the following message in the
message window at the bottom of the screen:
170
Finding Eclipses and Station Tutorials
Contacts
Notice that two contact intervals were found: one about 6 minutes long at the very be-
ginning of the mission (it starts at the Spacecraft's initial epoch), and a second one about
29 hours long, starting once it gets into geosynchronous orbit and extending to the end
of the simulation.
• Click Close to close the report. The report text is still available as
ContactLocator1.txt in the GMAT output folder.
Further Exercises
To expand on this tutorial, try the following exercise:
• For a mission like this, you probably will want ground station coverage during both
maneuvers. Try the following steps to make sure the coverage is adequate:
• Change the colors of the Propagate commands, so you can see visually where the
burns are located.
• Add GroundStation resources near the locations of the burns on the ground track.
• Confirm the burn epochs in the Command Summary for each Maneuver com-
mand.
• Confirm in the contact report that these times occur during a contact interval.
• Check the eclipse report, too: you may not want to perform a maneuver during an
eclipse!
This tutorial shows you the basics of adding eclipse and station contact location to your
mission. These resources have a lot of power, and there are many different ways to use
them. Consult the ContactLocator and EclipseLocator documentation for details.
171
172
Tutorials
Electric Propulsion
Audience Beginner
Length 15 minutes
Prerequisites Complete Simulating an Orbit
Script File Tut_ElectricPropulsionModelling.script
1. In the Resources tree, right-click on the Hardware folder, point to Add, and click
ElectricThruster. A Resource named ElectricThruster1 will be created.
2. In the Resources tree, right-click on the Hardware folder, point to Add, and click
ElectricTank. A Resource named ElectricTank1 will be created.
3. In the Resources tree, right-click on the Hardware folder, point to Add, and click
SolarPowerSystem. A Resource named SolarPowerSystem1 will be created.
173
Tutorials Electric Propulsion
Figure 101 below shows the ElectricThruster1 configuration that we will use.
174
Electric Propulsion Tutorials
We will use the default tank settings. Figure 102 shows the finished ElectricTank1
configuration.
175
Tutorials Electric Propulsion
176
Electric Propulsion Tutorials
177
Tutorials Electric Propulsion
178
Electric Propulsion Tutorials
1. In the Resources tree, right-click the Burns folder and add a FiniteBurn. A Re-
source named FiniteBurn1 will be created.
2. Double-click FiniteBurn1 to edit its properties.
3. Use the menu to the right of the Thruster field to select ElectricThruster1 as the
thruster associated with FiniteBurn1. Click OK.
179
Tutorials Electric Propulsion
1. In the Mission Tree, right click on Propagate1, select Rename, and enter Propa-
gate Two Days.
2. Right click on the command named Propagate Two Days, select Insert Before,
then select BeginFiniteBurn.
3. Right click on the command named Propagate Two Days, select Insert After, then
select EndFiniteBurn.
4. Rename the command named BeginFiniteBurn1 to StartTheManeuver.
5. Rename the command named EndFiniteBurn1 to EndTheManeuver.
Note that for more complex analysis that has multiple FiniteBurn objects, you will need
to configure the BeginFiniteBurn and EndFiniteBurn commands to select the desired
FiniteBurn Resource. As there is only one FiniteBurn Resource in this example, the
system automatically selected the correct FiniteBurn Resource.
180
Electric Propulsion Tutorials
181
182
Tutorials
Tut_Simulate_DSN_Range_and_Doppler_Data_3_weeks.script
Note
GMAT currently implements a number of different data types for orbit deter-
mination. Please refer to Tracking Data Types for OD for details on all the
measurement types currently supported by GMAT. The measurements be-
ing considered here are DSN two way range and DSN two way Doppler.
In this tutorial, we will use GMAT to generate simulated DSN range and Doppler mea-
surement data for a sample spacecraft in orbit about the Sun. The spacecraft in this
tutorial is in an Earth “drift away” type orbit about 1 AU away from the Sun and almost
300 million km away from the Earth.
1. Create and configure the spacecraft, spacecraft transponder, and related parame-
ters
2. Create and configure the Ground Station and related parameters
3. Define the types of measurements to be simulated
4. Create and configure Force model and propagator
5. Create and configure Simulator object
6. Run the mission and analyze the results
7. Create a realistic GMAT Measurement Data (GMD) file
Note that this tutorial, unlike most of the mission design tutorials, will be entirely script
based. This is because most of the resources and commands related to navigation are
not implemented in the GUI and are only available via the script interface.
As you go through the tutorial below, it is recommended that you paste the script seg-
ments into GMAT as you go along. After each paste into GMAT, you should perform a
syntax check by hitting the Save, Sync button ( ). To avoid syntax errors, where
needed, don’t forget to add the following command to the last line of the script segment
you are checking.
BeginMissionSequence
We note that in addition to the material presented here, you should also look at the
individual Help resources for all the objects and commands we create and use here.
183
Tutorials Simulate DSN Range and
Doppler Data
Next, we create a new spacecraft, Sat, and set its epoch and Cartesian coordinates.
Sat.Id = 11111;
184
Simulate DSN Range and Tutorials
Doppler Data
After we create the Transponder object, there are three fields, PrimaryAntenna, Hard-
wareDelay, and TurnAroundRatio that must be set.
Note that in the last script command above, we attach our newly created Transponder
and its related Antenna object to our spacecraft, Sat.
DSNTransmitter.PrimaryAntenna = DSNAntenna;
DSNReceiver.PrimaryAntenna = DSNAntenna;
DSNTransmitter.Frequency = 7200; %MHz
In the script segment above, we first created Transmitter, Receiver, and Anten-
na objects. The GMAT script line DSNTransmitter.PrimaryAntenna = DSNAnten-
na, sets the main antenna that the Transmitter object will be using. Likewise, the
DSNReceiver.PrimaryAntenna = DSNAntenna script line sets the main antenna that
the Receiver object will be using. As previously mentioned, the Antenna object cur-
rently has no function, but we include it here both because GMAT requires it and for
completeness since the Antenna resource may have a function in a future GMAT re-
lease. Finally, we set the transmitter frequency in the last GMAT script line above. See
the RunSimulator Help for a complete description of how this input frequency is used.
As described in the Help, since in this example we will not be using a ramp table, this
input frequency will be used to calculate the simulated value of the range and Doppler
185
Tutorials Simulate DSN Range and
Doppler Data
observations. In addition, this input frequency will also be output to the range data file
created by the RunSimulator command.
CAN.Id = 22222;
CAN.MinimumElevationAngle = 7.0;
CAN.IonosphereModel = 'IRI2007';
CAN.TroposphereModel = 'HopfieldSaastamoinen';
The script segment above is broken into five sections. In the first section, we create
our GroundStation object and we set our Earth-Centered Fixed Cartesian coordinates.
In the second section, we set the ID of the ground station that will output to the GMD
file created by the RunSimulator command. In the third section, we set the minimum
elevation angle to 7 degrees. Below this ground station to spacecraft elevation angle, no
simulated data will be created. In the fourth section, we specify which troposphere and
ionosphere model we wish to use to model RF signal atmospheric refraction effects. Fi-
nally, in the fifth section, we attached three pieces of previously created required hard-
ware to our ground station, a transmitter, a receiver, and an antenna.
186
Simulate DSN Range and Tutorials
Doppler Data
The script segment above is broken into three sections. The first section defines an
ErrorModel named DSNrange. The error model Type is DSN_SeqRange which indi-
cates that it is an error model for DSN sequential range measurements. The 1 sigma
standard deviation of the Gaussian white noise is set to 10.63 Range Units (RU) and
the measurement bias is set to 0 RU.
The second section above defines an ErrorModel named DSNdoppler. The error mod-
el Type is DSN_TCP which indicates that it is an error model for DSN total count phase-
derived Doppler measurements. The 1 sigma standard deviation of the Gaussian white
noise is set to 0.0282 Hz and the measurement bias is set to 0 Hz.
The third section above attaches the two ErrorModel resources we have just created
to the CAN GroundStation. Note that in GMAT, the measurement noise or bias is de-
fined on a per ground station basis. Thus, any range measurement error involving the
CAN GroundStation is defined by the DSNRange ErrorModel and any Doppler mea-
surement error involving the CAN GroundStation is defined by the DSNdoppler Er-
rorModel. Note that since GMAT currently only models two way measurements where
the transmitting and receiving ground stations are the same, we do not have to consider
the case where the transmitting and receiving ground stations are different. Suppose we
were to add an additional GroundStation to this simulation. The measurement error for
observations involving this new GroundStation would be defined by the ErrorModel
resources attached to it.
DSNsimData.UseLightTime = true;
DSNsimData.UseRelativityCorrection = true;
DSNsimData.UseETminusTAI = true;
187
Tutorials Simulate DSN Range and
Doppler Data
DSNsimData.SimDopplerCountInterval = 10.0;
DSNsimData.SimRangeModuloConstant = 3.3554432e+07;
The script lines above are broken into three sections. In the first section, the resource
name, DSNsimData, is declared, the data types are defined, and the output file name is
specified. AddTrackingConfig is the field that is used to define the data types. The first
AddTrackingConfig line tells GMAT to simulate DSN range two way measurements
for the CAN to Sat to CAN measurement strand. The second AddTrackingConfig line
tells GMAT to simulate DSN Doppler two way measurements for the CAN to Sat to CAN
measurement strand.
The second section above sets some simulation parameters that apply to both the range
and Doppler measurements. We set UseLightTime to True in order to generate realistic
measurements where GMAT takes into account the finite speed of light. The last two
parameters in this section, UseRelativityCorrection and UseETminusTAI, are set to
True so that general relativistic corrections, as described in Moyer [2000], are applied
to the light time equations.
The third section above sets simulation parameters that apply to a specific measure-
ment type. SimDopplerCountInterval applies only to Doppler measurements and Sim-
RangeModuloConstant applies only to range measurements. We note that the “Sim”
in the field names is used to indicate that these fields only are applicable when GMAT
is in simulation mode (i.e., when using the RunSimulator command) data and not
when GMAT is in estimation mode (i.e., when using the RunEstimator command).
SimDopplerCountInterval, the Doppler Count Interval, is set to 10 seconds and Sim-
RangeModuloConstant, the maximum possible range value, is set to 33554432. See
the RunSimulator Help and Appendix A – Determination of Measurement Noise Val-
ues for a description of how these parameters are used to calculate the measurement
values.
188
Simulate DSN Range and Tutorials
Doppler Data
In the first script line above, we create a Simulator object, Sim. The next field set is Ad-
dData which is used to specify which TrackingFileSet should be used. Recall that the
TrackingFileSet specifies the type of data to be simulated and the file name specifying
where to store the data. The TrackingFileSet, DSNsimData, that we created in the
Define the types of measurements to be simulated section, specified that we wanted to
simulate two way DSN range and Doppler data that involved the CAN GroundStation.
The next three script lines, which set the EpochFormat, InitialEpoch, and FinalEpoch
fields, specify the time period of the simulation. Here, we choose a short 12 minute
duration.
The next script line sets the MeasurementTimeStep field which specifies the request-
ed time between measurements. We choose a value of 10 minutes. This means that
our data file will contain a maximum of two range measurements and two Doppler mea-
surements.
The next script line sets the Propagator field which specifies which Propagator object
should be used. We set this field to the Prop Propagator object which we created in
the Create and configure Force model and propagator section.
Finally, in the last line of the script segment, we set the AddNoise field which speci-
fies whether or not we want to add noise to our simulated measurements. The noise
that can be added is defined by the ErrorModel objects that we created in the Create
and configure the Ground Station and related parameters section. As discussed in the
Create and configure the Ground Station and related parameters section and Appendix
A – Determination of Measurement Noise Values, the noise added to the range mea-
surements would be Gaussian with a one sigma value of 10.63 Range Units and the
noise added to the Doppler measurements would be Gaussian with a one sigma value
of 0.0282 Hz. For this simulation, we choose not to add noise.
BeginMissionSequence
RunSimulator Sim
189
Tutorials Simulate DSN Range and
Doppler Data
We have now completed all of our script segments. See the file,
Tut_Simulate_DSN_Range_and_Doppler_Data.script, in the GMAT samples folder,
for a listing of the entire script. We are now ready to run the script. Hit the Save,Sync,Run
button, ( ). Because we are only simulating a small amount of data, the script
should finish execution in about one second.
The first line of the file is a comment line indicating that this is a file containing mea-
surement data stored in GMAT’s internal format. There are 4 lines of data representing
range data at two successive times and Doppler data at two successive times. As we
expected, we have no more than 4 total measurements. Refer to the Tracking Data
Types for OD Help for a description of the range and Doppler GMD file format.
We now analyze the first line of data which represents a DSN two way range measure-
ment at the start of the simulation at '19 Aug 2015 00:00:00.000 UTCG’ which corre-
sponds to the output TAI modified Julian Day of 27253.500416666... TAIMJD.
The second and third fields, DSN_SeqRange and 9004, are just internal GMAT codes
indicating the use of DSN range (Trk 2-34 type 7) data.
The 4th field, 22222, is the Downlink station ID. This is the ID we gave the CAN
GroundStation object that we created in the Create and configure the Ground Station
and related parameters section. The 5th field, 11111, is the spacecraft ID. This is the
ID we gave the Sat Spacecraft object that we created in the Create and configure the
spacecraft, spacecraft transponder, and related parameters section.
The 6th field, 2.6025689337646484e+07, is the actual DSN range observation value
in RU.
The 7th field, 2, is an integer which represents the Uplink Band of the uplink GroundS-
tation, CAN. The designation, 2, represents X-band. See the RunSimulator Help for
a detailed discussion of how GMAT determines what value should be written here. As
described in the Help, since we are not using a ramp table, GMAT determines the Up-
link Band by looking at the transmit frequency of the Transmitter object attached to the
190
Simulate DSN Range and Tutorials
Doppler Data
CAN ground station. GMAT knows that the 7200 MHz value that we assigned to CAN’s
Transmitter resource, DSNTransmitter, corresponds to an X-band frequency.
The 8th field, 7.2e+009, is the transmit frequency of CAN at the time of the measure-
ment. Since we are not using a ramp table, this value will be constant for all measure-
ments and it is given by the value of the frequency of the Transmitter object, DSN-
Transmitter, that we attached to the CAN ground station. Recall the following script
segment, DSNTransmitter.Frequency = 7200; %MHz, from the Create and configure
the Ground Station and related parameters section.
The 9th field, 3.3554432e+07, represents the integer range modulo number that helps
define the DSN range measurement. This is the value that we set when we created and
configured the TrackingFileSet DSNsimData object in the Define the types of mea-
surements to be simulated section. Recall the following script command,
DSNsimData.SimRangeModuloConstant = 3.3554432e+07;
We now analyze the second line of data which represents a DSN two way Doppler
measurement at the start of the simulation at '19 Aug 2015 00:00:00.000 UTCG’ which
corresponds to the output TAI modified Julian Day of 27253.500416666... TAIMJD.
The second and third fields, Doppler and 9006, are just internal GMAT codes indicating
the use of DSN Doppler (derived from two successive Trk 2-34 type 17 Total Count
Phase measurements) data.
The 4th field, 22222, is the Downlink station ID. This is the ID we gave the CAN GroundS-
tation object that we created in the Create and configure the Ground Station and related
parameters section. The 5th field, 11111, is the spacecraft ID. This is the ID we gave
the Sat Spacecraft object that we created in the Create and configure the spacecraft,
spacecraft transponder, and related parameters section.
The 6th field, 2, is an integer which represents the Uplink Band of the uplink GroundS-
tation, CAN. As we mentioned when discussing the range measurement, the designa-
tion, 2, represents X-band.
The 7th field, 10, is the Doppler Count Interval (DCI) used to help define the Doppler
measurement. This is the value that we set when we created and configured the Track-
ingFileSet DSNsimData object in the Define the types of measurements to be simulat-
ed section. Recall the following script command,
DSNsimData.SimDopplerCountInterval = 10.0;
The 8th field, -8.4593363231570539e+09, is the actual DSN Doppler observation value
in Hz.
The third line of data represents the second DSN two way range measurement at '19
Aug 2015 00:10:00.000 UTCG’ which corresponds to the output TAI modified Julian
191
Tutorials Simulate DSN Range and
Doppler Data
Day time of 27253.507361111... TAIMJD. The fourth line of data represents the second
DSN two way Doppler measurement at '19 Aug 2015 00:10:00.000 UTCG.’
In order to generate measurement data from additional ground stations, we must first
create and configure additional GroundStation objects. Below, we create and configure
two new ground stations, GDS and MAD.
Now that we have defined two additional ground stations, we must specify the mea-
surement noise associated with these new ground stations. This can be done using the
previously created ErrorModel resources as shown below.
192
Simulate DSN Range and Tutorials
Doppler Data
Next, we must add the corresponding two way range and Doppler measurements as-
sociated with our new ground stations to our TrackingFileSet object, DSNsimData, as
shown below.
We now create our ramp table that many but not all missions use. A ramp table is a
table that allows GMAT to calculate the transmit frequency of all the ground stations
involved in our simulation. Recall that GMAT needs to know the transmit frequency, as
a function of time, in order to calculate the value of the observations. The term “ramp” is
used because the transmit frequency increases linearly with time and a graph of transmit
frequency vs. time would typically show a ramp. A mission that does not use a ramp
table simply uses a constant transmit frequency for a given ground station.
To modify our script to accommodate the use of a ramp table, we modify our Tracking-
FileSet object, DSNsimData, as shown below.
DSNsimData.RampTable = ...
{'../output/Simulate DSN Range and Doppler Data 3 weeks.rmp'};
We must now create a file with the name shown above in the GMAT ‘output’ directory.
Refer to the TrackingFileSet Help for a description of the ramp table file format. In order
for GMAT to determine the transmit frequencies of all the ground stations, the ramp table
must have at least one row of data for every ground station providing measurement
data. The contents of our ramp table is shown below.
Each row of data above is called a ramp record. Let’s analyze the first ramp record. The
first field, 27252, is the TAIMJD date of the ramp record.
The second field, 22222, is the ground station ID of the GroundStation object whose
frequency is being specified. We note that the ID 22222 corresponds to the CAN ground
station. The third field, 11111, is the ID of the spacecraft that the CAN ground station is
transmitting to. We recognize 11111 as the ID of the Sat spacecraft.
The 4th field, 2, is an integer representing the uplink band of the transmission. The
integer 2 represents X-band. The 5th field, 1, is an integer describing the ramp type.
The integer 1 represents the start of a new ramp.
The 6th field, 7.2e9, is the transmission frequency in Hz, from CAN to Sat at the time
given by the first field. The 7th input is the ramp rate in Hz/s.
193
Tutorials Simulate DSN Range and
Doppler Data
We now describe how GMAT uses the ramp record to determine the transmit frequency
of CAN to Sat at a given time. We let TAIMJD be the time associated with the ramp
record. Then GMAT will calculate the value of the transmit frequency at t = 27252.5
TAIMJD as shown below.
where
Note that, in the typical case where there are numerous ramp records, it is assumed that
is chosen as close to time t as possible. For our case above, the transmit frequency
from CAN to Sat at time t is
The second and third rows of the ramp table allow GMAT to calculate the transmit fre-
quency from GDS to Sat and MAD to Sat, respectively. We now create a file, Simulate
DSN Range and Doppler Data Realistic GMD.rmp, with the contents shown above
and place it in GMAT’s ‘output’ folder.
We make one final comment about the use of a ramp table. We note
that when a ramp table is used, GMAT uses the various script inputs (e.g.,
SatTransponder.TurnAroundRatio and DSNTransmitter.Frequency) differently.
See the RunSimulator Help for details.
We only have two steps remaining in order to create a script that generates more realistic
measurement data. The first step is to increase the simulation time from 10 minutes to
the more realistic three weeks worth of data that is typically needed to generate an orbit
determination solution for a spacecraft in this type of deep space orbit. The second step
is to turn on the measurement noise. These two steps are accomplished by making the
following changes to our TrackingFileSet object, DSNsimData.
Note that above, in addition to implementing the two needed steps, we also changed
the measurement time step from 600 seconds to 3600 seconds. This is not a realistic
time step as many missions would use a time step that might even be less than 600
seconds. We used this larger time step for tutorial purposes only so that the script would
not take too long to run.
A complete script, containing all the changes we have made in the Create a
more realistic GMAT Measurement Data (GMD) section, is contained in the file,
Tut_Simulate_DSN_Range_and_Doppler_Data_3_weeks.script. Note that in this
file, in addition to the changes above, we have also changed the GMD output file name
to Simulate DSN Range and Doppler Data 3 weeks.gmd.
Now run the script which should take approximately 2-3 minutes since we are generating
much more data than previously. We will use the GMD file we have created here as
194
Simulate DSN Range and Tutorials
Doppler Data
input to an estimation script we will build in the next tutorial, Orbit Estimation using
DSN Range and Doppler Data.
References
where
where
195
Tutorials Simulate DSN Range and
Doppler Data
Recall that in the Create and configure the Ground Station and related parameters sec-
tion, we set DSNTransmitter.Frequency = 7200; This corresponds to an X-band fre-
quency (so, C=221/1498) of 7200e6 Hz. For the case where a ramp table is not used,
we have a constant frequency, , and thus
For this example, for DSN range measurements, we want to use a 1 sigma noise bias
of 3 meters (Schanzle [1995]). From the calculations above, we determine that this
corresponds to 3*3.543172 10.63 RU.
We now turn our attention to the DSN Doppler measurement. The DSN Doppler mea-
surement that GMAT uses is actually a derived observation, O, calculated using two
successive Total Count Phase, , (type 17 Trk 2-34 record) measurements as shown
below.
where
In the absence of measurement noise, one can show (Moyer [2000]), that the Observed
value (O) above equals the Computed (C) value below.
where
196
Simulate DSN Range and Tutorials
Doppler Data
where
The quantity, , above represents the measurement noise and thus the equation
gives us a way to convert measurement noise in Hz to measurement noise in mm/s.
197
198
Tutorials
Note
GMAT currently implements a number of different data types for orbit deter-
mination. Please refer to Tracking Data Types for OD for details on all the
measurment types currently supported by GMAT. The measurements being
considered here are DSN two way range and DSN two way Doppler.
In this tutorial, we will use GMAT to read in simulated DSN range and Doppler measure-
ment data for a sample spacecraft in orbit about the Sun and determine its orbit. The
spacecraft is in an Earth “drift away” type orbit about 1 AU away from the Sun and almost
300 million km away from the Earth. This tutorial has many similarities with the Simulate
DSN Range and Doppler Data Tutorial in that most of the same GMAT resources need
to be created and configured. There are differences, however, in how GMAT uses the
resources that we will point out as we go along.
1. Create and configure the spacecraft, spacecraft transponder, and related parame-
ters
2. Create and configure the Ground Station and related parameters
3. Define the types of measurements to be processed
4. Create and configure Force model and propagator
5. Create and configure Batch Estimator object
6. Run the mission and analyze the results
Note that this tutorial, unlike most of the mission design tutorials, will be entirely script
based. This is because most of the resources and commands related to navigation are
not implemented in the GUI and are only available via the script interface.
As you go through the tutorial below, it is recommended that you paste the script seg-
ments into GMAT as you go along. After each paste into GMAT, you should perform a
syntax check by hitting the Save, Sync button ( ). To avoid syntax errors, where
needed, don’t forget to add the following command, as needed, to the last line of the
script segment you are checking.
BeginMissionSequence
199
Tutorials Orbit Estimation using DSN
Range and Doppler Data
We note that in addition to the material presented here, you should also look at the
individual Help resources for all the objects and commands we create and use here.
For example, Spacecraft, Transponder, Transmitter, GroundStation, ErrorModel,
TrackingFileSet, RunEstimator, etc all have their own Help pages.
Next, we create a new spacecraft, Sat, and set its epoch and Cartesian coordinates.
Sat.Id = 11111;
For the simulation tutorial, the Cartesian state above represented the “true” state. Here,
the Cartesian state represents the spacecraft operator’s best “estimate” of the state,
the so-called a priori estimate. Because, one never has exact knowledge of the true
state, we have perturbed the Cartesian state above by a few km in each component as
compared to the simulated true state shown in the comment field.
200
Orbit Estimation using DSN Tutorials
Range and Doppler Data
We set TurnAroundRatio, which is the ratio of the retransmitted to the input signal, to
'880/749.' See the RunEstimator Help for a discussion on how GMAT uses this input
field. Recall that, as part of their calculations, estimators need to form a quantity called
the observation residual, O-C, where O is the “Observed” value of a measurement and
C is the “Computed,” based upon the current knowledge of the orbit state, value of a
measurement. As described in the Help, since our DSN data, for this tutorial, uses a
ramp table, this input turn around ratio is not used to calculate the computed, C, Doppler
measurements. Instead, the turn-around ratio used to calculate the computed Doppler
measurement will be inferred from the value of the uplink band contained in the ramp
table.
Note that in the second to last script command above, we attach our newly created
Transponder resource, SatTransponder, and its related Antenna resource, HGA, to
our spacecraft, Sat.
The last script line, which was not present in the simulation script, is needed to tell GMAT
what quantities the estimator will be estimating, the so-called “solve-fors.” Here, we tell
GMAT to solve for the 6 components of our satellite’s Cartesian state. Since we input
the Sat state in SunMJ2000 coordinates, this is the coordinate system GMAT will use
to solve for the Cartesian state.
Before we create the GroundStation object itself, as shown below, we first create
the Transmitter, Receiver, and Antenna objects that must be associated with any
GroundStation.
201
Tutorials Orbit Estimation using DSN
Range and Doppler Data
DSNTransmitter.PrimaryAntenna = DSNAntenna;
DSNReceiver.PrimaryAntenna = DSNAntenna;
DSNTransmitter.Frequency = 7200; %MHz
In the script segment above, we first created Transmitter, Receiver, and Antenna ob-
jects. The GMAT script line DSNTransmitter.PrimaryAntenna = DSNAntenna, sets
the main antenna that the Transmitter resource, DSNTransmitter, will be using. Like-
wise, the DSNReceiver.PrimaryAntenna = DSNAntenna script line sets the main an-
tenna that the Receiver resource, DSNReceiver, will be using. As previously men-
tioned, the Antenna object currently has no function, but we include it here both be-
cause GMAT requires it and for completeness since the Antenna resource may have a
function in a future GMAT release. Finally, we set the transmitter frequency in the last
GMAT script line above. See the RunEstimator Help for a complete description of how
this input frequency is used. As described in the Help, since in this example we will be
using a ramp table, this input frequency will not be used to calculate the computed value
of the range and Doppler observations. Instead, the frequency value in the ramp table
will be used to calculate the computed range and Doppler observations.
The script segment above is broken into five sections. In the first section, we create our
GroundStation object and we set our Earth-Centered Fixed Cartesian coordinates. In
202
Orbit Estimation using DSN Tutorials
Range and Doppler Data
the second section, we set the ID of the ground station so that GMAT will be able to
identify data from this ground station contained in the GMD file.
In the third section, we set the minimum elevation angle to 7 degrees. Below this ground
station to spacecraft elevation angle, no measurement data will be used to form an orbit
estimate. In the fourth section, we specify which troposphere and ionosphere model we
wish to use to model RF signal atmospheric refraction effects. Finally, in the fifth section,
we attach three pieces of previously created required hardware to our ground station,
a transmitter, a receiver, and an antenna.
Next, we create and configure the GDS GroundStation resource, and associated
Transmitter resource.
Next, we create and configure the MAD GroundStation resource, and associated
Transmitter resource.
203
Tutorials Orbit Estimation using DSN
Range and Doppler Data
Since we have already created the GroundStation object and its related hardware, we
now create the ground station error models. Since we wish to form an orbit estimate
using both range and Doppler data, we need to create two error models as shown below,
one for range measurements and one for Doppler measurements.
The script segment above is broken into three sections. The first section defines an
ErrorModel named DSNrange. The error model Type is DSN_SeqRange which indi-
cates that it is an error model for DSN sequential range measurements. The 1 sigma
standard deviation of the Gaussian white noise is set to 10.63 Range Units (RU) and
the measurement bias is set to 0 RU.
The second section above defines an ErrorModel named DSNdoppler. The error mod-
el Type is DSN_TCP which indicates that it is an error model for DSN total count phase-
derived Doppler measurements. The 1 sigma standard deviation of the Gaussian white
noise is set to 0.0282 Hz and the measurement bias is set to 0 Hz. The range and
Doppler NoiseSigma values above will be used to form measurement weighting matri-
ces used by the estimator algorithm.
The third section above attaches the two ErrorModel resources we have just created to
the CAN, GDS, and MAD GroundStation resources. Note that in GMAT, the measure-
ment noise or bias is defined on a per ground station basis. Thus, any range measure-
ment error involving the CAN, GDS, and MAD GroundStation is defined by the DSN-
Range ErrorModel and any Doppler measurement error involving the CAN, GDS, and
MAD GroundStation is defined by the DSNdoppler ErrorModel. Note that, if desired,
we could have created 6 different ErrorModel resources, two error models representing
the two data types for 3 ground stations.
204
Orbit Estimation using DSN Tutorials
Range and Doppler Data
Create TrackingFileSet DSNsimData;
DSNsimData.AddTrackingConfig = {{CAN, Sat, CAN}, 'DSN_SeqRange'};
DSNsimData.AddTrackingConfig = {{CAN, Sat, CAN}, 'DSN_TCP'};
DSNsimData.AddTrackingConfig = {{GDS, Sat, GDS}, 'DSN_SeqRange'};
DSNsimData.AddTrackingConfig = {{GDS, Sat, GDS}, 'DSN_TCP'};
DSNsimData.AddTrackingConfig = {{MAD, Sat, MAD}, 'DSN_SeqRange'};
DSNsimData.AddTrackingConfig = {{MAD, Sat, MAD}, 'DSN_TCP'};
DSNsimData.FileName = ...
{'../output/Simulate DSN Range and Doppler Data 3 weeks.gmd'};
DSNsimData.RampTable = ...
{'../output/Simulate DSN Range and Doppler Data 3 weeks.rmp'};
DSNsimData.UseLightTime = true;
DSNsimData.UseRelativityCorrection = true;
DSNsimData.UseETminusTAI = true;
The script lines above are broken into three sections. In the first section, the resource
name, DSNsimData, is declared, the data types are defined, and the input GMD file and
ramp table name are specified. AddTrackingConfig is the field that is used to define
the data types. The first AddTrackingConfig line tells GMAT to process DSN range
two way measurements for the CAN to Sat to CAN measurement strand. The second
AddTrackingConfig line tells GMAT to process DSN Doppler two way measurements
for the CAN to Sat to CAN measurement strand. The remaining 4 AddTrackingConfig
script lines tell GMAT to also process GDS and MAD range and Doppler measurements.
Note that the input GMD and ramp table files that we specified are files that we created
as part of the Simulate DSN Range and Doppler Data Tutorial. Don’t forget to put
these files in the GMAT “output” directory.
The second section above sets some processing parameters that apply to both the
range and Doppler measurements. We set UseLightTime to True in order to generate
realistic computed, C, measurements that take into account the finite speed of light. The
last two parameters in this section, UseRelativityCorrection and UseETminusTAI, are
set to True so that general relativistic corrections, as described in Moyer [2000], are
applied to the light time equations.
Note that, in the simulation tutorial, we set two other DSNsimData fields, SimDoppler-
CountInterval and SimRangeModuloConstant. Since these fields only apply to sim-
ulations, there is no need to set them here as their values would only be ignored.
205
Tutorials Orbit Estimation using DSN
Range and Doppler Data
Fm.CentralBody = Sun;
Fm.PointMasses = {Sun, Earth, Luna, Mars, Saturn, ...
Uranus, Mercury, Venus, Jupiter};
Fm.SRP = On;
Fm.RelativisticCorrection = On;
Fm.ErrorControl = None;
Prop.FM = Fm;
Prop.MinStep = 0;
We set ErrorControl = None because for the current release of GMAT, batch
estimation requires fixed step numerical integration. The fixed step size is given by
Prop.InitialStepSize which has a default value of 60 seconds. For our deep space
orbit, the dynamics are slowly changing and this step size is not too big. For more dy-
namic force models, a smaller step size may be needed.
All of the fields above are described in BatchEstimator Help but we describe them
briefly here as well. In the first script line above, we create a BatchEstimator object,
bat. In the next line, we set the ShowProgress field to true so that detailed output of
the batch estimator will be shown in the message window.
In the third line, we set the ReportStyle to Normal. For the R2016A GMAT release, this
is the only report style that is available. In a future release, if we wanted to see additional
data such as measurement partial derivatives, we would use the Verbose style. In the
next line, we set the ReportFile field to the name of our desired output file which by
default is written to GMAT’s ‘output’ directory.
206
Orbit Estimation using DSN Tutorials
Range and Doppler Data
We set the Measurements field to the name of the TrackingFileSet resource we wish to
use. Recall that the TrackingFileSet, DSNsimData, that we created in the Define the
types of measurements that will be processed section defines the type of measurements
that we wish to process. In our case, we wish to process DSN range and Doppler data
associated with the CAN, GDS, and MAD ground stations.
The next script line sets the Propagator field which specifies which Propagator object
should be used during estimation. We set this field to the Prop Propagator object which
we created in the Define the types of measurements that will be processed section.
In the 11th script line, we set the ShowAllResiduals field to true show that the obser-
vation residuals plots, associated with the various ground stations, will be displayed
Next, we set the InversionAlgorithm field to 'Internal' which specifies which algorithm
GMAT should use to invert the normal equations. There are two other inversion algo-
rithms, 'Cholesky' or 'Schur' that we could optionally use.
Finally, we set the value of MatlabFile. This is the name of the MATLAB output file that
will be created, which, by default, is written to GMAT’s ‘output’ directory. This file can
be read into MATLAB to perform detailed calculations and analysis. The MATLAB file
can only be created if you have MATLAB installed and properly configured for use with
GMAT.
BeginMissionSequence
RunEstimator bat
207
Tutorials Orbit Estimation using DSN
Range and Doppler Data
We have now completed all of our script segments. See the file,
Tut_Orbit_Estimation_using_DSN_Range_and_Doppler_Data.script, in the sam-
ples folder, for a listing of the entire script. We are now ready to run the script. Hit the
Save,Sync,Run button, ( ). Given the amount of data we are processing, our
mission orbit, and our choice of force model, the script should finish execution in about
1-2 minutes.
We analyze the results of this script in many ways. In the first subsection, we analyze
the Message window output. In the second subsection, we look at the plots of the ob-
servation residuals, and in the third subsection, we analyze the batch estimation report.
Finally, in the fourth subsection, we discuss how the contents of the MATLAB output file
can be used to analyze the results of our estimation process.
The value of 1348 is the number of lines of measurement data in the GMD file listed
above.
Next, the window output contains a description of the tracking configuration. The output
below confirms that we are processing range and Doppler data from the CAN, GDS,
and MAD ground stations.
Later on in the output, GMAT echoes out the a priori estimate that we input into the script.
a priori state:
Estimation Epoch:
27253.5004170646025158930570 A.1 modified Julian
27253.5004166666661733004647 TAI modified Julian
19 Aug 2015 00:00:00.000 UTCG
Sat.SunMJ2000Eq.X = -126544963
Sat.SunMJ2000Eq.Y = 61978518
Sat.SunMJ2000Eq.Z = 24133225
Sat.SunMJ2000Eq.VX = -13.789
208
Orbit Estimation using DSN Tutorials
Range and Doppler Data
Sat.SunMJ2000Eq.VY = -24.673
Sat.SunMJ2000Eq.VZ = -10.662
Next, GMAT outputs some data associated with the initial iteration of the Outer Loop
Sigma Editing (OLSE) process as shown below.
As previously mentioned, the OLSE process can edit (i.e., remove) certain data from
use as part of the estimation algorithm. There are five conditions which could cause a
data point to be edited. For each condition, the output above specifies how many data
points were edited. We now discuss the meaning of the five conditions.
The first condition, “No Computed Value Configuration Available” means that GMAT
has read in some measurement data but no corresponding tracking configuration has
been defined in the GMAT script. Thus, GMAT has no way to form the computed, C,
value of the measurement. For example, this might happen if our script did not define
a GroundStation object corresponding to some data in the GMD file. Since we have
defined everything we need to, no data points are edited for this condition.
The second condition, “Out of Ramp Table Range,” means that while solving the light
time equations, GMAT needs to know the transmit frequency, for some ground station,
at a time that is not covered by the ramp table specified in our TrackingFileSet resource,
DSNsimData. Looking at our input GMD file, we see that our measurement times range
from 27253.5004166... to 27274.5004166666... TAIMJD. Since our ramp table has a
ramp record for all three ground stations at 27252 TAIMJD which is about 1 ½ days
before the first measurement and since our a priori Cartesian state estimate is fairly
good, it makes sense that no measurements were edited for this condition.
The third condition, “Signal Blocked,” indicates that while taking into account its cur-
rent estimate of the state, GMAT calculates that a measurement for a certain measure-
ment strand is not possible because the signal is “blocked.” Actually, the signal does
not have to blocked, it just has to violate the minimum elevation angle constraint as-
sociated with a given ground station. Consider a GDS to Sat to GDS range two way
range measurement at given time. If the GDS to Sat elevation angle was 6 degrees, the
measurement would be edited out since the minimum elevation angle, as specified by
the GDS.MinimumElevationAngle field, is set at 7 degrees. Since, in our simulation,
we specified that only data meeting this 7 degree constraint should be written out, it is
plausible that no data were edited because of this condition.
The fourth condition, “Initial RMS Sigma Filter,” corresponds to GMAT’s OLSE process-
ing for the initial iteration. As mentioned before, you can find a complete description
of the OLSE in the “Behavior of Outer Loop Sigma Editing (OLSE)” discussion in the
BatchEstimator Help. As described in the Help, for the initial iteration, data is edited if
209
Tutorials Orbit Estimation using DSN
Range and Doppler Data
(O-C)/NoiseSigma
and where NoiseSigma are inputs that we set when we created the various ErrorModel
resources.
We note that for a good orbit solution, the Weighted Measurement Residual has a value
of approximately one. Since our a priori state estimate is not that far off from the truth
and since we have set OLSEInitialRMSSigma to a very large value of 10,000, we do
not expect any data to be edited for this condition.
The fifth condition, “Outer-Loop Sigma Editor,” corresponds to GMAT’s OLSE process-
ing for the second or later iteration. Since the output we are analyzing is for the initial
iteration of the batch estimator, the number of data points edited because of this condi-
tion is 0. We will discuss the OLSE processing for the second or later iterations when
we analyze the output for a later iteration.
The first output line above gives the weighted RMS calculated when the estimate of the
state is the input a priori state (i.e., the 0th iteration state). The weighted RMS value of
approximately 1460 is significantly far away from the value of 1 associated with a good
orbit solution. The second output line gives the best (smallest) weighted RMS value for
all of the iterations. Since this is our initial iteration, the value of the BestRMS is the
same as the WeightedRMS. The third output line is the predicted weighted RMS value
for the next iteration. Because of the random noise involved in generating the simulated
input data, the numbers you see will differ from that above.
Next, GMAT outputs the state associated with the first iteration of the batch estimator.
Let’s define what we mean by iteration. The state at iteration ‘n’ is the state after GMAT
has solved the so-called normal equations (e.g., Eq. 4.3.22 or 4.3.25 in Tapley [2004])
‘n’ successive times. By convention, the state at iteration 0 is the input a priori state.
------------------------------------------------------
Iteration 1
210
Orbit Estimation using DSN Tutorials
Range and Doppler Data
Sat.SunMJ2000Eq.VZ = -10.662000523
Next, GMAT outputs statistics on how many data points were edited for this iteration.
For the same reasons we discussed for the initial 0th iteration, as expected, no data
points were edited because “No Computed Value Configuration Available” or because
a requested frequency was “Out of Ramp Table Range.” Also, for the same reasons
discussed for the 0th iteration, it is plausible that no data points were edited for this
iteration because of signal blockage. Note that there are no data points edited because
of the “Initial RMS Sigma Filter” condition. This is as expected because this condition
only edits data on the initial 0th iteration. Finally, we note that, in this example, 1 data
point out of 1348 data points are edited because of the OLSE condition. Due to the
randomness of the noise added in the simulation step, you may see more or fewer points
edited.
As discussed in the “Behavior of Outer Loop Sigma Editing (OLSE)” section in the
BatchEstimator Help,” data is edited if
where
WRMSP is the predicted weighted RMS calculated at the end of the previous
iteration.
It is a good sign that only a few points are edited out. If too much data is edited out, even
if you have a good weighted RMS value, it indicates that you may have a problem with
your state estimate. Next, GMAT outputs some root mean square, (RMS), statistical
data associated with iteration 1.
The first output line above gives the weighted RMS calculated when the estimate of
the state is the iteration 1 state. The weighted RMS value shown here of 0.974 is close
to the value of 1 associated with a good orbit solution. The second output line gives
211
Tutorials Orbit Estimation using DSN
Range and Doppler Data
the best (smallest) weighted RMS value for all of the iterations. Since this iteration 1
WeightedRMS value is the best so far, BestRMS is set to the current WeightedRMS
value. The third output line is the predicted weighted RMS value for the next iteration.
Note that the RMS values calculated above only use data points that are used to form
the state estimate. Thus, the edited points are not used to calculate the RMS.
Because the predicted WeightedRMS value is very close to the BestRMS value, GMAT,
as shown in the output below, concludes that the estimation process has converged.
As previously mentioned, see the “Behavior of Convergence Criteria” discussion in the
BatchEstimator Help for complete details.
********************************************************
*** Estimating Completed in 2 iterations
********************************************************
Estimation converged!
|1 - RMSP/RMSB| = | 1- 0.974224 / 0.974259| = 3.58173e-05 is
less than RelativeTol, 0.0001
GMAT then outputs the final, iteration 2, state. Note that GMAT does not actually cal-
culate the weighted RMS associated with this state but we assume that it is close to the
predicted value of 1.00804237273 that was previously output.
Estimation Epoch:
27253.5004170646025158930570 A.1 modified Julian
27253.5004166666661733004647 TAI modified Julian
19 Aug 2015 00:00:00.000 UTCG
Sat.SunMJ2000Eq.X = -126544963.637
Sat.SunMJ2000Eq.Y = 61978520.6939
Sat.SunMJ2000Eq.Z = 24133223.6628
Sat.SunMJ2000Eq.VX = -13.7890015517
Sat.SunMJ2000Eq.VY = -24.6729992038
Sat.SunMJ2000Eq.VZ = -10.6620000077
Finally, GMAT outputs the final Cartesian state error covariance matrix and correlation
matrix, as well as the time required to complete this script.
Final Covariance Matrix:
212
Orbit Estimation using DSN Tutorials
Range and Doppler Data
********************************************************
========================================
We now analyze the CAN range and Doppler residuals. For the 0th iteration, the range
residuals vary from approximately 11,000 to 31,000 RU. These residuals are this large
because our a priori estimate of the state was deliberately perturbed from the truth.
There are multiple indicators on this graph that indicate that GMAT has not yet con-
verged. First, the residuals have an approximate linear structure. If you have modeled
the dynamics and measurements correctly, the plots should have a random appearance
with no structure. Additionally, the residuals are biased, i.e., they do not have zero mean.
For a well modeled system, the mean value of the residuals should be near zero. Finally,
the magnitude of the range residuals is significantly too large. Recall that in the Create
and configure the Ground Station and related parameters section, we set the 1 sigma
measurement noise for the CAN range measurements to 10.63 RU. Thus, for a large
sample of measurements, we expect, roughly, that the vast majority of measurements
will lie between the values of approximately -32 and +32 RU. Taking a look at the 1st
iteration CAN range residuals, this is, approximately, what we get.
The 0th iteration CAN Doppler residuals range from approximately 0.0050 to 0.01535
Hz. As was the case for the range 0th iteration residuals, the fact that the Doppler resid-
uals are biased indicates that GMAT has not yet converged. Recall that in the Create
and configure the Ground Station and related parameters section, we set the 1 sigma
measurement noise for the CAN Doppler measurements to 0.0282 Hz. Thus, for a large
sample of measurements, we expect, roughly, that the vast majority of measurements
will lie between the values of approximately -0.0846 and +0.0846 RU. Taking a look at
the 1st iteration CAN Doppler residuals, this is, approximately, what we get.
There is one important detail on these graphs that you should be aware of. GMAT only
plots the residuals for data points that are actually used to calculate the solution. Recall
that for iteration 0, all 1348 of 1348 total measurements were used to calculate the
orbit state, i.e., no data points were edited. Thus, if you counted up all the data points
213
Tutorials Orbit Estimation using DSN
Range and Doppler Data
on the 6 iteration 0 plots, you would find 1348 points. The situation is different for the
1st iteration. Recall that for iteration 1, 1347 of 1348 total measurements were used to
calculate the orbit state, i.e., 1 data point was edited. Thus, if you counted up all the data
points on the 6 iteration 1 plots, you would find 1347 points. If you wish to generate plots
that contain both non-edited and edited measurements, you will need to generate them
yourself using the MATLAB output file as discussed in the Matlab Output File section.
We note that the graphs have some interactive features. Hover your mouse over the
graph of interest and then right click. You will see that you have four options. You can
toggle both the grid lines and the Legend on and off. You can also export the graph data
to a text file, and finally, you can export the graph image to a bmp file.
The first approximately 150 lines of the report are mainly an echo of the parameters we
input into the script such as initial spacecraft state, force model, propagator settings,
measurement types to be processed, etc.
After this echo of the input data, the output report contains measurement residuals
associated with the initial 0th iteration. Search the file for the words, ‘ITERATION 0:
MEASUREMENT RESIDUALS’ to find the location of where the relevant output begins.
This output sections contains information on all of the measurements, both non-edited
and edited, that can possibly be used in the estimation process. Each row of data corre-
sponds to one measurement. For each measurement, the output tells you the following
• Iteration Number
• Record Number
• Epoch in UTC Gregorian format
• Observation type. ‘DSN_SeqRange’ corresponds to DSN sequential range and
‘DSN_TCP’ corresponds to DSN total count phase-derived Doppler.
• Participants. For example, ‘22222,11111,22222’ tells you that your measurement
comes from a CAN to Sat to CAN link.
• Edit Criteria.
• Observed Value (O)
• Computed Value (C)
• Observation Residual (O-C)
• Elevation Angle
We have previously discussed the edit criteria. In particular, we discussed the various
reasons why data might be edited. If no edit code is shown for a residual record, this
means that the data was not edited and the data was used, for this iteration, to calculate
a state estimate.
Note that if the elevation angle of any of the measurements is below our input criteria
of 7 degrees, then the measurement would be edited because the signal would be con-
214
Orbit Estimation using DSN Tutorials
Range and Doppler Data
sidered to be “blocked.” For range data, we would see Bn where n is an integer spec-
ifying the leg number. For our two way range data type, we have two legs, the uplink
leg represented by the integer, 1, and the downlink leg, represented by the integer 2.
Thus, if we saw “B1” in this field, this would mean that the signal was blocked for the
uplink leg. Correspondingly, for Doppler data, we would also see Bn, but the integer n
would be 1 or 2 depending upon whether the blockage occurred in the start path (n=1)
or the end path (n=2).
After all of the individual iteration 0 residuals are printed out, four different iteration 0
observation summary reports, as shown below, are printed out.
After all of the observation summaries are printed out, the updated state and covariance
information, obtained by processing the previous residual information, are printed out.
The output also contains statistical information about how much the individual compo-
nents of the state estimate have changed for this iteration.
At this point, the output content repeats itself for the next iteration. The new state es-
timate is used to calculate new residuals and the process starts all over again. The
process stops when the estimator has either converged or diverged.
We now give an example of how this report can be used. In the Message Window Output
section, we noted that, for iteration 1, some measurements were edited because of the
OLSE criteria. Let’s investigate this in more detail. What type of data was edited? From
what station? Could there be a problem with this data type at this station? We look
at the ‘Observation Summary by Station and Data Type’ for iteration 1. We see that
one range measurement from the CAN station was edited. The mean residual and 1-
sigma standard deviation for GDS range measurements was -0.222339 and 10.082896
RU, respectively. The mean residual and 1-sigma standard deviation for MAD range
measurements was 0.199925 and 10.205535 RU, respectively.
Now that we know that the issue was with GDS and MAD range measurements, we look
at the detailed residual output, for iteration 1, to determine the time these measurements
occurred. We can search for the OLSE keyword to help do this. We determine that a
CAN range measurement was edited at 02 Sep 2015 04:00:00.000 UTCG and that it
had an observation residual of -33.161377 RU. This is just a bit beyond the 3-sigma
value and we conclude that there is no real problem with the CAN range measurements.
This is just normal statistical variation.
We remind you, that when you do your run, you may have a different number of data
points edited. This is because, when you do your simulation, GMAT uses a random
number generator and you will be using a different data set.
215
Tutorials Orbit Estimation using DSN
Range and Doppler Data
using DSN Range and Doppler Data.mat.' By default, this file is created in GMAT’s
‘output’ directory. This file will only be created if you have MATLAB installed and prop-
erly configured for use with GMAT.
Start up a MATLAB session. Change the directory to your GMAT ‘output’ directory and
then type the following at the MATLAB command prompt.
>> load 'Orbit Estimation using DSN Range and Doppler Data.mat'
After the file has loaded, type the following command to obtain a list of available variable
names inside this file.
>> whos
>> whos
Name Size Bytes Class Attributes
Each of the variables is a structure with multiple fields containing arrays of data such as
measurements, residuals, edit flags, state information, and other information useful for
analysis. Full details on the contents of the BatchEstimator MATLAB file can be found in
the section called “Batch Estimator MATLAB Data File” in the BatchEstimator resource
documentation.
You can use the data in the MATLAB file to perform custom plots and statistical analysis
using MATLAB. For example, to produce a plot of all range residuals from the second
iteration, you can do the following:
References
GTDS [1989] Goddard Trajectory Mathematical Theory, Revision 1, Edited by A.
Long, J. Cappellari, et al., Computer Sciences Corporation, FDD,
FDD-552-89-0001, July 1989.
GTDS [2007] Goddard Trajectory Determination System User’s Guide, National
Aeronautics and Space Administration, GSFC, Greenbelt, MD, MOMS-
FD-UG-0346, July 2007
Moyer [2000] Moyer, Theodore D., Formulation for Observed and Computed Values
of Deep Space Network Data Types for Navigation (JPL Publication
00-7), Jet Propulsion Laboratory, California Institute of Technology, Oc-
tober 2000.
216
Orbit Estimation using DSN Tutorials
Range and Doppler Data
Tapley [2004] Tapley, Schutz, Born, Statistical Orbit Determination, Elsevier, 2004
List of tracking configurations (present in participant ID) for load records from data file '../output/Simulate DSN Range and Doppler Data 3 weeks.gmd':
Config 0: {{22222,11111,22222},DSN_SeqRange}
Config 1: {{22222,11111,22222},DSN_TCP}
Config 2: {{33333,11111,33333},DSN_SeqRange}
Config 3: {{33333,11111,33333},DSN_TCP}
Config 4: {{44444,11111,44444},DSN_SeqRange}
Config 5: {{44444,11111,44444},DSN_TCP}
**** No tracking configuration was generated because the tracking configuration is defined in the script.
a priori state:
Estimation Epoch:
27253.5004170646025158930570 A.1 modified Julian
27253.5004166666661733004647 TAI modified Julian
19 Aug 2015 00:00:00.000 UTCG
Sat.SunMJ2000Eq.X = -126544963
Sat.SunMJ2000Eq.Y = 61978518
Sat.SunMJ2000Eq.Z = 24133225
Sat.SunMJ2000Eq.VX = -13.789
Sat.SunMJ2000Eq.VY = -24.673
Sat.SunMJ2000Eq.VZ = -10.662
------------------------------------------------------
Iteration 1
********************************************************
*** Estimation Completed in 2 iterations
********************************************************
Estimation converged!
|1 - RMSP/RMSB| = | 1- 0.974224 / 0.974259| = 3.58173e-05 is less than RelativeTol, 0.0001
Estimation Epoch:
27253.5004170646025158930570 A.1 modified Julian
27253.5004166666661733004647 TAI modified Julian
217
Tutorials Orbit Estimation using DSN
Range and Doppler Data
19 Aug 2015 00:00:00.000 UTCG
Sat.SunMJ2000Eq.X = -126544963.637
Sat.SunMJ2000Eq.Y = 61978520.6939
Sat.SunMJ2000Eq.Z = 24133223.6628
Sat.SunMJ2000Eq.VX = -13.7890015517
Sat.SunMJ2000Eq.VY = -24.6729992038
Sat.SunMJ2000Eq.VZ = -10.6620000077
********************************************************
========================================
218
Orbit Estimation using DSN Tutorials
Range and Doppler Data
In the discussion that follows, we will comment out the old commands using DSN data
and replace it with new commands using GN data. We start first with the simulation
script. In what follows, we will use the object names previously created even though
the object names may no longer be accurate. For example, in the simulation script, we
created an Antenna object, DSNAntenna. We will continue to use this object name
although clearly a better name for this object would be GNAntenna. Let's consider the
spacecraft and ground station electronics. For the GN, S-band is typically used. We
change the value of the spacecraft transponder turn-around ratio and the ground station
transmitter frequency to account for this.
219
Tutorials Orbit Estimation using DSN
Range and Doppler Data
As shown below, we need to tell GMAT to simulate Range and RangeRate data instead
of DSN_SeqRange and DSN_TCP data.
Our original simulation script used a ramp table to specify the ground station transmit
frequencies. Since ramp tables are not used with the GN, as shown below, we want to
comment out the command that reads in a ramp file. For script clarity, we also comment
out a command that does not apply for GN data.
%DSNsimData.RampTable = ...
{'../data/navdata/Simulate DSN Range and Doppler Data 3 weeks.rmp'};
%DSNsimData.SimRangeModuloConstant = 3.3554432e+07;
We now move on the examining the estimation script. Open up the estimation script
from the tutorial and save it to a new name, say Estimation_GN_data. As was done
for the simulation script, we change the value of the spacecraft transponder turn-around
ratio and the ground station transmitter frequencies to account for the fact that we are
using the GN.
As was done for the simulation script, we configure the ErrorModels objects to describe
GN data as opposed to DSN data.
220
Orbit Estimation using DSN Tutorials
Range and Doppler Data
Next, we need to tell GMAT to estimate using Range and RangeRate data instead of
DSN_SeqRange and DSN_TCP data. We note that, if desired, the new lines below
can be deleted and the script will still work. GMAT will just read in the GMD file and
automatically detect which ground stations and data types are being used.
Recall that our new GN simulation script is configured to output the GMD file to the
GMAT "output" directory. Let's change our estimation script, which will read in this file,
accordingly.
As was done for our simulation script, we comment out the line that reads in a ramp table.
The last step is to run our new Estimation_GN_data script and then analyze the
results in a similar fashion as to what was done in the Estimation tutorial.
221
222
Reference Guide
The Reference Guide contains individual topics that describe each of GMAT's resources and com-
mands. When you need detailed information on syntax or application-specific examples for spe-
cific features, go here. It also includes system-level references that describe the script language
syntax, parameter listings, external interfaces, and configuration files.
Reference Guide
API
User Guide
Note
The user guide for the API is written in Sphinx and located in the GMAT
distribution here: gmat/api/GMAT_API_UsersGuide.pdf.pdf
225
226
Reference Guide
Resources
227
Reference Guide Dynamics and Modeling
Barycenter
The center of mass of selected celestial bodies
Description
A Barycenter is the center of mass of a set of celestial bodies. GMAT contains two
barycenter resources: a built-in SolarSystemBarycenter resource and the Barycen-
ter resource that allows you to build a custom Barycenter such as the Earth-Moon
barycenter. This resource cannot be modified in the Mission Sequence.
Fields
Field Description
BodyNames The list of CelestialBody resources included in the Barycenter.
Providing empty brackets sets the bodies to the default list de-
scribed below.
228
Dynamics and Modeling Reference Guide
Field Description
TargetColor Allows you to select available colors for Barycenter object's per-
turbing orbital trajectories that are drawn during iterative process-
es such as Differential Correction or Optimization. The target col-
or can be identified through a string or an integer array. For ex-
ample: Setting a barycenter's perturbing trajectory color to yellow
can be done in following two ways: Barycenter.TargetColor
= Yellow or Barycenter.TargetColor = [255 255 0]. This
field can be modified in the Mission Sequence as well.
GUI
The Barycenter dialog box allows you to define the celestial bodies included in a custom
Barycenter. All celestial bodies, including user-defined bodies, are available for use in a
229
Reference Guide Dynamics and Modeling
Barycenter and appear in either the Available Bodies list or the Selected Bodies list.
The example above illustrates the default configuration which contains Earth and Luna.
The SolarySystemBarycenter dialog box shown above is a built-in object and you
cannot modify its configuration. See the Remarks section for details regarding the model
for the SolarSystemBarycenter.
Remarks
Built-in SolarSystemBarycenter Object
You can create a custom barycenter using the Barycenter resource. The position and
velocity of a Barycenter is a mass-weighted average of the position and velocity of the
included celestial bodies. In the equations below mi, ri, and vi are respectively the mass,
th
position, and velocity of the i body in the barycenter, and rb and vb are respectively the
position and velocity of the barycenter.
230
Dynamics and Modeling Reference Guide
GMAT allows you to assign colors to barycenter orbits that are drawn using the
OrbitView graphics resource. GMAT also allows you to assign colors to perturbing
barycenter orbital trajectories which are drawn during iterative processes such as differ-
ential correction or optimization. The Barycenter object's OrbitColor and TargetColor
fields are used to assign colors to both orbital and perturbing trajectories. See the Fields
section to learn more about these two fields. Also see Color documentation for discus-
sion and examples on how to set colors on a barycenter orbit.
Examples
BeginMissionSequence
231
Reference Guide Dynamics and Modeling
aSpacecraft.EarthMJ2000Eq.Z
BeginMissionSequence
BeginMissionSequence
232
Dynamics and Modeling Reference Guide
CelestialBody
A celestial body model
Description
The CelestialBody resource is a model of a celestial body containing settings for the
physical properties, as well as the models for the orbital motion and orientation. GMAT
contains built-in models for the Sun, the 8 planets, Earth's moon, and Pluto. You can
create a custom CelestialBody resource to model a planet, asteroid, comet, or moon.
This resource cannot be modified in the Mission Sequence.
Fields
Field Description
3DModelFile Allows you to load 3D models for your celestial body. Models
must be in .3ds model formats.
233
Reference Guide Dynamics and Modeling
Field Description
3DModelOffsetZ This field lets you translate a celestial body in +Z or -Z axis
of central body's coordinate system.
234
Dynamics and Modeling Reference Guide
Field Description
CentralBody The central body of the celestial body. The central body field
is used primarily by the GUI.
235
Reference Guide Dynamics and Modeling
Field Description
Flattening The body's polar flattening.
236
Dynamics and Modeling Reference Guide
Field Description
OrbitColor Allows you to set available colors on built-in or user-defined
CelestialBody objects that are drawn on the 3D OrbitView
graphics displays. Colors on a CelestialBody object can be
set through a string or an integer array. For example: Set-
ting a celestial body's orbit color to red can be done in the
following two ways: CelestialBody.OrbitColor = Red or
Celestialbody.OrbitColor = [255 0 0]. This field can
be modified in the Mission Sequence as well.
237
Reference Guide Dynamics and Modeling
Field Description
PlanetarySpiceKernel- List of SPICE PCK files to load for this body. Used to define
Name celestial body properties for use with ContactLocator and
EclipseLocator. See Remarks.
238
Dynamics and Modeling Reference Guide
Field Description
RotationRate The body's spin rate.
239
Reference Guide Dynamics and Modeling
Field Description
SpinAxisRARate The rate of change of the body's right ascension.
GUI
The CelestialBody GUI has three tabs that allow you to set the physical properties,
orbital properties, and the orientation model. CelestialBody resources can be used in
ForceModels, CoordinateSystems, LibrationPoints, and Barycenters, among oth-
ers. For a built-in CelestialBody, the Orbit and Orientation tabs are largely inactive
and the behavior is discussed below. To create a custom Asteroid - as an example of
how to create a custom CelestialBody - perform the following steps.
240
Dynamics and Modeling Reference Guide
The CelestialBody Properties tab is shown below. GMAT models all bodies as spherical
ellipsoids and you can set the Equatorial Radius, Flattening, and Mu (gravitational
parameter) on this dialog box, as well as the texture map used in OrbitView graphics
displays.
241
Reference Guide Dynamics and Modeling
The CelestialBody Orbit tab is shown below for creating a custom CelestialBody.
Settings on this panel are inactive for built-in celestial bodies and the ephemeris for built-
in bodies is configured on the SolarSystem dialog. The CentralBody field is populated
automatically when the object is created and is always inactive. To configure SPICE
ephemerides for a custom body, provide a list of SPK files and the NAIF ID. See the
discussion below for more information on configuring SPICE files.
242
Dynamics and Modeling Reference Guide
The CelestialBody Orientation tab is shown below. Most settings on this panel are
inactive for built-in celestial bodies and exceptions for the Earth and Earth's moon are
described further below. To define the orientation for a celestial body you provide a
reference epoch, the initial orientation at the reference epoch, and angular rates. See
the discussion below for a more detailed description of the orientation model.
243
Reference Guide Dynamics and Modeling
The Earth and Earth's moon have unique fields to configure their orientation models.
The Earth has an extra field called NutationUpdateInterval that can be used when
lower fidelity, higher performance simulations are required.
244
Dynamics and Modeling Reference Guide
The CelestialBody Visualization tab is shown below for creating a custom Celestial-
Body. On the visualization tab, you can set data such as 3d model of a celestial body,
texture file, translation and rotation of a celestial body on all three axes, scale of the 3D
model as well as assign orbit and target colors to the orbit of the body.
245
Reference Guide Dynamics and Modeling
Remarks
The orientation of built-in celestial bodies is modeled using high fidelity theories on a per-
body basis. The orientation of Earth is modeled using IAU-1976/FK5. The orientation of
the Moon is modeled using lunar librations from the DE file. The orientation of Neptune
is modeled using IAU-2002. The remaining built-in celestial body orientations are mod-
eled using data published by the IAU/IAG in "Report of the IAU/IAG Working Group on
Cartographic Coordinates and Rotational Elements of the Planets and Satellites: 2000".
246
Dynamics and Modeling Reference Guide
plane of the ICRF axis system. The constant values SpinAxisRAConstant, SpinAxis-
DECConstant, and RotationConstant are defined to be the values at the epoch de-
fined in OrientationEpoch.
Note: The orientation models available for Earth and Luna have additional fields for
configuration. Earth has an additional field called NutationUpdateInterval that controls
the update frequency for the Nutation matrix. For high fidelity applications, NutationUp-
dateInterval should be set to zero. The RotationDataSource field for Earth and Luna
defines the theory used for the rotation of those bodies. Currently, only FK5IAU1980
and DE are available for Earth and Luna respectively and the field is displayed for in-
formation purposes only.
GMAT allows you to assign colors to orbits of celestial bodies that are drawn in the Or-
bitView graphics display windows. GMAT also allows you to assign colors to perturb-
ing celestial body orbital trajectories drawn during iterative processes such as differen-
tial correction or optimization. The CelestialBody object's OrbitColor and TargetColor
247
Reference Guide Dynamics and Modeling
fields are used to assign colors to both orbital and perturbing trajectories. See the Fields
section for description of these two fields. Also see Color documentation for discussion
and examples on how to set colors on a celestial body.
Note that the DE files model the barycenter of planetary systems. So for Jupiter, when
using DE405 for example, you are modeling Jupiter's location as the barycenter of the
Jovian system. SPICE kernels differentiate the barycenter of a planetary system from
the location of the individual bodies. So when using SPICE to model Jupiter, you are
modeling the location of Jupiter using Jupiter's center of mass.
To specify the SPICE kernels for a custom CelestialBody, use the NAIFId, Central-
Body, and SourceFileName fields. GMAT is distributed with an SPK file for CERES
which has NAIF ID 2000001. Here is how to configure a CelestialBody to use the
CERES SPICE ephemeris data.
Note: GMAT currently only supports a single ephemeris model for custom bodies
(SPICE) and this is set using PosVelSource field. The default for PosVelSource is SPICE
and it is not necessary to configure this field in the current version of GMAT.
Warning
NAIF distributes SPICE kernels for many celestial bodies and each kernel
is consistent with a particular primary ephemeris release such as DE421.
For high precision analysis, it is important to ensure that the ephemerides
used for a custom celestial body are consistent with the ephemeris source
selection in the SolarSystem.EphemerisSource field. SPICE kernels are
typically distributed with a ".cmt" file and in that file the line that contains the
ephemeris model looks like this:
GMAT models all celestial bodies as spherical ellipsoids. To define the physical prop-
erties use the Flattening, EquatorialRadius, and Mu fields.
248
Dynamics and Modeling Reference Guide
CelestialBody shape and orientation are configured via SPICE PCK files, loaded from
two sources in the following order:
1. SolarSystem.PCKFilename
2. Sun.PlanetarySpiceKernelName (in list order), followed by Mercury, Venus, Earth,
Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, Luna
3. User-defined bodies
Data loaded last takes precedence over data loaded first, if there is a conflict. Note that
because the SPICE kernel pool is shared for the entire run, a PCK file loaded for Pluto
may override data loaded by Sun, if the file contains conflicting data. Note that this order
isn't absolute—coordinate systems that with an SPK-defined origin load differently, for
example. To determine the exact load order, see the GmatLog.txt file.
Note
GMAT's SPICE kernel load order is based on many factors, and can be un-
predictable. Therefore, it is important that the kernels referenced by a mis-
sion be consistent. For example, NAIF's de421.bsp and mar085.bsp are
consistent, because they are both based on the DE421 model. Inconsistent
kernels can cause unpredictable behavior based on the order in which they
are loaded.
The body-fixed frame for a CelestialBody is defined on the Orientation tab by the
SpiceFrameId and SpiceFrameKernelFile fields. The SpiceFrameId contains the
SPICE ID for the body-fixed frame, which may be built-in or defined via external FK
files. External FK files can be loaded by adding them to the SpiceFrameKernelFile list
for each body. These files are loaded just after PlanetarySpiceKernelName for each
body. The list of built-in frames is available as an appendix in the SPICE documentation.
GMAT's default frames are:
• Earth: ITRF93
• Luna: MOON_PA
• Other default bodies: IAU_CelestialBody
The Earth ITRF93 frame is defined by three high-fidelity orientation PCK files, shown
below. More information on these files can be found in the NAIF aareadme.txt file.
249
Reference Guide Dynamics and Modeling
The Luna MOON_PA frame is defined by an orientation PCK file and a frame-defining
FK file, shown below. More information can be found in the NAIF PCK aareadme.txt
file and the FK aareadme.txt file. Other versions of the MOON_PA frame are available
from NAIF.
Examples
Configure a CelestialBody to model Saturn's moon Titan. Note you must obtain the
SPICE kernel named "sat288.bsp" from here and place it in the directory identified in
the script snippet below
250
Dynamics and Modeling Reference Guide
ChemicalTank
Model of a chemical fuel tank
Description
Fields
Field Description
AllowNegativeFuelMass This field allows the ChemicalTank to have negative fuel
mass which can be useful in optimization and targeting
sequences before convergence has occurred. This field
cannot be modified in the Mission Sequence.
251
Reference Guide Dynamics and Modeling
Field Description
Pressure The pressure in the tank.
252
Dynamics and Modeling Reference Guide
Field Description
Volume The volume of the tank. GMAT checks to ensure that the
input volume of the tank is larger than the calculated vol-
ume of fuel loaded in the tank and throws an exception in
the case that the calculated fuel volume is larger than the
input tank volume.
GUI
The ChemicalTank dialog box allows you to specify properties of a fuel tank including
fuel mass, density, and temperature as well as tank pressure and volume. The layout
of the ChemicalTank dialog box is shown below.
253
Reference Guide Dynamics and Modeling
When performing a finite burn, you will typically want to model fuel depletion. To do this,
select the Decrement Mass button and then select the previously created Chemical-
Tank as shown below.
254
Dynamics and Modeling Reference Guide
255
Reference Guide Dynamics and Modeling
Next, select the desired ChemicalTank and use the right arrow button to attach the
ChemicalTank to the spacecraft. Then, click the Apply button as shown below.
256
Dynamics and Modeling Reference Guide
257
Reference Guide Dynamics and Modeling
Remarks
Use of ChemicalTank Resource in Conjunction with Maneuvers
To implement a finite maneuver, you must first create both a ChemicalThruster and
a FiniteBurn resource. You must also associate a ChemicalTank with the Chemi-
calThruster resource and you must associate a Thruster with the FiniteBurn resource.
The actual finite maneuver is implemented using the BeginFiniteBurn/EndFiniteBurn
commands. See the BeginFiniteBurn/EndFiniteBurn command documentation for
worked examples on how the ChemicalTank resource is used in conjunction with finite
maneuvers.
258
Dynamics and Modeling Reference Guide
As exhibited below, there are some subtleties associated with setting and getting par-
ent vs. cloned resources. In the example above, aTank is the parent ChemicalTank
resource and the field aSpacecraft.Tanks is populated with a cloned copy of aTank.
Create a second spacecraft and attach a fuel tank using the same procedure used in
the previous example. Set the FuelMass in the parent resource, aTank, to 900 kg.
Note that, in the example above, setting the value of the parent resource, aTank,
changes the fuel mass value in both cloned fuel tank resources. More specifically, the
value of both aSpacecraft.aTank.FuelMass and bSpacecraft.aTank.FuelMass are
both now equal to the new value of 900 kg. We note that the assignment command
for the parent resource, aTank.FuelMass, can be performed in both resource and com-
mand modes.
To change the value of the fuel mass in only the first created spacecraft, aSpacecraft,
we do the following.
259
Reference Guide Dynamics and Modeling
By default, GMAT will not allow the fuel mass to be negative. However, occasionally in
iterative processes such as targeting, a solver will try values of a maneuver parameter
that result in total fuel depletion. Using the default tank settings, this will throw an ex-
ception stopping the run unless you set the AllowNegativeFuelMass flag to true. GMAT
will not allow the the total spacecraft mass to be negative. If DryMass + FuelMass is
negative GMAT will throw an exception and stop.
Examples
BeginMissionSequence
260
Dynamics and Modeling Reference Guide
ChemicalThruster
A chemical thruster model
Description
Fields
The constants Ci below are used in the following equation to calculate thrust (in New-
tons), FT, as a function of pressure P (kPa) and temperature T (Celsius).
The constants Ki below are used in the following equation to calculate ISP (in seconds),
Isp, as a function of pressure P (kPa) and temperature T (Celsius).
Field Description
Axes Allows the user to define a spacecraft centered set of axes for the
ChemicalThruster. This field cannot be modified in the Mission
Sequence
261
Reference Guide Dynamics and Modeling
Field Description
CoordinateSystem Determines what coordinate system the orientation parameters,
ThrustDirection1, ThrustDirection2, and ThrustDirection3 re-
fer to. This field cannot be modified in the Mission Sequence.
262
Dynamics and Modeling Reference Guide
Field Description
C5 Thrust coefficient.
263
Reference Guide Dynamics and Modeling
Field Description
C10 Thrust coefficient.
264
Dynamics and Modeling Reference Guide
Field Description
C15 Thrust coefficient.
265
Reference Guide Dynamics and Modeling
Field Description
K1 ISP coefficient.
266
Dynamics and Modeling Reference Guide
Field Description
K6 ISP coefficient.
267
Reference Guide Dynamics and Modeling
Field Description
K11 ISP coefficient.
268
Dynamics and Modeling Reference Guide
Field Description
K16 ISP coefficient.
269
Reference Guide Dynamics and Modeling
Field Description
Tanks A list of ChemicalTank(s) from which the thruster draws propel-
lant from. In the script, an empty list, e.g., Thruster1.Tank =
{}, is NOT allowed. Via the script, if you wish to indicate that no
tank is associated with a thruster, do not include commands such
as Thruster1.Tank = ... in your script. This field cannot be
modified in the Mission Sequence.
270
Dynamics and Modeling Reference Guide
Field Description
ThrustScaleFactor ThrustScaleFactor is a scale factor that is multiplied by the
thrust vector, for a given thruster, before the thrust vector is
added into the total acceleration. Note that the value of this scale
factor does not affect the mass flow rate.
Interactions
GUI
271
Reference Guide Dynamics and Modeling
When configuring the Coordinate System field, you can choose between existing co-
ordinate systems or use locally defined coordinate systems. The Axes field is only ac-
tive if Coordinate System is set to Local. The Origin field is only active if Coordinate
System is set to Local and Axes is set to either VNB or LVLH.
As shown below, if Decrement Mass is checked, then you can input the gravitational
acceleration value used to calculate fuel use. The value of the gravitational acceleration
input here only affects fuel use and does not affect the force model.
272
Dynamics and Modeling Reference Guide
Selecting the Edit Thruster Coef. button brings up the following dialog box where you
may input the coefficients for the ChemicalThruster polynomial.
273
Reference Guide Dynamics and Modeling
Similarly, clicking the Edit Impulse Coef. button brings up the following dialog box
where you may input the coefficients for the specific impulse (ISP) polynomial.
274
Dynamics and Modeling Reference Guide
Remarks
Unscaled thrust, FT, and Isp, as a function of Pressure, in kPa, and Temperature, in
degrees Celsius, are calculated using the following polynomials.
275
Reference Guide Dynamics and Modeling
The thrust, T, output in Newtons, is scaled by the Duty Cycle and Thrust Scale Factor.
The thrust acceleration direction vector (the direction of the actual acceleration not the
thruster nozzle) is given by ThrustDirection1-3 and is applied in the input Coordinate
System. The Isp is output in seconds.
The mass flow rate and the thrust equations are shown below where FT and Isp are
defined above, fd is the duty cycle, fs is the thrust scale factor, RiT is the rotation matrix
from the thrust coordinate system to the inertial system, and Td is the unitized thrust
direction.
Here, a Local coordinate system is defined as one that we configure "locally" using the
ChemicalThruster resource interface as opposed to defining a coordinate system using
the Coordinate Systems folder in the Resources Tree.
To configure a local coordinate system, you must specify the coordinate system of the
input thrust acceleration direction vector, ThrustDirection1-3. If you choose a local
coordinate system, the four choices available, as given by the Axes sub-field, are VNB,
LVLH, MJ2000Eq, and SpacecraftBody. VNB or Velocity-Normal-Binormal is a non-
inertial coordinate system based upon the motion of the spacecraft with respect to the
Origin sub-field. For example, if the Origin is chosen as Earth, then the X-axis of this
coordinate system is the along the velocity of the spacecraft with respect to the Earth,
the Y-axis is along the instantaneous orbit normal (with respect to the Earth) of the
spacecraft, and the Z-axis completes the right-handed set.
Similarly, Local Vertical Local Horizontal or LVLH is also a non-inertial coordinate sys-
tem based upon the motion of the spacecraft with respect to the Origin sub-field. Again,
if we choose Earth as the origin, then the X-axis of this coordinate system is the position
of the spacecraft with respect to the Earth, the Z-axis is the instantaneous orbit normal
(with respect to the Earth) of the spacecraft, and the Y-axis completes the right-handed
set.
SpacecraftBody is the attitude system of the spacecraft. Since the thrust is applied in
this system, GMAT uses the attitude of the spacecraft, a spacecraft attribute, to deter-
276
Dynamics and Modeling Reference Guide
mine the inertial thrust direction. Note that the Origin sub-field is not needed to define
this coordinate system.
Note that both the thrust and ISP polynomials have terms that involve the ratio, (Tem-
perature / Reference Temperature). For GMAT, this temperature ratio is calculated in
Celsius units, and thus, there is a discontinuity when the Reference Temperature is
equal to zero. For this reason, GMAT requires that the absolute value of the input Ref-
erence Temperature is greater than 0.01.
Note also that the form of the Thrust and ISP polynomial has some behavior, when the
Reference Temperature is near 0 degrees Centigrade, that you need to be aware of.
Because of the previously mentioned discontinuity, the polynomials do not vary smooth-
ly when the Reference Temperature is near zero. For example, consider the two Refer-
ence Temperatures, -0.011 and + 0.011 degrees Centigrade. These two temperatures
are close to each other in value and one might expect that they have roughly similar
thrust and ISP values. This may not be the case, depending upon your choice of thrust/
ISP coefficients, since the temperature ratios associated with the two Reference Tem-
peratures have the same magnitude but different signs. You may choose to set the in-
put Reference Temperature equal to the input Temperature, thus eliminating any de-
pendence of thrust and ISP with temperature when using the currently implemented
ChemicalTank model based upon Boyle’s Law where the fuel Temperature does not
change as fuel is depleted.
Examples
Create a default ChemicalTank and a ChemicalThruster that allows for fuel depletion,
assign the ChemicalThruster the default ChemicalTank, and attach both the Chemi-
calThruster and ChemicalTank to a Spacecraft.
277
Reference Guide Dynamics and Modeling
Thruster1.ThrustDirection3 = 0
Thruster1.DutyCycle = 1
Thruster1.ThrustScaleFactor = 1
Thruster1.DecrementMass = true
Thruster1.Tank = {FuelTank1}
Thruster1.GravitationalAccel = 9.810000000000001
Thruster1.C1 = 10
Thruster1.C2 = 0
Thruster1.C3 = 0
Thruster1.C4 = 0
Thruster1.C5 = 0
Thruster1.C6 = 0
Thruster1.C7 = 0
Thruster1.C8 = 0
Thruster1.C9 = 0
Thruster1.C10 = 0
Thruster1.C11 = 0
Thruster1.C12 = 0
Thruster1.C13 = 0
Thruster1.C14 = 0
Thruster1.C15 = 0
Thruster1.C16 = 0
Thruster1.K1 = 300
Thruster1.K2 = 0
Thruster1.K3 = 0
Thruster1.K4 = 0
Thruster1.K5 = 0
Thruster1.K6 = 0
Thruster1.K7 = 0
Thruster1.K8 = 0
Thruster1.K9 = 0
Thruster1.K10 = 0
Thruster1.K11 = 0
Thruster1.K12 = 0
Thruster1.K13 = 0
Thruster1.K14 = 0
Thruster1.K15 = 0
Thruster1.K16 = 0
BeginMissionSequence
278
Dynamics and Modeling Reference Guide
BeginMissionSequence
279
Reference Guide Dynamics and Modeling
ContactLocator
A line-of-sight event locator between a target Spacecraft and an observer GroundS-
tation
Description
Note
ContactLocator is a SPICE-based subsystem that uses a parallel config-
uration for the solar system and celestial bodies from other GMAT compo-
nents. For precision applications, care must be taken to ensure that both
configurations are consistent. See Remarks for details.
Contact location can be performed between one Spacecraft (Target) and any number
of GroundStation resources (Observers). Each target-observer pair is searched indi-
vidually, and results in a separate segment of the resulting report. All pairs must use
the same interval and search options; to customize the options per pair, use multiple
ContactLocator resources.
By default, the ContactLocator searches the entire interval of propagation of the Tar-
get, after applying certain endpoint light-time adjustments; see Remarks for details. To
search a custom interval, set UseEntireInterval to False and set InitialEpoch and Fi-
nalEpoch accordingly. Note that these epochs are assumed to be at the observer, and
so must be valid when translated to the target via light-time delay and stellar aberration,
if configured. If they fall outside the propagation interval of the Target, GMAT will dis-
play an error.
The contact locator can optionally adjust for both light-time delay and stellar aberration,
using either a transmit sense (Observer→Target) or receive sense (Observer#Target)
depending on the value of LightTimeDirection. The light-time direction affects the valid
search interval by limiting searches near the start of the interval (for transmit sense) or
the end of the interval (for receive sense). See Remarks for details. Stellar aberration is
280
Dynamics and Modeling Reference Guide
only applied for the line-of-sight portion of the search; it has no effect during occultation
searches.
The event search is performed at a fixed step through the interval. You can control the
step size (in seconds) by setting the StepSize field. An appropriate choice for step size
is no greater than half the period of the line-of-sight function—that is, half the orbit period
for an elliptical orbit. If third-body occultations are used, the maximum step size is no
greater than the minimum-duration occultation event you wish to find. See Remarks for
details.
GMAT uses the SPICE library for the fundamental event location algorithm. As such, all
celestial body data is loaded from SPICE kernels for this subsystem, rather than GMAT's
own CelestialBody shape and orientation configuration. See Remarks for details.
Unless otherwise mentioned, ContactLocator fields cannot be set in the mission se-
quence.
Fields
Field Description
Filename Name and path of the contact report file. This field can be set in
the mission sequence.
281
Reference Guide Dynamics and Modeling
Field Description
InitialEpoch First epoch to search for contacts, in the format specified by In-
putEpochFormat. The epoch is relative to the Observer, and
must map to a valid epoch in the Target ephemeris interval, in-
cluding any light time. This field can be set in the mission se-
quence.
282
Dynamics and Modeling Reference Guide
Field Description
RunMode Mode of event location execution. 'Automatic' triggers event
location to occur automatically at the end of the run. 'Manual'
limits execution only to the FindEvents command. 'Disabled'
turns of event location entirely.
283
Reference Guide Dynamics and Modeling
Field Description
UseLightTimeDe- Use light-time delay in the event-finding algorithm. The clock is
lay always hosted on the Observer.
284
Dynamics and Modeling Reference Guide
GUI
The default ContactLocator GUI for a new resource is shown above. You can choose
one Spacecraft from Target, which is populated by all the Spacecraft resources cur-
rently configured in the mission. In the Observers list, you can check the box next to all
GroundStations you want to search for contacts to.
To search for third-body occultations, check the boxes next to any applicable Celes-
tialBody resources in the Occulting Bodies list. This list shows all celestial bodies
currently configured in the mission. Note that each occultation search will increase the
execution time of the overall search.
You can configure the output via Filename, Run Mode, and Write Report near the
bottom. If Write Report is enabled, a text report will be written to the file specified in
Filename. The search will execute during FindEvents commands (for Manual or Au-
tomatic modes) and automatically at the end of the mission (for Automatic mode), de-
pending on the Run Mode.
You can configure the search interval via the options in the upper right. Uncheck Use
Entire Interval to set the search interval manually. See the Remarks section for con-
siderations when setting the search interval.
You can control the search algorithm via the options in the bottom right. Configure light-
time and stellar aberration via the check boxes next to each, and select the signal di-
rection via the Light-time direction selection.
To control the fidelity and execution time of the search, set the Step size appropriately.
See the Remarks section for details.
285
Reference Guide Dynamics and Modeling
Remarks
Data configuration
The ContactLocator implementation is based on the NAIF SPICE toolkit, which uses a
different mechanism for environmental data such as celestial body shape and orienta-
tion, planetary ephemerides, body-specific frame definitions, and leap seconds. There-
fore, it is necessary to maintain two parallel configurations to ensure that the event lo-
cation results are consistent with GMAT's own propagation and other parameters. The
specific data to be maintained is:
Note
For precise applications, the Earth shape must be consistent in both sub-
systems to ensure consistent placement of a GroundStation. The following
script lines make the two definitions consistent.
SolarSystem.PCKFilename = '..\data\planetary_coeff\pck00010.tpc'
Earth.EquatorialRadius = 6378.1366
Earth.Flattening = 0.00335281310845547
Search interval
The ContactLocator search interval can be specified either as the entire ephemeris
interval of the Target, or as a user-defined interval. Each mode offers specific behavior
related to handling of light-time delay and discontinuous intervals.
If UseEntireInterval is true, the search is performed over the entire ephemeris interval
of the Target, including any gaps or discontinuities. If light-time delay is enabled, the
286
Dynamics and Modeling Reference Guide
search interval is truncated by the approximate light time to allow SPICE to determine
the exact light-time delay between the participants during the search. If LightTimeDi-
rection is Transmit, the beginning of the interval is truncated. If LightTimeDirection is
Receive, the end of the interval is truncated. In either case, the other end of the interval
is trimmed slightly via bisection to avoid stepping beyond the end of the ephemeris due
to numeric precision issues. This trimming is typically less than 1 s. The endpoints of
gaps or discontinuities are not modified, so these are not fully supported if light-time
delay is enabled. If light-time delay is disabled, the entire interval is used directly, with
no endpoint manipulation.
These rules are summarized in the following table, where t0 and tf are the beginning and
end of the Target ephemeris, respectively, and lt is the light time between the Target
and the Observer.
Run modes
The ContactLocator works in conjunction with the FindEvents command: the Con-
tactLocator resource defines the configuration of the event search, and the FindEvents
command executes the search at a specific point in the mission sequence. The mode
of interaction is defined by ContactLocator.RunMode, which has three options:
• Automatic: All FindEvents commands are executed as-is, plus an additional Find-
Events is executed automatically at the end of the mission sequence.
• Manual: All FindEvents commands are executed as-is.
• Disabled: FindEvents commands are ignored.
287
Reference Guide Dynamics and Modeling
Search algorithm
The ContactLocator uses the NAIF SPICE GF (geometry finder) subsystem to perform
event location. Specifically, the following two calls are used for the search:
Both functions implement a fixed-step search method through the interval, with an em-
bedded root-location step if an event is found. Proper selection of StepSize differs be-
tween the two functions.
For the basic line-of-sight search, without third-body occultations, StepSize can be set
as high as one-half the period of the event function. For an elliptic orbit, this is up to
one-half the orbit period.
For third-body occultations, StepSize should be set equal to the length of the mini-
mum-duration event to be found, or equal to the lenght of the minimum-duration gap
between events, whichever is smaller. To guarantee location of 10-second occultations,
set StepSize = 10.
If no third-body occultations are to be found, you can increase performance of the search
by increasing StepSize per the notes above.
For details, see the reference documentation for the two functions linked above.
Report format
• Target name
• For each Observer:
• Observer name
• For each event:
• Event start time (UTC)
• Event stop time (UTC)
• Duration (s)
• Total number of events
Target: DefaultSC
Observer: GroundStation1
Start Time (UTC) Stop Time (UTC) Duration (s)
01 Jan 2000 13:18:45.268 01 Jan 2000 13:29:54.824 669.55576907
01 Jan 2000 15:06:44.752 01 Jan 2000 15:18:22.762 698.01023654
288
Dynamics and Modeling Reference Guide
Number of events : 2
Observer: GroundStation2
Start Time (UTC) Stop Time (UTC) Duration (s)
01 Jan 2000 13:36:13.792 01 Jan 2000 13:47:51.717 697.92488540
Number of events : 1
When using the SPK propagator, you load one or more SPK ephemeris files using the
Spacecraft.OrbitSpiceKernelName field. For the purposes of event location, this field
causes the appropriate ephemeris files to be loaded automatically on run, and so use
of the Propagate command is not necessary. This is an easy way of performing event
location on an existing SPK ephemeris file. See the example below.
Examples
Perform a basic contact search in LEO:
SolarSystem.EphemerisSource = 'DE421'
Earth.EquatorialRadius = 6378.1366
Earth.Flattening = 0.00335281310845547
Create ForceModel fm
fm.CentralBody = Earth
fm.PrimaryBodies = {Earth}
fm.GravityField.Earth.PotentialFile = 'JGM2.cof'
fm.GravityField.Earth.Degree = 0
fm.GravityField.Earth.Order = 0
fm.GravityField.Earth.TideModel = 'None'
fm.Drag.AtmosphereModel = None
fm.PointMasses = {}
fm.RelativisticCorrection = Off
fm.SRP = Off
289
Reference Guide Dynamics and Modeling
Create GroundStation GS
GS.CentralBody = Earth
GS.StateType = Spherical
GS.HorizonReference = Ellipsoid
GS.Location1 = 0;
GS.Location2 = 0;
GS.Location3 = 0;
Create ContactLocator cl
cl.Target = sat
cl.Observers = {GS}
cl.Filename = 'Simple.report'
BeginMissionSequence
Perform a contact event search from an Earth ground station to a Mars orbiter, with
Phobos occultations:
SolarSystem.EphemerisSource = 'SPICE'
SolarSystem.SPKFilename = 'de421.bsp'
Mars.OrbitSpiceKernelName = '../data/planetary_ephem/spk/mar063.bsp'
Earth.EquatorialRadius = 6378.1366
Earth.Flattening = 0.00335281310845547
Create ForceModel fm
fm.CentralBody = Mars
290
Dynamics and Modeling Reference Guide
fm.PrimaryBodies = {Mars}
fm.GravityField.Mars.PotentialFile = 'Mars50c.cof'
fm.GravityField.Mars.Degree = 0
fm.GravityField.Mars.Order = 0
fm.Drag.AtmosphereModel = None
fm.PointMasses = {}
fm.RelativisticCorrection = Off
fm.SRP = Off
Create GroundStation GS
GS.CentralBody = Earth
GS.StateType = Spherical
GS.HorizonReference = Ellipsoid
GS.Location1 = 36.3269
GS.Location2 = 127.433
GS.Location3 = 0.081
Create ContactLocator cl
cl.Target = sat
cl.Observers = {GS}
cl.OccultingBodies = {Sun, Mercury, Venus, Luna, Mars, Phobos, Deimos}
291
Reference Guide Dynamics and Modeling
cl.Filename = 'Martian.report'
cl.StepSize = 5
BeginMissionSequence
SolarSystem.EphemerisSource = 'DE421'
Earth.EquatorialRadius = 6378.1366
Earth.Flattening = 0.00335281310845547
Create GroundStation GS
GS.CentralBody = Earth
GS.StateType = Spherical
GS.HorizonReference = Ellipsoid
GS.Location1 = 0
GS.Location2 = 0
GS.Location3 = 0
Create ContactLocator cl
cl.Target = sat
cl.Observers = {GS}
cl.Filename = 'SPKPropagation.report'
BeginMissionSequence
292
Dynamics and Modeling Reference Guide
CoordinateSystem
An axis and origin pair
Description
A CoordinateSystem in GMAT is defined as an origin and an axis system. You can
select the origin of a CoordinateSystem from various points such as a CelestialBody,
Spacecraft, GroundStation, or LibrationPoint to name a few. GMAT supports numer-
ous axis systems such as J2000 equator, J2000 ecliptic, ICRF, ITRF, Topocentric,
and ObjectReferenced among others. CoordinateSystems are tightly integrated into
GMAT to enable you to define, report, and visualize data in coordinate systems relevant
to your application. This resource cannot be modified in the Mission Sequence.
Fields
Field Description
Align- The x component of the AlignmentVector expressed in the local frame
mentVec- (for example, expressed in the LocalAlignedConstrained frame). Used
torX for the following axis systems: LocalAlignedConstrained.
293
Reference Guide Dynamics and Modeling
Field Description
Axes The axes of the CoordinateSystem.
294
Dynamics and Modeling Reference Guide
Field Description
Con- The x component of the ConstraintReferenceVector expressed in the
straintRe- ConstraintCoordinateSystem. Used for the following axis systems: Lo-
fer- calAlignedConstrained.
enceVec-
torX Data Type Real
Allowed Values -# < Real < # (norm of ConstraintReferenceVec-
tor>= 1e-9)
Access set
Default Value 0
Units N/A
Interfaces gui,script
Con- The y component of the ConstraintReferenceVector expressed in the
straintRe- ConstraintCoordinateSystem. Used for the following axis systems: Lo-
fer- calAlignedConstrained.
enceVec-
torY Data Type Real
Allowed Values -# < Real < # (norm of ConstraintReferenceVec-
tor>= 1e-9)
Access set
Default Value 0
Units N/A
Interfaces gui,script
Con- The z component of the ConstraintReferenceVector expressed in the
straintRe- ConstraintCoordinateSystem. Used for the following axis systems: Lo-
fer- calAlignedConstrained.
enceVec-
torZ Data Type Real
Allowed Values -# < Real < # (norm of ConstraintReferenceVec-
tor>= 1e-9)
Access set
Default Value 1
Units N/A
Interfaces gui,script
Con- The coordinate system for the ConstraintReferenceVector. Used for the
straint Co- following axis sytems: LocalAlignedConstrained.
ordinate
System Data Type Resource
Allowed Values CoordinateSystem
Access set
Default Value EarthMJ2000Eq
Units N/A
Interfaces gui,script
295
Reference Guide Dynamics and Modeling
Field Description
Epoch The reference epoch for the CoordinateSystem. This field is only used for
TOE amd MOE axis types.
296
Dynamics and Modeling Reference Guide
Field Description
Se- The secondary body for an ObjectReferenced axis system. This field is
condary only used if Axes = ObjectReferenced. See the discussion below for more
information on how Primary and Secondary are used to compute Objec-
tReferenced axes.
297
Reference Guide Dynamics and Modeling
GUI
The New Coordinate System dialog box shown above appears when you add a new
coordinate system in the Resource Tree. You provide a name for the new Coordi-
nateSystem in the Coordinate System Name box and configure the CoordinateSys-
tem by selecting the Origin and Axes types along with other settings. Some settings,
such as Primary and Secondary, are only active for particular Axes types and those
dependencies are described below.
298
Dynamics and Modeling Reference Guide
299
Reference Guide Dynamics and Modeling
If you select ObjectReferenced for the Axes type, then the Primary, Secondary, X,
Y, and Z fields are activated. You can use the ObjectReferenced axis system to define
coordinates based on the motion of two space objects such as Spacecraft, Celestial-
Bodies, or Barycenters to name a few. See the discussion below for a detailed defin-
ition of the ObjectReferenced axis system.
300
Dynamics and Modeling Reference Guide
If you select TOEEq, TOEEc, MOEEq, or MOEEc as the axis type, then the A1MJd
Epoch field is activated. Use the A1MJd Epoch field to define the reference epoch of
the coordinate system.
301
Reference Guide Dynamics and Modeling
Remarks
FK5 reduction is the transformation that rotates a vector expressed in the MJ2000Eq
system to the EarthFixed CoordinateSystem. There are many coordinate systems
that are intermediate rotations in FK5 reduction and this section describes how the
following axes types are computed: MJ2000Eq, MJ2000Ec, EarthFixed, MODEq,
MODEc,TODEq,TODEc, MODEq, MODEc, TODEq, and TODEc axes systems.
The time varying orientation of the Earth is complex due to interactions between the
Earth and its external environment (the Sun and Moon and Planets) and internal dy-
namics. The orientation cannot currently be modelled to the accuracy required by many
space applications and FK5 reduction is a combination of dynamical modelling along
with daily corrections from empirical observations. The figure below illustrates compo-
nents of motion of the Earth with respect to inertial space. The primary components of
the motion of the Earth with respect to inertial space are Precession, Nutation, Sidereal
time and, Polar Motion.
302
Dynamics and Modeling Reference Guide
The principal moment of inertia is defined as the Celestial Ephemeris Pole. 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 defined as 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 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 dynamical models of the Earth’s
motion. The Sidereal time is the rotation of the Earth about the Celestial Ephemeris Pole.
The sidereal time model is a combination of theory and observation. The Earth’s spin
axis direction is not constant with respect to the Earth’s crust and its 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.
The True of Date (TOD) systems and Mean of Date (MOD) systems are intermediate co-
ordinate systems in FK5 reduction and are commonly used in analysis. The details of the
computations are contained in the GMAT mathematical specification and the figure be-
low is included here for summary purposes. The following abbreviations are used in the
figure. PM: Polar Motion, ST: Sideral Time, NUT: Nutation, PREC: Precession, ITRF: In-
ternational Terrestrial Reference Frame (Earth Fixed), PEF: Pseudo Earth Fixed, TOD-
Eq: True of Date Equator, TODEc: True of Date Ecliptic, MODEc: Mean of Date Ecliptic,
MODEq: Mean of Date Equator, FK5: J2000 Equatorial Inertial (IAU-1976/1980).
303
Reference Guide Dynamics and Modeling
The computation for the International Celestial Reference Frame (ICRF) and the Inter-
national Terestrial Reference Fame (ITRF) are computed using the IAU 2000A theory
with the 2006 update to precession. GMAT uses the Celestial Intermediate Origin (CIO)
method of transformation which avoids issues associated with precession and nutation.
In the CIO model, the Celestial Intermediate Pole unit vector is modeled using the vari-
ables X and S and the CIO locator, s. For performance reasons, GMAT interpolates X,
Y, and s, from precomputed values stored in the file named ICRF_Table.txt distributed
with GMAT.
GMAT models the rotation from ICRF to MJ200Eq by rotating through the EarthFixed
frame which is identical for both the old (1976) and new (2000) theories. For performance
reasons, the conversion from ICRF to MJ2000Eq is interplolated from pre-computed
values of the Euler axis and angle between those frames. Note that GMAT does not
currenty support the IAU2000 body fixed frame for Earth and that model will be included
in a future release.
An ObjectReferenced axis system is defined by the motion of one object with respect
to another object. The figure below defines the six principal directions of an Object Ref-
erenced axis system. One is the relative position of the secondary object with respect
to the primary object, denoted by r, expressed in the inertial frame. The second is the
relative velocity, denoted here by v, of the secondary object with respect to the primary,
expressed in the inertial frame. The third direction is the vector normal to the direction
of motion which is denoted by n and is calculated using n = r × v. The remaining three
directions are the negative of the first three yielding the complete set: {R,-R, V,-V, N,-N}.
304
Dynamics and Modeling Reference Guide
You define an Object Referenced axis system by defining two axes from the three
available [X, Y, and Z] using the six available options {R,-R, V,-V, N,-N}. Given two
directions, GMAT constructs an orthogonal, right-handed CoordinateSystem. For ex-
ample, if you choose the x-axis to be in the direction of R and the z-axis to be in the
direction of N, GMAT completes the right-handed set by setting the y-axis in the direc-
tion of NxR. If you choose permutations that result in a non-orthogonal or left-handed
CoordinateSystem, GMAT will throw an error message.
Warning
GMAT currently assumes that terms involving the cross and dot product of
acceleration are zero when computing ObjectReferenced rotation matrices.
305
Reference Guide Dynamics and Modeling
306
Dynamics and Modeling Reference Guide
307
Reference Guide Dynamics and Modeling
308
Dynamics and Modeling Reference Guide
309
Reference Guide Dynamics and Modeling
Examples
310
Dynamics and Modeling Reference Guide
BeginMissionSequence
311
Reference Guide Dynamics and Modeling
BeginMissionSequence
312
Dynamics and Modeling Reference Guide
EclipseLocator
A Spacecraft eclipse event locator
Description
Note
EclipseLocator is a SPICE-based subsystem that uses a parallel configura-
tion for the solar system and celestial bodies from other GMAT components.
For precision applications, care must be taken to ensure that both configu-
rations are consistent. See Remarks for details.
Eclipse location can be performed with one or more CelestialBody resources as eclips-
ing (or occulting) bodies. Any configured CelestialBody can be used as an occulting
body, including user-defined ones. Any type of eclipse can be found, including total
(umbra), partial (penumbra), and annular (antumbra). All selected occulting bodies are
searched using the same selection for eclipse types, search interval, and search op-
tions; to customize the options per body, use multiple EclipseLocator resources.
By default, the EclipseLocator searches the entire interval of propagation of the Space-
craft. To search a custom interval, set UseEntireInterval to False and set InitialEpoch
and FinalEpoch accordingly. Note that these epochs are assumed to be Spacecraft
epochs, and so must be valid and within the Spacecraft ephemeris interval. If they fall
outside the propagation interval of the Spacecraft, GMAT will display an error.
The contact locator can optionally adjust for both light-time delay and stellar aberration,
though stellar aberration currently has no effect.
The event search is performed at a fixed step through the interval. You can control the
step size (in seconds) by setting the StepSize field. An appropriate choice for step size
is no greater than the duration of the minimum event you wish to find, or the minimum
gap between events you want to resolve, whichever is smaller. See Remarks for details.
GMAT uses the SPICE library for the fundamental event location algorithm. As such, all
celestial body data is loaded from SPICE kernels for this subsystem, rather than GMAT's
own CelestialBody shape and orientation configuration. See Remarks for details.
Unless otherwise mentioned, EclipseLocator fields cannot be set in the mission se-
quence.
313
Reference Guide Dynamics and Modeling
Fields
Field Description
EclipseTypes Types of eclipses (shadows) to search for. May be Umbra (to-
tal eclipses), Penumbra (partial eclipses), or Antumbra (annular
eclipses).
314
Dynamics and Modeling Reference Guide
Field Description
InitialEpoch First epoch to search for eclipses, in the format specified by
InputEpochFormat. The epoch must be a valid epoch in the
Spacecraft ephemeris interval. This field can be set in the mis-
sion sequence.
315
Reference Guide Dynamics and Modeling
Field Description
StepSize Step size of event locator. See Remarks for discussion of appro-
priate values.
316
Dynamics and Modeling Reference Guide
GUI
The default EclipseLocator GUI for a new resource is shown above. You can choose
one Spacecraft from the list, which is populated by all the Spacecraft resources cur-
rently configured in the mission. In the Occulting Bodies list, you can check the box
next to all CelestialBody resources you want to search for eclipses. This list shows all
celestial bodies currently configured in the mission.
In the Eclipse Types list, choose the types of eclipses to search for. Note that each
selection will increase the duration of the search.
You can configure the output via Filename, Run Mode, and Write Report near the
bottom. If Write Report is enabled, a text report will be written to the file specified in
Filename. The search will execute during FindEvents commands (for Manual or Au-
tomatic modes) and automatically at the end of the mission (for Automatic mode), de-
pending on the Run Mode.
You can configure the search interval via the options in the upper right. Uncheck Use
Entire Interval to set the search interval manually. See the Remarks section for con-
siderations when setting the search interval.
You can control the search algorithm via the options in the bottom right. Configure light-
time and stellar aberration via the check boxes next to each, and select the signal di-
rection via the Light-time direction selection.
To control the fidelity and execution time of the search, set the Step size appropriately.
See the Remarks section for details.
317
Reference Guide Dynamics and Modeling
Remarks
Data configuration
The EclipseLocator implementation is based on the NAIF SPICE toolkit, which uses a
different mechanism for environmental data such as celestial body shape and orienta-
tion, planetary ephemerides, body-specific frame definitions, and leap seconds. There-
fore, it is necessary to maintain two parallel configurations to ensure that the event lo-
cation results are consistent with GMAT's own propagation and other parameters. The
specific data to be maintained is:
Search interval
The EclipseLocator search interval can be specified either as the entire ephemeris
interval of the Spacecraft, or as a user-defined interval. If UseEntireInterval is true,
the search is performed over the entire ephemeris interval of the Spacecraft, including
any gaps or discontinuities. If UseEntireInterval is false, the provided InitialEpoch and
FinalEpoch are used to form the search interval directly. The user must ensure than
the provided interval results in valid Spacecraft and CelestialBody ephemeris epochs.
Run modes
The EclipseLocator works in conjunction with the FindEvents command: the Eclipse-
Locator resource defines the configuration of the event search, and the FindEvents
command executes the search at a specific point in the mission sequence. The mode
of interaction is defined by EclipseLocator.RunMode, which has three options:
• Automatic: All FindEvents commands are executed as-is, plus an additional Find-
Events is executed automatically at the end of the mission sequence.
• Manual: All FindEvents commands are executed as-is.
• Disabled: FindEvents commands are ignored.
318
Dynamics and Modeling Reference Guide
Search algorithm
The EclpseLocator uses the NAIF SPICE GF (geometry finder) subsystem to perform
event location. Specifically, the following call is used for the search:
This function implements a fixed-step search method through the interval, with an em-
bedded root-location step if an event is found. StepSize should be set equal to the length
of the minimum-duration event to be found, or equal to the length of the minimum-du-
ration gap between events, whichever is smaller. To guarantee location of 10-second
eclipses, or 10-second gaps between adjacent eclipses, set StepSize = 10.
For details, see the reference documentation for the function linked above.
Report format
When WriteReport is enabled, the EclipseLocator outputs an event report at the end
of each search execution. The report contains the following data:
• Spacecraft name
• For each event:
• Event start time (UTC)
• Event stop time (UTC)
• Event duration (s)
• Occulting body name
• Eclipse type
• Total event number
• Total duration
• Number of individual events
• Number of total events
• Maximum total duration
• Eclipse number of total duration
The report makes the distinction between an individual event and a total event.
When using the SPK propagator, you load one or more SPK ephemeris files using the
Spacecraft.OrbitSpiceKernelName field. For the purposes of event location, this field
causes the appropriate ephemeris files to be loaded automatically on run, and so use
of the Propagation command is not necessary. This is an easy way of performing event
location on an existing SPK ephemeris file. See the example below.
319
Reference Guide Dynamics and Modeling
Examples
Perform a basic eclipse search in LEO:
SolarSystem.EphemerisSource = 'DE421'
Create ForceModel fm
fm.CentralBody = Earth
fm.PrimaryBodies = {Earth}
fm.GravityField.Earth.PotentialFile = 'JGM2.cof'
fm.GravityField.Earth.Degree = 0
fm.GravityField.Earth.Order = 0
fm.GravityField.Earth.TideModel = 'None'
fm.Drag.AtmosphereModel = None
fm.PointMasses = {}
fm.RelativisticCorrection = Off
fm.SRP = Off
Create EclipseLocator el
el.Spacecraft = sat
el.Filename = 'Simple.report'
el.OccultingBodies = {Earth}
el.EclipseTypes = {'Umbra', 'Penumbra', 'Antumbra'}
BeginMissionSequence
Perform an eclipse event search from a Mars orbiter, with Phobos, Earth, and Moon
eclipses:
SolarSystem.EphemerisSource = 'SPICE'
320
Dynamics and Modeling Reference Guide
SolarSystem.SPKFilename = 'de421.bsp'
Mars.NAIFId = 499
Mars.OrbitSpiceKernelName = {'../data/planetary_ephem/spk/mar063.bsp'}
Create ForceModel fm
fm.CentralBody = Mars
fm.PrimaryBodies = {Mars}
fm.GravityField.Mars.PotentialFile = 'Mars50c.cof'
fm.GravityField.Mars.Degree = 0
fm.GravityField.Mars.Order = 0
fm.Drag.AtmosphereModel = None
fm.PointMasses = {}
fm.RelativisticCorrection = Off
fm.SRP = Off
321
Reference Guide Dynamics and Modeling
Deimos.NAIFId = 402
Deimos.OrbitSpiceKernelName = {'mar063.bsp'}
Deimos.EquatorialRadius = 7.5
Deimos.SpiceFrameId = 'IAU_DEIMOS'
Deimos.Flattening = 0.30666666666666664
Deimos.Mu = 1.588174e-004
Create EclipseLocator ec
ec.Spacecraft = sat
ec.OccultingBodies = {Mercury, Venus, Earth, Luna, Mars, Phobos, Deimos}
ec.Filename = 'EarthTransit.report'
BeginMissionSequence
SolarSystem.EphemerisSource = 'DE421'
Create EclipseLocator cl
cl.Spacecraft = sat
cl.OccultingBodies = {Earth}
cl.Filename = 'SPKPropagation.report'
BeginMissionSequence
322
Dynamics and Modeling Reference Guide
ElectricTank
A model of a tank containing fuel for an electric propulsion system
Description
For a complete descripton of how to configure all Resources required for electric propul-
sion modelling, see the Tutorial named Electric Propulsion
Fields
Field Description
AllowNegativeFuelMass This field allows the ElectricTank to have negative fuel
mass which can be useful in optimization and targeting
sequences before convergence has occurred. This field
cannot be modified in the Mission Sequence.
GUI
The ElectricTank dialog box allows you to specify properties of a fuel tank. The layout
of the ElectricTank dialog box is shown below.
323
Reference Guide Dynamics and Modeling
Remarks
Use of ElectricTank Resource in Conjunction with Maneuvers
For a complete descripton of how to configure all Resources required for electric propul-
sion modelling, see the Tutorial named Electric Propulsion
As exhibited below, there are some subtleties associated with setting and getting parent
vs. cloned resources. In the example above, aTank is the parent ElectricTank resource
and the field aSpacecraft.Tanks is populated with a cloned copy of aTank.
Create a second spacecraft and attach a fuel tank using the same procedure used in
the previous example. Set the FuelMass in the parent resource, aTank, to 900 kg.
324
Dynamics and Modeling Reference Guide
Note that in the example above, setting the value of the parent resource, aTank, changes
the fuel mass value in both cloned fuel tank resources. More specifically, the value
of both aSpacecraft.aTank.FuelMass and bSpacecraft.aTank.FuelMass are both
now equal to the new value of 900 kg. We note that the assignment command for the
parent resource, aTank.FuelMass, can be performed in both resource and command
modes.
To change the value of the fuel mass in only the first created spacecraft, aSpacecraft,
we do the following.
By default, GMAT will not allow the fuel mass to be negative. However, occasionally in
iterative processes such as targeting, a solver will try values of a maneuver parameter
that result in total fuel depletion. Using the default tank settings, this will throw an excep-
tion stopping the run unless you set the AllowNegativeFuelMass flag to true. GMAT
will not allow the the total spacecraft mass to be negative. If DryMass + FuelMass is
negative GMAT will throw an exception and stop.
Examples
325
Reference Guide Dynamics and Modeling
BeginMissionSequence
326
Dynamics and Modeling Reference Guide
ElectricThruster
An electric thruster model
Description
For a complete descripton of how to configure all Resources required for electric propul-
sion modelling, see the Tutorial named Electric Propulsion
Fields
Field Description
Axes Allows the user to define a spacecraft centered set of axes for the
ElectricThruster. This field cannot be modified in the Mission
Sequence
327
Reference Guide Dynamics and Modeling
Field Description
CoordinateSystem Determines what coordinate system the orientation parameters,
ThrustDirection1, ThrustDirection2, and ThrustDirection3 re-
fer to. This field cannot be modified in the Mission Sequence.
328
Dynamics and Modeling Reference Guide
Field Description
GravitationalAccel Value of the gravitational acceleration used for the Fu-
elTank/Thruster calculations.
329
Reference Guide Dynamics and Modeling
Field Description
MassFlowCoeff4 Mass flow coefficient.
330
Dynamics and Modeling Reference Guide
Field Description
MixRatio The mixture ratio employed to draw fuel from multiple tanks. For
example, if there are two tanks and MixRatio is set to [2 1], then
twice as much fuel will be drawn from tank one as from tank 2
in the Tank list. Note, if a MixRatio is not supplied, fuel is drawn
from tanks in equal amounts, (the MixRatio is set to a vector of
ones the same length as the Tank list).
331
Reference Guide Dynamics and Modeling
Field Description
ThrustCoeff1 Thrust coefficient.
332
Dynamics and Modeling Reference Guide
Field Description
ThrustDirection1 X component of the spacecraft thrust vector direction.
333
Reference Guide Dynamics and Modeling
Interactions
GUI
334
Dynamics and Modeling Reference Guide
When configuring the Coordinate System field, you can choose between existing co-
ordinate systems or use locally defined coordinate systems. The Axes field is only ac-
335
Reference Guide Dynamics and Modeling
tive if Coordinate System is set to Local. The Origin field is only active if Coordinate
System is set to Local and Axes is set to either VNB or LVLH.
Selecting the Configure Polynomials button brings up the following dialog box where
you may input the coefficients for the ElectricThruster polynomial.
Similarly, clicking the Configure Polynomials also allows you to edit mass flow coeffi-
cients as shown below.
Remarks
Mathematical Models
The ElectricThruster model supports several models for computation of thrust and and
mass flow rate and the model used is set by the ThrustModel field. When ThrustModel
is set to ThrustMassPolynomial, the following polynomials are used to compute thrust
and mass flow rate
336
Dynamics and Modeling Reference Guide
where P is the power provided to the thruster which is computed using the power logic
defined on the FiniteBurn resource, f_d is duty cycle, f_s is thrust scale factor, R_iT is
the rotation matrix from the thrust coordinate system to the inertial system, and T_hat is
the thrust unit vector. By industry convention, the mass flow rate and thrust polynomial
equations are in mg/s and milli-Newtons respectively. GMAT internally converts the units
to be consistent with the equations of motion.
where C_t1 is set using the ConstantThrust field, Isp is set using the Isp field, f_d is
duty cycle, f_s is thrust scale factor, R_iT is the rotation matrix from the thrust coordinate
system to the inertial system, and T_hat is the thrust unit vector. Note, by industry con-
vention, the mass flow rate and thrust polynomial equations are in mg/s and milli-New-
tons respectively. GMAT internally converts the units to be consistent with the equations
of motion.
where P is the power provided to the thruster which is computed from the power logic
defined on the FiniteBurn Resource. "Eta" is the FixedEfficiency setting, f_d is duty
cycle, f_s is thrust scale factor, R_iT is the rotation matrix from the thrust coordinate
system to the inertial system, and T_hat is the thrust unit vector.
337
Reference Guide Dynamics and Modeling
For a complete descripton of how to configure all Resources required for electric propul-
sion modelling, see the Tutorial named Electric Propulsion
Here, a Local coordinate system is defined as one that we configure "locally" using the
ElectricThruster resource interface as opposed to defining a coordinate system using
the Coordinate Systems folder in the Resources Tree.
To configure a local coordinate system, you must specify the coordinate system of the
input thrust acceleration direction vector, ThrustDirection1-3. If you choose a local
coordinate system, the four choices available, as given by the Axes sub-field, are VNB,
LVLH, MJ2000Eq, and SpacecraftBody. VNB or Velocity-Normal-Binormal is a non-
inertial coordinate system based upon the motion of the spacecraft with respect to the
Origin sub-field. For example, if the Origin is chosen as Earth, then the X-axis of this
coordinate system is the along the velocity of the spacecraft with respect to the Earth,
the Y-axis is along the instantaneous orbit normal (with respect to the Earth) of the
spacecraft, and the Z-axis completes the right-handed set.
Similarly, Local Vertical Local Horizontal or LVLH is also a non-inertial coordinate sys-
tem based upon the motion of the spacecraft with respect to the Origin sub-field. Again,
if we choose Earth as the origin, then the X-axis of this coordinate system is the position
of the spacecraft with respect to the Earth, the Z-axis is the instantaneous orbit normal
(with respect to the Earth) of the spacecraft, and the Y-axis completes the right-handed
set.
SpacecraftBody is the attitude system of the spacecraft. Since the thrust is applied in
this system, GMAT uses the attitude of the spacecraft, a spacecraft attribute, to deter-
mine the inertial thrust direction. Note that the Origin sub-field is not needed to define
this coordinate system.
Examples
Create a default ElectricTank and an ElectricThruster that allows for fuel depletion,
assign the ElectricThruster the default ElectricTank, and attach both to a Spacecraft.
338
Dynamics and Modeling Reference Guide
BeginMissionSequence
339
Reference Guide Dynamics and Modeling
FiniteBurn
A finite burn
Description
Fields
Field Description
Thrusters The Thruster field allows the selection of which Thruster, from a
list of previously created thrusters, to use when applying a finite
burn. Currently, using the GUI, you can only select one Thruster
to attach to a FiniteBurn resource. Using the scripting interface,
you may attach multiple thrusters to a FiniteBurn resource. Us-
ing the scripting interface, you may attach multiple thrusters to
a FiniteBurn resource. In a script command, an empty list, e.g.,
FiniteBurn1.Thruster={}, is allowed but is of limited utility
since the GUI will automatically associate a ChemicalThruster,
if one has been created, with the FiniteBurn. This field cannot
be modified in the Mission Sequence.
340
Dynamics and Modeling Reference Guide
Field Description
VectorFormat Deprecated. Allows you to define the format of the finite burn
thrust direction. This field has no affect. The finite burn thrust di-
rection, as specified in the Thruster resource, is always given in
Cartesian format. Note: You can use GMAT scripting to covert
from other representations to Cartesian and then set the Carte-
sian format.
GUI
The FiniteBurn dialog box allows you to specify which thruster to use for the finite burn.
The layout of the FiniteBurn dialog box is shown below.
Remarks
Configuring a FiniteBurn
To perform a finite burn, the FiniteBurn resource itself and a number of related re-
sources and commands must be properly configured. You must associate a specific
ChemicalThruster hardware resource with a created FiniteBurn. You must associate
a specific ChemicalTank hardware resource with the chosen ChemicalThruster. Fi-
nally, you must attach both the chosen Thrusters and Tanks to the desired Spacecraft.
See the example below for additional details.
Using the GUI, a FiniteBurn resource must be associated with exactly one Thruster.
Using the scripting interface, one can assign multiple thrusters to a single FiniteBurn
resource.
341
Reference Guide Dynamics and Modeling
Interactions
Field Description
Spacecraft re- Must be created in order to apply any burn.
source
Thruster re- As discussed in the Remarks, every FiniteBurn resource must be
source associated with at least one ChemicalThruster or ElectricThruster.
Any thruster created in the resource tree can be incorporated into a
FiniteBurn but thruster types cannot be mixed.
ChemicalTank To perform a finite burn, a Tank must be attached to the Spacecraft.
resource (A ChemicalTank is needed to provide pressure and temperature
data used when modeling the thrust and specific impulse. A Tank is
also needed if you want to model mass depletion.)
BeginFinite- After a FiniteBurn is created, to apply it in the mission sequence, a
Burn and BeginFiniteBurn and EndFiniteBurn command must be appended
EndFiniteBurn to the mission tree.
command
Propagate In order to apply a non-zero finite burn, there must be a Propagate
command command between the BeginFiniteBurn and EndFiniteBurn com-
mands.
GMAT now supports finite burn parameters that report the thrust component data for a
finite burn. The parameters include total thrust from all thrusters in the three coordinate
directions, the total acceleration from all thrusters in the three coordinate directions, and
the total mass flow rate from all thrusters. Currently, by default the total thrust and to-
tal acceleration parameters in the three coordinate directions are reported only in the
J2000 system and do not support any other coordinate system dependency. Further-
more, you can now also report out any thruster's individual parameters such as thrust
magnitude, Isp and mass flow rate. See the Calculation Parameters reference for de-
finitions of these finite burn and thruster specific parameters. Also see the Examples
section for an example that shows how to report the finite burn and individual thruster
specific parameters to a report file.
Examples
Configure a chemical finite burn. Create a default Spacecraft and ChemicalTank Re-
source; Create a default ChemicalThruster that allows for fuel depletion from the de-
fault ChemicalTank; Attach ChemicalTank and ChemicalThruster to the Spacecraft;
Create default ForceModel and Propagator; Create a Finite Burn that uses the default
thruster and apply a 30 minute finite burn to the spacecraft.
342
Dynamics and Modeling Reference Guide
BeginMissionSequence
This example shows how to report finite burn parameters such as total acceleration
(from all thrusters), total thrust (from all thrusters) in the three coordinate directions. We
also report total mass flow rate from all thrusters. Additionally, individual thruster specific
parameters such as thruster mass flow rate, thrust magnitude and thruster Isp are also
reported. Note that in the generated report, all finite burn and thruster parameters are
reported as zeros when thrusters are not turned on.
aSat.Thrusters = {aThruster}
aSat.Tanks = {aFuelTank}
343
Reference Guide Dynamics and Modeling
Create ReportFile rf
rf.Add = {aSat.UTCGregorian, aFB.TotalAcceleration1, aFB.TotalAcceleration2, ...
aFB.TotalAcceleration3, aFB.TotalMassFlowRate, aFB.TotalThrust1, ...
aFB.TotalThrust2, aFB.TotalThrust3, aSat.aThruster.MassFlowRate, ...
aSat.aThruster.ThrustMagnitude, aSat.aThruster.Isp}
BeginMissionSequence
344
Dynamics and Modeling Reference Guide
FieldOfView
Models the mask, or field-of-view, of a hardware Resource.
Description
Fields
Field Description
Alpha The transparency of the sensor field-of-view in the graphics dis-
play.
345
Reference Guide Dynamics and Modeling
Field Description
AngleWidth Maximum clock angle distance from reference point (+X axis of
Hardware coordinate frame) for points in the field of view. Only
applies to RectangularFOV Resource.
346
Dynamics and Modeling Reference Guide
Field Description
ClockAngles Array containing cone angles for each point on the perimeter of
the field of view. This array is used in conjunction with ClockAn-
gles. Only applies to CustomFOV Resource.
Remarks
Field-of-view objects define the sensor mask (a representation of the perimeter of the
field of view) for use in graphics applications. Future versions of GMAT will determine if
a given vector (e.g., the spacecraft-to-Sun vector) is in the sensor field of view.
Note
The configuration of a sensor location and orientation in the body frame is
configured on the Antenna Resource. The orientation of the hardware ob-
ject in the spacecraft body frame and the spacecraft attitude is used to per-
form the rotations of vectors between a reference frame and a hardware co-
ordinate frame. By convention a sensor boresight is the +Z axis of the sensor
coordinate frame.
Configuring a ConicalFOV
A ConicalFOV object models a conical field of view, which can be represented by its
cone angle; the angle between the boresight and the edge of the field of view. This
angle remains constant, and the field of view mask can be thought of as a circle on the
unit sphere.
Configure a ConicalFOV.
347
Reference Guide Dynamics and Modeling
Configurating a RectangularFOV
The RectangularFOV Resource models a field-of-view where the 4 corners are defined
by the angular width and height limits.A RectangularFOV object models a field of view
defined by limits on cone angle and and clock angle. A (cone angle, clock angle) pair
defines a point on the unit sphere. Unlike a conical sensor, which assumes the cone
angle is uniform for all clock angles, the cone angle is measured along a “prime merid-
ian” lying in the X-Z plane of the Hardware coordinate frame. A positive cone angle is
measured towards the +X axis, a negative cone angle is measured towards the -X axis.
Configure a RectangularFOV.
Configurating a CustomFOV
The CustomFOV models the field of view’s perimeter as a sequence of points on the
unit sphere, represented by a (cone,clock) pair of angles. A CustomFOV can model an
irregular sensor field of view zigzag across the unit sphere in an arbitrary manner.
Warning
The CustomFOV uses the Jordan Curve Thereom to determine if a point is
inside of a sensor. Future versions of GMAT will expose that interface to
provide sensor coverage computations. It is important that no line segements
in a CustomFOV cross one another.
Configure a CustomFOV.
348
Dynamics and Modeling Reference Guide
The example below contains contents of the mask file for the example above. The mask
file consists of pairs of cone and clock angles in degrees. Cone and clock angles pairs
are on a row with the cone angle first and the clock angle second.
30.0 15.0
45.0 25.0
60.0. 35.0
349
Reference Guide Dynamics and Modeling
ForceModel
Used to specify force modeling options such as gravity, drag, solar radiation pressure,
and non-central bodies for propagation.
Description
For details on the ForceModel resource, see the section called “Force Model” in the
Propagator resource.
350
Dynamics and Modeling Reference Guide
Formation
A collection of spacecraft.
Description
A Formation resource allows you to combine spacecraft in a “container” object and then
GMAT’s propagation subsystem will model the collection of spacecraft as a coupled dy-
namic system. You can only propagate Formation resources using numerical-integra-
tor type propagators. This resource cannot be modified in the Mission Sequence.
Fields
Field Description
Add Adds a list of Spacecraft to the Formation. The list cannot be empty.
GUI
To create a simple Formation and configure its Spacecraft, in the Resource Tree:
351
Reference Guide Dynamics and Modeling
Note
A Spacecraft can only be added to one Formation.
Remarks
You can only propagate Formation resources using numerical-integrator type propa-
gators. GMAT does not support propagation of the orbit state transition matrix when
propagating formations.
When propagating a Formation, all spacecraft in the Formation must have equivalent
epochs. GMAT will allow you to separately propagate a Spacecraft that has been added
to a Formation, like this:
However, when a Formation is propagated, if the epochs of all Spacecraft in the For-
mation are not equivalent to a tolerance of a few microseconds, GMAT will throw an
error and execution will stop.
352
Dynamics and Modeling Reference Guide
If you want to set unique colors on spacecraft trajectories that are nested in the Forma-
tion resource, then change colors through either the Spacecraft resource or the Prop-
agate command. See the Color documentation for discussion and examples on how to
set unique colors on Spacecraft resource and Propagate command.
Examples
Create two Spacecraft, add them to a Formation, and propagate the Formation.
BeginMissionSequence
353
Reference Guide Dynamics and Modeling
GroundStation
A ground station model.
Description
Fields
Field Description
AddHardware List of all Transmitter, Receiver, and Antenna hardware used
by ground station
354
Dynamics and Modeling Reference Guide
Field Description
DataSource Source of where to get Temperature, Pressure, Humidity, and
MinimumElevationAngle. If the value is Constant, then the val-
ues of these parameters, as set in the GroundStation resource,
remain constant for all relevant measurements. Currently, the val-
ue of Constant is the only allowed value.
355
Reference Guide Dynamics and Modeling
Field Description
Id Id of the GroundStation used in simulation and estimation
356
Dynamics and Modeling Reference Guide
Field Description
Location2 The second component of the GroundStation location. When
StateType is Cartesian, Location2 is the y-component of station
location in the body-fixed system. When StateType is Spherical
or Ellipsoid, Location2 is the Longitude (deg.) of the GroundS-
tation.
357
Reference Guide Dynamics and Modeling
Field Description
MinimumElevatio- Minimum elevation angle constraint for use with ContactLoca-
nAngle tor. For navigation related processing, this is minimum elevation
angle for signal transmitted from spacecraft to ground station.
During simulation, this is the minimum elevation angle required
in order for data to be output. During estimation, this is the min-
imum elevation angle required for data to be used to calculate
an estimate. GMAT only uses this value if DataSource is set to
Constant.
358
Dynamics and Modeling Reference Guide
Field Description
StateType The type of state used to define the location of the ground station.
For example, Cartesian or Ellipsoid.
359
Reference Guide Dynamics and Modeling
Field Description
Temperature Air temperature at ground station used to calculate tropospheric
correction for the HopfieldSaastamoinen model. GMAT only uses
this value if DataSource is set to Constant.
GUI
360
Dynamics and Modeling Reference Guide
You can set the ground station location in several state representations. The Cartesian
representation is illustrated above. To set the Longitude, Latitude, and Altitude to 45
deg., 270 deg., and 0.1 km respectively, with respect to the reference ellipsoid:
361
Reference Guide Dynamics and Modeling
Remarks
The GroundStation model allows you to configure a facility by defining the location
in body-fixed coordinates using one of several state representations. GMAT supports
Cartesian, Sphere, and Ellipsoid representations and examples below show how to
configure a GroundStation in each representation. When using the Ellipsoid model or
Sphere representations, GMAT uses the physical properties - flattening and radius for
example - defined on the CelestialBody resource.
GMAT allows you to set colors on a ground station facility that you create. The GroundS-
tations are drawn on the GroundTrackPlot 2D graphics display. The GroundStation
object's OrbitColor and TargetColor fields are used to set colors on a ground station
facility. See the Fields section to read more about these two fields. Also See Color doc-
umentation for discussion and examples on how to set colors on a ground station facility.
The Marini troposphere model utilizes a data file which contains monthly mean values
for the model calculation for different locations on the Earth's surface. This data file's
location is specified by the MARINI_TROPO_FILE property in the startup file. Each line
in the data file contains a latitude longitude pair, followed by 12 values, one for each
month of the year. Each value in the data file combines both the refractivity and a scale
362
Dynamics and Modeling Reference Guide
height factor into a single integer, which are both used in the Marini model. The two
rightmost digits are used to obtain the scale height, while the remaining digits to the left
represent the refractivity. The digits used for the scale height have the decimal point
placed between the two digits, while the refractivity values have the decimal point placed
at the right of its rightmost digit. For example, a value in the data file of 37068 would
correspond to a refractivity of 370, and a scale height of 6.8.
The line in the data file is selected for use if it is within one degree of latitude and one
degree of longitude of the ground station location. The column is then selected based on
the month of the year. If the location of the ground station is within one degree of latitude
and longitude of multiple locations in the data file, the first line is the one selected. If
the location of the ground station is not within one degree of latitude and longitude of a
location in the data file, a default value of 37068 is used instead, regardless of month.
The latitude ranges from -90 to 90 degrees, while the longitude spans from 0 to 360
degrees.
Examples
Configure a GroundStation in Geodetic coordinates.
% or alternatively
aGroundStation.Latitude = 60
aGroundStation.Longitude = 45
aGroundStation.Altitude = 0.01
% or alternatively
aGroundStation.Latitude = 59.83308194090783
aGroundStation.Longitude = 45
aGroundStation.Altitude = -15.99424674414058
363
Reference Guide Dynamics and Modeling
Configure a GroundStation that, when used for navigation, will model how the RF signal
is refracted in the atmosphere.
BeginMissionSequence;
BeginMissionSequence;
364
Dynamics and Modeling Reference Guide
ImpulsiveBurn
An impulsive maneuver
Description
Fields
Field Description
Axes Allows you to define a spacecraft centered set of axes for the
impulsive burn. This field cannot be modified in the Mission Se-
quence.
365
Reference Guide Dynamics and Modeling
Field Description
DecrementMass Flag which determines if the FuelMass is to be decremented as
it used. This field cannot be modified in the Mission Sequence.
366
Dynamics and Modeling Reference Guide
Field Description
Isp Value of the specific impulse of the fuel
367
Reference Guide Dynamics and Modeling
Field Description
V Deprecated. X-component of the applied impulsive burn (Delta-
V)
GUI
368
Dynamics and Modeling Reference Guide
The Origin and Axes fields are only relevant if Coordinate System is set to Local. See
the Remarks for more detail on local coordinate systems.
If Decrement Mass is checked, then you can select the desired ChemicalTank used
as the fuel supply for mass depletion.
Remarks
Here, a Local Coordinate System is defined as one that we configure "locally" using the
ImpulsiveBurn resource interface as opposed to defining a coordinate system using
the Coordinate Systems folder in the Resources Tree.
To configure a Local Coordinate System, you must specify the coordinate system of
the input Delta-V vector, Element1-3. If you choose a local Coordinate System, the
four choices available, as given by the Axes sub-field, are VNB, LVLH, MJ2000Eq, and
SpacecraftBody. VNB or Velocity-Normal-Binormal is a non-inertial coordinate system
based upon the motion of the spacecraft with respect to the Origin sub-field. For exam-
ple, if the Origin is chosen as Earth, then the X-axis of this coordinate system is the
along the velocity of the spacecraft with respect to the Earth, the Y-axis is along the
instantaneous orbit normal (with respect to the Earth) of the spacecraft, and the Z-axis
points away from the Earth as much as possible while remaining orthogonal to the other
two axes, completing the right-handed set.
369
Reference Guide Dynamics and Modeling
SpacecraftBody is the coordinate system used by the spacecraft. Since the thrust is
applied in this system, GMAT uses the attitude of the spacecraft, a spacecraft attribute,
to determine the inertial thrust direction. Note that the Origin sub-field is not needed to
define this coordinate system.
Note that the standard method, as shown below, for specifying the components of an
ImpulsiveBurn is to use the Element1, Element2, and Element3 field names.
For this current version of GMAT, you may also use the field names V, N, and B in
place of Element1, Element2, and Element3, respectively. The commands below are
equivalent to the commands above.
Examples of axes defined using the spacecraft velocity are the VNB and LVLH axes
discussed above as well as some user-defined axes. The behavior when applying an
impulsive maneuver using these types of axes during a backwards-propagation is subtle
and requires some explanation. In the examples that follow, we will focus our discussion
on a VNB maneuver.
370
Dynamics and Modeling Reference Guide
As will be shown in the script samples below, an impulsive maneuver is applied during a
backwards propagation using the ‘BackProp’ keyword. The maneuver components that
you specify for a backwards propagation are used to calculate the components of the
maneuver actually applied. Refer to the script sample below where a backwards-prop-
agated impulsive maneuver is followed by the same maneuver using a normal formal
propagation. The impulsive maneuver is defined so that the velocity of the spacecraft
is unchanged after the script is run.
BeginMissionSequence
Maneuver BackProp myImpulsiveBurn(Sat);
Maneuver myImpulsiveBurn(Sat);
To calculate the actual maneuver components applied, GMAT, internally, uses an itera-
tive calculation method. This iteration method works best for maneuver magnitudes that
are not an appreciable fraction of the overall spacecraft velocity. In addition, for VNB
maneuvers, the iteration method works best for maneuvers where the ‘N’ and ‘B’ com-
ponent magnitudes are relatively small as compared to the 'V' component magnitude.
If the GMAT internal iterative method fails to converge, a warning message will be gen-
erated. Currently, there is not an easy way for the user to report out the actual applied
back-propagated maneuver components. (The maneuver report outputs the user sup-
plied VNB coordinates). After the back-propagated maneuver has been applied, how-
ever, we do know what the components of the maneuver are. If the VNB maneuver has
user-supplied components, (Vx, Vy, Vz), then after the back-propagated maneuver has
been applied, the VNB components of the maneuver are (-Vx, -Vy, -Vz).
Consider the script sample below where the ‘N’ and ‘B’ components of the maneuver
are zero and the ‘V’ component is +5 km/s. If the spacecraft velocity is (7,0,0) km/s in
J2000 inertial coordinates, then after the backwards-propagated impulsive maneuver,
the velocity of the spacecraft will be (2,0,0) km/s.
myImpulsiveBurn.Element1 = 5
myImpulsiveBurn.Element2 = 0.0
myImpulsiveBurn.Element3 = 0.0
BeginMissionSequence
371
Reference Guide Dynamics and Modeling
Finally, we note that when mass change is modeled for a backwards-propagated impul-
sive maneuver, mass is added to the tank. This is done so there is no change in mass
when a backwards-propagated impulsive maneuver is followed by the same maneuver
using a normal forward propagation.
Interactions
Resource Description
Space- Must be created in order to apply any ImpulsiveBurn
craft re-
source
Chemical- If you want to model mass depletion for an ImpulsiveBurn, attach a Chem-
Tank re- icalTank to the maneuvered Spacecraft as a source of fuel mass.
source
Maneuver Must use the Maneuver command to apply an ImpulsiveBurn to a Space-
command craft.
Vary com- If you want to allow the ImpulsiveBurn components to vary in order to
mand achieve some goal, then the Vary command, as part of a Target or Opti-
mize command sequence, must be used.
Examples
Create a default ChemicalTank and an ImpulsiveBurn that allows for fuel depletion,
assign the ImpulsiveBurn the default ChemicalTank, attach the ChemicalTank to a
Spacecraft, and apply the ImpulsiveBurn to the Spacecraft.
372
Dynamics and Modeling Reference Guide
DefaultIB.Isp = 300
DefaultIB.GravitationalAccel = 9.810000000000001
BeginMissionSequence
Maneuver DefaultIB(DefaultSC)
373
Reference Guide Dynamics and Modeling
LibrationPoint
An equilibrium point in the circular, restricted 3-body problem
Description
Fields
Field Description
OrbitCol- Allows you to set available colors on user-defined LibrationPoint orbits.
or The libration point orbits are drawn using the 3D OrbitView graphics dis-
plays. Colors on a LibrationPoint object can be set through a string or an
integer array. For example: Setting a libration point's orbit color to red can
be done in the following two ways: LibrationPoint.OrbitColor = Red
or LibrationPoint.OrbitColor = [255 0 0]. This field can be modified
in the Mission Sequence as well..
374
Dynamics and Modeling Reference Guide
Field Description
Primary The primary body or barycenter.
375
Reference Guide Dynamics and Modeling
GUI
The LibrationPoint dialog box allows you to select the Primary Body, Secondary
Body, and the libration point index. You can select from celestial bodies and barycen-
ters. You cannot choose the SolarSystemBarycenter as either the Primary or Se-
condary and the Primary and Secondary cannot be the same object.
Remarks
376
Dynamics and Modeling Reference Guide
GMAT allows you to assign colors to libration point orbits that are drawn using the Or-
bitView graphics display windows. GMAT also allows you to assign colors to perturbing
libration point orbital trajectories which are drawn during iterative processes such as
differential correction or optimization. The LibrationPoint object's OrbitColor and Tar-
getColor fields are used to assign colors to both orbital and perturbing trajectories. See
the Fields section to learn more about these two fields. Also see Color documentation
for discussion and examples on how to set colors on a libration point orbit.
Examples
% Create the libration point and rotating libration point coordinate system
Create LibrationPoint EarthMoonL2
EarthMoonL2.Primary = Earth
EarthMoonL2.Secondary = Luna
EarthMoonL2.Point = L2
377
Reference Guide Dynamics and Modeling
EarthMoonRotLibCoord.Secondary = Luna
Create Variable I
BeginMissionSequence
378
Dynamics and Modeling Reference Guide
BeginMissionSequence
379
Reference Guide Dynamics and Modeling
NuclearPowerSystem
A nuclear power system
Description
The NuclearPowerSystem models a nuclear power system including power generated
as function of time and distance from the sun.
For a complete descripton of how to configure all Resources required for electric propul-
sion modelling, see the Tutorial named Electric Propulsion
Fields
Field Description
AnnualDecayRate The annual decay rate of the power system.
380
Dynamics and Modeling Reference Guide
Field Description
EpochFormat The epoch format for the PowerInitialEpoch field.
GUI
381
Reference Guide Dynamics and Modeling
Remarks
where "tau" is the power AnnualDecayRate, P_0 is InitialMaxPower, and "delta t" is
the elapsed time between the simulation epoch and InitialEpoch.
The power required by the spacecraft bus for all subsystems other than the propulsion
system is computed using
where A_Bus, B_Bus, and C_Bus are BusCoeff1, BusCoeff2, and BusCoeff3 respec-
tively and r is the distance from the Sun in Au.
382
Dynamics and Modeling Reference Guide
Examples
BeginMissionSequence
For a complete descripton of how to configure all Resources required for electric propul-
sion modeling, see the Tutorial named Electric Propulsion.
383
Reference Guide Dynamics and Modeling
Plate
Used to specify the properties of a single spacecraft surface (body panel, solar array
side, or other surface) for high-fidelity solar radiation pressure modeling, including spec-
ular, diffuse, and absorptive effects.
Description
Warning
The NPlate area model is an alpha-level option for this release and should
not be used for operational support. Use of this model may be enabled by
setting RUN_MODE = TESTING in the Debug options section of the GMAT
startup file.
The Plate resource allows the user to construct a detailed spacecraft area model for
higher-fidelity solar radiation pressure (SRP) modeling. A spacecraft will typically be
modeled as a collection of plates; at a minimum six plates are required to represent
the spacecraft as a rectangular prism or box. You may also specify plates to represent
appendages such as solar arrays or a high-gain antenna. These plates can be modeled
as having a dynamic attitude with respect to the spacecraft body, either by specifying
them as Sun-facing or by providing an external file which gives the plate attitude as a
function of time.
The collection of Plate resources that comprise the model are assigned on the Space-
craft object using the Spacecraft AddPlates field. Each Plate has an associated Area-
Coefficient parameter which represents a correction factor that may be estimated in
the orbit determination. You may estimate an individual correction for each Plate in the
model, or choose to associate a single correction with a grouping of plates using the
Spacecraft NPlateSRPEquateAreaCoefficients parameter.
Fields
Field Description
Area The plate area surface area.
384
Dynamics and Modeling Reference Guide
Field Description
AreaCoefficient A scale factor applied to the plate area, typically used for estimat-
ing errors in the plate model.
385
Reference Guide Dynamics and Modeling
Field Description
PlateNormal Plate surface normal vector. This specifies the orientation of the
plate in the spacecraft body frame, when the Plate.Type is set
to FixedInBody.
386
Dynamics and Modeling Reference Guide
Field Description
Type Specifies the method of describing the plate orientation.
Remarks
Modeling of solar radiation pressure for each plate includes effects due to individual
plate specular reflectivity, diffuse reflectivity, and absorption. The sum of each plate's
specular, diffuse, and absorptive fractions must equal 1. In the Plate resource, the user
specifies the specular and diffuse coefficients; the absorption fraction is the remainder
from 1 of the sum of the specular and diffuse fractions.
If the Plate Type is set to File, the user must provide an external attitude history file,
assigned on the Plate.PlateNormalHistoryFile parameter. The plate normal history
file gives the plate normal vector as a function of time. The file contains a header as
described below.
Following the header are a series of records, one per line, giving a time in seconds from
the Start_Epoch, followed by the Cartesian components of the normal vector to the plate
at the given time in seconds past the Start_Epoch. A sample file is shown below.
387
Reference Guide Dynamics and Modeling
Examples
This example shows how to create a simple single-plate model. In this example, we
model both the front and back of a single plate on the X-face of the spacecraft body.
%
% N-Plate models
%
PlusX.Type = FixedInBody;
PlusX.PlateNormal = [1.0, 0.0, 0.0];
PlusX.LitFraction = 1.0;
PlusX.AreaCoefficient = 1.0;
PlusX.Area = 12;
PlusX.SpecularFraction = 1;
PlusX.DiffuseFraction = 0;
MinusX.Type = FixedInBody;
MinusX.PlateNormal = [-1.0, 0.0, 0.0];
MinusX.LitFraction = 1.0;
MinusX.AreaCoefficient = 1.0;
MinusX.Area = 12;
388
Dynamics and Modeling Reference Guide
MinusX.SpecularFraction = 0.5;
MinusX.DiffuseFraction = 0.1;
389
Reference Guide Dynamics and Modeling
Propagator
A propagator models spacecraft motion
A Propagator is the GMAT component used to model spacecraft motion. GMAT con-
tains two types of propagators: a numerical integrator type, and an ephemeris type.
When using a numerical integrator type Propagator, you can choose among a suite of
numerical integrators implementing Runge-Kutta and predictor corrector methods. Nu-
meric Propagators also require a ForceModel. Additionally, you can configure a Prop-
agator to use SPICE kernels or Code500 ephemeris files for propagation. This resource
cannot be modified in the Mission Sequence. However, you set one Propagator equal
to another Propagator in the mission,( i.e. myPropagator = yourPropagator ).
GMAT's documentation for Propagator components is broken down into three sections:
Numerical Propagator
Overview
When working in the script, you must create a ForceModel object separately from the
Propagator and specify the force model using the “FM” field on the propagator object.
See the Examples section later in this section for details.
390
Dynamics and Modeling Reference Guide
Options
Option Description
Accuracy The desired accuracy for an integration step. GMAT uses the
method selected in the ErrorControl field on the Force Model to
determine a metric of the integration accuracy. For each step, the
integrator ensures that the error in accuracy is smaller than the
value defined by the ErrorControl metric.
391
Reference Guide Dynamics and Modeling
Option Description
MaxStep The maximum allowable step size.
392
Dynamics and Modeling Reference Guide
Option Description
Type Specifies the integrator or analytic propagator used to model the
time evolution of spacecraft motion.
GUI
Settings for the embedded Runge-Kutta integrators. Select the desired integrator from
the Type menu.
393
Reference Guide Dynamics and Modeling
Remarks
The comparison data presented in a later section suggest that the PrinceDormand78
integrator is the best all purpose integrator in GMAT. When in doubt, use the Prince-
Dormance78 integrator, and set MinStep to zero so that the integrator’s adaptive step
algorithm controls the minimum integration step size. Below are some important com-
ments on GMAT’s step size control algorithms and the dangers of using a non-zero
value for the minimum integration step size. The AdamsBashforthMoulton integrator
is a low order integrator and we only recommend its use for low precision analysis when
a predictor-corrector algorithm is required. We recommend that you study the perfor-
mance and accuracy analysis documented later in this section to select a numerical in-
tegrator for your application. You may need to perform further analysis and comparisons
for your application.
Caution
Caution: GMAT’s default error computation mode is RSStep and this is a
more stringent error control method than RSSState that is often used as the
default in other software such as STK. If you set Accuracy to a very small
number, 1e-13 for example, and leave ErrorControl set to RSSStep, inte-
grator performance will be poor, for little if any improvement in the accura-
cy of the orbit integration. To find the best balance between integration ac-
curacy and performance, we recommend you experiment with the accuracy
setting for your selected integrator for your application. You can start with a
relatively high setting of Accuracy, say 1e-9, and lower the accuracy by an
order of magnitude at a time and compare the final orbital states to determine
where smaller values of Accuracy result in longer propagation times without
providing more accurate orbital solutions.
Caution
Caution: GMAT allows you to set a minimum step on numerical integrators. It
is possible that the requested Accuracy cannot be achieved given the Min-
imumStep setting. The Propagator flag StopIfAccuracyIsViolated deter-
mines the behavior if Accuracy cannot be satisfied. If StopIfAccuracyIsVi-
olated is true, GMAT will throw an error and stop execution if integration
accuracy is not satisfied. If StopIfAccuracyIsViolated is false, GMAT will
only throw a warning that the integration accuracy was not satisfied but will
continue to propagate the orbit.
394
Dynamics and Modeling Reference Guide
Option Description
RungeKutta89 An adaptive step, ninth order Runge-Kutta integrator with
eighth order error control. The coefficients were derived by
J. Verner. Verner developed several sets of coefficients for
an 89 integrator and we have chosen the coefficients that
are the most robust but not necessarily the most efficient.
PrinceDormand78 An adaptive step, eighth order Runge-Kutta integrator with
seventh order error control. The coefficients were derived
by Prince and Dormand.
PrinceDormand853 An adaptive step, eighth order Runge-Kutta integrator with
5th order error control that incorporates a 3rd order cor-
rection, as described in section II.10 of "Solving Ordi-
nary Differential Equations I: Nonstiff Problems" by Hair-
er, Norsett and Warner. The coefficients were derived by
Prince and Dormand. This integrator performs surprising-
ly well at loose Accuracy settings.
PrinceDormand45 An adaptive step, fifth order Runge-Kutta integrator with
fourth order error control. The coefficients were derived by
Prince and Dormand.
RungeKutta68 A second order Runge-Kutta-Nystrom type integrator with
coefficients developed by by Dormand, El-Mikkawy and
Prince. The integrator is a 9-stage Nystrom integrator, with
error control on both the dependent variables and their de-
rivatives. This second order implementation will correctly
integrate forces that are non-conservative but it is not rec-
ommended for this use. See the integrator comparisons
below for numerical comparisons. You cannot use this in-
tegrator to integrate mass during a finite maneuver be-
cause the mass flow rate is a first order differential equa-
tion not supported by this integrator.
RungeKutta56 An adaptive step, sixth order Runge-Kutta integrator with
fifth order error control. The coefficients were derived by
E. Fehlberg.
395
Reference Guide Dynamics and Modeling
Option Description
AdamsBashforthMoulton A fourth-order Adams-Bashford predictor / Adams-Moul-
ton corrector as described in Fundamentals of Astrody-
namics by Bate, Mueller, and White. The predictor step
extrapolates the next state of the variables using the the
derivative information at the current state and three previ-
ous states of the variables. The corrector uses derivative
information evaluated for this state, along with the deriv-
ative information at the original state and two preceding
states, to tune this state, giving the final, corrected state.
The ABM integrator uses the RungeKutta89 integrator to
start the integration process. The ABM is a low order in-
tegrator and should not be used for precise applications
or for highly nonlinear applications such as celestial body
flybys.
The tables below contain performance comparison data for GMAT's numerical integra-
tors. The first table shows the orbit types, dynamics models, and propagation duration
for each test case included in the comparison. Five orbit types were compared: low earth
orbit, Molniya, Mars transfer (Type 2), Lunar transfer, and finite burn (case 1 is blow
down, and case 2 is pressure regulated). For each test case, the orbit was propagated
forward for a duration and then back-propagated to the intial epoch. The error values in
the table are the RSS difference of the final position after forward and backward prop-
agation to the initial position. The run time data for each orbit type is normalized on the
integrator with the fasted run time for that orbit type. For all test cases the ErrorCon-
trol setting was set to RSSStep. Accuracy was set to 1e-12 for all integrators except
for AdamsBashfourthMoulton which was set to 1e-11 because of poor performance
when Accuracy was set to 1e-11.
396
Dynamics and Modeling Reference Guide
Comparing the run time data for each integrator shown in the table below we see that
the PrinceDormand78 integrator was the fastest for 4 of the 6 cases and tied with the
RungeKutta89 integrator for LEO test case. For the Lunar flyby case, the RungeKut-
ta89 was the fastest integrator, however, in this case the PrinceDormand78 integrator
was at least 2 orders of magnitude more accurate given equaivalent Accuracy settings.
Notice that the AdamsBashforthMoulton integrator has km level errors for some orbits
because it is a low-order integrator.
Examples
BeginMissionSequence
397
Reference Guide Dynamics and Modeling
BeginMissionSequence
BeginMissionSequence
Force Model
Overview
A ForceModel is a model of the environmental forces and dynamics that affect the
motion of a spacecraft. GMAT supports numerous force models such as point mass
and spherical harmonic gravity models, atmospheric drag, solar radiation pressure, tide
models, and relativistic corrections. A ForceModel is configured and attached to the
Propagator object (see the Propagator object for differences between script and GUI
398
Dynamics and Modeling Reference Guide
configuration when configuring a Propagator). The Propagator, along with the Propa-
gate command, uses a ForceModel to numerically solve the orbital equations of motion
(forwards or backwards in time) using the forces configured in the ForceModel object,
and may include thrust terms in the case of powered flight. See the discussion below
for detailed information on how to configure force models for your application. This re-
source cannot be modified in the Mission Sequence.
Fields
Option Description
CentralBody The central body of propagation. CentralBody must
be a celestial body and cannot be a LibrationPoint,
Barycenter, Spacecraft, or other special point.
399
Reference Guide Dynamics and Modeling
Option Description
Drag.CSSISpaceWeatherFile The file name of the CSSI space weather file with op-
tional path information. See Remarks for details on file
format.
400
Dynamics and Modeling Reference Guide
Option Description
Drag.F107A The average (monthly) value of solar flux at wave-
length of 10.7 cm. This field is only active in the script if
there is a PrimaryBody. Realistic values for this seet-
ing are 50 <= Drag.F107A <= 400.
401
Reference Guide Dynamics and Modeling
Option Description
Drag.MagneticIndex The geomagnetic index (Kp) used in density calcula-
tions. Kp is a planetary 3-hour-average, geomagnetic
index that measures magnetic effects of solar radia-
tion. This field is only active if there is a PrimaryBody.
402
Dynamics and Modeling Reference Guide
Option Description
Drag.SchattenTimingModel The timing model used from the Schatten file. Schatten
predicts include a nominal solar cycle model, an early
model, and a late model. See Remarks for details on
the file format.
403
Reference Guide Dynamics and Modeling
Option Description
GravityField. The degree of the harmonic gravity field. This field is
PrimaryBodyName.Degree only active if there is a PrimaryBody.
404
Dynamics and Modeling Reference Guide
Option Description
GravityField. The upper bound on the degree and order to be used
PrimaryBodyName.StmLimit when calculating the State Transition Matrix (STM).
The STM will not use a degree or order greater than
that specified by either the Degree and Order fields or
the StmLimit. This field has no effect on the degree or
order used to calculate the state, only the STM. This
field is only active if there is a PrimaryBody.
405
Reference Guide Dynamics and Modeling
Option Description
Model A GUI list of "configured' gravity files defined in the
file gmat_startup_file.txt. Model allows you to quickly
choose between gravity files distributed with GMAT.
For example, if PrimaryBody is Earth, you can select
among Earth gravity models provided with GMAT such
as JGM-2 and EGM-96. If you select Other, you can
provide the path and filename for a custom gravity file.
406
Dynamics and Modeling Reference Guide
Option Description
RelativisticCorrection Sets relativistic correction on or off.
407
Reference Guide Dynamics and Modeling
Option Description
SRP.SRPModel User choice of Spacecraft area model for SRP compu-
tation. The NPlate option is still in development and is
only available by setting RUN_MODE = TESTING in
the Debug options section of the GMAT startup file.
408
Dynamics and Modeling Reference Guide
GUI
Remarks
In GMAT, a primary body is a celestial body that is modeled with a complex force model
which may include a spherical harmonic gravity model, tides, or drag. A body cannot
appear in both the PrimaryBodies and PointMasses fields. GMAT currently requires
that there are no more than one primary body per ForceModel, but this behavior will
change in future versions and the user interface is designed to naturally support this
future development area.
GMAT currently requires that the primary body is either the same as the CentralBody
or set to None. If you change the CentralBody in the GUI, GMAT changes the primary
body to None, and you can then select between None and the central body. When you
select a primary body in the GUI, the Gravity and Drag fields activate and allow you to
select models for those forces consistent with the body selected in the PrimaryBodies
409
Reference Guide Dynamics and Modeling
field. For example, if you select Earth as the primary body, you can only select Earth
drag models in the Drag.AtmosphereModel field. See the field list above for available
models.
GMAT supports point mass gravity, spherical harmonic, and tide modeling for all celes-
tial bodies. On a Propagator, all celestial bodies are classified into two mutually exclu-
sive categories: PrimaryBodies, and Point Masses. To model a body as a point mass,
add it to the PointMasses list. GMAT currently requires that there be only a single body
in the PrimaryBodies list. When a primary body is selected, the CentralBody and pri-
mary body must be the same.
Bodies modeled as PointMasses use the gravitational parameter defined on the body
(i.e. Earth.Mu) in the equations of motion. Bodies defined as PrimaryBodies use the
constants defined on the potential file in the equations of motion. GMAT supports two
gravity file formats: the .cof format, and the STK .grv format. You can provide a custom
potential file for your application as long as it is one of the supported formats. Potential
files defined in the startup file are available in the Model list in the GUI. For example, the
following lines in the startup file configure GMAT so that EGM96 is an available option
for Model in the GUI when the primary body is Earth:
EARTH_POT_PATH = DATA_PATH/gravity/earth/
EGM96_FILE = EARTH_POT_PATH/EGM96.cof
By default, the tide data source is set to None and the tide model selector is disabled if
no tide model is selected. To use a tide model, first the tide data source must be changed
to either Inherited or Tide File, at which point the Tide Model selector becomes enabled
to select from the tide models supported by the tide data source. See the field list above
for available models. The Inherited option indicates that the data for the tide model is
provided either by the gravity potential file or the data is built into GMAT. The tide data
contained in a gravity potential file has precedence over any built-in values. The Tide
File option enables the file selector to choose a file containing the Love numbers to be
used as the data source for the tide model. The tide data contained in a tide file has
precedence over all other tide data sources.
GMAT supports solid tide modeling for all central bodies, and both solid and pole tide
modeling for the Earth. Tide models can only be used if a PrimaryBody is set. GMAT
410
Dynamics and Modeling Reference Guide
contains built-in values for both solid and pole tides for the Earth. External files can also
be used to provide the Love numbers to be used in the tide model, either from a gravity
file that supports tides, or a separate tide file.
If a gravity file with Love numbers is provided, those Love numbers will be used for the
solid tide model calculations. If a tide file is provided, the Love numbers in the tide file
will be used. If both a gravity file with Love numbers and a tide file are provided, the
Love numbers from both files will be used, with the Love numbers in the tide file having
precedence over the gravity file. Only if no tide file is provided and the gravity potential
file has no love numbers are GMAT's default Love numbers used for the Earth. GMAT's
built-in values are the only data source for pole tides.
Below is an example script snippet for configuring a custom gravity model including
Lunar solid tides.
Tide files use the .tide file extension. You can provide a custom tide file for your appli-
cation as long as it is in the supported format. Tide files contain the Love numbers to be
used to model the solid tides. Tide files can include the k2, k3, and k+ coefficients. The
format used by the tide file is 'k {degree} {order} {value}' or 'kplus {order} {value}' for k+.
Below is a sample tide file using the built-in values that GMAT uses for the Earth's Love
numbers
k 2 0 0.30190
k 2 1 0.29830
k 2 2 0.30102
k 3 0 0.093
k 3 1 0.093
k 3 2 0.093
k 3 3 0.094
kplus 0 -0.00087
kplus 1 -0.00079
kplus 2 -0.00057
The selection of a tide model is closely linked to the gravitational potential model that is
used. Some gravitational potential models incorporate some tidal effects into the gravi-
tational potential model. Two common ways gravitational models handle modeling tidal
forces are by being tide-free and zero-tide. Tide free gravitational models contain no
effects of tidal forces in the gravitational potential, while zero tide gravitational models
411
Reference Guide Dynamics and Modeling
contain the permanent (time-independent) effect of tides on the potential. For STK .grv
files, the "IncludesPermTides" keyword is recognized to identify if the gravitational po-
tential model includes permanent tide effects, however the coefficients in the "TideFree-
Values" and "ZeroTideValues" keyword blocks are currently ignored.
Caution
Caution: If a zero tide gravitational model is used with the Solid or SolidAnd-
Pole tide options, the effect of permanent tides is double counted and may
yield inaccurate results. For further a more in-depth discussion, please con-
sult the IERS Conventions (2010). GMAT does not convert between a zero
tide and tide free potential, therefore the user must pay attention to which
potential they intend on using, particularly when modeling solid tides.
GMAT supports many density models for Earth including Jacchia-Roberts and various
MSISE models. Density models for non-Earth bodies -- the Mars-GRAM model for ex-
ample -- are included using custom plug-in components and are currently only support-
ed in the script interface. With any density model, the user also has the choice of using
either a spherical spacecraft area model or a SPAD file for the spacecraft area computa-
tion. Spacecraft area modeling is selected using the Drag.DragModel parameter. More
details of SPAD area modeling can be found in Spacecraft Ballistic/Mass Properties
To configure Earth density models, select Earth as the primary body, In the GUI, this
activates the AtmosphereModel list. You can configure the solar flux values using the
Setup button next to the AtmosphereModel list after you have selected an atmosphere
model. Below is an example script snippet for configuring the NRLMSISE00 density
model.
Caution
Caution: GMAT uses the original single precision FORTAN code developed
by the scientists who created the MSISE models. At low altitudes, the single
precision density can cause numeric issues in the double precision integrator
step size control and integration can be unacceptably slow. You can avoid
the performance issue by using either fixed step integration or by using a
relatively high Accuracy value such as 1e-8. You may need to experiment
with the Accuracy setting to a value acceptable for your application.
Note that when you select None for Drag.AtmosphereModel, the fields associated with
density configuration, such as Drag.F107, Drag.F107A, and Drag.MagneticIndex and
others are inactive and must be removed from your script file to avoid parsing errors.
When working in the GUI, this is performed automatically.
412
Dynamics and Modeling Reference Guide
The table below describes the limits on altitude for drag models supported by GMAT.
MarsGRAM2005
When PrimaryBody is Mars, you can choose Mars-GRAM 2005 as your atmosphere
model. This model is only available when the libMarsGRAM plugin is available and en-
abled in the GMAT startup file.
Warning
As of version R2015a, you can only have one unique Mars-GRAM force mod-
el configuration in a given script. If you include multiple propagators with
Mars-GRAM force models with different Mars-GRAM configurations, the dif-
ferent configurations are not honored, and all of the propagators will use the
same configuration for Mars-GRAM.
When using the MarsGRAM2005 atmosphere model, three new fields are available in
the script language (but not the GUI):
• Drag.InputFile
• Drag.DensityModel
• Drag.F107: value of 10.7 cm solar flux at 1 AU, as documented in the Fields section
• Drag.F107A: not used
• Drag.MagneticIndex: not used
The Mars-GRAM 2005 input file is a text file in FORTRAN NAMELIST format. Most vari-
ables in this file are passed directly to the Mars-GRAM model and are used as intended.
However, some are replaced internally by GMAT-supplied values. The following table
lists those input variables that are handled specially.
413
Reference Guide Dynamics and Modeling
The input file is read by the Mars-GRAM 2005 model code, which has limited error
checking. If the input file or data files are incorrect or missing, GMAT may exhibit unin-
tended behavior. Note that local winds returned by the Mars-GRAM 2005 model are not
included in GMAT's drag model.
GMAT supports several space weather input types for drag modelling including con-
stant flux and Geo-magnetic index values, a historical weather data file, and a predicted
weather data file. You can separately configure the data used for historical data and
predicted data. For historical data you can choose between constant values and a CSSI
space weather file. For predicted data you can choose between constant values and a
Schatten predict file. Each of those sources is discussed in detail below.
414
Dynamics and Modeling Reference Guide
The precedence for data source is determined by the simulation epoch (i.e. the epoch
when density is evaluated), and the epochs contained on the data files
• If both historical data and predicted data sources are set to constants, then constant
values are always used.
• If you have selected a CSSI file as the historical data source, if the simulation epoch
falls before the last row of historical data in the CSSI file's historical data block, then
the CSSI data is used (the first row is used if the simulation epoch is before the first
historical data record), otherwise, the predicted data source is used. Note: GMAT
does not use any of the predicted data from the CSSI file.
• If you have selected the Schatten file for predicted data, if the simulation epoch is
NOT in the CSSI file historical data, or the historical data source is set to constant
values, then the data is used from the Schatten file.
Constant Values
GMAT supports constant flux and Geo-magnetic index values for all Earth density mod-
els. You configure GMAT to use those values for historical and predicted data as shown
below using NRLMSISE00 for the example.
You can provide a Center for Space Standards and Innovation (CSSI) file for historical
space weather data. GMAT does not use the predicted portion of the file but does use the
historical portion of the data. The CCSI file format is described in detail at the Celestrak
website and the files are available for download at that site and here. You configure
GMAT to use historical data as shown below.
You can provide a full or relative path to the file, or put the file in GMAT’s data file folders
documented in the startup file help.
415
Reference Guide Dynamics and Modeling
You can provide a full or relative path to the file, or put the file in GMAT’s data file fold-
ers documented in the startup file help. Additionally you can choose between Nomi-
nal, PlusTwoSigma, and MinusTwoSigma for the SchattenErrorModel, and between
NominalCycle, EarlyCycle, and LateCycle for the SchattenTimingModel.
The Schatten file is distributed by the Flight Dynamics Facility (FDF) at Goddard Space
Flight Center. You can apply for an account to obtain Schatten file updates at the FDF
Forms Interface. Note that GMAT reads the raw file containing all permutation of mean,
+2 sigma, and -2 sigma, and nominal, early and late solar cycles. The files from the
FDF must be modified to include keywords that indicate when data starts and ends as
shown below:
NOMINAL TIMING EARLY TIMING LATE TIMING
mo. yr. mean +2sig -2sig ap mean +2sig -2sig ap mean +2sig -2sig ap
BEGIN_DATA
2 2011 92 107 76 9 105 125 85 10 77 87 66 8
3 2011 93 110 77 9 106 128 86 10 79 89 67 8
4 2011 95 112 78 9 108 129 87 10 80 92 69 8
END_DATA
GMAT supports a spherical SRP model, and a SPAD file for high fidelity SRP modelling.
Both models use a dual cone model for central body shadowing of the spacecraft. See
the Spacecraft Ballistic/Mass Properties documentation for configuring a SPAD file for
a spacecraft. The script snippet below shows how to configure two ForceModels, one
that uses Spherical area modeling (the default), and one that uses a SPADFile.
% A spherical SRP model
Create ForceModel aForceModel_1
aForceModel_1.PrimaryBodies = {Earth}
aForceModel_1.SRP = On
aForceModel_1.SRP.SRPModel = Spherical
You can define the solar flux using two approaches which are currently only supported
in the script interface. One approach is to define the flux value using the SRP.Flux field
and the value of an astronomical unit (in km) using the Nominal_Sun field as shown
in the following example.
Create ForceModel aForceModel
416
Dynamics and Modeling Reference Guide
aForceModel.PrimaryBodies = {Earth}
aForceModel.SRP = On
aForceModel.SRP.Flux = 1367
aForceModel.SRP.Nominal_Sun = 149597870.691
An alternative approach is to define the flux pressure at 1 astronomical unit using the
Flux_Pressure field as shown below..
If you mix flux settings, as shown in the example below, GMAT will use the last approach
in the script. Here, GMAT will use the Flux_Pressure setting.
Caution
Caution: GMAT’s default option for configuring solar flux for an SRP model
is to use SRP.Flux and Nominal_Sun fields. If you initially configured the
Flux_Pressure field, when you save your mission via the save button in the
toolbar, GMAT will write out SRP.Flux and Nominal_Sun values consistent
with your setting of Flux_Pressure.
GMAT can optionally propagate the orbit State Transition Matrix (STM). For more infor-
mation on how to configure GMAT to compute the STM, see the Propagate command
documentation.
Caution
Caution: GMAT allows you to propagate the State Transition Matrix (STM)
along with the orbital state. However, not all variational terms are implement-
ed for STM propagation. The following are implemented: point mass per-
turbation, spherical harmonics (with tide models), drag, and solar radiation
pressure. The following are NOT implemented: relativistic terms and finite
burns. Additionally, the SRP variational term does not include the partial de-
rivative of the percent shadow with respect to orbital state. This approxima-
tion is acceptable for orbits with short penumbra durations but is inaccurate
for orbits that spend relatively long periods of time in penumbra.
417
Reference Guide Dynamics and Modeling
Examples
BeginMissionSequence
BeginMissionSequence
418
Dynamics and Modeling Reference Guide
aSpacecraft.DryMass = 2000
aSpacecraft.SPADSRPFile = '..\data\vehicle\spad\SphericalModel.spo'
aSpacecraft.SPADSRPScaleFactor = 1;
BeginMissionSequence
BeginMissionSequence
419
Reference Guide Dynamics and Modeling
SPK-Configured Propagator
Description
Fields
Field Description
CentralBody The central body of propagation. This field has no effect for
SPK, Code500, or STK propagators.
420
Dynamics and Modeling Reference Guide
Field Description
Start Epoch Only used for an SPK, Code500, or STK propagator. The
initial epoch of propagation. When an epoch is provided
that epoch is used as the initial epoch. When the keyword
"FromSpacecraft" is provided, the start epoch is inherited
from the spacecraft.
421
Reference Guide Dynamics and Modeling
GUI
To configure a Propagator to use SPK files, on the Propagator dialog box, select SPK
in the Type menu. There are four fields you can configure for an SPK propagator in-
cluding StepSize, CentralBody, EpochFormat, and StartEpoch. Note that changing
the EpochFormat setting converts the input epoch to the selected format. You can also
type FromSpacecraft into the StartEpoch field and the Propagator will use the epoch
of the Spacecraft as the initial propagation epoch.
Remarks
To use an SPK-configured Propagator, you must specify the SPK kernels and NAIFId
on the Spacecraft, configure a Propagator to use SPK files as opposed to numerical
methods, and configure the Propagate command to use the configured SPK propaga-
tor. The subsections and examples below discuss each of these items in detail.
To use an SPK-configured Propagator, you must add the SPK kernels to the Space-
craft and define the spacecraft's NAIFId. SPK Kernels for selected spacecraft are avail-
able here. Two sample vehicle spk kernels, (GEOSat.bsp and MoonTransfer.bsp) are
distributed with GMAT for example purposes. An example of how to add spacecraft ker-
nels via the script interface is shown below.
422
Dynamics and Modeling Reference Guide
You can add more than one kernel to a spacecraft as shown via scripting below, where
the files GEOSat1.bsp and GEOSat2.bsp are dummy file names used for example pur-
poses only and are not distributed with GMAT. In the script, you can use relative path
or absolute path to define the location of an SPK file. Relative paths are defined with
respect to the GMAT bin directory of your local installation.
423
Reference Guide Dynamics and Modeling
To explicitly define the StartEpoch on the Propagator Resource use the following syn-
tax.
An SPK-configured Propagator works with the Propagate command in the same way
numerical propagators work with the Propagate command with the following excep-
tions:
• If a Propagate command uses an SPK propagator, then you can only propagate
one spacecraft using that propagator. You can however, mix SPK propagators and
numeric propagators in a single propagate command.
• SPK-configured Propagators will not propagate the STM or compute the orbit Jaco-
bian (A matrix).
Below is a script snippet that demonstrates how to propagate backwards using an SPK
propagator.
424
Dynamics and Modeling Reference Guide
the beginning or end of ephemeris files, the use of the double precision arithmetic may
affect results. For example, if an ephemeris file has has an initial epoch TDBModJulian
= 21545.00037249916, and you specify the StartEpoch in UTC Gregorian, round off
error in time conversions and/or truncation of time using the Gregorian format (only ac-
curate to millisecond) may cause the requested epoch to fall slightly outside of the range
provided on the ephemeris file. The best solution is to provide extra ephemeris data to
avoid time issues at the boundaries and the more subtle issue of poor interpolation.
Warning
To locate requested stopping conditions, GMAT needs to bracket the root
of the stopping condition function. Then, GMAT uses standard root finding
techniques to locate the stopping condition to the requested accuracy. If
the requested stopping condition lies at or near the beginning or end of the
ephemeris data, then bracketing the stopping condition may not be possible
without stepping off the ephemeris file which throw an error and execution
will stop. In this case, you must provide more ephemeris data to locate the
desired stopping condition.
Examples
BeginMissionSequence
Propagate spkProp(aSpacecraft) {aSpacecraft.TA = 90}
Propagate spkProp(aSpacecraft) {aSpacecraft.ElapsedDays = 2.4}
425
Reference Guide Dynamics and Modeling
aSpacecraft.NAIFId = -123456789
aSpacecraft.OrbitSpiceKernelName = {...
'..\data\vehicle\ephem\spk\MoonTransfer.bsp'}
BeginMissionSequence
Propagate spkProp(aSpacecraft) {aSpacecraft.ElapsedDays = 12}
Description
The Propagator CentralBody option is not applicable to the Code500 propagator and
should not be used with the Code500 propagator type. GMAT will automatically detect
and use the central body of the ephemeris file. The Propagate command should be
used to traverse the ephemeris file. GMAT will throw an error message and terminate
when attempting to propagate outside the bounds of the ephemeris file.
Fields
The only Propagator fields applicable to the Code500 ephemeris propagator are
EpochFormat, StartEpoch, StepSize and Type.
426
Dynamics and Modeling Reference Guide
Field Description
EpochFormat Only used for an SPK, Code500, or STK propagator. Speci-
fies format of the epoch contained in the StartEpoch field.
427
Reference Guide Dynamics and Modeling
Field Description
Type Specifies the integrator or analytic propagator used to model
time evolution of spacecraft motion. Specify Code500 for a
Code500 ephemeris propagator.
GUI
To configure a Propagator from the GMAT GUI to use Code500 ephemeris files, se-
lect and open a Propagator from the Resources tree. In the Integrator category se-
lect Code500 from the Type drop-down box. This will display the Code500 propagator
options dialog. There are four fields displayed for a Code500 propagator - StepSize,
CentralBody, EpochFormat, and StartEpoch. Note that changing the EpochFormat
428
Dynamics and Modeling Reference Guide
setting converts the input epoch to the selected format. You can also type FromSpace-
craft into the StartEpoch field and the Propagator will use the epoch of the Space-
craft as the initial propagation epoch. The CentralBody field is displayed to the user,
but is unused when the integrator type is Code500.
Remarks
aSpacecraft.EphemerisName = '../data/vehicle/ephem/code500/sat_leo.ephem'
BeginMissionSequence
A spacecraft may have only one Code500 ephemeris assigned. There is currently no
GUI option to add a Code500 ephemeris file to a spacecraft.
If you have assigned the ephemeris file to your spacecraft, configuring the propagator
only requires assigning the Code500 type and the desired step size on a Propagator
resource. The central body of propagation will be the central body of the the ephemeris
file. If desired, you may also specify an EpochFormat and StartEpoch on the propa-
gator to specify an initial epoch from which to start propagation. The same effect can
be accomplished with an independent Propagate command (see Propagate) to the de-
sired starting epoch.
Code500Prop.Type = 'Code500'
Code500Prop.StepSize = 60.
BeginMissionSequence
The same remarks mentioned in the prior section on SPK propagators with regard to
interaction with the Propagate command and behavior near ephemeris boundaries also
apply to the Code500 ephemeris propagator.
429
Reference Guide Dynamics and Modeling
Examples
aSpacecraft.EphemerisName = '../data/vehicle/ephem/code500/sat_leo.ephem'
aSpacecraft.DateFormat = UTCGregorian
aSpacecraft.Epoch = '22 Apr 2015 00:00:00.000'
Code500Prop.Type = 'Code500'
Code500Prop.StepSize = 60.
Code500Prop.StartEpoch = 'FromSpacecraft'
PropReport.Filename = 'EphemPropagator_Code500_ForwardProp.txt'
PropReport.WriteHeaders = True
BeginMissionSequence
Propagate Code500Prop(aSpacecraft)
EndWhile
Description
430
Dynamics and Modeling Reference Guide
The Propagator CentralBody option is not applicable to the STK propagator and
should not be used with the STK propagator type. GMAT will automatically detect and
use the central body of the ephemeris file. The Propagate command should be used
to traverse the ephemeris file. GMAT will throw an error message and terminate when
attempting to propagate outside the bounds of the ephemeris file. The STK propagator
includes code that steps the spacecraft to the ephem boundary before stepping out of
the span of the ephem
STK ephemeris files are ASCII files conforming to the Satellite Tool Kit TimePosV-
el specifications. As discussed in the EphemerisFile help, GMAT can generate STK
ephemeris files using the EphemerisFile.OutputFormat field. The STK propagator
works with STK formatted files, starting with STK 4.0, or GMAT STK ephemerides.
Fields
The only Propagator fields applicable to the STK ephemeris propagator are EpochFor-
mat, StartEpoch, StepSize and Type.
Field Description
EpochFormat Only used for an SPK, Code500, or STK propagator. Speci-
fies format of the epoch contained in the StartEpoch field.
431
Reference Guide Dynamics and Modeling
Field Description
Start Epoch Only used for an SPK, Code500, or STK propagator. Spec-
ifies initial epoch of propagation. When an epoch is provid-
ed that epoch is used as the initial epoch. When the key-
word FromSpacecraft is provided, the start epoch is inher-
ited from the spacecraft.
432
Dynamics and Modeling Reference Guide
GUI
To configure a Propagator from the GMAT GUI to use STK ephemeris files, select and
open a Propagator from the Resources tree. In the Integrator category select STK from
the Type drop-down box. This will display the STK propagator options dialog. There are
four fields displayed for an STK propagator that affect propagation - StepSize, Central-
Body, EpochFormat, and StartEpoch. Note that changing the EpochFormat setting
converts the input epoch to the selected format. You can also type FromSpacecraft
into the StartEpoch field and the Propagator will use the epoch of the Spacecraft as
the initial propagation epoch. The CentralBody field is displayed to the user, but is un-
used when the integrator type is STK.
Implementation Notes
433
Reference Guide Dynamics and Modeling
STK ephemeris files can set an ephemeris epoch that is very different from the data in
the file by setting a distant in time Scenario Epoch, and compensating using the time
offset for each ephemeris point in the file. This can lead to round-off issues in propaga-
tion, particularly when propagating to the end of an ephemeris (or back propagating to
the start).
Remarks
There is currently no GUI option to assign the STK ephemeris file to the Spacecraft
resource. You must specify the STK ephemeris file on the Spacecraft.EphemerisName
parameter via script. The subsections below provide examples of how to do this.
To use a STK ephemeris-configured Propagator, you must add the STK ephemeris file
to the Spacecraft. A sample spacecraft Code500 ephemeris, (sat_leo.ephem, in the
data/vehicle/ephem/code500 directory) is distributed with GMAT. This sample file
has a span of 4/20/2015 00:00:00 to 4/30/2015 00:00:00. An example of how to assign
this ephemeris to a spacecraft is shown below. Relative paths are defined with respect
to the GMAT bin directory of your local installation.
aSpacecraft.EphemerisName = '../data/vehicle/ephem/stk/SampleSTKEphem.e';
BeginMissionSequence;
A spacecraft may have only one STK ephemeris assigned. There is currently no GUI
option to add an STK ephemeris file to a spacecraft.
If you have assigned the ephemeris file to your spacecraft, configuring the propagator
only requires assigning the STK type and the desired step size on a Propagator re-
source. The central body of propagation will be the central body of the ephemeris file.
If desired, you may also specify an EpochFormat and StartEpoch on the propagator
to specify an initial epoch from which to start propagation. The same effect can be ac-
complished with an independent Propagate command (see Propagate) to advance the
Spacecraft to the desired starting epoch.
STKProp.Type = 'STK';
STKProp.StepSize = 60;
BeginMissionSequence;
The same remarks mentioned in the section on SPK propagators with regard to interac-
tion with the Propagate command and behavior near ephemeris boundaries also apply
to the STK ephemeris propagator.
434
Dynamics and Modeling Reference Guide
Examples
%
% Spacecraft
%
Create Spacecraft STKSat;
%
% Propagator
%
%
% Output
%
%----------------------------------------
%---------- Arrays, Variables, Strings
%----------------------------------------
%
% Miscellaneous variables.
%
%
% Mission Sequence
%
BeginMissionSequence;
435
Reference Guide Dynamics and Modeling
Propagate STKProp(STKSat);
EndWhile;
436
Dynamics and Modeling Reference Guide
SolarPowerSystem
A solar power system model
Description
For a complete descripton of how to configure all Resources required for electric propul-
sion modelling, see the Tutorial named Electric Propulsion
Fields
Field Description
AnnualDecayRate The annual decay rate of the power system.
437
Reference Guide Dynamics and Modeling
Field Description
BusCoeff3 Coefficient of power required by spacecraft bus.
438
Dynamics and Modeling Reference Guide
Field Description
ShadowBodies A list of celestial bodies for use in the shadow computa-
tion. A body cannot be added more than once.
439
Reference Guide Dynamics and Modeling
Field Description
SolarCoeff4 Coefficient of power created by solar power system.
GUI
Remarks
440
Dynamics and Modeling Reference Guide
where "tau" is the power AnnualDecayRate, P_0 is InitialMaxPower, and "delta t" is
the elapsed time between the simulation epoch and InitialEpoch.
The power required by the spacecraft bus for all subsystems other than the propulsion
system is computed using
where A_Bus, B_Bus, and C_Bus are BusCoeff1, BusCoeff2, and BusCoeff3 respec-
tively and r is the distance from the Sun in Au.
The solar power model scales the base power based on a polynomial function in terms
of the solar distance. Total power is compute using
where P_Sun is the percent sun ( full sun is 1.0, no sun is 0.0), r is the distance from
the Sun in Au, and C_1 is SolarCoeff1 and so on. Thrust power available for electric
propulsion is finaly computed using
Note that when modeling shadows for a solar power system, discontinuities in the force
model can occur when the power avialable for propulsion is less than a thruster's min-
imum useable power setting. As a spacecraft passes from penumbra to umbra, and
power avialable for thusting goes to zero, thrust power causes thrust acceleration to
discontinuously terminate, causing issues when using adaptive step integrators. In this
case, there are a few options. You can configure any itegrator to use fixed step integra-
tion by setting the ErrorControl to None. Or you can configure the integrator to continue
propagating if a bad step, in this case a small discontinuity, occurs. See the Propagator
reference material for more information.
Examples
Create a SolarPowerSystem and attach it to a Spacecraft.
441
Reference Guide Dynamics and Modeling
BeginMissionSequence
For a complete descripton of how to configure all Resources required for electric propul-
sion modeling, see the Tutorial named Electric Propulsion.
442
Dynamics and Modeling Reference Guide
SolarSystem
High level solar system configuration options
Description
The SolarSystem resource allows you to define global properties for the model of the
solar system including the ephemeris source for built-in celestial bodies and selected
settings to improve performance when medium fidelity modelling is acceptable for your
application. This resource cannot be modified in the mission sequence.
Note
As of release R2015a, GMAT uses two separate solar system configurations
for core parts of the system. For propagation, GMAT uses the source speci-
fied by SolarSystem.EphemerisSource and the CelestialBody properties
configured on each resource. For event location with the new ContactLo-
cator and EclipseLocator resources, GMAT always uses SPICE data for
SolarSystem and CelestialBody properties. See ContactLocator, Eclipse-
Locator, and CelestialBody for details.
Fields
Field Description
DEFilename The path and name of the DE file.
443
Reference Guide Dynamics and Modeling
Field Description
EphemerisUpdateInter- The time between time updates for celetial body ephemeris.
val For example, if EphemerisUpdateInterval = 60, if an
ephemeris call is made at time t = 1200, and a subsequent
call is made at time t = 1210, the same ephemeris will be re-
turned for the second call. This option is for high speed, low
fidelity modelling or for use when modelling orbits far from
third body perturbation sources.
444
Dynamics and Modeling Reference Guide
Field Description
UseTTForEphemeris Flag to use Terrestrial Time (TT) as input to the orbital
ephemeris routines. When set to false, TDB is used.
GUI
The SolarSystem dialog box allows you to configure global properties for solar system
modelling. The default configuration is illustrated above. Use Ephemeris Source to
choose the ephemeris model for built-in celestial bodies. If you select either DE405,
DE421, or DE424 the dialog box above illustrates available options.
445
Reference Guide Dynamics and Modeling
Warning
GMAT allows you to provide user-created DE or SPK kernel files but we
recommend using the files distributed with GMAT. The files provided with
GMAT have been extensively tested for consistency and accuracy with the
original data provided by JPL and other models in GMAT. Using inconsistent
ephemeris files or user-generated files can result in instability or numerical
issues if the files are not generated correctly.
If you select SPICE for Ephemeris Source, the SolarSystem dialog box reconfigures
to disable the Ephemeris Filename option, indicating that this is no longer used in this
mission..
446
Dynamics and Modeling Reference Guide
Remarks
GMAT uses the ephemeris file selected in the EphemerisSource field for all built-in
celestial bodies. For user-defined bodies, the ephemeris model is specified on the Ce-
lestialBody object.
Note: The SolarSystem and built-in CelestialBody resources require several hundred
fields for full configuration. GMAT only saves non-default values for SolarSystem and
CelestialBody to the script so that scripts are not populated with hundreds of default
settings.
Examples
BeginMissionSequence
BeginMissionSequence
447
Reference Guide Dynamics and Modeling
Spacecraft
A spacecraft model
Description
A Spacecraft resource is GMAT's spacecraft model and includes data and models for
the spacecraft's orbit, epoch, attitude, and physical parameters (such as mass and drag
coefficient), as well as attached hardware, including tanks and thrusters. The Space-
craft model also contains the data that configures how the Spacecraft 3-D CAD model
is used in an OrbitView. Spacecraft has certain fields that can be set in the Mission
Sequence and some that cannot. See the field tables on the pages below for more in-
formation.
GMAT's documentation for Spacecraft is extensive and is broken down into the follow-
ing sections:
• Spacecraft Attitude
• Spacecraft Ballistic/Mass Properties
• Spacecraft Epoch
• Spacecraft Hardware
• Spacecraft Navigation
• Spacecraft Orbit State
• Spacecraft Visualization Properties
448
Dynamics and Modeling Reference Guide
Spacecraft Attitude
The spacecraft attitude model
Description
GMAT models the orientation and rate of rotation of a spacecraft using several differ-
ent mathematical models. Currently, GMAT assumes that a Spacecraft is a rigid body.
The currently supported attitude models are Spinner, PrecessingSpinner, Coordi-
nateSystemFixed, NadirPointing, ThreeAxisKinematic, CCSDS-AEM and SpiceAt-
titude. The Spinner model is a simple, inertially fixed spin axis model. The Precess-
ingSpinner model adds models for precession and nutation of the spin axis. The Co-
ordinateSystemFixed model allows you to use any CoordinateSystem supported by
GMAT as the attitude of a Spacecraft. The NadirPointing model constructs a coor-
dinate system based on spacecraft position and velocity vectors. The SpiceAttitude
model allows you to define the Spacecraft attitude based on SPICE attitude kernels.
The ThreeAxisKinematic model propagates the attitude quaternion from angular ve-
locity inputs; it was originally designed for an animation application where attitude was
propagated every 25 msec.
Fields
Field Description
AngularVelocityX The x-component of Spacecraft body angular velocity ex-
pressed in the inertial frame. AngularVelocityX is used
for the following Attitude models: Spinner.
449
Reference Guide Dynamics and Modeling
Field Description
AngularVelocityZ The z-component of Spacecraft body angular velocity ex-
pressed in the inertial frame. AngularVelocityZ is used
for the following Attitude models: Spinner.
450
Dynamics and Modeling Reference Guide
Field Description
AttitudeCoordinateSys- The CoordinateSystem used in attitude computations.
tem The AttitudeCoordinateSystem field is only used for the
following attitude models: CoordinateSystemFixed.
451
Reference Guide Dynamics and Modeling
Field Description
AttitudeSpiceKernel- SPK Kernels for Spacecraft attitude. SPK atttitude ker-
Name nels have extension ".BC". This field cannot be set in the
Mission Sequence. An empty list unloads all kernels of this
type on the Spacecraft.
452
Dynamics and Modeling Reference Guide
Field Description
BodyConstraintVectorX The x-component of the constraint vector, expressed in
the body frame. See NadirPointing description for further
details. BodyConstraintVectorX is used for the following
attitude models: NadirPointing.
453
Reference Guide Dynamics and Modeling
Field Description
BodySpinAxisY The y-component of the spin axis, expressed in the body
frame. BodySpinAxisY is used for the following attitude
models: PrecessingSpinner.
454
Dynamics and Modeling Reference Guide
Field Description
DCM13 Component (1,3) of the Direction Cosine Matrix. DCM13
is used for the following Attitude models: Spinner.
455
Reference Guide Dynamics and Modeling
Field Description
DCM32 Component (3,2) of the Direction Cosine Matrix. DCM32
is used for the following Attitude models: Spinner.
456
Dynamics and Modeling Reference Guide
Field Description
EulerAngleRate1 The value of the first Euler angle rate. EulerAngleRate1
is used for the following Attitude models: Spinner.
457
Reference Guide Dynamics and Modeling
Field Description
EulerAngleSequence The Euler angle sequence used for Euler angle input and
output..
458
Dynamics and Modeling Reference Guide
Field Description
NutationAngle The attitude nutation angle. NutationAngle is used for the
following attitude models: PrecessingSpinner.
459
Reference Guide Dynamics and Modeling
Field Description
MRP1 The value of the first modified Rodrigues parameter.
MRP1 is used for the following Attitude models: Spinner.
460
Dynamics and Modeling Reference Guide
Field Description
Q1 First component of quaternion. GMAT’s quaternion repre-
sentation includes the three “vector” components as the
first three elements in the quaternion and the “rotation”
component as the last element in the quaternion. Q1 is
used for the following Attitude models: Spinner.
461
Reference Guide Dynamics and Modeling
Field Description
Q4 Fourth component of quaternion. GMAT’s quaternion rep-
resentation includes the three “vector” components as the
first three elements in the quaternion and the “rotation”
component as the last element in the quaternion. Q4 is
used for the following Attitude models: Spinner.
462
Dynamics and Modeling Reference Guide
Remarks
Note
GMAT attitude parameterizations such as the DCM rotate from inertial to
body.
Quaternion
aSpacecraft.Q1 = 0.5
aSpacecraft.Q2 = 0.5
aSpacecraft.Q3 = 0.5
aSpacecraft.Q4 = 0.5
GMAT normalizes the quaternion before use. In command mode, you must enter the
entire quaternion as a single vector to avoid scaling components of the quaternion before
the entire quaternion is set.
DirectionCosineMatrix (DCM)
The Direction Cosine Matrix is a 3x3 array that contains cosines of the angles that rotate
from the x, y, and z inertial axes to the x, y, and z body axes. The direction cosine matrix
must be ortho-normal and you define the DCM element by element. Here is an example
that shows how to define the attitude using the DCM.
aSpacecraft.DCM11 = 1
aSpacecraft.DCM12 = 0
463
Reference Guide Dynamics and Modeling
aSpacecraft.DCM13 = 0
aSpacecraft.DCM21 = 0
aSpacecraft.DCM22 = 1
aSpacecraft.DCM23 = 0
aSpacecraft.DCM31 = 0
aSpacecraft.DCM32 = 0
aSpacecraft.DCM33 = 1
Euler Angles
Euler angles are a sequence of three rotations about coordinate axes to transform from
one system to another system. GMAT supports all 12 Euler angle sequences. Here is
an example setting attitude using a “321” sequence.
aSpacecraft.EulerAngleSequence = '321'
aSpacecraft.EulerAngle1 = 45
aSpacecraft.EulerAngle2 = 45
aSpacecraft.EulerAngle3 = 90
Warning
Caution: The Euler angles have singularities that can cause issues during
modeling. We recommend using other representations for this reason.
The modified Rodrigues parameters are a modification of the Euler Axis/Angle repre-
sentation. Specifically, the MRP vector is equal to nhat* tan(Euler Angle/4) where nhat
is the unitized Euler Axis.
aSpacecraft.MRP1 = 0.2928932188134525
aSpacecraft.MRP2 = 0.2928932188134524
aSpacecraft.MRP3 = 1.149673585146546e-017
The Euler angle rates are the first time derivative of the Euler angles and can be used
to define the body rates. Euler angle rates use the same sequence as the EulerAngles.
The example below shows how to define the Euler angle rates for a spacecraft.
aSpacecraft.EulerAngleSequence = '321'
aSpacecraft.EulerAngleRate1 = -5
aSpacecraft.EulerAngleRate2 = 20
aSpacecraft.EulerAngleRate3 = 30
Angular Velocity
The angular velocity is the angular velocity of the spacecraft body with respect to the
inertial frame, expressed in the inertial frame. The example below shows how to define
the angular velocity for a spacecraft.
464
Dynamics and Modeling Reference Guide
aSpacecraft.AngularVelocityX = 5;
aSpacecraft.AngularVelocityY = 10;
aSpacecraft.AngularVelocityZ = 5;
Warning
For the CoordinateSystemFixed attitude model, the attitude is completely
described by the selected coordinate system. If you are working in the script,
setting attitude parameters (Euler Angles, Quaternion etc.) or setting attitude
rate parameters such as (Euler Angle Rates etc.) has no effect.
The script example below shows how to configure a Spacecraft to use a spacecraft
VNB attitude system.
465
Reference Guide Dynamics and Modeling
aSat.AttitudeCoordinateSystem = 'attCoordSys'
BeginMissionSequence
The Spinner attitude model propagates the attitude assuming the spin axis direction
is fixed in inertial space. We recommend using the newer PrecessingSpinner model
instead of Spinner, and this model is maintained primarily for backwards compatibility.
You define the attitude by providing initial body orientation and rates. GMAT propagates
the attitude by computing the angular velocity and then rotates the Spacecraft about
that angular velocity vector at a constant rate defined by the magnitude of the angular
velocity. You can define the initial attitude using quaternions, Euler angles, the DCM,
or the modified Rodriques parameters. You can define the attitude rates using Euler
angles rates or angular velocity. When working with Euler angles, the rotation sequence
is determined by the EulerAngleSequence field.
Warning
Caution: If you are working in the script, setting the CoordinateSystem for
the Spinner attitude model has no effect.
466
Dynamics and Modeling Reference Guide
The example below configures a spacecraft to spin about the inertial z axis.
BeginMissionSequence
467
Reference Guide Dynamics and Modeling
The SpiceAttitude model propagates the attitude using attitude SPICE kernels. To con-
figure a Spacecraft to use SPICE kernels select SpiceAttitude for the Attitude field
as shown below.
Warning
Caution: For the SpiceAttitude model, the attitude is completely described
by the spice kernels. When working in the script, setting the CoordinateSys-
tem, attitude parameters (EulerAngles, Quaternion etc.) or attitude rate
parameters such as (EulerAngleRates etc.) has no effect.
You must provide three SPICE kernel types for the SpiceAttitude model: the attitude
kernel (.bc file), the frame kernel (.tf file) and the spacecraft clock kernel (.tsc file). These
files are defined on the Spacecraft SPICE tab as shown below. In addition to the ker-
nels, you must also provide the Spacecraft NAIFId and the NAIFIdReferenceFrame.
Below is an illustration of the SPICE tab configured for MarsExpress script found later
in this section.
468
Dynamics and Modeling Reference Guide
The example below configures a Spacecraft to use SPK kernels to propagator the at-
titude for Mars Express. The SPK kernels are distributed with GMAT.
469
Reference Guide Dynamics and Modeling
BeginMissionSequence
The NadirPointing attitude mode configures the attitude of a spacecraft to point a spec-
ified vector in the spacecraft body system in the nadir direction. The ambiguity in angle
about the nadir vector is resolved by minimizing the angle between two constraint vec-
tors. Note: the nadir pointing mode points the attitude in the negative radial direction
(not opposite the planetodetic normal).
To configure which axis points to nadir, set the AttitudeReferenceBody field to the de-
sired celestial body and define the body components of the alignment vector using the
BodyAlignmentVector fields. To configure the constraint, set the AttitudeConstraint-
Type field to the desired constraint type, and define the body components of the con-
straint using the BodyConstraintVector fields. GMAT supports two constraint types,
OrbitNormal and Velocity, and in both cases the vectors are constructed using the
inertial spacecraft state with respect to the AttitudeReferenceBody.
Warning
Attitude rates are not computed for the NadirPointing model. If you per-
form a computation that requires attitude rate information when using the
NadirPointing mode, GMAT will throw an error message and execution will
stop. Similarly, if the definitions of the BodyAlignmentVector and Body-
ConstraintVector fields result in an undefined attitude, an error message is
thrown and execution will stop.
470
Dynamics and Modeling Reference Guide
The script example below shows how to configure a Spacecraft to use an Earth Nadir-
Pointing attitude system where the body y-axis points nadir and the angle between the
body x-axis and the orbit normal vector is a minimum.
BeginMissionSequence
471
Reference Guide Dynamics and Modeling
The CCSDS Attitude Ephemeris Message (AEM) is an ASCII standard for atti-
tude ephemerides documented in “ATTITUDE DATA MESSAGES” RECOMMENDED
STANDARD CCSDS 504.0-B-1. GMAT supports some, but not all, of the attitude mes-
sages defined in the standard. According to the CCSDS AEM specification, “The set of
attitude data messages described in this Recommended Standard is the baseline con-
cept for attitude representation in data interchange applications that are cross-support-
ed between Agencies of the CCSDS.” Additionally, the forward of the standard states
“Derived Agency standards may implement only a subset of the optional features al-
lowed by the Recommended Standard and may incorporate features not addressed by
this Recommended Standard. See the details below for supported keyword types and
details for creating AEM files that GMAT can use for attitude modelling.
An AEM file must have the format illustrated below described in Table 4-1 of the stan-
dard. The header section contains high level information on the version, originator, and
date. The body of the file is composed of paired blocks of Metadata and data. The Meta-
data sections contain information on the data such as the first and last epoch of the
block, the time system employed, the reference frames, the attitude type (quaternion,
Euler Angle, etc.) and many other items documented in later sections. The data sections
contain lines of epoch and attitude data.
472
Dynamics and Modeling Reference Guide
CCSDS_AEM_VERS = 1.0
CREATION_DATE = 2002-11-04T17:22:31
ORIGINATOR = NASA/JPL
META_START
COMMENT This file was produced by M.R. Somebody, MSOO NAV/JPL, 2002 OCT 04.
COMMENT It is to be used for attitude reconstruction only.
COMMENT The relative accuracy of these attitudes is 0.1 degrees per axis.
OBJECT_NAME = MARS GLOBAL SURVEYOR
OBJECT_ID = 1996-062A
CENTER_NAME = mars barycenter
REF_FRAME_A = EME2000
REF_FRAME_B = SC_BODY_1
ATTITUDE_DIR = A2B
TIME_SYSTEM = UTC
START_TIME = 1996-11-28T21:29:07.2555
USEABLE_START_TIME = 1996-11-28T22:08:02.5555
USEABLE_STOP_TIME = 1996-11-30T01:18:02.5555
STOP_TIME = 1996-11-30T01:28:02.5555
ATTITUDE_TYPE = QUATERNION
QUATERNION_TYPE = LAST
INTERPOLATION_METHOD = hermite
INTERPOLATION_DEGREE = 7
META_STOP
DATA_START
1996-11-28T21:29:07.2555 0.56748 0.03146 0.45689 0.68427
1996-11-28T22:08:03.5555 0.42319 -0.45697 0.23784 0.74533
1996-11-28T22:08:04.5555 -0.84532 0.26974 -0.06532 0.45652
< intervening data records omitted here >
1996-11-30T01:28:02.5555 0.74563 -0.45375 0.36875 0.31964
DATA_STOP
META_START
473
Reference Guide Dynamics and Modeling
DATA_START
1996-12-18T12:05:00.5555 -0.64585 0.018542 -0.23854 0.72501
1996-12-18T12:10:05.5555 0.87451 -0.43475 0.13458 -0.16767
1996-12-18T12:10:10.5555 0.03125 -0.65874 0.23458 -0.71418
< intervening records omitted here >
1996-12-28T21:28:00.5555 -0.25485 0.58745 -0.36845 0.67394
DATA_STOP
CCSDS files require many keywords and fields, some are required for all file
types, others are Situationally Required (SR) depending upon the type of file (i.e. If
ATTITUDE_TYPE = QUATERNION, then QUATERNION_TYPE must be included).
The tables below describe GMAT’s implementation starting with header keywords
Example:
CCSDS_AEM_VERS =1.0
COMMENT N Comments (allowed after AEM version number and
META_START and before a data block of ephemeris
lines). Each comment line shall begin with this keyword.
GMAT does not use this field.
474
Dynamics and Modeling Reference Guide
Example:
475
Reference Guide Dynamics and Modeling
Example:
OBJECT_NAME = EUTELSAT
Note: GMAT does not use this field. In GMAT, you asso-
ciate a file with a particular spacecraft by configuring a
particular spacecraft to use the file as shown below.
Example:
REF_FRAME_A = EME2000
REF_FRAME_A = SC_Body_1
476
Dynamics and Modeling Reference Guide
Example:
REF_FRAME_A = EME2000
REF_FRAME_A = SC_Body_1
ATTITUDE_DIR Y Rotation direction of the attitude specifying from which
frame the transformation is to: A2B specifies a transfor-
mation from the REF_FRAME_A to the REF_FRAME_B;
B2A specifies a transformation from the REF_FRAME_B
to the REF_FRAME_A.
Examples:
ATTITUDE_DIR = A2B
ATTITUDE_DIR = B2A
TIME_SYSTEM Y Time system used for both attitude ephemeris data and
metadata. GMAT supports the following options: UTC
Example:
TIME_SYSTEM = UTC
START_TIME Y Start of TOTAL time span covered by attitude ephemeris
data immediately following this metadata block. The
START_TIME time tag at a new block of attitude
ephemeris data must be equal to or greater than the
STOP_TIME time tag of the previous block. See the
CREATION_DATE specification for detailed information
on time formats. Note: precision in the seconds place is
only preserved to a few microseconds.
Example:
START_TIME = 1996-12-18T14:28:15.117
477
Reference Guide Dynamics and Modeling
Example:
Example:
STOP_TIME = 1996-12-18T14:28:15.117
ATTITUDE_TYPE Y The format of the data lines in the message. GMAT sup-
ports the following types
ATTITUDE_TYPE = QUATERNION
ATTITUDE_TYPE = EULER_ANGLE
478
Dynamics and Modeling Reference Guide
Example:
QUATERNION_TYPE = FIRST
QUATERNION_TYPE = LAST
EULER_ROT_SEQ SR The rotation sequence of the Euler angles that rotate
from REF_FRAME_A to REF_FRAME_B, or vice versa,
as specified using the ATTITUDE_DIR keyword. This key-
word is only used if ATTITUDE_TYPE denotes EulerAn-
gles and in that case the field is required.
Example:
EULER_ROT_SEQ = 321
RATE_FRAME N GMAT does not use this field.
INTERPOLATION N Recommended interpolation method for attitude
_METHOD ephemeris data in the block immediately following this
metadata block. Note. GMAT uses spherical linear in-
terpolation when ATTITUDE_TYPE = QUATERNION.
GMAT uses lagrange interpolation for ATTITUDE_TYPE
= EULER_ANGLE.
Examples:
Example:
INTERPOLATION _DEGREE = 7
479
Reference Guide Dynamics and Modeling
Example:
Example:
480
Dynamics and Modeling Reference Guide
BeginMissionSequence;
To configure the spin axis of the spacecraft body, set the BodySpinAxis, which is ex-
pressed in the body frame, and define the reference vector of the steady-state pre-
cession motion using the NutationReferenceVector, which is expressed in the inertial
frame. To configure the initial attitude of the spacecraft, set InitialPrecessionAngle to
define the initial angle of the precession, set InitialSpinAngle to define the initial an-
gle of the spin, and set NutationAngle to define the nutation angle which is constant.
To configure the rate of precession and spin rate, set PrecessingRate and SpinRate
which are constant.
Note
The PrecessingSpinner model uses the cross product of the BodySpinAx-
is axis and the inertial x-axis as a reference for the initial attitude. To avoid an
undefined attitude when the spin axis is aligned, or nearly aligned, with the
inertial x-axis, a different reference vector is used in that case. In the event
that the cross product of BodySpinAxis and the inertial x-axis is less than
1e-5, the inertial y-axis is used as the reference vector. For further details
see the engineering/mathematical specifications.
481
Reference Guide Dynamics and Modeling
The script example below shows how to configure a Spacecraft to have Precess-
ingSpinner attitude mode where the body z-axis spins with respect to the inertial z-
axis. PrecessionRate is set to 1 deg./sec., InitialPrecessionAngle is set to 0 deg./
sec., SpinRate is set to 2 deg./sec., InitialSpinAngle is set to 0 deg./sec., and Nuta-
tionAngle is set to 30 deg.
482
Dynamics and Modeling Reference Guide
BeginMissionSequence
The ThreeAxisKinematic attitude model propagates the attitude state using a function
of the attitude quaternion and the angular velocity. It does not include any modeling
of torques. The quaternion kinematic algorithm was used for onboard attitude compu-
tations before rad hard processors were powerful enough to support numeric integra-
tion. Mathematically it produces the same result as the Spinner model; operationally
there is no assumption that the spin axis is fixed – its first use was for a Lunar Catalyst
project in which a new angular velocity would be read from telemetry every second. The
initial attitude can be specified with any of DCM, quaternion, Euler angles, or Modified
Rodrigues parameters; the initial rates can be specified with either angular velocity or
Euler rates. When working with Euler rates, the rotation sequence is determined by the
EulerAngleSequence field.
Warning
Caution: If you are working in the script, setting the CoordinateSystem for
the ThreeAxisKinematic attitude model has no effect.
483
Reference Guide Dynamics and Modeling
aSat.Attitude = ThreeAxisKinematic;
aSat.Q1 = 0.0
aSat.Q2 = 0.0
aSat.Q3 = 0.0
aSat.Q4 = 1.0;
GMAT DefaultSC.AngularVelocityX = 3; % deg/sec
GMAT DefaultSC.AngularVelocityY = 0
GMAT DefaultSC.AngularVelocityZ = 0;
BeginMissionSequence
484
Dynamics and Modeling Reference Guide
Description
The Spacecraft ballistic and mass properties include the drag and SRP areas and co-
efficients as well as the spacecraft dry mass. These quantities are used primarily in or-
bital dynamics modelling. GMAT supports spherical SRP and drag models, and a higher
fidelity drag and area model called SPAD.
Fields
Field Description
AddPlates For use with the NPlate area model. Selection of Plate objects
that comprise the spacecraft area model. See also Plate
485
Reference Guide Dynamics and Modeling
Field Description
Drag Area The area used to compute acceleration due to atmospheric drag
for the spherical drag area model. This parameter is ignored
when using SPAD drag modeling.
486
Dynamics and Modeling Reference Guide
Field Description
SPADDragInterpo- Interpolation method for SPAD drag vectors.
lationMethod
Data Type String
Allowed Values 'Bicubic' or 'Bilinear'
Access set
Default Value Bilinear
Units N/A
Interfaces GUI, script
SPADDragScale- Scale factor applied to the drag force when using a SPAD drag
Factor area model.
487
Reference Guide Dynamics and Modeling
Field Description
SRPArea The area used to compute acceleration due to solar radiation
pressure for the spherical SRP area model. This parameter is ig-
nored when using SPAD SRP modeling.
GUI
The GUI interface for ballistic and mass properties is contained on the Ballistic/Mass
tab of the Spacecraft resource. You can enter physical properties such as the drag and
SRP areas and coefficients and the Spacecraft dry mass which are used in orbital dy-
namics modelling. GMAT supports a spherical SRP model and a SPAD (Solar Pressure
and Aerodynamic Drag) file.
Remarks
Configuring Area Properties for the Spherical Area Model
GMAT supports a spherical (sometimes called a "cannonball") area model for drag and
SRP modeling. In the spherical model, the area is assumed to be independent of the
488
Dynamics and Modeling Reference Guide
spacecraft's orientation with respect to the local velocity vector and the sun vector. The
spherical area model is selected by setting the configured ForceModel SRP.SRPModel
and Drag.DragModel to Spherical. For more details on the computation and configu-
ration of drag and SRP models see the Force Model documentation.
Warning
The NPlate area model is an alpha-level option for this release and should
not be used for operational support. Use of this model may be enabled by
setting RUN_MODE = TESTING in the Debug options section of the GMAT
startup file.
GMAT supports a multi-plate area model for SRP modeling. In the NPlate model, the
area is built up from a collection of Plate resources, each specifying a separate area,
orientation, and reflectivity properties. The NPlate area model is selected by setting the
configured ForceModel SRP.SRPModel to NPlate. The NPlate model is not currently
available for drag modeling. For more details on the configuration of the NPlate model,
see the Plate documentation.
SPAD stands for Solar Pressure and Aerodynamic Drag. A SPAD file can be used for
high fidelity SRP and drag modeling taking into account the physical properties of the
spacecraft (shape and reflectivity) and the spacecraft attitude. SPAD files contain tabu-
lated data representing the spacecraft area scaled by physical properties like Cr includ-
ing specular, diffuse, and reflective properties. Area data in the SPAD file is tabulated
as a function of azimuth and elevation in the spacecraft body frame. In the case of SRP
modeling, the azimuth and elevation tabulated on the file should be the azimuth and
elevation of the vector from the Spacecraft to the Sun, expressed in the body frame. For
drag modeling, the azimuth and elevation denote the direction of the spacecraft velocity
vector relative to the rotating atmosphere. The SPAD area model is selected by setting
the configured ForceModel SRP.SRPModel and Drag.DragModel to SPADFile.
To compute the SRP or drag acceleration at each integration point, GMAT determines
the sun or relative velocity vector’s azimuth and elevation in the spacecraft body frame
at the integration time, and then interpolates the SPAD data using bi-linear or bi-cubic
interpolation. Since the SRP or drag vector is taken in the spacecraft body frame, this
formulation results in an attitude dependent acceleration. For more details on the com-
putation and configuration of drag and SRP models see the Force Model documentation.
489
Reference Guide Dynamics and Modeling
Caution
When using a SPAD file, GMAT uses the attitude defined on the Spacecraft
resource to compute the Sun's or relative velocity vector in the body frame. If
the attitude uses a coordinate system with Axes set to ObjectReferenced,
and those axes refer back to the Spacecraft orbit state (i.e. VNB or LVLH
systems), GMAT holds the attitude constant over a given integration step. In
those cases, we recommend carefully choosing a maximum step size small
enough to ensure the resulting approximation is acceptable for your appli-
cation.
A valid SPAD file header, and the first three lines of data are shown below for illustrative
purposes. Note, GMAT does not use all values provide on the file and GMAT's usage
of SPAD files is described in detail in the table below the example.
Version : 4.21
System : sphericalSat
Analysis Type : Area
Pixel Size : 5
Spacecraft Size : 436.2
Pressure : 1
Center of Mass : (50.9, 184.9, -49)
Current time : May 7, 2009 15:53:38.00
Motion : 1
Name : Azimuth
Method : Step
Minimum : -180
Maximum : 180
Step : 5
Motion : 2
Name : Elevation
Method : Step
Minimum : -90
Maximum : 90
Step : 5
: END
A SPAD file contains three sections as illustrated below. Data specifications for items in
each section are described in the tables below. A SPAD file header may contain many
fields but only a few are used by GMAT as described below. Other fields are ignored.
490
Dynamics and Modeling Reference Guide
Example:
The SPAD file Motion Data section describes the data contained in the body of the file.
The Motion Data fields used by GMAT are described below. Others are ignored.
Examples:
Motion : 1
Name : Azimuth
and
Motion : 2
Name : Elevation
491
Reference Guide Dynamics and Modeling
Examples:
Motion : 1
Name : Azimuth
and
Motion : 2
Name : Elevation
Method Y The step size in the independent variable. The only sup-
ported value is Step.
Example:
Motion : 1
Method : Step
Maximum Y The maximum value for an independent variable (Motion
Type). For Azimuth, Maximum must be 180, and for Ele-
vation Maximum must be 90.
Example:
Motion : 1
Name : Azimuth
Maximum : 180
Motion : 2
Name : Elevation
Maximum : 90
492
Dynamics and Modeling Reference Guide
Example:
Motion : 1
Name : Azimuth
Minimum : -180
Motion : 2
Name : Elevation
Minimum : -90
Step Y The step size for the independent variable (Motion Type).
If Step does not divide evenly into the variable range, then
errors may occur because the maximum and/or minimum
values may not be on the file.
Example:
Motion : 1
Step : 15
Record count Y Record count is the number of rows of data in the data
segment. Record count = (360/(Azimuth Step) +1)*(180/
(Elevation Step) +1).
Example:
The SPAD file data block contains tabulated force modeling data as described below.
493
Reference Guide Dynamics and Modeling
Example:
AzimuthElevatio
degrees degrees
------- -------
-180.00 -90.00
-180.00 -75.00
-180.00 -60.00
Elevation N Elevation data column. Must be second column in the
data. Units must be degrees. Elevation is the eleva-
tion of the vector from spacecraft to Sun (for SRP,
atan2(zSun,sqrt(xSun^2 + ySun^2)), or the relative veloc-
ity vector (for drag) expressed in the body frame.
Example:
AzimuthElevatio
degrees degrees
------- -------
-180.00 -90.00
-180.00 -75.00
-180.00 -60.00
Force(*) N Area vector columns. Must be columns 3-5 in the data.
Quantities must be in base units of m^2,mm^2,cm^2,in^2,
or ft^2. If another unit is provided in the header lines, an
exception is thrown. The area vector is the direction of the
resulting SRP force in the spacecraft body frame, scaled
by area and reflectivity properties.
The TotalMass property of a Spacecraft is a read-only property that is the sum of the
DryMass value and the sum of the fuel mass in all attached fuel tanks. GMAT’s propa-
gators will not allow the total mass of a spacecraft to be negative. However, GMAT will
allow the mass of a ChemicalTank to be negative. See the ChemicalTank documen-
tation for details.
494
Dynamics and Modeling Reference Guide
Examples
BeginMissionSequence
BeginMissionSequence
495
Reference Guide Dynamics and Modeling
Spacecraft Epoch
The spacecraft epoch
Description
The epoch of a Spacecraft is the time and date corresponding to the specified orbit
state. See the Spacecraft Orbit State section for interactions between the epoch, coor-
dinate system, and spacecraft state fields.
Caution
GMAT’s Modified Julian Date (MJD) format differs from that of other software.
The Modified Julian format is a constant offset from the full Julian date (JD):
MJD = JD - offset
Fields
Field Description
DateFormat The time system and format of the Epoch field. In the GUI,
this field is called EpochFormat.
496
Dynamics and Modeling Reference Guide
Field Description
Epoch The time and date corresponding to the specified orbit
state.
497
Reference Guide Dynamics and Modeling
Field Description
A1Gregorian The Spacecraft orbit epoch in the A.1 system and the
Gregorian format.
498
Dynamics and Modeling Reference Guide
Field Description
TTGregorian The Spacecraft orbit epoch in the TT system and the Gre-
gorian format.
499
Reference Guide Dynamics and Modeling
Field Description
Epoch.TAIGregorian The Spacecraft orbit epoch in the TAI system and the
Gregorian format.
500
Dynamics and Modeling Reference Guide
Field Description
Epoch.TTModJulian The Spacecraftorbit epoch in the TT system and the Mod-
ified Julian format.
501
Reference Guide Dynamics and Modeling
GUI
Remarks
502
Dynamics and Modeling Reference Guide
The epoch can be set in multiple ways. The default method is to set the DateFormat
field to the desired time system and format, then set the Epoch field to the desired
epoch. This method cannot be used to get the epoch value, such as on the right-hand
side of an assignment statement.
aSat.DateFormat = UTCGregorian
aSat.Epoch = '18 May 2012 12:00:00.000'
An alternate method is to specify the DateFormat in the parameter name. This method
works in both “get” and “set” modes.
A third method can be used in “get” mode everywhere, but in “set” mode only in the
mission sequence (i.e. after the BeginMissionSequence command).
GMAT uses the A.1 time system in the Modified Julian format for its internal calculations.
The system converts all other systems and formats on input and again at output.
Leap Seconds
When converting to and from the UTC time system, GMAT includes leap seconds as
appropriate, according to the tai-utc.dat data file from the IERS. This file contains
the conversion between TAI and UTC, including all leap seconds that have been added
or announced.
GMAT applies the leap second as the last second before the date listed in the tai-
utc.dat file, which historically has been either January 1 or July 1. In the Gregorian
th
date format, the leap second appears as a “60 second”: for example, “31 Dec 2008
23:59:60.000”. From the International Astronomical Union's Standards of Fundamental
Astronomy "SOFA Time Scale and Calendar Tools" documentation: "Note that UTC
503
Reference Guide Dynamics and Modeling
has to be expressed as hours, minutes and seconds (or at least in seconds in a given
day) if leap seconds are to be taken into account in the correct manner. In particular, it
is inappropriate to express UTC as a Julian Date, because there will be an ambiguity
during a leap second so that for example 1994 June 30 23:59:60:0 and 1994 July 1
00:00:00:0 would both come out as MJD 49534.00000 and because subtracting two
such JDs would not yield the correct interval in cases that contain leap seconds." For
this reason, we discourage use of the UTC modified Julian system, and recommend
using UTC Gregorian when a UTC time system is required.
For epochs prior to the first entry in the leap-second file, the UTC and TAI time systems
are considered identical (i.e. zero leap seconds are added). For epochs after the last
entry, the leap second count from the last entry is used.
The tai-utc.dat file is periodically updated by the IERS when new leap seconds
are announced. The latest version of this file can always be found at http://
maia.usno.navy.mil/ser7/tai-utc.dat. To replace it, download the latest ver-
sion and replace GMAT’s file in the location <GMAT>/data/time/tai-utc.dat, where
<GMAT> is the install directory of GMAT on your system.
Examples
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedDays = 1}
504
Dynamics and Modeling Reference Guide
aSat.DateFormat = TTGregorian
aSat.Epoch = '01 Dec 1978 00:00:00.000'
505
Reference Guide Dynamics and Modeling
Spacecraft Hardware
Add hardware to a spacecraft
Description
The hardware fields allow you to attach pre-configured hardware models to a space-
craft. Current models include ChemicalTank, ChemicalThruster ,ElectricTank, and
ElectricThruster. Before you attach a hardware model to a Spacecraft, you must first
create the model.
Fields
Field Description
Tanks This field is used to attach FuelTank(s) to a Spacecraft. In a script com-
mand, an empty list, e.g., DefaultSC.Tanks={}, is allowed and is used to
indicate that no FuelTank(s) is attached to the spacecraft.
GUI
There are two spacecraft hardware items, the FuelTank and the Thruster, that can
be attached to a Spacecraft. Here, we describe the method used to create and then
attach these items to a Spacecraft. For details on how to configure the FuelTank and
Thruster resources, see the help for the individual hardware item. Note the discussion
below uses a chemical system as an example but applies equally to electric systems.
As shown below, to add a ChemicalTank to your script, highlight the Hardware re-
source and then right click to add a ChemicalTank.
506
Dynamics and Modeling Reference Guide
To add a Thruster to your script, highlight the Hardware resource and then right click
to add a Thruster.
507
Reference Guide Dynamics and Modeling
Next, select the desired ChemicalTank and use the right arrow button to attach the
ChemicalTank to the Spacecraft as shown below. Then click the Apply button.
508
Dynamics and Modeling Reference Guide
509
Reference Guide Dynamics and Modeling
Remarks
To use a Thruster to apply a finite burn to a Spacecraft, additional steps are required.
For example, when you create the ChemicalThruster resource, you have to associate
a ChemicalTank with the ChemicalThruster. For details on this and related matters,
see the help for the ChemicalTank, ChemicalThruster, and FiniteBurn resources.
Examples
BeginMissionSequence
510
Dynamics and Modeling Reference Guide
Description
GMAT supports a suite of state types for defining the orbital state, including Cartesian
and Keplerian, among others. In addtion, you can define the orbital state in different co-
ordinate systems, for example EarthMJ2000Eq and EarthFixed. GMAT provides three
general state types that can be used with any coordinate system: Cartesian, Spheri-
calAZFPA, and SphericalRADEC. There are three additional state types that can be
used with coordinate systems centered at a celestial body: Keplerian, ModifiedKep-
lerian, and Equinoctial.
In the section called “Remarks” below, we describe each state type in detail including
state-type definitions, singularities, and how the state fields interact with the Coordi-
nateSystem and Epoch fields. There are some limitations when setting the orbital state
during initialization, which are discussed in the section called “Remarks”. We also in-
clude examples for setting each state type in commonly used coordinate systems.
Fields
Field Description
AltEquinoctialP A measure of the orientation of the orbit. AltEquinoctialP and
AltEquinoctialQ together govern how an orbit is oriented. AltE-
quinotialP = sin(INC/2)*sin(RAAN).
511
Reference Guide Dynamics and Modeling
Field Description
AOP The orbital argument of periapsis expressed in the coordinate
system chosen in the CoordinateSystem field.
512
Dynamics and Modeling Reference Guide
Field Description
BrouwerLongINC Brouwer-Lyddane long-term averaged (short-term averaged)
mean inclination.
BrouwerShortINC
Data Type Real
Allowed Values 0 # BrouwerLongINC/BrouwerShortINC
# 180
Access set, get
Default Value Conversion from default Cartesian state
Units deg
Interfaces GUI, script
BrouwerLongMA Brouwer-Lyddane long-term averaged (short-term averaged)
mean MA (mean anomaly).
BrouwerShortMA
Data Type Real
Allowed Values -# < BrouwerLongMA/BrouwerShortMA
<#
Access set, get
Default Value Conversion from default Cartesian state
Units deg
Interfaces GUI, script
BrouwerLon- Brouwer-Lyddane long-term averaged (short-term averaged)
gRAAN mean RAAN (right ascension of the ascending node).
513
Reference Guide Dynamics and Modeling
Field Description
CoordinateSystem The coordinate system with respect to which the orbital state
is defined. The CoordinateSystem field is dependent upon the
DisplayStateType field. If the coordinate system chosen by the
user does not have a gravitational body at the origin, then the
state types Keplerian, ModifiedKeplerian, and Equinoctial are
not permitted.
514
Dynamics and Modeling Reference Guide
Field Description
DelaunayG Delaunay "G" element, the magnitude of the orbital angular mo-
mentum, expressed in the coordinate system chosen in the Co-
ordinateSystem field.
515
Reference Guide Dynamics and Modeling
Field Description
DelaunayL Delaunay "L" element, related to the two-body orbital energy, ex-
pressed in the coordinate system chosen in the CoordinateSys-
tem field.
516
Dynamics and Modeling Reference Guide
Field Description
EquinoctialH A measure of the orbital eccentricity and argument of periapsis.
EquinoctialH and EquinoctialK together govern how elliptic an
orbit is and where the periapsis is located. EquinotialH = ECC
* sin(AOP + RAAN) .
517
Reference Guide Dynamics and Modeling
Field Description
FPA The orbital flight path angle expressed in the coordinate system
chosen in the CoordinateSystem field.
518
Dynamics and Modeling Reference Guide
Field Description
IncomingC3Energy C3 energy. C3Energy = -mu/SMA. IncomingC3Energy/
OutgoingC3Energy differ only in that they are associated with
OutgoingC3Energy the IncomingAsymptote and OutgoingAsymptote state repre-
sentations, respectively.
OutgoingC3Energy # -1e-7 or
OutgoingC3Energy # 1e-7
Access set, get
Default Value Conversion from default Cartesian state
2 2
Units km /s
Interfaces GUI, script
IncomingDHA IncomingDHA/OutgoingDHA is the declination of the incom-
ing/outgoing asymptote. If C3Energy < 0 the apsides vector is
OutgoingDHA substituted for the incoming/outgoing asymptote..
abs(OutgoingRadPer) # 1 meter.
Access set, get
Default Value Conversion from default Cartesian state
Units km
Interfaces GUI, script
519
Reference Guide Dynamics and Modeling
Field Description
IncomingRHA IncomingRHA/OutgoingRHA is the right ascension of the in-
coming/outgoing asymptote. If C3Energy < 0 the apsides vector
OutgoingRHA is substituted for the incoming/outgoing asymptote.
520
Dynamics and Modeling Reference Guide
Field Description
ModEquinoctialH Identical to EquinoctialQ.
521
Reference Guide Dynamics and Modeling
Field Description
PlanetodeticHFPA The orbital horizontal flight path angle expressed in the coor-
dinate system chosen in the CoordinateSystem field. Plane-
todeticHFPA is only valid for coordinate systems with Body-
Fixed axes.
522
Dynamics and Modeling Reference Guide
Field Description
PlanetodeticVMAG The magnitude of the orbital velocity vector expressed in the co-
ordinate system chosen in the CoordinateSystem field. Unlike
the VMAG field, PlanetodeticVMAG is associated with the Plan-
etodetic state representation, which is only valid for coordinate
systems with BodyFixed axes.
523
Reference Guide Dynamics and Modeling
Field Description
RadPer The orbital radius of periapsis expressed in the coordinate sys-
tem chosen in the CoordinateSystem field. The radius of peri-
apsis is the minimum distance (osculating) between the Space-
craft and celestial body at the origin of CoordinateSystem.
524
Dynamics and Modeling Reference Guide
Field Description
SMA The orbital semi-major axis expressed in the coordinate system
chosen in the CoordinateSystem field.
525
Reference Guide Dynamics and Modeling
Field Description
VX The x-component of the Spacecraft velocity with respect to the
coordinate system chosen in the spacecraft's CoordinateSys-
tem field.
526
Dynamics and Modeling Reference Guide
Field Description
Y The y-component of the Spacecraft position with respect to the
coordinate system chosen in the spacecraft's CoordinateSys-
tem field.
GUI
527
Reference Guide Dynamics and Modeling
The Spacecraft orbit state dialog box allows you to set the epoch, coordinate system,
and state type values for the Spacecraft orbital state. When you specify an orbital state,
you define the state in the representation selected in the StateType menu, with respect
to the coordinate system specified in the CoordinateSystem menu, at the epoch de-
fined in the Epoch menu. If the selected CoordinateSystem is time varying, the epoch
of the coordinate system is defined by the Epoch field, and changing the epoch changes
the inertial representation of the orbital state.
A change in Epoch Format causes an immediate update to Epoch to reflect the chosen
time system and format.
Remarks
Cartesian State
The Cartesian state is composed of the position and velocity components expressed
with respect to the selected CoordinateSystem.
The Keplerian and ModifiedKeplerian state types use the osculating Keplerian orbital
elements with respect to the selected CoordinateSystem. To use either the Kepler-
ian or ModifiedKeplerian state type, the Spacecraft’s coordinate system must have a
central body at the origin. The two representations differ in how the orbit size and shape
are defined. The Keplerian state type is composed of the following elements: SMA,
ECC, INC, RAAN, AOP, and TA. The ModifiedKeplerian state type is composed of
the following elements: RadApo, RadPer, INC, RAAN, AOP, and TA. The tables and
figures below describe each Keplerian state element in detail including singularities.
Name Description
SMA SMA contains information on the type and size of an orbit. If SMA > 0 the
orbit is elliptic. If SMA <0 the orbit is hyperbolic. SMA is infinite for parabolic
orbits.
ECC ECC contains information on the shape of an orbit. If ECC = 0, then the
orbit is circular. If 0 < ECC < 1, the orbit is elliptical. If , ECC = 1 the orbit
is parabolic. If ECC > 1 then the orbit is hyperbolic.
528
Dynamics and Modeling Reference Guide
Name Description
INC INC is the angle between the orbit angular momentum vector and the z-
axis. If INC < 90 deg., then the orbit is prograde. If INC > 90 deg, then the
orbit is retrograde
RAAN RAAN is defined as the angle between x-axis and the node vector mea-
sured counterclockwise. The node vector is defined as the cross product
of the z-axis and orbit angular momentum vector. RAAN is undefined for
equatorial orbits.
AOP AOP is the angle between a vector pointing at periapsis and a vector point-
ing in the direction of the line of nodes. AOP is undefined for circular orbits.
TA TA is defined as the angle between a vector pointing at periapsis and a
vector pointing at the spacecraft. TA is undefined for circular orbits.
The Keplerian and ModifiedKeplerian state types have several singularities. The table
below describes the different singularities and how each is handled in the state conver-
sion algorithms.
529
Reference Guide Dynamics and Modeling
The conversion between Delaunay and Cartesian is performed passing through clas-
sical Keplerian state. Therefore, Delaunay state cannot represent parabolic orbits. Al-
so, the Delaunay state cannot represent hyperbolic orbits because of the definition of
DelaunayL, which is not a real value when SMA is negative. The table below describes
the elements of the Delaunay state.
Element Description
Delaunayl The mean anomaly. It is related to uniform angular motion
on a circle of radius SMA.
Delaunayg See “Keplerian State” section, AOP
Delaunayh See “Keplerian State” section, RAAN
DelaunayL Related to the two-body orbital energy. DelaunayL =
sqrt(mu*SMA)
530
Dynamics and Modeling Reference Guide
Element Description
DelaunayG Magnitude of the orbital angular momentum vector. De-
launayG = DelaunayL*sqrt(1-ECC^2)
DelaunayH The K component of the orbital angular momentum. De-
launayH = DelaunayG * cos(INC)
Singularities in the Delaunay elements is the same as the Keplerian elements, because
it uses the Keplerian elements during conversion. See “Keplerian State” section. The
table below shows the additional singularities regarding the Delaunay state type.
Element Description
ECC > 1 DelaunayL is not real for hyperbolic orbits by its definition.
The BrouwerMeanShort state represents short-term averaged mean motion under low-
order zonal harmonics (i.e. J2-J5). Likewise, BrouwerMeanLong state represents long-
term averaged mean motion under low-order zonal harmonics (i.e. J2-J5). GMAT uses
JGM-2 zonal coefficients in Brouwer Mean states algorithms. Both are singular for near
parabolic or hyperbolic orbits. To use BrouwerMeanShort/BrouwerMeanLong state
type in GMAT, the central body must be the Earth. If the central body is the Earth, GMAT
can calculate BrouwerMeanShort/BrouwerMeanLong state from the osculating state
(Cartesian, Keplerian, etc.) and vice-versa.
Element Description
BrouwerLongAOP Brouwer-Lyddane long-term averaged (short-term aver-
aged) mean argument of periapsis.
BrouwerShortAOP
BrouwerLongMA Brouwer-Lyddane long-term averaged (short-term aver-
aged) mean MA (mean anomaly).
BrouwerShortMA
BrouwerLongECC Brouwer-Lyddane long-term averaged (short-term aver-
aged) mean eccentricity.
BrouwerShortECC
BrouwerLongINC Brouwer-Lyddane long-term averaged (short-term aver-
aged) mean inclination.
BrouwerShortINC
BrouwerLongRAAN Brouwer-Lyddane long-term averaged (short-term aver-
aged) mean RAAN (right ascension of the ascending
BrouwerShortRAAN node).
BrouwerLongSMA Long-term averaged (short-term averaged) mean se-
mi-major axis.
BrouwerShortSMA
531
Reference Guide Dynamics and Modeling
Element Description
BrouwerSMA < 3000/(1- Because Brouwer’s formulation based on Earth’s zon-
BrouwerECC) al harmonics, BrouwerMeanShort and BrouwerMean-
Long cannot address orbits with mean perigee distance is
smaller than Earth’s radius, 3000 km because of numeri-
cal instability.
BrouwerLongINC= 63, If given BrouwerLongINC (long-term averaged INC on-
BrouwerLongINC = 117 ly) is close to ic= 63 deg. or 117 deg., the algorithm is
unstable because of singular terms (non-zero imaginary
components). Thus, GMAT cannot calculate osculating el-
ements.
BrouwerLongECC = 0, If BrouwerECC is larger than 0.9, or BrouwerECC is
BrouwerLongECC # 1 smaller than 1E-7, it has been reported that Cartesian to
BrouwerMeanLong state does not converge statistically.
For these cases, GMAT gives a warning message with the
current conversion error.
The SphericalAZFPA and SphericalRADEC state types are composed of the polar co-
ordinates of the spacecraft state expressed with respect to the selected CoordinateSys-
tem. The two spherical representations differ in how the velocity is defined. The Spheri-
calRADEC state type is composed of the following elements: RMAG, RA, DEC, VMAG,
RAV, and DECV. The SphericalAZFPA state type is composed of the following ele-
ments: RMAG, RA, DEC, VMAG, AZI and FPA. The tables and figures below describe
each spherical state element in detail including singularities.
Name Description
RMAG The magnitude of the position vector.
RA The right ascension which is the angle between the projection of the posi-
tion vector into the xy-plane and the x-axis measured counterclockwise.
DEC The declination which is the angle between tjhe position vector and the xy-
plane.
VMAG The magnitude of the velocity vector.
FPA The vertical flight path angle. The angle measured from a plane normal to
the postion vector to the velocity vector , measured in the plane formed by
position vector and velocity vector.
532
Dynamics and Modeling Reference Guide
Name Description
AZI The flight path azimuth. The angle measured from the vector perpendicular
to the position vector and pointing north, to the projection of the velocity
vector, into a plane normal to the position vector.
RAV The right ascension of velocity. The angle between the projection of the ve-
locity vector into the xy-plane and the x-axis measured counterclockwise.
DECV The flight path azimuth. The angle between the velocity vector and the xy-
plane.
The Planetodetic state type is useful for specifying states relative to the surface of a
central body. It is very similar to the spherical state types, but uses the central body's
flattening in its definition. To use the Planetodetic state type, the spacecraft’s coordi-
nate system must have a celestial body at the origin, and must have BodyFixed axes.
533
Reference Guide Dynamics and Modeling
Element Description
PlanetodeticRMAG Magnitude of the orbital radius vector.
PlanetodeticLON Planetodetic longitude.
PlanetodeticLAT Planetodetic latitude, using the Flattening of the central
body.
PlanetodeticVMAG Magnitude of the orbital velocity vector in the fixed frame.
PlanetodeticAZI Orbital velocity azimuth in the fixed frame.
PlanetodeticHFPA Horizontal flight path angle. HFPA = 90 - VFPA
GMAT supports the Equinoctial state representation which is non-singular for elliptic
orbits with inclinations less than 180 degrees. To use the Equinoctial state type, the
spacecraft’s coordinate system must have a central body at the origin.
Element Description
SMA See Keplerian section.
EquinoctialH A measure of the orbital eccentricity and argument of pe-
riapsis. EquinoctialH and EquinoctialK together govern
how elliptical an orbit is and where the periapsis is located.
EquinotialH = ECC * sin(AOP).
EquinoctialK A measure of the orbital eccentricity and argument of pe-
riapsis. EquinoctialH and EquinoctialK together govern
how eliptical an orbit is and where the periapsis is located.
EquinotialK = ECC * cos(AOP)
EquinoctialP A measure of the orientation of the orbit. EquinoctialP
and EquinoctialQ together govern how an orbit is orient-
ed. EquinotialP = tan(INC/2)*sin(RAAN).
EquinoctialQ A measure of the orientation of the orbit. EquinoctialP
and EquinoctialQ together govern how an orbit is orient-
ed. EquinotialQ = tan(INC/2)*cos(RAAN).
534
Dynamics and Modeling Reference Guide
Element Description
MLONG A measure of the mean location of the spacecraft in its
orbit. MLONG = AOP + RAAN + MA.
Element Description
INC = 180 RAAN is undefined. If INC > 180 - 1.0e-11, GMAT sets
RAAN to 0 degrees. GMAT does not support Equinoctial
elements for true retrograde orbits.
ECC > 0.9999999 Equinoctial elements are not defined for parabolic or hy-
perbolic orbits.
Element Description
SMA See Keplerian section.
EquinoctialH See Equinoctial section.
EquinoctialK See Equinoctial section.
AltEquinoctialP A measure of the orientation of the orbit. AltEquinoctialP
and AltEquinoctialQ together govern how an orbit is ori-
ented. AltEquinotialP = sin(INC/2)*sin(RAAN).
AltEquinoctialQ A measure of the orientation of the orbit. AltEquinoctialP
and AltEquinoctialQ together govern how an orbit is ori-
ented. AltEquinotialP = sin(INC/2)*cos(RAAN).
MLONG See Equinoctial section.
Element Description
SemilatusRectum Magnitude of the position vector when at true anomaly of
90 deg SemilatusRectum = SMA*(1-ECC^2)
ModEquinoctialF Components of eccentricity vector (with ModEquinoc-
tialG). Projection of eccentricity vector onto x. ModE-
quinoctialF = ECC * cos (AOP+RAAN)
535
Reference Guide Dynamics and Modeling
Element Description
ModEquinoctialG Components of eccentricity vector (with ModEquinoc-
tialF). Projection of eccentricity vector onto y. ModE-
quinoctialG = ECC * sin (AOP+RAAN)
ModEquinoctialH Identical to EquinoctialQ.
ModEquinoctialK Idential to EquinoctialP.
TLONG A measure of the true location of the spacecraft in its orbit.
TLONG = AOP + RAAN + TA.
Element Description
INC = 180 Similar to Equinoctial elements, there is singularity at INC
= 180 deg. GMAT does not support ModifiedEquinoctial
elements for retrograde equatorial orbits.
GMAT supports two related hyperbolic asymptote state types: IncomingAsymptote for
defining the incoming hyperbolic asymptote, and OutgoingAsymptote, for defining the
outgoing hyperbolic asymptote. Both representations are useful for defining flybys.
Element Description
IncomingRadPer The orbital radius of periapsis. The radius of periapsis
is the minimum distance (osculating) between the space-
OutgoingRadPer craft and celestial body at the origin of coordinate system.
IncomingRadPer/OutgoingRadPer differ from RadPer
only in that they are associated with the IncomingAsymp-
tote and OutgoingAsymptote state representations, re-
spectively.
IncomingC3Energy C3 energy. C3Energy = -mu/SMA. IncomingC3Energy/
OutgoingC3Energy differ only in that they are associated
OutgoingC3Energy with the IncomingAsymptote and OutgoingAsymptote
state representations, respectively.
IncomingRHA IncomingRHA/OutgoingRHA is the right ascension of
the incoming/outgoing asymptote. If C3Energy < 0 the ap-
OutgoingRHA sides vector is substituted for the incoming/outgoing as-
ymptote.
IncomingDHA IncomingDHA/OutgoingDHA is the declination of the in-
coming/outgoing asymptote. If C3Energy < 0 the apsides
OutgoingDHA vector is substituted for the incoming/outgoing asymp-
tote..
536
Dynamics and Modeling Reference Guide
Element Description
IncomingBVAZI IncomingBVAZI/OutgoingBVAZI is the B-vector az-
imuth at infinity of the incoming/outgoing asymptote mea-
OutgoingBVAZI sured counter-clockwise from south. If C3Energy < 0 the
apsides vector is substituted for the outgoing/incoming as-
ymptote.
TA See Keplerian.
Element Description
IncomingC3Energy/ If IncomingC3Energy/OutgoingC3Energy = 0 the
OutgoingC3Energy = 0 spacecraft has a parabolic orbit. Hyperbolic asymptote
states do not support parabolic orbits. It must be avoided
that -1E-7 # IncomingC3Energy/OutgoingC3Energy #
1E-7 by choosing a proper set of elements.
ECC = 0 For the case of circular orbits, TA is undefined. It must
be avoided that ECC # 1E-7 by choosing a proper set of
elements. GMAT does not support hyperbolic asymptote
representation for true circular orbits.
Asymptote vector parallel If the asymptote vector is parallel or antiparallel to coordi-
to z-axis nate system’s z-direction, then the B-plane is undefined.
It must be avoided by choosing either a proper coordinate
system or set of elements.
When you define Spacecraft state elements such as SMA, X, or DEC for example,
these values are set in coordinates defined by the Spacecraft’s CoordinateSystem
field. For example, the following lines result in the X-component of the Cartesian state
of MySat to be 1000, in the EarthFixed system.
aSpacecraft.CoordinateSystem = EarthFixed
aSpacecraft.X = 1000
When the script lines above are executed in a script, GMAT converts the state to the
specified coordinate system, in this case EarthFixed, sets the X component to 1000,
and then converts the state back to the internal inertial representation.
The following example sets SMA to 8000 in the EarthMJ2000Eq system, then sets X
to 6000 in the Earth fixed system. (Note this is NOT allowed in initialization mode; see
later remarks for more information).
aSpacecraft.CoordinateSystem = EarthMJ2000Eq
aSpacecraft.SMA = 8000
aSpacecraft.CoordinateSystem = EarthFixed
537
Reference Guide Dynamics and Modeling
aSpacecraft.X = 6000
When you specify the Spacecraft’s epoch, you define the initial epoch of the spacecraft
in the specified coordinate system. If your choice for the Spacecraft's coordinate system
is a time varying system such as the EarthFixed system, then you define the state in
the EarthFixed system at that epoch. For example, the following lines would result in
the cartesian state of MySat to be set to [7000 0 1300 0 7.35 1] in the EarthFixed
system at 01 Dec 2000 12:00:00.000 UTC.
X = -2320.30266
Y = -6604.25075
Z = 1300.02599
VX = 7.41609
VY = -2.60562
VZ = 0.99953
You can change the epoch of a Spacecraft in the mission sequence using a script line
like this:
When the above line is executed in the mission sequence, GMAT converts the state
to the specified coordinate system and then to the specified state type — in this case
EarthFixed and Cartesian respectively — sets the epoch to the value of 02 Dec 2000
12:00:00.000, and then converts the state back to the internal representation. This be-
havior is identical to that of the spacecraft orbit dialog box in the GUI. Because the co-
ordinate system in this case is time varying, changing the spacecraft epoch has resulted
in a change in the spacecraft's inertial state representation. After the epoch is changed
to 02 Dec 2000 12:00:00.000, the EarthMJ2000Eq state representation is now:
X = -2206.35771
Y = -6643.18687
Z = 1300.02073
VX = 7.45981
VY = -2.47767
VZ = 0.99953
538
Dynamics and Modeling Reference Guide
When setting the Spacecraft orbit state in a script, there are a few limitations to be
aware of. In the initialization portion of the script (before the BeginMissionSequence
command), you should set the epoch and coordinate system only once; multiple defini-
tions of these parameters will result in either errors or warning messages and may lead
to unexpected results.
Also when setting a state during initialization, you must set the orbit state in a set of fields
corresponding to a single state type. For example, set the orbit state using the X, Y, Z,
VX, VY, VZ fields (for the Cartesian state type) or the SMA, ECC, INC, RAAN, AOP,
TA fields (for the Keplerian state type), but not a mixture of the two. If you need to mix
state types, coordinate systems, or epochs to define the state of a spacecraft, you must
set the state using scripting in the mission sequence (after the BeginMissionSequence
command).
Some state components, such as SMA, are shared among multiple state representa-
tions. In the mission sequence, GMAT does not require you to specify the state repre-
sentation that you are setting; rather, you may specify a combination of elements from
different representations.
For these shared components, GMAT defines a default representation for each, and
uses that representation when setting or retrieving the value for the shared component.
This is normally transparent, though it can have side effects if the default representa-
tion has singularities or numerical precision losses caused by the value being set or
retrieved. The following table lists each shared state component and its default repre-
sentation.
539
Reference Guide Dynamics and Modeling
BeginMissionSequence
aSpacecraft.SMA = 20000 % conversion goes through Keplerian
aSpacecraft.RA = 30 % conversion goes through SphericalAZFPA
aSpacecraft.OutgoingDHA = 90 % conversion goes through OutgoingAsymptote
aSpacecraft.TA = 45 % conversion goes through Keplerian
Warning
When setting state parameters (especially in Keplerian-based representa-
tions) using non-default dependencies, be careful of the loss of precision
caused by large translations in the intermediate orbit.
Examples
540
Dynamics and Modeling Reference Guide
MoonInertial.Axes = BodyInertial
541
Reference Guide Dynamics and Modeling
542
Dynamics and Modeling Reference Guide
Description
The Spacecraft Visualization Properties lets you define a spacecraft model, translate
the spacecraft in X,Y, Z directions or apply a fixed rotation to the attitude orientation of
the model. You can also adjust the scale factor of the spacecraft model size. GMAT lets
you set orbit colors via the spacecraft visualization properties as well. You can set colors
to spacecraft orbital trajectories and any perturbing trajectories that are drawn during
iterative processes. See Color documentation for discussion and examples on how to
set orbital colors using Spacecraft object's OrbitColor and TargetColor fields. Also
see the Fields section below to read more about these two fields. The Spacecraft visu-
alization properties can be configured either through GMAT’s GUI or the script interface.
Fields
Field Description
ModelOffsetX This field lets you translate a spacecraft in +X or -X axis of central
body's coordinate system.
543
Reference Guide Dynamics and Modeling
Field Description
ModelRotationX Allows you to perform a fixed rotation of spacecraft's attitude w.r.t
X-axis of central body's coordinate system.
544
Dynamics and Modeling Reference Guide
Field Description
OrbitColor Allows you to set available colors on spacecraft orbits. The
spacecraft orbits are drawn using the OrbitView graphics dis-
plays. The colors can be identified through a string or an integer
array. For example: Setting spacecraft's orbit color to red can be
done in following two ways: DefaultSC.OrbitColor = Red or
DefaultSC.OrbitColor = [255 0 0]. This field can be modi-
fied in the Mission Sequence as well.
GUI
The figure below shows the default settings for the Spacecraft Visualization Proper-
ties resource:
545
Reference Guide Dynamics and Modeling
The GUI interface for Spacecraft Visualization Properties is contained on the Visual-
ization tab of the Spacecraft resource. You can configure visualization properties of the
spacecraft and visualize the changes in the Display window.
Within the Display window, you can Left click and drag your mouse to change camera
orientation. Camera orientation can be changed in Up/Down/Left/Right directions. You
can also Right click and drag your mouse to zoom in and out of the Display window.
Right click and moving the cursor in Up direction helps to zoom out and moving the
cursor in Down direction helps to zoom in.
Remarks
GMAT lets you define any spacecraft model but currently GMAT supports only .3ds
model format. Several .3ds spacecraft model formats are available here. You can also
download more .3ds models by clicking here. Most of these models are in .3ds format,
which can be read by most 3D programs.
GMAT lets you apply fixed rotation to the attitude orientation of the spacecraft model or
translate the model in any of the X, Y and Z directions. You can also apply a scale factor
to the selected spacecraft model to adjust the size of the model. Any changes that are
made to the spacecraft model, attitude orientation, translation or scale size factor will
also be displayed in OrbitView resource’s graphics window. The configured spacecraft
visualization properties will only show up in OrbitView graphics window after you have
546
Dynamics and Modeling Reference Guide
run the mission. See OrbitView resource’s user-specification document to learn more
about OrbitView graphics window.
Examples
This example shows you how to configure Spacecraft Visualization Properties re-
source. All values are non-default values.
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedSecs = 9000}
547
Reference Guide Dynamics and Modeling
ThrustHistoryFile
A time history of input thrust/acceleration vectors and mass flow rate
Description
Fields
Field Description
AddThrustSeg- Method to specify one or more thrust segments contained in a giv-
ment en thrust/acceleration and mass flow rate history file.
Remarks
The thrust history file contains blocks of data. Each block of data starts with a Be-
ginThrust keyword and ends with an EndThrust keyword. More specifically, the start of a
block of data is indicated by the keyword "BeginThrust {ThrustSegment object name}"
and ends with the keyword "EndThrust {ThrustSegment object name}." The specified
ThrustSegment resource defines how the data in a given block is to be used.
We assume that the user has created a script where a ThrustSegment resource, Seg-
ment1, has been created. Below, we show a sample thrust history file that references
Segment1.
548
Dynamics and Modeling Reference Guide
BeginThrust {Segment1}
Start_Epoch = 29 Jan 2019 16:35:00.000
Thrust_Vector_Coordinate_System = EarthMJ2000Eq
Thrust_Vector_Interpolation_Method = None
Mass_Flow_Rate_Interpolation_Method = None
ModelAccelOnly
0.0 0.003 0.011 0.002
1.0 0.003 0.011 0.002
EndThrust {Segment1}
The Start_Epoch parameter value in this history file specifies that the thrust/ac-
celeration data in the file should be applied starting at 29 Jan 2019 16:35:00.000
UTCG. The Thrust_Vector_Coordinate_System parameter value specifies that
the thurst/acceleration data in this file uses the EarthMJ2000Eq coordinate
system. The Thrust_Vector_Interpolation_Method parameter value specifies
that the thrust/acceleration data in this file should not be interpolated. The
Mass_Flow_Rate_Interpolation_Method parameter value specifies that mass flow
rate data, if any, in this file, should not be interpolated. ModelAccelOnly in the file above
is a header describing the data that follows. It tells GMAT what type of acceleration/thrust
and mass flow rate modeling to perform. In this case, the ModelAccelOnly tells GMAT
we are modeling acceleration only.
Next, the thrust history file contains two rows of acceleration data. The first entry in each
row is elapsed seconds from the Start_Epoch value. The next three entries in each row
is an acceleration vector in . The 0.0 value in the first row indicates that the acceler-
ation should occur 0 elapsed seconds from Start_Epoch, at 29 Jan 2019 16:35:00.000
UTCG. The acceleration vector, at this time, will have a value of (0.003 0.011 0.002)
applied in the EarthMJ2000Eq coordinate system. The 1.0 value in the second row
indicates that the applied acceleration should end at 29 Jan 2019 16:35:01.000 UTCG.
The acceleration vector, at this time, will have a value of (0.003 0.011 0.002) ap-
plied in the EarthMJ2000Eq coordinate system. Note that if the interpolation method
is None as shown here, the acceleration is applied in piecewise constant fashion and
only the time from the last acceleration record is needed; the acceleration values are
ignored. The Linear and CubicSpline interpolation methods will use the acceleration
values in the last record as interpolation nodes.
The table below provides more information on the four parameters defined within a block
of data, enclosed within BeginThrust/EndThrust pair keywords, in a thrust history file.
549
Reference Guide Dynamics and Modeling
The table below lists the four valid header values that describe how the data enclosed
within BeginThrust/EndThrust pair keywords, in a thrust history file, is to be used.
Header Description
ModelThrustAnd- Each row of data contains five elements. The first element is the
MassRate elapsed seconds (non-negative) from the Start_Epoch parameter
value. The next three elements are the three components of thrust
in Newtons (N). The final (fifth) element is the mass flow rate in
kg/s. A positive value for this fifth element corresponds to a mass
decrease to simulate fuel mass being consumed.
ModelThrustOnly Each row of data contains four elements. The first element is the
elapsed seconds (non-negative) from the Start_Epoch parameter
value. The next three elements are the three components of thrust
in Newtons (N).
550
Dynamics and Modeling Reference Guide
Header Description
ModelAccelAnd- Each row of data contains five elements. The first element is the
MassRate elapsed seconds (non-negative) from the Start_Epoch parameter
value. The next three elements are the three components of accel-
eration in m/s^2. The final (fifth) element is the mass flow rate in
kg/s. A positive value for this fifth element corresponds to a mass
decrease to simulate fuel mass being consumed.
ModelAccelOnly Each row of data contains four elements. The first element is the
elapsed seconds (non-negative) from the Start_Epoch parameter
value. The next three elements are the three components of accel-
eration in m/s^2.
The choice of header value as listed in the previous table will affect the GMAT EOM.
In addition, the choice of value for the associated ThrustSegment ApplyThrustScale-
ToMassFlow flag, either True or False, can also affect the EOM. The table below shows
how the GMAT EOM change as a function of header type and value of the ThrustSeg-
ment. ApplyThrustScaleToMassFlow parameter.
ModelAccelAndMassRate True
ModelAccelAndMassRate False
ModelThrustAndMassRate True
ModelThrustAndMassRate False
Notation:
•
•
•
•
•
•
•
•
•
•
551
Reference Guide Dynamics and Modeling
Examples
BeginMissionSequence;
The script above will would pass a syntax check but in order for it to run without error,
you would have to create a thrust file, myThrustFile.thrust, and place it in the GMAT
'data' folder. For a complete example of how the ThrustHistoryFile and ThrustSeg-
ment resources are used to apply a thrust/acceleration and mass flow rate profile to a
spacecraft, see the first example in the BeginFileThrust Help.
552
Dynamics and Modeling Reference Guide
ThrustSegment
One or more ThrustSegments define how data in a thrust history file are used.
Description
Fields
Field Description
ApplyThrustScaleToMass- Flag specifying if the thrust/acceleration ThrustS-
Flow caleFactor should also be applied to the mass flow
rate.
553
Reference Guide Dynamics and Modeling
Field Description
ThrustScaleFactorSigma Standard deviation of ThrustScaleFactor. Only used
if ThrustScaleFactor is defined as a solve-for (using
the SolveFors parameter defined below)
Examples
Create a ThrustSegment where the thrust scale factor, with a value of 2.0, will also be
applied to the mass flow rate.
BeginMissionSequence
If you use the script snippet above to create a full script, you will need to create a thrust/
acceleration and mass flow rate input file. Suppose the mass flow rate for a given instant
554
Dynamics and Modeling Reference Guide
of time is set to 1 kg/s in the file, what is the actual mass flow rate applied to the space-
craft? We need to take into account the values of ThrustScaleFactor, MassFlowS-
caleFactor, and ApplyThrustScaleToMassFlow before we can answer this question.
In all cases, MassFlowScaleFactor is applied to the mass flow rate value given in the
file. In this example, since ApplyThrustScaleToMassFlow is set to True, the ThrustS-
caleFactor will also be applied to the mass flow rate value given in the file. Thus, to
answer our question, in this example, the actual mass flow rate applied to the space-
craft is MassFlowScaleFactor*ThrustScaleFactor*1 kg/s equals 3 kg/s. In the ex-
ample above, the actual thrust/acceleration profile actually applied to the spacecraft is
(ThrustScaleFactor = 2.0) times the thrust/acceleration given in the input file.
Commands
555
Reference Guide Dynamics and Modeling
BeginFileThrust
Apply a piece-wise continuous thrust/acceleration and mass flow rate profile
Script Syntax
BeginFileThrust aThrustHistoryFile(aSpacecraft)
EndFileThrust aThrustHistoryFile(aSpacecraft)
Description
When you apply a BeginFileThrust command, you turn on the thrust/acceleration and
mass flow rate profile given in the specified ThrustHistoryFile as applied to the speci-
fied Spacecraft. Similarly when you apply an EndFileThrust command, you turn off the
thrust/acceleration and mass flow rate profile given in the specified ThrustHistoryFile
as applied to the specified Spacecraft. In order to actually apply the thrust/acceleration
and mass flow rate profile, there must be a Propagate command between the Begin-
FileThrust and EndFileThrust commands.
Options
Option Description
BeginFileThrust - ThrustHisto- Specifies the ThrustHistoryFile object activated by
ryFile the BeginFileThrust command.
556
Dynamics and Modeling Reference Guide
Option Description
EndFileThrust - ThrustHistory- Specifies the ThrustHistoryFile object de-activat-
File ed by the EndFileThrust command.
Remarks
1. Create a Spacecraft object whose thrust/acceleration and/or mass flow rate profile
you wish to modify.
2. If you wish to apply a mass flow rate profile, create and configure a ChemicalTank
model. Add this ChemicalTank to the Spacecraft created in Step 1. The mass of the
ChemicalTank will be changed according to the profile specified by the ThrustHis-
toryFile and ThrustSegment objects that we will create.
3. Create one or more ThrustSegment objects. A thrust segment is a block of data
inside the file specified by the ThrustHistoryFile object, encapsulated between "Be-
ginThrust {ThrustSegment object name}" and "EndThrust {ThrustSegment object
name}" keywords. A given thrust history file can contain one or more thrust segments.
As described in the ThrustSegment help, the ThrustSegment object describes how
the segment data will be used. The following steps should be taken.
a. Set the parameters (scale factor related parameters, solve-for related parameters,
etc) for the ThrustSegment.
b. (If modeling mass flow), configure the ThrustSegment to use the ChemicalTank
created in Step 2.
4. Create a ThrustHistoryFile Object.
557
Reference Guide Dynamics and Modeling
Similarly, since the BeginFileThrust and EndFileThrust commands are used to turn on
or off the thrust/mass and mass flow rate profiles, applying the same command multiple
times in a script without its inverse is the same as applying it once. In other words, if
you do this:
BeginFileThrust aThrustHistoryFile(aSat);
BeginFileThrust aThrustHistoryFile(aSat);
BeginFileThrust aThrustHistoryFile(aSat);
The effect is the same as only applying the BeginFileThrust command one time. The
same holds true for the EndFileThrust command.
Examples
Apply a thrust and mass flow rate profile to a Spacecraft
We will create a sample script to apply a thrust and mass flow rate profile to a Spacecraft
object. In our script, we will create a Spacecraft object, aSat, with an initial epoch of
'01 Jan 2010 00:00:00.000.'. We decide that we want to apply a 3 Newton force in the
Earth Centered Inertial (ECI) X direction for a duration of 100 seconds starting at '01
Jan 2010 00:01:00.000.' During the same time duration, we also want to apply a mass
flow rate profile that uses fuel at a rate of 0.01 kg/s. Before we run our script, we will
need to create a thrust history file, with the contents listed below. The user should name
this file 'SampleThrustFile.thrust' and place it in the GMAT 'data' directory.
BeginThrust {aThrustSegment}
Start_Epoch = 01 Jan 2010 00:00:00.000
Thrust_Vector_Coordinate_System = EarthMJ2000Eq
Thrust_Vector_Interpolation_Method = None
Mass_Flow_Rate_Interpolation_Method = None
ModelThrustAndMassRate
60.0 3.0 0.0 0.0 0.01
160.0 3.0 0.0 0.0 0.01
EndThrust {aThrustSegment}
558
Dynamics and Modeling Reference Guide
• Create and configure a ReportFile object so that we can determine the fuel mass in
our created ChemicalTank object both before and after the desired thrust and mass
flow rate profile has been applied.
aThrustHistoryFile.AddThrustSegment = {'aThrustSegment'};
aThrustHistoryFile.FileName = '../data/SampleThrustFile.thrust';
BeginMissionSequence
BeginFileThrust aThrustHistoryFile(aSat);
Propagate aPropagator(aSat) {aSat.ElapsedSecs = 180.0};
EndFileThrust aThrustHistoryFile(aSat);
After running the script above, take a look at the before and after values of aTank's
fuel mass to note that the mass has decreased by 2 kg. This is the expected result.
Recall that we apply a mass flow rate profile of 0.01 kg/s for 100 seconds starting at
'01 Jan 2010 00:01:00.000' and ending at '01 Jan 2010 00:02:40.000'. 100 seconds
multiplied by 0.01 kg/s corresponds to a mass drop of 1 kg but we need to remember
that aThrustSegment.MassFlowScaleFactor=2.0. Thus, the mass flow rate specified in
the file is doubled to obtain an expected mass drop of 2 kg.
Navigation Applications
In the example above, we focused on applying a thrust and mass flow rate profile to a
spacecraft in a mission design trajectory propagation context. We did this by sandwich-
ing in a Propagate command in between a BeginFileThrust and EndFileThrust com-
559
Reference Guide Dynamics and Modeling
mand. One can also use BeginFileThrust and EndFileThrust commands in the con-
text of orbit determination. This is done by sandwiching in a RunSimulator or a RunEs-
timator command in between a BeginFileThrust and EndFileThrust command.
• We configure two Spacecraft, SimSat, and EstSat, in Low Earth Orbit to use Range
measurements from three GroundStations to obtain a navigation solution.
• The SimSat spacecraft is used to generate simulated Range measurements over a
12 hour period. During the entire period, a thrust history profile, 20 N in the velocity
direction, is applied. When we apply this thrust, we use a ThrustScaleFactor of 1.0.
For this simplified case, we do not apply a mass flow rate profile.
• The EstSat spacecraft reads in the simulated Range measurements generated by the
SimSat spacecraft. During the entire 12 hour period, a thrust history profile, 20 N in
the velocity direction, is applied, albeit with a different starting value for the ThrustS-
caleFactor. We wish to solve-for the EstSat ThrustScaleFactor. We start with an a
priori guess, ThrustScaleFactor = 0.75, which results in large initial residuals. We run
the estimation process to show that we both converge to a good orbit solution with
low measurement residuals and that we solve for a ThrustScaleFactor close to the
true 1.0 value.
560
Dynamics and Modeling Reference Guide
BeginFiniteBurn
Model finite thrust maneuvers
Script Syntax
BeginFiniteBurn aFiniteBurn(aSpacecraft)
EndFiniteBurn aFiniteBurn(aSpacecraft)
Description
When you apply a BeginFiniteBurn command, you turn on the thruster configuration
given in the specified FiniteBurn model. Similarly, when you apply an EndFiniteBurn
command, you turn off the thruster configuration in the specified FiniteBurn model.
After GMAT executes a BeginFiniteBurn command, all propagation for the spacecraft
affected by the FiniteBurn object will include the configured finite thrust in the dynamics
until an EndFiniteBurn line is executed for that configuration. In order to apply a non-
zero finite burn , there must be a Propagate command between the BeginFiniteBurn
and EndFiniteBurn commands.
Options
Option Description
BeginFiniteBurn - Burn Specifies the FiniteBurn object activated by the Be-
ginFiniteBurn command.
561
Reference Guide Dynamics and Modeling
Option Description
BeginFiniteBurn - Space- Specifies the Spacecraft (currently only a single
craftList Spacecraft can be in this list) acted upon by the
BeginFiniteBurn command. The Spacecraft listed
in SpacecraftList will have thrusters activated ac-
cording to the configuration of the FiniteBurn object
defined by the Burn field.
GUI
The BeginFiniteBurn and EndFiniteBurn command dialog boxes allow you to imple-
ment a finite burn by specifying which finite burn model should be used and which space-
craft the finite burn should be applied to. The dialog boxes for BeginFiniteBurn and
EndFiniteBurn are shown below.
562
Dynamics and Modeling Reference Guide
Use the Burn menu to select the FiniteBurn model for the maneuver. Use the Space-
craft text box to select the spacecraft for the finite burn. You can either type the space-
craft name in the Spacecraft text box or click the Edit button and select the spacecraft
using the ParameterSelectDialog box.
Remarks
563
Reference Guide Dynamics and Modeling
3. Add the ChemicalTank and ChemicalThruster created in the previous two steps
to the Spacecraft.
4. Create a FiniteBurn model and configure it to use the ChemicalThruster created
in Step 2.
Warning
Caution: If GMAT throws the error message “Propagator Exception: Mass-
Flow is not a known propagation parameter on DefaultSC”, then you have
not configured all of the required models to perform a finite burn. See de-
tailed instructions above and examples to configure models required by the
EndFiniteBurn/BeginFiniteBurn commands.
Similarly, since the BeginFiniteBurn and EndFiniteBurn commands are used to turn
on or off the thrusters, applying the same command multiple times in a script without its
inverse is the same as applying it once. In other words, if you do this:
BeginFiniteBurn aFiniteBurn(aSat)
BeginFiniteBurn aFiniteBurn(aSat)
BeginFiniteBurn aFiniteBurn(aSat)
The effect is the same as only applying the BeginFiniteBurn command one time. The
same holds true for the EndFiniteBurn command.
Examples
Perform a finite burn while the spacecraft is between true anomaly of 300 degrees and
60 degrees.
% Create objects
Create Spacecraft aSat
Create ChemicalThruster aThruster
Create ChemicalTank aTank
Create FiniteBurn aFiniteBurn
Create Propagator aPropagator
564
Dynamics and Modeling Reference Guide
BeginMissionSequence
% Create objects
Create Spacecraft aSat
Create ChemicalThruster aThruster
Create ChemicalTank aTank
Create FiniteBurn aFiniteBurn
Create Propagator aPropagator
BeginMissionSequence
565
Reference Guide Dynamics and Modeling
EndFileThrust
Apply a piece-wise continuous thrust/acceleration and mass flow rate profile
Description
566
Dynamics and Modeling Reference Guide
EndFiniteBurn
Model finite thrust maneuvers in the mission sequence
Description
To implement a finite burn, you use a pair of commands, the BeginFiniteBurn command
and the EndFiniteBurn command. The use of both of these commands is described in
the BeginFiniteBurn command help.
567
Reference Guide Dynamics and Modeling
FindEvents
Execute an event location search
Script Syntax
Description
The FindEvents command executes an event location search defined by either of the
event location resources, ContactLocator or EclipseLocator. If configured, the search
will result in a text-based event report.
An explicit FindEvents command is not necessary for most simple event location
searches. If the locator resource is configured with RunMode = 'Automatic', FindE-
vents is executed automatically at the end of the mission sequence. Manual execution
of the command is most useful to generate custom searches for part of a mission, or to
change search intervals based on mission data.
The Append option is used to configure how the report file is written. If Append is true,
the new report will be appended to the end of the existing file. If Append is false, it will
replace the old file. Note that if Append is true, the report may be appended to a file
that existed prior to the current GMAT session.
Options
Option Description
Locator The event locator to execute.
568
Dynamics and Modeling Reference Guide
GUI
The FindEvents GUI panel is very simple. Choose the event locator to execute from the
Event Locator list, which is populated by all existing EclipseLocator and ContactLo-
cator resources. To append the report (if one is generated), enable the Append box.
Remarks
Using FindEvents in loops
The FindEvents command can be used inside loops like For and While, but not inside
solver sequences, like Target and Optimize. To perform event location based on the
result of a solver sequence, put the FindEvents command after the sequence.
When FindEvents is used inside a loop, but there are several potential issues to be
aware of. The following snippet illustrates several.
Create EclipseLocator ec
ec.Spacecraft = sat
ec.OccultingBodies = {Mercury, Venus, Earth, Luna, Mars, Phobos, Deimos}
ec.Filename = 'ForLoop.report'
ec.InputEpochFormat = TAIGregorian
BeginMissionSequence
% Main loop
For I = 1:1:71
569
Reference Guide Dynamics and Modeling
Examples
SolarSystem.EphemerisSource = 'DE421'
Create ForceModel fm
fm.CentralBody = Earth
fm.PrimaryBodies = {Earth}
fm.GravityField.Earth.PotentialFile = 'JGM2.cof'
fm.GravityField.Earth.Degree = 0
fm.GravityField.Earth.Order = 0
fm.GravityField.Earth.TideModel = 'None'
fm.Drag.AtmosphereModel = None
fm.PointMasses = {}
fm.RelativisticCorrection = Off
fm.SRP = Off
Create EclipseLocator el
el.Spacecraft = sat
el.Filename = 'Simple.report'
el.OccultingBodies = {Earth}
el.EclipseTypes = {'Umbra', 'Penumbra', 'Antumbra'}
570
Dynamics and Modeling Reference Guide
el.RunMode = 'Manual'
BeginMissionSequence
FindEvents el
SolarSystem.EphemerisSource = 'SPICE'
SolarSystem.SPKFilename = 'de421.bsp'
Create ForceModel fm
fm.CentralBody = Mars
fm.PrimaryBodies = {Mars}
fm.GravityField.Mars.PotentialFile = 'Mars50c.cof'
fm.GravityField.Mars.Degree = 0
fm.GravityField.Mars.Order = 0
fm.Drag.AtmosphereModel = None
fm.PointMasses = {}
fm.RelativisticCorrection = Off
fm.SRP = Off
571
Reference Guide Dynamics and Modeling
Phobos.SpiceFrameId = 'IAU_PHOBOS'
Phobos.EquatorialRadius = 13.5
Phobos.Flattening = 0.3185185185185186
Phobos.Mu = 7.093399e-004
Create EclipseLocator ec
ec.Spacecraft = sat
ec.OccultingBodies = {Mercury, Venus, Earth, Luna, Mars, Phobos, Deimos}
ec.Filename = 'ForLoop.report'
ec.RunMode = 'Manual'
ec.UseEntireInterval = false
ec.InputEpochFormat = TAIGregorian
Create Variable I
BeginMissionSequence
ec.InitialEpoch = sat.TAIGregorian
Propagate prop(sat) {sat.ElapsedSecs = 2400}
ec.FinalEpoch = sat.TAIGregorian
FindEvents ec {Append = false}
For I = 1:1:71
ec.InitialEpoch = sat.TAIGregorian
Propagate prop(sat) {sat.ElapsedSecs = 2400}
ec.FinalEpoch = sat.TAIGregorian
FindEvents ec {Append = true}
EndFor
572
Dynamics and Modeling Reference Guide
sat.RAAN = 0
sat.AOP = 0
sat.TA = 0
Create ForceModel fm
fm.CentralBody = Earth
fm.PrimaryBodies = {Earth}
fm.GravityField.Earth.PotentialFile = 'JGM2.cof'
fm.GravityField.Earth.Degree = 0
fm.GravityField.Earth.Order = 0
fm.GravityField.Earth.TideModel = 'None'
fm.Drag.AtmosphereModel = None
fm.PointMasses = {}
fm.RelativisticCorrection = Off
fm.SRP = Off
Create EclipseLocator ec
ec.Spacecraft = sat
ec.OccultingBodies = {Mercury, Venus, Earth, Luna}
ec.Filename = 'WhileLoop.report'
ec.RunMode = 'Manual'
SolarSystem.EphemerisSource = 'DE421'
BeginMissionSequence
573
Reference Guide Dynamics and Modeling
Maneuver
Perform an impulsive (instantaneous) maneuver
Script Syntax
Description
Options
Option Description
ImpulsiveBurn- Allows the user to select which ImpulsiveBurn to apply. As an
Name example, to maneuver DefaultSC using DefaultIB, the script line
would appear as Maneuver DefaultIB(DefaultSC).
GUI
The Maneuver command dialog box, as shown below, allows you to select which pre-
viously created ImpulsiveBurn should be applied to which Spacecraft.
574
Dynamics and Modeling Reference Guide
Remarks
Fuel Depletion
To model fuel depletion associated with your chosen ImpulsiveBurn, you must config-
ure the ImpulsiveBurn object as follows:
Interactions
Examples
Create a default Spacecraft and ChemicalTank and attach the ChemicalTank to the
Spacecraft. Perform a 100 m/s impulsive maneuver in the Earth VNB-V direction.
575
Reference Guide Dynamics and Modeling
FuelTank1.Volume = 0.75
FuelTank1.FuelDensity = 1260
FuelTank1.PressureModel = PressureRegulated
BeginMissionSequence
% Apply impulsive maneuver to DefaultSC
Maneuver IB(DefaultSC)
576
Dynamics and Modeling Reference Guide
Propagate
Propagates spacecraft to a requested stopping condition
Script Syntax
or
Propagate PropagatorName(SatName,{StopCond});
or
Propagate PropagatorName(SatName){StopCond};
In GMAT, syntax for setting orbit color on a Propagate command for a single Spacecraft
propagating forward to a single stopping condition can be done by either identifying orbit
color through ColorName or via RGB triplet value:
or
Description
The Propagate command controls the time evolution of spacecraft. GMAT allows you
to propagate single Spacecraft, multiple non-cooperative Spacecraft, and Formations
577
Reference Guide Dynamics and Modeling
in a single Propagate command. The Propagate command is complex and controls the
following aspects of the temporal modelling of spacecraft:
Options
Option Description
Mode Optional flag to time-synchronize propagation of Spacecraft per-
formed by multiple Propagators in a single Propagate com-
mand. See the section called “Remarks” for more details.
578
Dynamics and Modeling Reference Guide
Option Description
SatList A comma separated list of Spacecraft. For SPK type Propaga-
tors, the Spacecraft must be configured with valid SPK kernels.
579
Reference Guide Dynamics and Modeling
Option Description
OrbitColor Sets orbit color on a Propagate command. Default color
on Propagate segment is seeded from color that is set on
Spacecraft.OrbitColor field. To set unique colors on Propa-
gate command in script mode: Enter ColorName or RGB triplet
value for the color of your choice. In GUI mode, select unique
color of your choice on the Propagate command by clicking
on Orbit Color Selectbox. For Example: Setting yellow color on
Propagate segment in script mode can be done in either of
the following two ways: Propagate DefaultProp(DefaultSC)
{DefaultSC.Earth.Apoapsis, OrbitColor = Yel-
low} or Propagate DefaultProp(DefaultSC)
{DefaultSC.Earth.Apoapsis, OrbitColor = [255 255 0]}.
GUI
Introduction
To follow the examples below, you can load the following script snippet or create a
new mission with three spacecraft (named sat1, sat2, and sat3) and two propagators
(named prop1 and prop2).
580
Dynamics and Modeling Reference Guide
a Propagator named prop1 and Spacecraft named sat2 and sat3 using a Propaga-
tor named prop2. You will configure the command to propagate for 1 day or until sat2
reaches periapsis, whichever happens first. You will need to configure GMAT as de-
scribed in the the section called “Introduction” section and add a new Propagate com-
mand to your mission sequence. GMAT auto-populates the Propagate command GUI
with the first Propagator in the GUI list and the first Spacecraft when you add a new
Propagate command so you should start from this point.
1. In the Propagator list, click the ellipsis button in the second row to open the Propa-
gator Select Dialog.
581
Reference Guide Dynamics and Modeling
Stopping conditions
Continuing with the example above, now you will configure GMAT to propagate for one
elapsed day or until sat2 reaches periapsis.
1. In the Parameter list, click the ellipsis button in the first row to bring up the Parameter
Select Dialog.
2. In the ObjectProperties list, double click ElapsedDays, and click OK.
3. In the Condition list, double click the first row containing 12000, type 1, and click OK.
582
Dynamics and Modeling Reference Guide
4. In the Parameter list, click the ellipsis button in the second row to bring up the Pa-
rameter Select Dialog.
5. In the Object list, click Sat2.
6. In the ObjectProperties list, double click Periapsis and click OK.
The Propagate1 dialog should now look like the image below.
Remarks
Introduction
The Propagate command documentation below describes how to propagate single and
multiple Spacecraft to desired conditions forward and backwards in time. To stream-
line the script examples, the objects numSat, spkSat, numProp, and spkProp are as-
sumed to be configured as shown below. GMAT is distributed with the SPK kernels used
in the examples.
583
Reference Guide Dynamics and Modeling
numProp.Type = PrinceDormand78
BeginMissionSequence
Note: See the the section called “Introduction” section for a script snippet to configure
GMAT to execute the examples in this section.
Propagate numProp(numSat){numSat.Periapsis}
% or
Propagate numProp(numSat,{numSat.Periapsis})
To take a single propagation step, simply omit the stopping conditions as shown below.
The Propagator will take a step based on its step size control algorithm. See the Prop-
agator documentation for more information on step size control.
Propagate numProp(numSat)
% or
Propagate spkProp(spkSat)
In the script line above Sat1 and Sat2 are propagated using Prop1; Prop2 is used to
propagate Sat3 and Sat4; all Spacecraft added to aFormation are propagated using
Prop3. The Propagate command configured above propagates all Spacecraft until
Sat1 reaches Earth periapsis.
584
Dynamics and Modeling Reference Guide
All Spacecraft propagated by the same Propagator are time synchronized during prop-
agation. By time synchronization, we mean that all Spacecraft are propagated across
the same time step. The Synchronized keyword tells GMAT to keep Spacecraft prop-
agated by different Propagators synchronized in time during propagation. Time syn-
chronization among multiple Propagators is performed by taking a single step for all
Spacecraft controlled by the first Propagator (Prop1 in the above example), and then
stepping all other Propagators to that time. When the Synchronized keyword is omit-
ted, Spacecraft propagated by different Propagators are not synchronized in time. In
that case, each Propagator takes steps determined by its step size control algorithm
without regard to the other Propagators in the Propagate command. Time synchro-
nization is particularly useful if you need ephemeris files for multiple spacecraft with
consistent time tags, or if you are visualizing multiple spacecraft in an OrbitView.
Warning
Caution: When using a Propagator configured to use SPK kernels, you can
only have one Spacecraft per Propagator.
This is supported:
GMAT allows you to define a set of stopping conditions when propagating Spacecraft
that define conditions that must be satisfied at the termination of the Propagate com-
mand. For example, it is often useful to propagate to an orbital location such as Apogee.
When no stopping condition is provided, the Propagate command takes a single step.
When given a set of stopping conditions, the Propagate command propagates the
Spacecraft to the condition that occurs first in elapsed propagation time and terminates
propagation. There are several ways to define stopping conditions via the script inter-
face. One is to include a comma separated list of stopping conditions with each Prop-
agator like this.
Note that the above two methods result in the same stopping epoch. When you provide
a set of stopping conditions, regardless of where in the command the stopping condition
is defined, GMAT builds a list of all conditions and tracks them until the first condition
occurs.
585
Reference Guide Dynamics and Modeling
The Propagate command currently requires that the left hand side of a stopping condi-
tion is a valid Spacecraft parameter. For example, the first line in the following example
is supported and the second line is not supported.
GMAT supports special built-in stopping conditions for apoapsis and periapsis like this:
You can define the tolerance on the stopping condition by including the StopTolerance
keyword in the Propagate command as shown below. In this example, GMAT will prop-
agate until the true anomaly of Sat1 is 90 degrees to within +/- 1e-5 degrees.
Warning
Caution: GMAT currently propagates Spacecraft to a time quantization of a
few microseconds. Depending upon the rate of the stopping condition func-
tion, it may not be possible to locate the stopping condition to the requested
StopTolerance. In that case, GMAT throws a warning to alert you that the
tolerance was not satisfied and provides information on the achieved stop-
ping value and the requested tolerance.
Note: GMAT does not currently support tolerances on a per stopping con-
dition basis. If you include StopTolerance multiple times in a single Propa-
gate command, GMAT uses the last value provided.
The Propagate command uses an algorithm called the First Step Algorithm (FSA) when
back-to-back propagations occur and both propagations have at least one stopping con-
dition that is the same in both commands. For example:
The FSA determines the behavior of the first step when the last propagation performed
on a Spacecraft was terminated using a stopping condition listed in the current com-
mand. If the error in the stopping condition at the initial epoch of the second Propagate
command is less than SafetyFactor*StopTolerance, the propagate command will take
one integration step before attempting to locate the stopping condition again. In the
FSA, SafetyFactor = 10, and the StopTolerance is from the second Propagate com-
mand. Continuing with the example above, if abs(TA_Achieved - TA_Desired) < 1e-3
-- where TA_Achieved is the TA after the first Propagate command and TA_Desired is
the requested value of TA in the second Propagate command -- then the Propagate
command will take one step before attempting to locate the stopping condition. The first
step algorithm works the same way for forward propagation, backwards propagation,
and changing propagation directions.
586
Dynamics and Modeling Reference Guide
Warning
Caution: It is possible to specify a StopTolerance that cannot be satisfied
by the stopping condition root locators and in that case, a warning is thrown.
However, subsequent Propagate commands using the same stopping con-
ditions may not behave as desired. For the FSA algorithm to work as de-
signed, you must provide StopTolerance values that are achievable.
To propagate backwards using the script interface, include the keyword BackProp be-
tween the Propagate command and the first Propagator in the command as shown
below. All Propagators in the command will propagate backwards.
GMAT propagates the STM for all Spacecraft propagated using numerical integrators
by including the STM keyword in a Propagate command as shown below. If the STM
keyword is included anywhere in a Propagate command, the STM is propagated for all
spacecraft using numerical propagators.
GMAT does not currently support propagating the STM when propagating Formation
resources or when using SPK type propagators.
GMAT allows you to assign unique colors to Spacecraft trajectory segments by setting
orbital colors on each Propagate command. If you do not set unique colors on each
Propagate command, then by default, the color on each propagate segment is seed-
ed from color that is set on Spacecraft.OrbitColor field. See the Options section for
OrbitColor option that lets you set colors on the Propagate command. Also see Color
documentation for discussion and examples on how to set unique colors on orbital tra-
jectory segments through GMAT's Propagate command.
587
Reference Guide Dynamics and Modeling
Examples
BeginMissionSequence
BeginMissionSequence
BeginMissionSequence
Propagate two Spacecraft, each using a different Propagator, but keep the Spacecraft
synchronized in time. Propagate until either Spacecraft reaches a mean anomaly of
45 degrees.
588
Dynamics and Modeling Reference Guide
aProp2.Type = PrinceDormand78
BeginMissionSequence
589
590
Reference Guide
Input/Output
This chapter contains documentation for Resources and Commands related to data and
system I/O.
Resources
591
Reference Guide Input/Output
DynamicDataDisplay
A user-defined resource used in tandem with the UpdateDynamicData command to
print current values of parameters to a table on the GUI.
Description
Various options when using this resource include being able to set the parameter's text
color, setting the background color of the data cell, setting warning condition bounds
and setting critical condition bounds. The most common places to use this resource is
in looping sequences such as a for loop, optimization, targeting, etc.
Fields
Field Description
AddParameters Field to set the parameters the desired row, the first en-
try in this array must be the row number desired. Ex.
MyDynamicDataDisplay.AddParameters = {1, Sat.X, Array(2,
1)};
592
Input/Output Reference Guide
Field Description
BackgroundColor Field to set the background color of the cell showing the cho-
sen parameter value, the first entry in this array must be the
parameter to change the background color of followed by the
desired color, i.e. MyDynamicDataDisplay.BackgroundColor =
{ParamName, Color}.
593
Reference Guide Input/Output
Field Description
Maximized Allows the user to maximize the DynamicDataDisplay window.
This field cannot be modified in the Mission Sequence.
594
Input/Output Reference Guide
Field Description
Size Allows the user to control the display size of generated Dynam-
icDataDisplay. First value in [0 0] matrix controls horizontal size
and second value controls vertical size of the DynamicDataDis-
play. This field cannot be modified in the Mission Sequence.
595
Reference Guide Input/Output
Field Description
WarnBounds Field to set the warning bounds on a parameter, stepping out-
side these bounds will change the parameter value’s text to the
set warning color. The first entry is the parameter to which these
bounds will be applied to while the second is a real array, i.e.
MyDynamicDataDisplay.WarnBounds = {ParamName, [Lower-
Bound UpperBound]}.
GUI
The figure below shows default name and settings for the DynamicDataDisplay re-
source:
596
Input/Output Reference Guide
The figure below shows default name and settings for a parameter to be displayed in
the DynamicDataDisplay resource:
The grid in the setup panel represents the current parameters added to this Dynamic-
DataDisplay. To change the grid dimensions, enter integers into the “Row” and “Col-
umn” text boxes and click “Update”. Double clicking with the left mouse button on one of
the grid cells will open a dialog containing all the options for the parameter that will go in
the selected cell. The “Select” button takes the user to a parameter selection window to
choose the desired parameter. Once selected, the user can also change the options on
this parameter if desired. Once “Ok” is clicked, the name of the chosen parameter will
appear in the cell on the initial panel that was selected. To remove an undesired para-
597
Reference Guide Input/Output
meter from the grid, select a cell and hit the Delete key. This will remove the parameter
and set all other settings of that cell back to default values.
Remarks
Behavior of display under various inputs
If the user skips a row or multiple rows in the script (for example only putting parameters
in rows 1 and 4), then the rows in between are simply left as empty cells shown in the
GUI. When the table is built, it will make the number of columns in each row match the
row with the most parameters. For example, if row 1 has 5 parameters, but row 2 only
has 3, the two extra columns in row 2 will still appear but they will simply be left empty.
The user may also insert their own empty fields in the grid by adding an empty string
using quotations or by leaving boxes in the grid blank when using the setup panel.
The critical condition overrides the warning condition, i.e. if a parameter is currently the
warning color and proceeds to step outside the critical bounds, the text color will be
changed to the critical color. If a parameter returns within the critical or warning bounds,
the critical or warning colors are removed respectively. If the user has specified a text
color besides black to be used for a parameter, the warning and critical bound colors
will not be applied even if bounds are violated.
Examples
Create a DynamicDataDisplay resource named myDisplay with two rows, user set text
colors, and setting condition bounds on mySC.X.
BeginMissionSequence
Propagate myProp(mySC) {mySC.ElapsedSec = 12000.0};
598
Input/Output Reference Guide
UpdateDynamicData myDisplay;
599
Reference Guide Input/Output
EphemerisFile
Generate spacecraft’s ephemeris data
Description
GMAT allows you to generate any number of ephemeris data files by creating multiple
EphermisFile resources. An EphemerisFile resource can be created using either the
GUI or script interface. GMAT also provides the option of when to write and stop writ-
ing ephemeris data to a text file through the Toggle On/Off commands. See the Re-
marks section below for detailed discussion of the interaction between EphemerisFile
resource and Toggle command.
Fields
Field Description
CoordinateSystem Allows you to generate spacecraft ephemeris w.r.t the coordinate
system that you select for this field. Ephemeris can also be gen-
erated w.r.t a user-specified coordinate system. This field cannot
be modified in the Mission Sequence.
600
Input/Output Reference Guide
Field Description
EpochFormat The field allows you to set the type of the epoch that you choose
to enter for InitialEpoch and FinalEpoch fields. This field cannot
be modified in the Mission Sequence.
601
Reference Guide Input/Output
Field Description
FinalEpoch Allows the user to specify the time span of an ephemeris file.
Ephemeris file is generated up to final epoch that is specified in
FinalEpoch field. This field cannot be modified in the Mission
Sequence.
602
Input/Output Reference Guide
Field Description
InitialEpoch Allows the user to specify the starting epoch of the ephemeris
file. Ephemeris file is generated starting from the epoch that is
defined in InitialEpoch field. This field cannot be modified in the
Mission Sequence.
603
Reference Guide Input/Output
Field Description
OutputFormat Allows the user to specify what type of format they want
GSFC Code-500 ephmeris to be generated in. GSFC Code-500
ephemeris can be generated in the Little-Endian or Big-Endian
format. This field cannot be modified in the Mission Sequence.
604
Input/Output Reference Guide
Field Description
StepSize The ephemeris file is generated at the step size that is speci-
fied for StepSize field. The user can generate ephemeris file at
default Integration step size (using raw integrator steps) or by
defining a fixed step size. For CCSDS-OEM and STK-TimePosV-
el file formats, you can generate ephemeris at either Integrator
steps or fixed step size. For SPK file format, GMAT lets you gen-
erate ephemeris at only raw integrator step sizes. For Code-500
ephemeris file type, you can generate ephemeris at only fixed
step sizes. This field cannot be modified in the Mission Sequence.
GUI
The figure below shows the default settings for the EphemerisFile resource:
605
Reference Guide Input/Output
GMAT allows you to modify InitialEpoch, FinalEpoch and StepSize fields of Ephemer-
isFile resource. Instead of always generating the ephemeris file at default time span set-
tings of InitialSpacecraftEpoch and FinalSpacecraftEpoch, you can define your own
initial and final epochs. Similarly, instead of using the default IntegratorSteps setting
for StepSize field, you can generate the ephemeris file at the step size of your choice.
The GUI figure below shows ephemeris file which will be generated from initial epoch
of 01 Jan 2000 14:00:00.000 to final epoch of 01 Jan 2000 20:00:00.000 while using
non-default step size of 300 seconds:
606
Input/Output Reference Guide
Remarks
Behavior of Coordinate System Field for CCSDS, Code 500 and SPK File For-
mats
If the selected CoordinateSystem uses MJ2000Eq axes, the CCSDS ephemeris file
contains “EME2000” for the REF_FRAME according to CCSDS convention. By CCSDS
requirements, non-standard axes names are allowed when documented in an ICD. The
CoordinateSystems specifications document in the user's guide is the ICD for all axes
supported by GMAT. Also if you create a new coordinate system whose origin is Luna,
then the CCSDS ephemeris file contains “Moon” for the CENTER_NAME.
For code 500 file format, GMAT can write ephemeris for a CoordinateSystem under
CoordinateSystem field that references a MJ2000Eq, BodyFixed, or TOD axis for any
central body. For SPK file format, GMAT can only write ephemeris for a coordinate
607
Reference Guide Input/Output
system under CoordinateSystem field that references MJ2000Eq axis type for any
central body.
There is one important difference between GMAT and IAU conventions. By IAU con-
vention, there is no name for the IAU2000 axes that is independent of the origin. GCRF
is coordinate system centered at earth with IAU2000 axes, and ICRF is a coordinate
system centered at the solar system barycenter with IAU2000 axes. We have chosen to
name the IAU2000 axes ICRF regardless of the origin. Please refer to CoordinateSys-
tems specifications document to read more about built-in coordinate systems and de-
scription of Axes types that GMAT supports.
When generating an ephemeris file for a mission sequence, GMAT separately inter-
polates ephemeris segments that are bounded by discontinuous or discrete mission
events. Discontinuous or discrete mission sequence events can range from impulsive
or finite-burn maneuvers, changes in dynamics models or when using assignment com-
mands. Furthermore, when a mission sequence employs iterative processes such as
differential correction or optimization, GMAT only writes the ephemeris for the final so-
lution from the iterative processes. See the Examples section below to see how an
ephemeris file is generated during a discontinuous event such as an impulsive burn and
iterative process like differential correction.
Version 1 of CCSDS Orbit Data Messages (ODMs) document used to require that the
ephemeris be generated in increasing time order and only going forward. However ver-
sion 2 of CCSDS ODM document now allows for ephemeris file to be generated back-
wards as well. Currently in GMAT, when you propagate a spacecraft backwards in time,
then the CCSDS ephemeris is also generated backwards.
Warning
The Code500 ephemeris file requires fixed time steps and has a pre-defined
format for handling chunks of ephemeris data. The format does not allow
chunking to stop and start at state discontinuities that occur at impulsive ma-
neuvers. GMAT's current behavior is to interpolate across those discontinu-
ities as the code 500 format does not elegantly support ephemerides with
discontinuities. This is acceptable for small maneuvers but becomes less
accurate as the maneuvers grow in magnitude. We recommend using more
modern ephemeris file formats for this reason. In the event you must use a
Code500 ephemeris file with a discontinuous trajectory, we recommend us-
ing a propagator with small, fixed times steps, and a small StepSize setting
on the ephemeris file to reduce interpolation error near the discontinuity.
608
Input/Output Reference Guide
Behavior of Ephemeris File When It Does Not Meet CCSDS File Format Require-
ments
Currently, the ephemeris file that is generated by GMAT meets most of the recommend-
ed standards that are prescribed by the CCSDS. However whenever there is a case
when GMAT’s ephemeris violates CCSDS file format requirements, then the generated
ephemeris file will display a warning in ephemeris file’s Header section. More specifical-
ly, this warning will be given under COMMENT and it will let you know that this ephemeris
file does not fully satisfy CCSDS file formatting requirements.
For CCSDS file formats, whenever there is not enough raw data available to support
the requested interpolation type and order, GMAT throws an error message and stops
interpolation. GMAT still generates the ephemeris file but no spacecraft ephemeris data
is written to the file and only the file’s Header section will be there. Within the Header
section and under COMMENT, a message will be thrown saying that not enough raw
data is available to generate spacecraft ephemeris data at the requested interpolation
order.
For SPK file formats, raw data is always collected at every integrator step for each seg-
ment and then sent to SPK kernel writer. GMAT does not perform any interpolation for
SPK files as SPK contains its own interpolation. As a result, InitialEpoch and FinalE-
poch fields behave differently for SPK ephemerides. The first epoch on the file is the first
step after InitialEpoch. The last epoch on the file is the last step before FinalEpoch.
For code 500 file formats, you can set the interpolation order and currently GMAT sup-
ports Lagrange as the available interpolator method. For code 500 file formats, if there is
not enough raw data available to support interpolation type and order, GMAT will throw
an error message and stop interpolation.
For the STK-TimePosVel ephemeris format, whenever there is not enough raw data
available to support the generation of ephemeris at the requested interpolation order
and fixed step size, GMAT will internally adjust the interpolation order such that at least
the beginning and the last ephemeris points are reported in the STK .e ephemeris file.
This new interpolation order will be reported at STK . e ephemeris's header data.
EphemerisFile resource generates ephemeris file at each propagation step of the entire
mission duration. If you want to generate ephemeris data during specific points in your
mission, then a Toggle On/Off command can be inserted into the Mission tree to control
when the EphemerisFile resource writes data. When Toggle Off command is issued
609
Reference Guide Input/Output
Below is an example script snippet that shows how to use Toggle Off/On commands
while using the EphemerisFile resource. No ephemeris data is sent for first two days
of propagation and only the data that is collected during last four days of propagation
is sent to text file called ‘EphemerisFile1.eph’:
anEphmerisFile.Spacecraft = aSat
anEphmerisFile.Filename = 'EphemerisFile1.eph'
BeginMissionSequence
Behavior of Code 500 Ephemeris File During Discontinuous & Iterative Process-
es
Code 500 ephemeris file follows the ephemeris format and definitions that have been
defined in Flight Dynamics Division (FDD) Generic Data Product Formats Interface Con-
trol Document.
Unlike CCSDS ephemeris file, code 500 ephemeris does not support separate chunks in
the data blocks whenever discontinuous or discrete mission events such as impulsive/fi-
nite maneuvers, change in dynamics or assignment command takes place. Rather, code
500 ephemeris is generated all in one continuous data block regardless of any number
of mission events that may occur between initial and final epochs of ephemeris file. Fur-
thermore, when a mission sequence employs iterative processes such as differential
correction or optimization, GMAT will only write the ephemeris for the final solution from
the iterative processes. Code 500 ephemeris does not allow non-monotonic ephemeris
generation and an exception will be thrown if propagation direction changes. Further-
more, any discontinuities created by assignments may result in invalid code 500 files.
The standard format for Code 500 ephemeris files has a logical record length of
2800 bytes. Code 500 files have two header records, ephemeris header record 1 and
ephemeris record 2, followed by as many ephemeris data records as required for the
file timespan. Many parameters in ephemeris file's header records are mandatory while
some fields are optional. GMAT's Code 500 ephemeris header records only speci-
610
Input/Output Reference Guide
fies fields that are mandatory and optional fields have not been included. Code 500's
ephemeris header record 1 is mandatory while ephemeris record 2 is optional. Complete
description of ephemeris format and list of mandatory and optional ephemeris header
record parameters is defined in Flight Dynamics Division (FDD) Generic Data Product
Formats Interface Control Document. In GMAT, only required fields have been written
in header record 1 while header record 2 is left blank. Table below lists header record
1's required fields and any additional comments pertaining to that field.
611
Reference Guide Input/Output
For ephemeris header record 1, there are some required fields that have not been tabu-
lated in GMAT's Code 500 ephemeris header record 1. These fields that have not been
tabulated in header record 1 are listed in the table below. 0.0 indicates "used" and 1.0
means "not used".
612
Input/Output Reference Guide
Examples
This example shows how to generate a simple ephemeris file. Ephemeris file is gen-
erated for two days of propagation. At default settings, ephemeris file is generated at
each integrator step and in CCSDS file format. Ephemeris data is sent to text file called
‘EphemerisFile2.eph’:
anEphmerisFile.Spacecraft = aSat
anEphmerisFile.Filename = 'EphemerisFile2.eph'
BeginMissionSequence
This example shows how an ephemeris file is generated during an iterative process
like differential correction that includes a discontinuous event like an impulsive burn.
Ephemeris data is sent to text file called ‘EphemerisFile3.eph’:
anEphmerisFile.Spacecraft = aSat
anEphmerisFile.Filename = 'EphemerisFile3.eph'
BeginMissionSequence
Target aDC
Vary aDC(TOI.Element1 = 0.24, {Perturbation = 0.001, Lower = 0.0, ...
Upper = 3.14159, MaxStep = 0.5})
Maneuver TOI(aSat)
Propagate aProp(aSat) {aSat.Earth.Apoapsis}
Achieve aDC(aSat.Earth.RMAG = 42165)
EndTarget
This example shows how to generate a simple STK-TimePosVel (i.e. STK .e) ephemeris
file. Ephemeris file is generated for 1 day of propagation, then a simple impulsive ma-
613
Reference Guide Input/Output
neuver takes place and spacecraft propagates for another day. This ephemeris is gen-
erated at raw integrator steps.
Create ImpulsiveBurn IB
IB.Element1 = 0.5
anEphmerisFile.Spacecraft = aSat
anEphmerisFile.Filename = 'EphemerisFile.e'
anEphmerisFile.FileFormat = STK-TimePosVel
BeginMissionSequence
614
Input/Output Reference Guide
FileInterface
An interface to a data file
Description
The FileInterface resource is an interface to a data file that can be used to load mission
data, like Spacecraft state information and physical properties. Once an interface is
established to a file, the Set command can be used to load the data and apply it to a
destination.
• TVHF_ASCII: ASCII format of the TCOPS Vector Hold File (TVHF), defined by the
NASA Goddard Space Flight Center Flight Dynamics Facility. This file contains space-
craft state and physical information that can be transferred to a Spacecraft resource.
Fields
Field Description
Filename Full path of the file to read. Relative paths are interpreted as relative to
the directory containing the GMAT executable. If the path is omitted, it is
assumed to be “./”.
615
Reference Guide Input/Output
GUI
The FileInterface GUI has two fields: a list of accepted options for Format (currently
only TVHF_ASCII), and an input box for Filename. Click Browse to the right of the
Filename box to interactively select a file.
Remarks
Each file format supported by the FileInterface resource exposes a set of keywords
that can be used to extract certain data elements. These keywords can be used in the
Data option of the Set command, as follows:
If the 'All' keyword is used, those fields with a checkmark in the “All” column are
selected.
TVHF_ASCII
Limitations
Examples
Read a TVHF file and use it to configure a spacecraft.
616
Input/Output Reference Guide
BeginMissionSequence
617
Reference Guide Input/Output
GroundTrackPlot
A user-defined resource that draws longitude and latitude time-history of a spacecraft
Description
The GroundTrackPlot resource allows you to draw spacecraft’s longitude and latitude
time-history onto the texture map of a user-selected central body. GMAT allows you to
draw ground track plots of any number of spacecrafts onto a single texture map. You
can also create multiple GroundTrackPlot resources by using either the GUI or script
interface of GMAT. GMAT also provides the option of when to plot and stop plotting
ground track of a spacecraft to a GroundTrackPlot through the Toggle On/Off com-
mand. See the Remarks section below for detailed discussion of the interaction between
GroundTrackPlot resource and the Toggle command. GroundTrackPlot resource al-
so allows you to display any number of user-defined ground stations onto the texture
map of the central body.
Fields
Field Description
Add Allows the user to pick selected resources such as Space-
crafts or GroundStations. The GroundTrackPlot object is
used to draw spacecraft's longtitude and latitude time-history
on a two-dimensional texture map of a central body that you
select. After creating GroundStation object, you can also add
ground stations onto the the texture map of the central body.
To select multiple Spacecrafts or GroundStations, seperate
the list by comma and enclose the list in curly brackets. For
Example: DefaultGroundTrackPlot.Add = {aSat, bSat,
aGroundStaton, bGroundStation}. This field cannot be
modified in the Mission Sequence.
618
Input/Output Reference Guide
Field Description
DataCollectFrequency The number of integration steps to skip between plot points.
This field cannot be modified in the Mission Sequence.
619
Reference Guide Input/Output
Field Description
ShowPlot This field specifies whether to show ground track plot during
a mission run. This field cannot be modified in the Mission
Sequence.
620
Input/Output Reference Guide
Field Description
TextureMap Allows you to enter or select any user-defined texture map
image for the central body. This field cannot be modified in
the Mission Sequence.
GUI
621
Reference Guide Input/Output
Remarks
Behavior when using GroundTrackPlot Resource & Toggle Command
Below is an example script snippet that shows how to use Toggle Off and Toggle On
command while using the GroundTrackPlot resource. GroundTrackPlot is turned off
for the first 2 days of the propagation:
622
Input/Output Reference Guide
BeginMissionSequence
GMAT allows you to specify how data is plotted onto a plot during iterative processes
such as differential correction or optimization. The SolverIterations field of Ground-
TrackPlot resource supports 3 options which are described in the table below:
SolverItera- Description
tions options
Current Shows only current iteration/perturbation in an iterative process and
draws current iteration to a plot
All Shows all iterations/perturbations in an iterative process and draws
all iterations/perturbations to a plot
None Shows only the final solution after the end of an iterative process and
draws only final solution to a plot
GMAT’s GroundTrackPlot resource allows you to draw longitude and latitude time-
history of a spacecraft. You can choose to draw ground track plot of multiple spacecrafts
onto a single texture map of a central body.
Warning
The longitude and latitude of a spacecraft is drawn as an approximation that
includes straight line segments and longitude/latitude data does not takes
into account central body shape or its oblateness.
When using GroundTrackPlot.Add field, if brackets are not populated with user-de-
fined spacecrafts, then GMAT turns off GroundTrackPlot resource and no plot is gen-
erated. If you run the script with Add field having empty brackets, then GMAT throws in
a warning message in the Message Window indicating that GroundTrackPlot resource
will be turned off since no SpacePoints were added to the plot. Below is a sample script
snippet that generates such a warning message:
623
Reference Guide Input/Output
aGroundTrackPlot.Add = {}
BeginMissionSequence;
Propagate aProp(aSat, aSat2) {aSat.ElapsedDays = 1}
Examples
This example shows how to use GroundTrackPlot resource. A single spacecraft and a
ground station is added to the GroundTrackPlot. Spacecraft’s ground track is plotted
for one day of propagation:
BeginMissionSequence
Propagate a spacecraft for two days around a non-default central body. Spacecraft’s
ground track is plotted on planet Mars:
BeginMissionSequence
624
Input/Output Reference Guide
625
Reference Guide Input/Output
OpenFramesInterface
A user-defined resource that provides high-performance 3D interactive visualizations of
GMAT missions
Description
Note
The main OpenFramesInterface documentation is available on its online
GitLab Wiki. You can directly access relevant Wiki sections by pressing the
Help button on any GUI panel.
The OpenFramesInterface (OFI) resource allows you to visualize GMAT missions us-
ing interactive 3D graphics that are high-performance, customizable, and easy to use.
OFI is developed as a replacement for OrbitView, so it provides greater functionality
and performance while retaining a similar GUI and script format. You will be able to
easily use the OpenFramesInterface regardless of your comfort level with OrbitView!
• Create multiple interactive views per window. Each view can follow spacecraft or other
bodies, and can even automatically rotate to track another object.
• Control simulation time, animate the scene at any desired rate (including realtime and
backwards time), and synchronize time between multiple windows.
• Many visualization changes apply instantly without requiring a mission re-run.
• Use various 3D model formats for spacecraft and bodies: 3ds, lwo, obj, and more.
• View any GMAT mission in Virtual Reality using headsets such as the Oculus Rift
or HTC Vive. VR provides information about nonplanar trajectories that is difficult to
glean on a traditional monitor.
Tip
The GMAT samples/NeedOpenFramesInterface folder has examples of
using OFI based on similarly-named OrbitView sample scripts.
626
Input/Output Reference Guide
OrbitView
A user-defined resource that plots 3-Dimensional trajectories
Description
GMAT also provides the option of when to start and stop plotting spacecraft’s trajectories
to an OrbitView resource through the Toggle On/Off command. See the Remarks sec-
tion below for detailed discussion of the interaction between an OrbitView resource and
the Toggle command. GMAT’s Spacecraft, SolarSystem and OrbitView resources
also interact with each other throughout the entire mission duration. Discussion of the
interaction between these resources is also mentioned in the Remarks section.
Fields
Field Description
Add This field allows you to add a Spacecraft, Celestial body,
Libration Point, or Barycenter resource to a plot. When cre-
ating a plot, the Earth is added as a default body and may
be removed at any time. You can add a Spacecraft, Celes-
tial body, Libration Point, or Barycenter to a plot by using
the name used to create the resource. The GUI's Selected
field is the equivalent of the script's Add field. In the event
of no Add command or no resources in the Selected field,
GMAT should run without the OrbitView plot and a warning
message will be displayed in the message window. The fol-
lowing warning message is sufficient: The OrbitView named
"DefaultOrbitView" will be turned off. No SpacePoints were
added to plot. This field cannot be modified in the Mission Se-
quence.
627
Reference Guide Input/Output
Field Description
Axes Allows you to draw the Cartesian axis system associated with
the coordinate system selected under the CoordinateSys-
tem field of an OrbitView plot. This field cannot be modified
in the Mission Sequence.
628
Input/Output Reference Guide
Field Description
DataCollectFrequency Allows you to define how data is collected for plotting. It is of-
ten inefficient to draw every ephemeris point associated with
a trajectory. Often, drawing a smaller subset of the data still
results in smooth trajectory plots, while executing more quick-
ly. The DataCollectFrequency is an integer that represents
how often to collect data and store for plotting. If DataCol-
lectFrequency is set to 10, then data is collected every 10
integration steps. This field cannot be modified in the Mission
Sequence.
629
Reference Guide Input/Output
Field Description
EnableStars This field gives you the option of displaying stars on the Or-
bitView Plot. When the EnableStars field is turned off, then
EnableConstellations field is automatically diabled. This
field cannot be modified in the Mission Sequence.
630
Input/Output Reference Guide
Field Description
RelativeZOrder Allows you to select which OrbitView window to display first
on the screen. The OrbitViewPlot with lowest Relative-
ZOrder value will be displayed last while OrbitViewPlot with
highest RelativeZOrder value will be displayed first. This field
cannot be modified in the Mission Sequence.
631
Reference Guide Input/Output
Field Description
Size Allows you to control the display size of OrbitViewPlot win-
dow. First value in [0 0] matrix controls horizonal size and sec-
ond value controls vertical size of OrbitViewPlot display win-
dow. This field cannot be modified in the Mission Sequence.
632
Input/Output Reference Guide
Field Description
SunLine Allows you to draw a line that starts at the center of central
body and points towards the Sun. This field cannot be modi-
fied in the Mission Sequence.
633
Reference Guide Input/Output
Field Description
UseInitialView This field lets you control the view of an OrbitView plot be-
tween multiple runs of a mission sequence. The first time a
specific OrbitView plot is created, GMAT will automatically
use the view as defined by the fields associated with View
Definition, View Up Direction, and View Option. However,
if you change the view using the mouse, GMAT will retain this
view upon rerunning the mission as long as UseInitialView
is set to false. If UseInitialView is set to true, the view for an
OrbitView plot will be returned to the view defined by the ini-
tial settings. This field cannot be modified in the Mission Se-
quence.
634
Input/Output Reference Guide
Field Description
ViewPointReference This optional field allows you to change the reference point
from which ViewPointVector is measured. ViewPointRefer-
ence defaults to the origin of the coordinate system for the
plot. A ViewPointReference can be any Spacecraft, Celes-
tial body, Libration Point, or Barycenter. This field cannot
be modified in the Mission Sequence.
635
Reference Guide Input/Output
Field Description
ViewUpAxis This field lets you define which axis of the ViewUpCoor-
dinateSystem field will appear as the up direction in an
OrbitView plot. See the comments under ViewUpCoordi-
nateSystem for more details of fields used to determine the
up direction in an OrbitView plot. This field cannot be modi-
fied in the Mission Sequence.
636
Input/Output Reference Guide
Field Description
WireFrame When the WireFrame field is set to On, celestial bodies are
drawn using a wireframe model. When the WireFrame field
is set to Off, then celestial bodies are drawn using a full map.
This field cannot be modified in the Mission Sequence.
GUI
The figure below shows the default settings for the OrbitView resource:
637
Reference Guide Input/Output
The list of controls in the table below helps you navigate through the OrbitView graphics
window. "Left" and "Right" designate the mouse button which have to be pressed.
Control Description
Left Drag Helps to change camera orientation. Camera orientation can be
changed in Up/Down/Left/Right directions.
Right Drag Helps to zoom in and out of the graphics window. Moving the cursor
in Up direction leads to zoom out of the graphics window. Moving the
cursor in Down direction helps to zoom into the graphics window.
Shift+Right Helps to adjust the Field of View.
Drag
Remarks
The OrbitView resource plots spacecraft’s trajectory at each propagation step of the
entire mission duration. If you want to report data to an OrbitView plot at specific points
638
Input/Output Reference Guide
in your mission, then a Toggle On/Off command can be inserted into the mission se-
quence to control when OrbitView is to plot a given trajectory. When Toggle Off com-
mand is issued for an OrbitView, no trajectory is drawn until a Toggle On command
is issued. Similarly, when a Toggle On command is used, trajectory is plotted at each
integration step until a Toggle Off command is used.
BeginMissionSequence
GMAT allows you to specify how trajectories are plotted during iterative processes such
as differential correction or optimization. The SolverIterations field of OrbitView re-
source supports 3 options which are described in the table below:
SolverItera- Description
tions options
Current Shows only current iteration/perturbation in an iterative process and
plots current trajectory.
All Shows all iterations/perturbations in an iterative process and plots all
perturbed trajectories.
None Shows only the final solution after the end of an iterative process and
plots only that final trajectory.
GMAT allows you to plot trajectories of any number of spacecrafts when using the Or-
bitView resource. The initial epoch of all the spacecrafts must be same in order to plot
the trajectories. If initial epoch of one of the spacecrafts does not match with initial epoch
of other spacecrafts, then GMAT throws in an error alerting you that there is a coupled
639
Reference Guide Input/Output
propagation error mismatch between the spacecrafts. GMAT also allows you to propa-
gate trajectories of spacecrafts using any combination of the propagators that you may
create.
Below is an example script snippet that shows how to plot trajectories of multiple space-
crafts that use different propagators:
BeginMissionSequence
GMAT is capable of drawing orbit plots that allow you to visualize the motion of space-
craft and celestial bodies throughout the mission sequence. Here we discuss the op-
tions you can use in setting up and viewing Orbit plots. You can choose many properties
including the coordinate system of the orbit view plot and the view location and direction
from where visualizations can be seen. The script snippet below shows how to create
OrbitView resource that includes key view definition controls fields as well. Detailed
definitions of all fields for OrbitView resource can be found in Fields section.
You can specify the view location and direction of OrbitView plot object by using the
ViewPointReference, ViewPointVector, ViewDirection, ViewUpCoordinateSystem
and ViewUpAxis fields. Figure below shows a graphical definition of ViewPointRefer-
ence, ViewPointVector, and ViewDirection fields and how they determine the actual
view location and view direction. You can supply ViewPointReference, ViewPointVec-
640
Input/Output Reference Guide
tor and ViewDirection fields by either giving a vector in the format [x y z] or by specify-
ing an object name. If a vector is given for one of the quantities, then we simply use it in
its appropriate place in the computations below. If an object is given, we must determine
the vector associated with it. The rest of this section is devoted in determining View-
PointReference, ViewPointVector and ViewDirection fields if you specify an object.
MyOrbitViewPlot.CoordinateSystenm = MyCoordSys
MyOrbitViewPlot.ViewPointReference = ViewRefObject
ViewPointVector field points from ViewPointReference (rr) in the direction of the view
point location. If an object is given for ViewPointVector field, i.e. you have the following
in the sample script:
MyOrbitViewPlot.CoordinateSystenm = MyCoordSys
MyOrbitViewPlot.ViewPointVector = ViewPointObject
then we need to determine rv as illustrated in above figure by using the coordinate sys-
tem conversion routine to calculate the following:
641
Reference Guide Input/Output
We now know everything to calculate the location of the view point in the desired coor-
dinate system. From inspection of the above figure, we see that the relation is:
Now that we know the view point location, we need to determine the ViewDirection: rd
as illustrated in above figure. If a vector was specified for ViewDirection field, then no
computations are required. However, if an object was given as shown in the following
sample script:
MyOrbitViewPlot.CoordinateSystenm = MyCoordSys
MyOrbitViewPlot.ViewDiection = ViewDirectionObject
Below are some examples that show how to generate OrbitView plots using different
View Definition Controls configurations:
Earth Inertial view with spacecraft: This example shows orbit view plot with Earth and
a spacecraft. Since ViewPointReference field is set to an object (i.e. Earth), hence
ViewPointRef vector in above figure is [0 0 0] in EarthMJ2000Eq coordinate system.
The ViewPointVector field is set to a vector ( i.e. set to [0 0 40000] ). This means
that the view is from 40000 km above the Earth's equatorial plane on the z-axis of
the EarthMJ2000Eq coordinate system. The view direction (specified in ViewDirection
field) is towards the earth.
642
Input/Output Reference Guide
anOrbitView.CoordinateSystem = EarthMJ2000Eq
anOrbitView.ViewPointReference = Earth
anOrbitView.ViewPointVector = [ 0 0 40000 ]
anOrbitView.ViewDirection = Earth
anOrbitView.ViewScaleFactor = 1
anOrbitView.ViewUpCoordinateSystem = EarthMJ2000Eq
anOrbitView.ViewUpAxis = Z
BeginMissionSequence
Earth Inertial view with spacecraft and Luna: This example shows orbit view plot with
Earth, spacecraft and Moon. Note ViewPointReference field is set to an object (i.e.
Earth), hence ViewPointRef vector in above figure = [0 0 0] in EarthMJ2000Eq coordi-
nate system. ViewPointVector field is still set to a vector ( i.e. set to [0 0 500000] ).
This means that the view is from 500000 km above the Earth's equatorial plane on the
z-axis of the EarthMJ2000Eq coordinate system. ViewDirection field defines the view
direction which is set towards the earth.
anOrbitView.CoordinateSystem = EarthMJ2000Eq
anOrbitView.ViewPointReference = Earth
anOrbitView.ViewPointVector = [ 0 0 500000 ]
anOrbitView.ViewDirection = Earth
anOrbitView.ViewScaleFactor = 1
anOrbitView.ViewUpCoordinateSystem = EarthMJ2000Eq
anOrbitView.ViewUpAxis = Z
BeginMissionSequence
View of spacecraft from Luna in Earth inertial frame: This example of an orbit view plot
shows spacecraft as viewed from Luna orbiting around Earth in an inertial reference
frame. ViewPointReference field is set to an object (i.e. Earth), hence ViewPointRef
vector is [0 0 0] in EarthMJ2000Eq coordinate system. This time ViewPointVector field
is set to an object (i.e. Luna ). This means that the spacecraft will be seen from the
vantage point of Luna. Note that ViewDirection field is set to spacecraft (aSat). This
643
Reference Guide Input/Output
means that view direction as seen from Luna is towards the spacecraft. After you run
this example, re-run this example but this time with ViewScaleFactor field set to 2 and
see what happens. You'll notice that ViewScaleFactor simply scales ViewPointVector
field.
anOrbitView.CoordinateSystem = EarthMJ2000Eq
anOrbitView.ViewPointReference = Earth
anOrbitView.ViewPointVector = Luna
anOrbitView.ViewDirection = aSat
anOrbitView.ViewScaleFactor = 1
anOrbitView.ViewUpCoordinateSystem = EarthMJ2000Eq
anOrbitView.ViewUpAxis = Z
BeginMissionSequence
View towards Luna from Earth as spacecraft orbits around Luna in inertial frame: This
example of an orbit view plot shows view of Luna from vantage point of Earth as a
spacecraft orbits around Luna. ViewPointReference field is set to an object (i.e. Luna),
hence ViewPointRef vector in above figure is [0 0 0] in LunaMJ2000Eq coordinate sys-
tem. ViewPointVector field is set to an object (i.e. Earth ). This means that the camera
or vantage point is located at Earth. ViewDirection field is also set to an object (i.e.
Luna). This means that view direction as seen from Earth is towards Luna.
aSat.CoordinateSystem = LunaMJ2000Eq
aSat.SMA = 7300
aSat.ECC = 0.4
aSat.INC = 90
aSat.RAAN = 270
aSat.AOP = 315
aSat.TA = 180
644
Input/Output Reference Guide
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedDays = 5}
View towards spacecraft1 from spacecraft2 in inertial frame: This example of an orbit
view plot shows spacecraft1 (aSat1) being viewed from spacecraft2 (aSat2) as they
move in inertial reference frame. ViewPointReference field is set to an object (i.e.
Earth), hence ViewPointRef vector in above figure is [0 0 0] in EarthMJ2000Eq coordi-
nate system. ViewPointVector field is set to an object (i.e. aSat2 ) and ViewDirection
field is also set to an object (i.e. aSat1). This means that aSat1 will be viewed from the
vantage point of aSat2.
aSat2.X = 19500
aSat2.Z = 10000
anOrbitView.CoordinateSystem = EarthMJ2000Eq
anOrbitView.ViewPointReference = Earth
anOrbitView.ViewPointVector = aSat2
anOrbitView.ViewDirection = aSat
anOrbitView.ViewScaleFactor = 1.0
anOrbitView.ViewUpCoordinateSystem = EarthMJ2000Eq
anOrbitView.ViewUpAxis = Z
BeginMissionSequence
Orbit view plot of Sun-Earth-Moon L1 Rotating System: This example of an orbit view
plot shows the Earth and spacecraft in the Sun-Earth-Moon rotating coordinate system.
ViewPointReference field is set to an object (i.e. ESL1), hence ViewPointRef vector in
above figure is [0 0 0] in SunEarthMoonL1 rotating coordinate system. ViewPointVec-
645
Reference Guide Input/Output
tor field is set to a vector (i.e. [0 0 30000] ). This means that the view is taken from
30000 km above the SunEarthMoonL1 coordinate system's XY plane on the z-axis of
the SunEarthMoonL1 coordinate system. ViewDirection field is also set to an object
(i.e. ESL1). This means that view direction as seen from 30000 km above the Sun-
EarthMoonL1 coordinate system's XY plane is towards ESL1. Note that in this example,
ViewScaleFactor is set to 25. This simply scales or amplifies ViewPointVector field
25 times its original value.
646
Input/Output Reference Guide
anOrbitView.ViewDirection = ESL1
anOrbitView.ViewScaleFactor = 25
anOrbitView.ViewUpCoordinateSystem = SunEarthMoonL1
anOrbitView.ViewUpAxis = Z
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedDays = 15}
GMAT displays spacecraft models by reading model data from 3D Studio files describ-
ing the spacecraft shape and colors. These files have the file extension .3ds, and are
generally called 3ds files. 3ds files contain data that defines the 3-dimensional coordi-
nates of vertices outlining the spacecraft, a mapping of those vertices into triangles used
to create the displayed surface of the spacecraft, and information about the colors and
texture maps used to fill in the displayed triangles.
When using OrbitView.Add field, if brackets are not populated with user-defined space-
crafts, then GMAT turns off OrbitView resource and no plot is generated. If you run the
script with Add field having empty brackets, then GMAT throws in a warning message
in the Message Window indicating that OrbitView resource will be turned off since no
SpacePoints were added to the plot. Below is a sample script snippet that generates
such a warning message:
BeginMissionSequence
Propagate aProp(aSat, aSat2){aSat.ElapsedSecs = 12000.0}
Examples
Propagate spacecraft for 1 day and plot the orbit at every integrator step:
647
Reference Guide Input/Output
BeginMissionSequence
BeginMissionSequence
Target aDC
Vary aDC(TOI.Element1 = 0.24, {Perturbation = 0.001, Lower = 0.0, ...
Upper = 3.14159, MaxStep = 0.5})
Maneuver TOI(aSat)
Propagate aProp(aSat) {aSat.Earth.Apoapsis}
Achieve aDC(aSat.Earth.RMAG = 42165)
EndTarget
Plotting spacecraft’s trajectory around non-default central body. This example shows
how to plot a spacecraft’s trajectory around Luna:
aSat.CoordinateSystem = LunaMJ2000Eq
aSat.SMA = 7300
aSat.ECC = 0.4
aSat.INC = 90
aSat.RAAN = 270
aSat.AOP = 315
aSat.TA = 180
648
Input/Output Reference Guide
BeginMissionSequence
Plotting spacecraft’s trajectory around non-default central body. This example shows
how to plot a spacecraft’s trajectory around Mars:
aSat.CoordinateSystem = MarsMJ2000Eq
aSat.SMA = 7300
aSat.ECC = 0.4
aSat.INC = 90
aSat.RAAN = 270
aSat.AOP = 315
aSat.TA = 180
649
Reference Guide Input/Output
BeginMissionSequence
Plotting spacecraft’s trajectory around non-default central body. This example shows
how to plot a spacecraft’s trajectory around Sun. This is an interplanetary trajectory.
Spacecraft is shown on an out-going hyperbolic trajectory in an EarthView and then an
interplanetary trajectory is drawn around Sun in a SunView. Mars Orbit around Sun is
also shown:
aSat.CoordinateSystem = EarthMJ2000Eq
aSat.DateFormat = UTCGregorian
aSat.Epoch = '18 Nov 2013 20:26:24.315'
aSat.X = 3728.345810006184
aSat.Y = 4697.943961035268
aSat.Z = -2784.040094879185
aSat.VX = -9.502477543864449
aSat.VY = 5.935188001372066
aSat.VZ = -2.696272103530009
650
Input/Output Reference Guide
BeginMissionSequence
651
Reference Guide Input/Output
ReportFile
Report data to a text file
Description
The ReportFile resource allows you to write data to a text file that can be viewed after
a mission run has been completed. GMAT allows you to report user-defined Variables,
Arrays, Strings and Object Parameters. GMAT gives you control over setting format-
ting properties of the output report file that is generated at the end of a mission run.
You can create ReportFile resource in either the GUI or script interface. GMAT also
provides the option of when to write and stop writing data to a text file through the Tog-
gle On/Off command. See the Remarks section below for detailed discussion of the
interaction between ReportFile resource and Toggle command.
Fields
Field Description
Add Allows a user to add any number of user-defined Variables, Ar-
rays, Strings or Object Parameters to a report file. To add mul-
tiple user-defined variables or parameters, enclose the reported
values with curly brackets. Ex. MyReportName.Add ={Sat.X,
Sat.Y, Var1, Array(1,1)}; The GUI's Selected Value(s) field
is the equivalent of the script's Add field. This field cannot be
modified in the Mission Sequence.
652
Input/Output Reference Guide
Field Description
Delimiter When FixedWidth field is turned off, this field become active. The
Delimiter field allows you to report data to a report file in Comma,
Semicolon, Space and Tab delimited format.
653
Reference Guide Input/Output
Field Description
Maximized Allows the user to maximize the ReportFile window. This field
cannot be modified in the Mission Sequence.
654
Input/Output Reference Guide
Field Description
SolverIterations This field determines whether or not data associated with per-
turbed trajectories during a solver (Targeter, Optimize) se-
quence is written to a report file. When SolverIterations is set to
All, all perturbations/iterations are written to a report file. When
SolverIterations is set to Current, only current solution is written
to a report file. When SolverIterations is set to None, this shows
only final solution after the end of an iterative process and reports
only final solution to a report file.
655
Reference Guide Input/Output
Field Description
ZeroFill Allows zeros to be placed in data written to a report to match set
precision.
GUI
Figure below shows default name and settings for the ReportFile resource:
Remarks
GMAT allows you to specify the name of the report file in two ways. The default naming
convention for a report file when using FileName field is shown below:
656
Input/Output Reference Guide
An alternate method for naming a report file is to name the file without using any single
quotes around the report file’s name.
GMAT allows you to report data to a report file in two ways: You can use ReportFile.Add
field or a Report command.
You can add data using the .Add field of ReportFile resource and this method reports
data to the report file at each propagation step. Below is an example script snippet that
shows how to report epoch and selected orbital elements using the .Add field:
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedSecs = 8640.0}
GMAT’s ReportFile.Add field will not report selected data to the report file at each prop-
agation step if Propagate command is not included under the BeginMissionSequence.
An alternative method of reporting data to the report file is via the Report command.
Using the Report command allows you to report data to the report file at specific points
in your mission. Below is an example script snippet that shows how to report epoch and
selected orbital elements using the Report command:
BeginMissionSequence
657
Reference Guide Input/Output
Behavior and Interactions when using ReportFile Resource & Report Command
Suppose you utilize a ReportFile resource and opt not to write a report and select false
for the field name WriteReport, as shown in the example below:
Now assume that at the same time, you decide to utilize Report command in the Mis-
sion tree, as shown in the example script snippet below:
BeginMissionSequence;
Report aReport aSat.A1ModJulian aSat.Earth.SMA aSat.Earth.ECC
Propagate aProp(aSat) {aSat.Earth.Periapsis}
Report aReport aSat.A1ModJulian aSat.Earth.SMA aSat.Earth.ECC
At this point, you may think that since false option is selected under the field
name WriteReport in ReportFile resource, hence GMAT will not generate the report
file called ReportFile1.txt. On the Contrary, GMAT will generate a report called
ReportFile1.txt, but this report will only contain data that was requested using the
Report command. ReportFile1.txt text file will contain epoch, semi-major-axis and
eccentricity only at specific points of the mission.
GMAT allows you to specify how data is written to reports during iterative processes such
as differential correction or optimization. SolverIterations field of ReportFile resource
supports 3 options which are described in the table below:
SolverItera- Description
tions options
All Shows only current iteration/perturbation after the end of an iterative
process and reports current solution to a report file.
Current Shows all iterations/perturbations in an iterative process and reports
all iterations/perturbations to a report file.
None Shows only final solution after the end of an iterative process and
reports only final solution to a report file.
GMAT allows you to write reports to any desired path or location. You can do this by go-
ing to GMAT’s startup file called gmat_startup_file.txt and define an absolute path
under OUTPUT_PATH. This allows you to save report files in the directory of your choice as
oppose to saving report files in GMAT's default Output folder. In ReportFile.FileName
field, If no path is provided and only name of the report file is defined, then report files
are written to GMAT's default Output folder. The default path where reports are written
to is the Output folder located in the main directory where GMAT is installed.
658
Input/Output Reference Guide
Below is an example script snippet that shows where generated reports are written
when only report file’s name is provided under the FileName field. In this example,
'ReportFile1.txt'report is written to the Output folder located in the main directory
where GMAT is installed:
aReport.Filename = 'ReportFile1.txt'
aReport.Add = {aSat.A1ModJulian, aSat.Earth.ECC}
An alternate method where report files can be written is by defining a relative path.
You can define the relative path in GMAT’s startup file gmat_startup_file.txt under
OUTPUT_PATH. For example, you can set a relative path by setting OUTPUT_PATH = C:/
Users/rqureshi/Desktop/GMAT/mytestfolder/../output2/. In this path, the syn-
tax ".." means to “go up one level”. After saving the startup file, when the script is exe-
cuted, the generated report file named under FileName field will be written to a path C:
\Users\rqureshi\Desktop\GMAT\output2.
Another method where report files can be written to is by defining an absolute path
in GMAT’s startup file gmat_startup_file.txt under OUTPUT_PATH. For example,
you can set an absolute path by setting OUTPUT_PATH = C:/Users/rqureshi/Desk-
top/GMAT/mytestfolder/. When the script is executed, report file named under File-
Name field will be written to an absolute path C:\Users\rqureshi\Desktop\GMAT
\mytestfolder.
Instead of defining a relative or an absolute path in GMAT's startup file, you can
choose to define an absolute path under FileName field too. For example, if you
set ReportFile.FileName = C:\Users\rqureshi\Desktop\GMAT\mytestfold-
er\ReportFile.txt, then report file will be saved in mytestfolder.
GMAT allows you to use Toggle command while using the Add field of ReportFile
resource. When Toggle Off command is issued for a ReportFile, not data is sent to a
report file until a Toggle On command is issued. Similarly, when a Toggle On command
is used, data is sent to a report file at each integration step until a Toggle Off command
is used.
Below is an example script snippet that shows how to use Toggle Off and Toggle On
command while using the ReportFile resource. Spacecraft’s cartesian position vector
is reported to the report file.
659
Reference Guide Input/Output
BeginMissionSequence
When using ReportFile.Add field, GMAT does not allow brackets to be left empty. The
brackets must always be populated with values that you wish to report. If brackets are
left empty, then GMAT throws in an exception. Below is a sample script snippet that
shows an example of empty brackets. If you were to run this script, then GMAT throws
in an execption reminding you that brackets cannot be left empty.
aReport.Add = {}
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedSecs = 8640.0}
Examples
Propagate an orbit and write cartesian state to a report file at every integrator step
BeginMissionSequence
Propagate an orbit for 1 day and write cartesian state to a report file at specific points
in your mission
660
Input/Output Reference Guide
BeginMissionSequence
661
Reference Guide Input/Output
XYPlot
Plots data onto the X and Y axes of a graph
Description
The XYPlot resource allows you to plot data onto the X and Y axis of the graph. You
can choose to plot any number of parameters as a function of a single independent
variable. GMAT allows you to plot user-defined variables, array elements, or spacecraft
parameters. You can create multiple XYPlots by using either the GUI or script interface
of GMAT. GMAT also provides the option of when to plot and stop plotting data to a XY-
Plot through the Toggle On/Off command. See the Remarks section below for detailed
discussion of the interaction between an XYPlot resource and the Toggle command.
GMAT’s Spacecraft and XYPlot resources also interact with each other throughout the
entire mission duration. Discussion of the interaction between Spacecraft and XYPlot
resources can also be found in the Remarks section.
Fields
Field Description
Maximized Allows the user to maximize the XYPlot window. This field cannot
be modified in the Mission Sequence.
662
Input/Output Reference Guide
Field Description
RelativeZOrder Allows the user to select which XYPlot window to display first on
the screen. The XYPlot with lowest RelativeZOrder value will be
displayed last while XYPlot with highest RelativeZOrder value
will be displayed first. This field cannot be modified in the Mission
Sequence.
663
Reference Guide Input/Output
Field Description
SolverIterations This field determines whether or not data associated with per-
turbed trajectories during a solver (Targeter, Optimize) se-
quence is displayed in the XYPlot. When SolverIterations is set
to All, all perturbations/iterations are plotted in the XYPlot. When
SolverIterations is set to Current, only the current solution or
perturbation is plotted in XYPlot. When SolverIterations is set
to None, only the final nominal run is plotted on the XYPlot.
664
Input/Output Reference Guide
GUI
The figure below shows the default settings for the XYPlot resource:
Remarks
Behavior when using XYPlot Resource & Toggle Command
The XYPlot resource plots data onto the X and Y axis of the graph at each propagation
step of the entire mission duration. If you want to report data to an XYPlot at specific
points in your mission, then a Toggle On/Off command can be inserted into the mission
sequence to control when the XYPlot is to plot data. When Toggle Off command is
issued for a XYPlot, no data is plotted onto the X and Y axis of the graph until a Toggle
On command is issued. Similarly when a Toggle On command is used, data is plotted
onto the X and Y axis at each integration step until a Toggle Off command is used.
Below is an example script snippet that shows how to use Toggle Off and Toggle
On commands while using the XYPlot resource. Spacecraft’s position magnitude and
semi-major-axis are plotted as a function of time.
BeginMissionSequence
665
Reference Guide Input/Output
Spacecraft resource contains information about spacecraft’s orbit, its attitude, physical
parameters (such as mass and drag coefficient) and any attached hardware, including
thrusters and fuel tanks. Spacecraft resource interacts with XYPlot throughout the en-
tire mission duration. The data retrieved from the spacecraft is what gets plotted onto
the X and Y axis of the graph at each propagation step of the entire mission duration.
When using XYPlot.YVariables field, GMAT does not allow brackets to be left empty.
The brackets must always be populated with values that you wish to plot against a
variable in XVariable field. If brackets are left empty, then GMAT throws in an exception.
Below is a sample script snippet that shows an example of empty brackets. If you were
to run this script, then GMAT throws in an execption reminding you that brackets for
YVariables field cannot be left empty.
aXYPlot.XVariable = aSat.ElapsedDays
aXYPlot.YVariables = {}
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedDays = 2}
GMAT allows you to specify how data is plotted onto a plot during iterative processes
such as differential correction or optimization. The SolverIterations field of an XYPlot
resource supports three options which are described in the table below:
SolverItera- Description
tions options
Current Shows only current iteration/perturbation in an iterative process and
plots current iteration to a plot.
All Shows all iterations/perturbations in an iterative process and plots all
iterations/perturbations to a plot.
None Shows only the final solution after the end of an iterative process and
plots only that final solution to the plot.
Examples
Propagate an orbit and plot the spacecraft’s altitude as a function of time at every inte-
grator step:
666
Input/Output Reference Guide
BeginMissionSequence
BeginMissionSequence
Commands
667
Reference Guide Input/Output
ClearPlot
Allows you to clear all data from an XYPlot
Script Syntax
ClearPlot OutputNames
OutputNames
OutputNames is the list of subscribers whose data is to be
cleared. When data of multiple subscribers is to be cleared,
then they need to be separated by a space.
Description
The ClearPlot command allows you to clear all data from an XYPlot after it has been
plotted. The ClearPlot command works only for the XYPlot resource and data from
multiple XYPlot resources can be cleared. ClearPlot command can be used through
GMAT’s GUI or the script interface.
Options
Option Description
OutputNames The ClearPlot command allows the user to clear data from an
XYPlot subscriber. When more than one subscriber is being
used, the subscribers need to be separated by a space.
GUI
Figure below shows default settings for ClearPlot command.
668
Input/Output Reference Guide
Remarks
GMAT allows you to insert ClearPlot command into the Mission tree at any location.
This allows you to clear data output from an XYPlot at any point in your mission. The
XYPlot subscriber plots data at each propagation step of the entire mission duration. If
you want to report data to an XYPlot at specific points in your mission, then a ClearPlot
command can be inserted into the mission sequence to control when a subscriber plots
data. Refer to the Examples section below to see how ClearPlot command can be used
in the Mission tree.
Examples
This example shows how to use ClearPlot command on multiple subscribers. Data from
XYPlot subscribers is cleared after 2 days of the propagation:
aPlot1.XVariable = aSat.ElapsedSecs
aPlot1.YVariables = {aSat.EarthMJ2000Eq.X}
aPlot2.XVariable = aSat.ElapsedSecs
aPlot2.YVariables = {aSat.EarthMJ2000Eq.Y}
aPlot3.XVariable = aSat.ElapsedSecs
aPlot3.YVariables = {aSat.EarthMJ2000Eq.VX, aSat.EarthMJ2000Eq.VY, ...
aSat.EarthMJ2000Eq.VZ}
BeginMissionSequence
This example shows how to use ClearPlot command on a single subscriber. Data from
XYPlot is cleared for the first 3 days of the propagation and only the data retrieved from
last day of propagation is plotted:
aPlot1.XVariable = aSat.ElapsedDays
aPlot1.YVariables = {aSat.EarthMJ2000Eq.X, aSat.EarthMJ2000Eq.Y}
BeginMissionSequence
669
Reference Guide Input/Output
ClearPlot aPlot1
Propagate aProp(aSat) {aSat.ElapsedDays = 1}
670
Input/Output Reference Guide
GetEphemStates()
Function used to output initial and final spacecraft states from an ephemeris file
Script Syntax
Inputs:
ephemType : Ephemeris type ('STK', 'SPK', 'Code500')
sat : Spacecraft with an associated ephemeris file
epochFormat : String in single quotes containing a valid epoch
format for the resulting epoch output
coordSystem : CoordinateSystem for the resulting state output
Outputs:
initialEpoch : String of initial epoch on the file in requested
epochFormat
initialState : 6-element Array in the requested coordinateSystem
finalEpoch : String of final epoch on the file in requested
epochFormat
finalState : 6-element Array in the requested coordinateSystem
Description
GetEphemStates() is a special function that allows you to output initial and final space-
craft ephemeris states from a generated spacecraft ephemeris file. The GetEphemS-
tates() function can query through the following ephemeris types: STK-TimePosVel (i.e.
STK .e ephemeris), spice (SPK) and Code-500. You can request the resulting initial
epoch, initial state, final epoch and final state in the epoch format and coordinate system
of your choice.
The initial state output stored in the initialState array corresponds to the state in the
ephemeris file at ephemeris file's initial epoch. Similarly, the final state output stored in
the finalState array corresponds to the final state in the ephemeris file at ephemeris
file's final epoch. You can request both the initial and final epochs in any of the epoch
formats that GMAT supports. Also both initial and final states can be requested in any
of GMAT's default or user-defined coordinate systems.
671
Reference Guide Input/Output
GUI
The GetEphemStates() GUI is a very simply one and it simply reflects how you imple-
ment this function in the script mode. It is easiest to work with GetEphemStates() func-
tion in the script mode.
Remarks
The Examples section will show simple examples in how to use GetEphemStates()
function to extract initial and final spacecraft states for all three STK .e, Code-500 and
Spice ephemeris types.
Examples
First run only 'Example 1A' to generate STK-TimePosVel (i.e. STK .e) ephemeris
file. Now run 'Example 1B' that shows you how to read through a generated STK .e
ephemeris file and retrieve spacecraft's initial/final states in the desired epoch for-
mat and coordinate system. Before running Example 1B, make sure that you put
'STK_Ephemeris.e' ephemeris file in the same directory as your main GMAT script
672
Input/Output Reference Guide
BeginMissionSequence
Create ReportFile rf
BeginMissionSequence
First run only 'Example 2A' to generate a Code-500 ephemeris file. Now run 'Example
2B' that shows you how to read through a generated Code-500 ephemeris file and re-
trieve spacecraft's initial/final states in the desired epoch format and coordinate sys-
tem. Before running Example 2B, make sure that you put 'Code500_Ephemeris.eph'
ephemeris file in the same directory as your main GMAT script
673
Reference Guide Input/Output
BeginMissionSequence
%%% Example 2B. Read through Code-500 ephemeris file using GetEphemStates():
Create ReportFile rf
BeginMissionSequence
First run only 'Example 3A' to generate a Spice ephemeris file. Now run 'Example 3B'
that shows you how to read through a generated spice ephemeris file and retrieve
spacecraft's initial/final states in the desired epoch format and coordinate system. Be-
fore running Example 3B, make sure that you put 'SPK_Ephemeris.bsp' ephemeris file
in the same directory as your main GMAT script
Create ImpulsiveBurn IB
IB.Element1 = 0.5
674
Input/Output Reference Guide
anEphmerisFile.Spacecraft = aSat
anEphmerisFile.Filename = 'SPK_Ephemeris.bsp'
anEphmerisFile.FileFormat = SPK
BeginMissionSequence
%%% Example 3B. Read through a Spice ephemeris file using GetEphemStates():
Create ImpulsiveBurn IB
IB.Element1 = 0.5
Create ReportFile rf
BeginMissionSequence
675
Reference Guide Input/Output
MarkPoint
Allows you to add a special mark point character on an XYPlot
Script Syntax
MarkPoint OutputNames
OutputNames
OutputNames is the list of subscribers and a special mark point
will be added to each subscriber’s XYPlot. When mark points need
to be added to multiple subscribers, then the subscribers need
to be separated by a space.
Description
The MarkPoint command allows you to add a special mark point character to highlight a
single data point on an XYPlot. MarkPoint command works only for XYPlot subscriber.
This command also allows you to add special mark points on multiple XYPlot resources.
MarkPoint command can be used through GMAT’s GUI or the script interface.
Options
Option Description
OutputNames The MarkPoint command allows the user to add a special mark
point character to highlight an individual data point on an XYPlot.
GUI
Figure below shows default settings for MarkPoint command:
676
Input/Output Reference Guide
Remarks
GMAT allows you to insert MarkPoint command into the Mission tree at any location.
This allows you to add special mark points on an XYPlot at any point in your mission. The
XYPlot subscriber plots data at each propagation step of the entire mission duration.
If you to want to place mark points on an XYPlot at specific points, then a MarkPoint
command can be inserted into the mission sequence to control when mark points are
placed onto an XYPlot. Refer to the Examples section below to see how MarkPoint
command can be used in the Mission tree.
Examples
This example shows how to use MarkPoint command on multiple subscribers. Mark
points are added on two XYPlots after every 0.2 days through an iterative loop:
aPlot1.XVariable = aSat.A1ModJulian
aPlot1.YVariables = {aSat.EarthMJ2000Eq.X}
aPlot2.XVariable = aSat.A1ModJulian
aPlot2.YVariables = {aSat.EarthMJ2000Eq.VX}
BeginMissionSequence;
This example shows how to use MarkPoint on a single subscriber. In this example,
mark points are placed on the XYPlot the moment spacecraft’s altitude goes below 750
Km. Note that mark points are placed on the XYPlot at every integration step:
aPlot1.XVariable = aSat.A1ModJulian
aPlot1.YVariables = {aSat.Earth.Altitude}
BeginMissionSequence
677
Reference Guide Input/Output
MarkPoint aPlot1
EndIf
EndWhile
678
Input/Output Reference Guide
PenUpPenDown
Allows you to stop or begin drawing data on a plot
Script Syntax
PenUp OutputNames
OutputNames
OutputNames is the list of subscribers that
PenUp command operates on. When PenUp
command is used on multiple subscribers, then the subscribers
need to be separated by a space.
PenDown OutputNames
OutputNames
OutputNames is the list of subscribers
that PenDown command operates on.
When PenDown command is used on multiple subscribers, then the
subscribers need to be separated by a space.
Description
The PenUp and PenDown commands allow you to stop or begin drawing data on a plot.
The PenUp and PenDown commands operate on XYPlot, OrbitView and Ground-
TrackPlot subscribers. GMAT allows you to insert PenUp and PenDown commands
into the Mission tree at any location. This allows you to stop or begin drawing data
output on a plot at any point in your mission. The PenUp and PenDown commands can
be used through GMAT’s GUI or the script interface.
Options
Option Description
OutputNames When a PenUp command is issued for a plot, no data is drawn
to that plot until a PenDown command is issued for that plot
679
Reference Guide Input/Output
Option Description
OutputNames When a PenDown command is issued for a plot, data is drawn
for each integration step until a PenUp command is issued for
that plot.
GUI
Figures below show default settings for PenUp and PenDown commands:
Remarks
XYPlot, OrbitView and GroundTrackPlot subscribers plot data at each integration step
of the entire mission duration. If you want to plot data at specific points in your mission,
then a PenUp and PenDown command can be inserted into the mission sequence to
680
Input/Output Reference Guide
control when a subscriber plots data. For example, when a PenUp command is issued
for XYPlot, OrbitView or GroundTrackPlot, no data is drawn to that plot until a Pen-
Down command is issued for that same plot. Similarly, when a PenDown command is
issued for any of the three subscribers, then data is drawn for each integration step until
a PenUp command is issued for that specific subscriber. Refer to the Examples section
below to see how PenUp and PenDown commands can be used in the Mission tree.
Examples
This example shows how to use PenUp and PenDown commands on multiple sub-
scribers. PenUp and PenDown commands are used on XYPlot, OrbitView and
GroundTrackPlot. Data is drawn to the plots for first day of the propagation, turned off
for second day of propagation and then data is drawn for third day of the propagation:
BeginMissionSequence
This example shows how to use PenUp and PenDown commands on a single XYPlot
subscriber. Data is drawn to the plot for one-third of the day, turned off for second one-
third of the day and then data is drawn again for last one-third of the day:
Create Variable I
I = 0
BeginMissionSequence
681
Reference Guide Input/Output
If I == 960
PenDown aPlot1
EndIf
GMAT I = I +1
EndWhile
682
Input/Output Reference Guide
Report
Allows you to write data to a text file
Script Syntax
ReportName
ReportName option allows you to specify the
ReportFile for data output.
DataList
DataList option allows you to output data to the Filename
specified by the ReportName. Multiple objects can be written
in the DataList when they are separated by spaces.
Description
The Report command allows you to report data at specific points in your mission se-
quence. GMAT allows you to insert Report command into the Mission tree at any lo-
cation. Report command can be used through GMAT’s GUI or via the script interface.
The parameters reported by Report command are placed into a report file that can be
accessed at the end of the mission run.
Options
Option Description
ReportName The ReportName option allows the user to specify the Report-
File for data output.
683
Reference Guide Input/Output
GUI
Figure below shows default settings for Report command:
Remarks
Report command can be used to report data to a report file at specific points in your
mission. If you want data to be reported at each propagation step of the entire mission
duration, then you should not use Report command. Instead you should use ReportFile
resource. See ReportFile resource section of the User's Guide to learn about the syntax
that allows you to report data at each raw integrator steps.
Examples
Propagate an orbit for two days and report epoch and selected orbital elements to a
report file using the Report command.
BeginMissionSequence
684
Input/Output Reference Guide
BeginMissionSequence
While spacecraft propagates for less than a day, report spacecraft's true anomaly, ec-
centricity and altitude after every 3600 seconds using the Report command:
BeginMissionSequence
685
Reference Guide Input/Output
Set
Configure a resource from a data interface
Script Syntax
Description
The Set command retrieves data from source according to options and populates
destination. Time systems, time formats, state types, and coordinate systems are
automatically converted to those required by destination.
Options
Option Description
destina- The resource to populate from the data source.
tion
Accepted Data Types Spacecraft
Allowed Values any Spacecraft resource
Default Value (None)
Required yes
Interfaces GUI, script
source The data source from which to obtain data.
The following options are available when source is a FileInterface and the Format is
“TVHF_ASCII”:
686
Input/Output Reference Guide
GUI
The Set GUI is a very simple text box that lets you type the command directly. By default,
it has no arguments, so you must finish the command yourself.
Examples
BeginMissionSequence
Read a TVHF file and use it to set only the epoch and the Cartesian state.
BeginMissionSequence
687
Reference Guide Input/Output
Toggle
Allows you to turn data output off or on
Script Syntax
OutputNames
OutputNames is the list of subscribers that are to be toggled.
When multiple subscribers are being toggled in the OutputNames,
then they need to be separated by a space.
Arg
Arg option allows you to turn off or on the data output to
the selected subscribers listed in the OutputNames.
Description
The Toggle command allows you to turn data output off or on for the subscribers that you
select such as ReportFile, XYPlot, OrbitView, GroundTrackPlot and EphemerisFile.
GMAT allows you to insert Toggle command into the Mission tree at any location and
data output can be turned off or on at any point in your mission. Toggle command can
be used through GMAT’s GUI or the script interface.
Options
Option Description
OutputNames The Toggle option allows the user to assign subscribers such as
ReportFile, XYPlot, OrbitView, GrounTrackPlot or Ephemer-
isFile to be toggled. When more than one subscriber is being
toggled, they need to be separated by a space.
688
Input/Output Reference Guide
GUI
Remarks
Examples
This example shows how to use Toggle Off and Toggle On commands while using the
XYPlot resource. Spacecraft’s position magnitude and semi-major-axis are plotted as
a function of time. XYPlot is turned off for the first 2 days of the propagation:
BeginMissionSequence
689
Reference Guide Input/Output
This example shows how to use Toggle Off and Toggle On commands while using the
ReportFile resource. Spacecraft’s cartesian position vector is reported to the report file.
Report file is turned off for the first day of the propagation:
BeginMissionSequence
This example shows how to toggle multiple subscribers. Toggle Off and Toggle On
commands are used on multiple subscribers like ReportFile, XYPlot and Ephemeris-
File. Subscribers are turned off for first 3 days of the propagation:
BeginMissionSequence
690
Input/Output Reference Guide
UpdateDynamicData
A command used in tandem with a DynamicDataDisplay to update the data being
shown in the display table on the GUI.
Description
The UpdateDynamicData command is used to specify when in a mission sequence a
DynamicDataDisplay will update its data to their current values. This allows the user
to control what points in the mission sequence they will see the new data. The user
may also specify certain data within a DynamicDataDisplay to update rather than the
entire table if desired. This command can be placed at any desired point in a mission
sequence and multiple can be used on the same DynamicDataDisplay.
Fields
Field Description
DynamicTableName Field to set which DynamicDataDisplay object will be updated
by this command
GUI
The figure below shows the UpdateDynamicData using the basic command GUI panel:
691
Reference Guide Input/Output
Examples
BeginMissionSequence
Propagate DefaultProp(DefaultSC) (DefaultSC.ElapsedSecs = 12000.0);
UpdateDynamicData myDisplay;
Propagate DefaultProp(DefaultSC) (DefaultSC.ElapsedSecs = 24000.0);
UpdateDynamicData myDisplay DefaultSC.X;
692
Input/Output Reference Guide
Write
Writes data to one or more of the following three destinations: the message window, the
log file, or a ReportFile resource.
Script Syntax
Write ResourceList [{ MessageWindow = true, LogFile = false,
Style = Concise, ReportFile = myReport }]
Description
The Write command allows you to selectively write information to GMAT output des-
tinations during execution. The Write command can aid in automated QA by writing
data to the GMAT log file or ReportFile resource for an independent QA systems to
process, or to write data to the message window to aid in troubleshooting and debugging
script configurations. This command can also be used to write information on attached
resources in order to see how paramters change throughout a mission.
Options
Option Description
LogFile Flag to specify if output should be written to the log file
693
Reference Guide Input/Output
Option Description
ResourceList A list of one or more GMAT resources and/or resource fields
whose values we wish to output
GUI
In the example below, the value of myVar would be written to the message window only.
Examples
Below are some sample scripts using the Write command with the output shown in bold
font.
myVar = 3.1415
694
Input/Output Reference Guide
BeginMissionSequence
7100
3.1415
'This is my string'
Write myArray
10
01
Write myArray(2,2)
myString2 = sprintf('%10.7f',Sat.X)
Write myString2 {Style = Script}
695
Reference Guide Input/Output
myString2 = '7100.0000000';
Write myString2
'7100.0000000'
The example below writes out a report that can be read into a GMAT script using the
#Include capability.
BeginMissionSequence;
The example below writes out parameters for the fuel tank which is an attached resource
to the spacecraft after a manuever is complete. The output is shown below the script,
note the decrease in fuel mass was written using the Write command this way.
BeginMissionSequence;
Maneuver ImpulsiveBurn1(Sat);
Propagate DefaultProp(Sat) {Sat.ElapsedSecs = 12000};
Write Sat.ChemicalTank1
ChemicalTank1.AllowNegativeFuelMass = true;
ChemicalTank1.FuelMass = 386.9462121211856;
ChemicalTank1.Pressure = 1500;
ChemicalTank1.Temperature = 20;
ChemicalTank1.RefTemperature = 20;
ChemicalTank1.Volume = 0.75;
ChemicalTank1.FuelDensity = 1260;
ChemicalTank1.PressureModel = 'PressureRegulated';
System
696
Input/Output Reference Guide
Color
Color support in GMAT resources and commands
Description
GMAT lets you assign different colors to orbital trajectory segments that are drawn
by Spacecraft, CelestialBody, LibrationPoint and Barycenter resources. You can
also assign unique colors to Spacecraft orbital trajectory segments by setting colors
through the Propagate command. The orbital trajectories of these resources are drawn
using the OrbitView 3D graphics resource. Additionally, GMAT allows you set colors
on GroundStation facilities that are drawn on a spacecraft’s ground track plot created
by GroundTrackPlot 2D graphics resource.
In addition to setting colors on orbital trajectory segments of the following five re-
sources and single command: Spacecraft, CelestialBody, LibrationPoint, Barycen-
ter, GroundStation and Propagate, GMAT also allows you to assign colors to perturb-
ing trajectories that may be drawn by the above five resources. These perturbing trajec-
tories are drawn during iterative processes such as differential correction or optimization.
The above five resources and single Propagate command each have a common field
called OrbitColor. The OrbitColor field is used to set colors on orbital trajectory seg-
ments drawn by these resources and single command. Similarly, these five resources
also have a common field called TargetColor. The Propagate command does not have
a TargetColor field. The TargetColor field of these five resources can be used to set
colors on perturbing trajectories that may be drawn during iterative processes.
You can set colors on the above five resources and Propagate command either via
the GUI or script interface of GMAT. Setting colors on these five resources and single
command via the GUI mode is very easy: After opening any of the five resources or
Propagate command, you can choose colors for OrbitColor field by clicking on any
available colors from Orbit Color selectbox. Similarly, for the five resources, you can
select colors for the TargetColor field by choosing any available colors from the Target
Color selectbox. See the GUI section below that walks you through an example of how
to select colors through the GUI mode.
There are two ways to set colors on both OrbitColor and TargetColor fields via GMAT’s
script mode. The available colors are identified through a string or a three digit integer
array. You can input color of your choice by either entering a color’s ColorName or
its corresponding RGB triplet value. The table below shows a list of 75 colors that are
available for you to select from. Each row of the table lists an available color's Color-
Name and an equivalent RGB triplet value. Refer to the Fields section of the above five
resources and Propagate command's Options section to learn more about OrbitColor
and TargetColor fields and how to set colors. Also see the Remarks section below for
additional script snippets that show how to assign colors through either ColorName or
RGB triplet value input method for the above five resources and single command.
697
Reference Guide Input/Output
698
Input/Output Reference Guide
699
Reference Guide Input/Output
GUI
In the Visualization window, you will see Orbit Color and Target Color Select boxes. You
can choose colors for OrbitColor and TargetColor fields by clicking on the Orbit Color
and Target Color select boxes respectively. For example, clicking either on the Orbit
Color or Target Color select box opens the Color panel seen below. Using this Color
panel, you can select basic colors, create custom colors of your choice and add custom
colors to the list of available colors.
700
Input/Output Reference Guide
Selecting colors on Propagate command’s OrbitColor option through the GUI mode is
also very easy. Open any Propagate command. Below is screenshot of GMAT’s default
Propagate command:
In GMAT, the default orbit color on any Propagate command is the color that is set on
Spacecraft resource’s OrbitColor field (i.e. Spacecraft.OrbitColor). Whenever you do
not set a unique color on the Propagate command's OrbitColor option, hence the color
on the Propagate command will always be the color that is set on Spacecraft object's
OrbitColor field.
701
Reference Guide Input/Output
To set your own unique colors to the Propagate command, click and check the Override
Color For This Segment box. This makes the Orbit Color select box active. Clicking
on the Orbit Color select box opens the Color panel shown below:
Using this Color panel, you can select basic colors, create custom colors of your choice
and add custom colors to the list of available colors and set them on the Propagate
command’s OrbitColor option.
Remarks
Configuring Orbit and Target Colors on Spacecraft Resource
You can set unique colors of your choice on orbital trajectories of a Spacecraft by
assigning colors to Spacecraft object’s OrbitColor field. As long as you do not reset or
reassign orbit color on the Propagate command, then all spacecraft trajectory colors that
GMAT draws will be the same color that you first set on Spacecraft object’s OrbitColor
field. The default color on Spacecraft object’s OrbitColor field is set to red. With this
default setting of red color to OrbitColor field, all Spacecraft trajectories will be drawn
in red color as long as you do not reset orbit color on any of the Propagate commands.
Now for example, if you want all Spacecraft orbital trajectories to be drawn in yellow
color alone, the script snippet below demonstrates two acceptable methods of setting
yellow color to Spacecraft object’s OrbitColor field:
Similarly, setting colors of your choice on spacecraft’s perturbing trajectories that may
be drawn during iterative processes such as differential correction or optimization can be
702
Input/Output Reference Guide
done by assigning unique colors to Spacecraft object’s TargetColor field. Setting colors
on the TargetColor field is only useful when you want to assign colors on perturbed
trajectories generated during iterative processes. Both OrbitColor and TargetColor
fields of Spacecraft object can also be used and modified in the Mission Sequence as
well. The example script snippet below shows two acceptable methods of setting blue
violet color to Spacecraft resource’s TargetColor field:
The list of available colors that you can set on Spacecraft object's OrbitColor and Tar-
getColor fields are tabulated in the table in Description section. You can assign colors
either via the ColorName or RGB triplet value input method. Also see the Examples
section below for complete sample scripts that show how to use Spacecraft object’s
OrbitColor and TargetColor fields.
GMAT allows you to set unique colors of your choice on GroundStation object's Orbit-
Color or TargetColor fields. The list of available colors that you can set are tabulated
in the table in Description section. You can assign colors either via the ColorName or
RGB triplet value method. The custom ground station facility that you create shows up
on the ground track plot of a spacecraft that is drawn on a 2D texture map of a central
body. The colors that are assigned on GroundStation object's TargetColor field are
only used whenever GroundStation object is drawn during iterative processes such as
differential correction or optimization. The script snippet below shows how to set colors
on GroundStation's OrbitColor and TargetColor fields using either the ColorName
or RGB method:
See the Examples section below for complete sample script that shows how to use
GroundStation object’s OrbitColor field.
GMAT allows you to set available colors to orbits of built-in or custom-defined celestial
bodies. GMAT contains built-in models for the Sun, the 8 planets, Earth's moon, and
Pluto. You can create a custom CelestialBody resource to model a planet, asteroid,
comet, or moon. The orbit colors on CelestialBody objects are set through the Orbit-
Color field. You can also set colors to a celestial body's perturbing trajectories that are
703
Reference Guide Input/Output
See the Examples section below for complete sample scripts that show how to use
CelestialBody object’s OrbitColor field
GMAT lets you set available colors on an orbit that is drawn by a libration point. In order
to see orbital trajectory that a libration point draws in space, you must draw the Lagrange
points in an inertial space. The orbit colors on LibrationPoint resources are set through
the OrbitColor field. GMAT also allows you to set colors on a libration point's perturb-
ing trajectories that are drawn during iterative processes such as differential correction
or optimization. Setting colors on perturbing libration point trajectories is done via the
TargetColor field. Setting colors on the TargetColor field is only useful whenever per-
turbed libration point trajectories are generated during iterative processes. The avail-
able colors that can be set on OrbitColor and TargetColor fields are tabulated in the
table shown in the Description section. You can either use the ColorName or RGB triplet
value method to assign colors on OrbitColor and TargetColor fields. These two fields
of LibrationPoint resource can also be used and modified to set colors in the Mission
Sequence as well. The script snippet below shows how to set colors on OrbitColor and
TargetColor fields using either the ColorName or RGB method:
704
Input/Output Reference Guide
See the Examples section below for complete sample script that shows how to use
LibrationPoint object’s OrbitColor field.
In GMAT, you can assign available colors on an orbit that is drawn by a barycenter
point. Since a barycenter is a center of mass of a set of celestial bodies, hence in or-
der to see its orbital trajectory, the barycenters must be plotted in an inertial space.
You can set orbit colors on GMAT’s both built-in SolarSystemBarycenter resource or
custom barycenters that you create through the Barycenter object. The orbit colors on
Barycenter resources are set through the OrbitColor field. GMAT also allows you to set
colors on a barycenter's perturbing trajectories that are drawn during iterative processes
such as differential correction or optimization. Setting colors on perturbing barycenter
trajectories is done via the TargetColor field. Setting colors on the TargetColor field is
only useful whenever you want to set different colors on the perturbing trajectories. The
available colors that can be set on OrbitColor and TargetColor fields are tabulated in
the table shown in the Description section. You can either use the ColorName or RGB
triplet value color input method to assign colors on OrbitColor and TargetColor fields.
These two fields of Barycenter resource can also be used and modified in the Mission
Sequence as well. The script snippet below shows how to set colors on OrbitColor and
TargetColor fields using either the ColorName or RGB method:
See the Examples section below for complete sample script that shows how to use
Barycenter object’s OrbitColor field.
In GMAT, you can set unique colors on different Spacecraft trajectory segments by set-
ting orbital colors on Propagate commands. If you do not select unique colors on each
Propagate command, then by default, the color on all Propagate commands is seeded
from color that is set on Spacecraft object's OrbitColor field. You can set orbit colors on
each Propagate command through the OrbitColor option. The available colors that can
be set on Propagate command's OrbitColor option are tabulated in the table shown in
the Description section. You can either use the ColorName or RGB triplet value input
method to assign colors on OrbitColor option. The script snippet below shows how to
set colors on OrbitColor option using either the ColorName or RGB method:
% ColorName method:
Propagate aProp(aSat) {aSat.ElapsedSecs = 500, OrbitColor = Gold}
% or RGB method:
705
Reference Guide Input/Output
See the Examples section below for complete sample scripts that show how to use
Propagate command’s OrbitColor option.
Examples
Set non-default sky blue color to Spacecraft object’s OrbitColor field through both Col-
orName and RGB triplet value methods. Both methods draw spacecraft orbital trajectory
in sky blue color. Note: Since orbit color was not re-set in the Propagate command,
hence entire spacecraft orbital trajectory is drawn in sky blue color:
BeginMissionSequence
% or
BeginMissionSequence
Set unique colors on Spacecraft object’s OrbitColor field multiple times through com-
bination of both ColorName and RGB method. Notice that Spacecraft.OrbitColor is
used and modified in the Mission Sequence as well:
BeginMissionSequence
706
Input/Output Reference Guide
Set non-default yellow color on Spacecraft object’s TargetColor field. Setting color on
the TargetColor field is only useful when perturbed trajectories are generated during
iterative processes such as differential correction. Note yellow color was set via the
ColorName method. It could’ve been also set through the RGB triplet value method as
well.
BeginMissionSequence
Target aDC;
Vary aDC(TOI.Element1 = 0.24, {Perturbation = 0.001, Lower = 0.0, ...
Upper = 3.14159, MaxStep = 0.5})
Maneuver TOI(aSat);
Propagate aProp(aSat) {aSat.Earth.Apoapsis}
Achieve aDC(aSat.Earth.RMAG = 20000)
EndTarget
Set non-default colors on multiple GroundStation objects through the OrbitColor field.
The colors are assigned through combination of both ColorName and RGB input meth-
ods:
707
Reference Guide Input/Output
aGroundStation.StateType = Spherical
aGroundStation.Latitude = 45
aGroundStation.OrbitColor = Black
aGroundStation2.StateType = Spherical
aGroundStation2.Longitude = 20
aGroundStation2.OrbitColor = [165 42 42] % RGB value for Brown
aGroundStation3.StateType = Spherical
aGroundStation3.Latitude = 30
aGroundStation3.Longitude = 45
aGroundStation3.OrbitColor = [255 127 80] % RGB value for Coral
BeginMissionSequence
Set non-default colors on built-in celestial body orbits. In this example, CelestialBody
object’s OrbitColor field is assigned colors through mixture of both ColorName and
RGB triplet value methods. By default, GMAT sets Spacecraft orbit color to red:
Mercury.OrbitColor = Orange
Venus.OrbitColor = [255 255 0] % RGB value for Yellow
Earth.OrbitColor = Cyan
Mars.OrbitColor = [0 128 0] % RGB value for Green
708
Input/Output Reference Guide
anOrbitView.ViewPointReference = Sun
anOrbitView.ViewPointVector = [0 0 150000000]
anOrbitView.ViewDirection = Sun
anOrbitView.ViewScaleFactor = 6
anOrbitView.ViewUpCoordinateSystem = SunMJ2000Ec
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedDays = 150}
Set unique non-default orbit colors on built-in CelestialBody object’s OrbitColor field
multiple times through combination of both ColorName and RGB triplet value methods.
Notice that CelestialBody.OrbitColor is used and modified in the Mission Sequence
as well:
Mars.OrbitColor = Orange
BeginMissionSequence
709
Reference Guide Input/Output
Set unique non-default orbit colors on Earth-Sun L1 libration point orbit. ESL1 libration
point is plotted in an inertial space in order to see its orbit around sun.The orbit col-
ors on LibrationPoint object’s OrbitColor field are set multiple times through combina-
tion of both ColorName and RGB triplet value input methods. Notice that in this exam-
ple, LibrationPoint.OrbitColor is also set in the Mission Sequence as well. By default,
GMAT sets Spacecraft orbit color to red:
BeginMissionSequence
710
Input/Output Reference Guide
Set unique non-default orbit colors on Earth-Moon barycenter. The Earth Moon barycen-
ter had to be plotted in an inertial space in order to see its orbit around the sun. The orbit
colors on Barycenter object’s OrbitColor field are set multiple times through combina-
tion of both ColorName and RGB triplet value input methods. Notice that in this example,
Barycenter.OrbitColor is also set in the Mission Sequence as well. By default, GMAT
sets Spacecraft orbit color to red:
BeginMissionSequence
711
Reference Guide Input/Output
Name and RGB input methods. Notice that although by default, red color is set on
aSat.OrbitColor field, however since orbit color has been reset on all Propagate com-
mands, hence red color is never drawn:
BeginMissionSequence
BeginMissionSequence
Set colors on Propagate commands when used with Target resource and during dif-
ferential correction iterative process. This time, since colors have been set on all Prop-
agate commands, hence default color of red which is set on aSat.OrbitColor field is
never plotted. Also notice that although aSat.TargetColor is set to Yellow, but since
anOrbitView.SolverIterations is set to None, hence perturbed trajectories that are
drawn during iterative process are not plotted and only final solution is plotted
712
Input/Output Reference Guide
BeginMissionSequence
Target aDC;
Vary aDC(TOI.Element1 = 0.24, {Perturbation = 0.001, Lower = 0.0, ...
Upper = 3.14159, MaxStep = 0.5})
Maneuver TOI(aSat);
Propagate aProp(aSat) {aSat.Earth.Apoapsis, OrbitColor = Blue}
Achieve aDC(aSat.Earth.RMAG = 20000)
EndTarget
713
714
Reference Guide
Targeting/Parameter Optimization
This chapter contains documentation for Resources and Commands related to targeting
and parameter optimization.
Resources
715
Reference Guide Targeting/Parameter Optimiza-
tion
DifferentialCorrector
A numerical solver
Description
You must create and configure a DifferentialCorrector resource for your application
by setting numerical properties of the solver such as the algorithm type, the maximum
number of allowed iterations and choice of derivative method used to calculate the finite
differences. You can also select among different output options that show increasing
levels of information for each differential corrector iteration.
Fields
Field Description
Algorithm The numerical method used to solve the boundary value problem.
716
Targeting/Parameter Optimiza- Reference Guide
tion
Field Description
MaximumIterations Sets the maximum number of nominal passes the Differential-
Corrector is allowed to take during the attempt to find a solution.
If the maximum iterations is reached, GMAT exits the target loop
and continues to the next command in the mission sequence. In
this case, the objects retain their states as of the last nominal
pass through the targeting loop.
717
Reference Guide Targeting/Parameter Optimiza-
tion
Field Description
ShowProgress When the ShowProgress field is set to true, then data illustrating
the progress of the differential correction process are written to
the message window and the ReportFile. The message window
is updated with information on the current control variable values
and the contraint variances. When the ShowProgress field is
set to false, no information on the progress of the differential cor-
rection process is displayed to the message window or written to
the ReportFile.
GUI
The DifferentialCorrector dialog box allows you to specify properties of a Differential-
Corrector such as the numerical algorithm, maximum iterations, choice of derivative
method used to calculate the finite differences, and choice of reporting options.
Remarks
Supported Algorithm Details
GMAT supports several algorithms for solving boundary value problems including New-
ton Raphson, Broyden, and Modified Broyden. These algorithms use finite differenc-
718
Targeting/Parameter Optimiza- Reference Guide
tion
ing or other numerical approximations to compute the Jacobian of the constraints and
independent variables. The default algorithm is currently NewtonRaphson. Brodyen’s
method and ModifiedBroyden usually take more iterations but fewer function evalua-
tions than NewtonRaphson and so are often faster. A description of each algorithm is
provided below. We recommend trying different algorithm options for your application to
determine which algorithm provides the best balance of performance and robustness.
Newton-Raphson
Broyden
Broyden’s method uses the slope between state iterations as an approximation of the
first derivative instead of numerically calculating the first derivative using finite differ-
encing. This results in substantially fewer function evaluations. The Broyden iterate is
updated using the following equation.
ModifiedBroyden
The modified Broyden’s method updates the inverse of the Jacobian matrix to avoid nu-
merical issues in matrix inversion when solving near singular problems. Like Broyden’s
method, it requires fewer function evaluations than the NewtonRaphson algorithm. The
inverse of the Jacobian, H, is updated using the following equation,
where
The DifferentialCorrector object can only be used in the context of targeting-type com-
mands. Please see the documentation for Target, Vary, and Achieve for more infor-
mation and worked examples.
719
Reference Guide Targeting/Parameter Optimiza-
tion
Examples
BeginMissionSequence
Propagate aProp(aSat){aSat.Periapsis}
Target aDC
EndTarget
To see further examples for how the DifferentialCorrector object is used in conjunction
with Target, Vary, and Achieve commands to solve orbit problems, see the Target
command examples.
720
Targeting/Parameter Optimiza- Reference Guide
tion
FminconOptimizer
The Sequential Quadratic Programming (SQP) optimizer, fmincon
Description
Fields
Field Description
DiffMaxChange Upper limit on the perturbation used in MATLAB's finite differenc-
ing algorithm. For fmincon, you don't specify a single perturbation
value, but rather give MATLAB a range, and it uses an adaptive
algorithm that attempts to find the optimal perturbation.
721
Reference Guide Targeting/Parameter Optimiza-
tion
Field Description
MaxFunEvals Specifies the maximum number of cost function evaluations used
in an attempt to find an optimal solution. This is equivalent to
setting the maximum number of passes through an optimization
loop in a GMAT script. If a solution is not found before the max-
imum function evaluations, fmincon outputs an ExitFlag of zero,
and GMAT continues.
722
Targeting/Parameter Optimiza- Reference Guide
tion
Field Description
ShowProgress Determines whether data pertaining to iterations of the solver is
both displayed in the message window and written to the report
specified by the ReportFile field. When ShowProgress is true,
the amount of information contained in the message window and
written in the report is controlled by the ReportStyle field.
GUI
723
Reference Guide Targeting/Parameter Optimiza-
tion
and then select SQP (fmincon). This will create a new FminconOptimizer resource,
SQP1. Double-click on SQP1 to bring up the FminconOptimizer dialog box shown
below.
Remarks
This optimizer is only available if you have access to both MATLAB and MATLAB's
Optimization toolbox. GMAT contains an interface to the fmincon optimizer and it will
appear to you that fmincon is a built in optimizer in GMAT. Field names for this resource
have been copied from those used in MATLAB’S optimset function for consistency with
MATLAB in contrast with other solvers in GMAT.
GMAT Stop Button Does Not work, in Some Situations, When Using Fmincon
Sometimes, when developing GMAT scripts, you may inadvertently create a situation
where GMAT goes into an inifinite propagation loop. The usual remedy for this situation
is to apply the GMAT Stop button. Currently, however, if the infinite loop occurs within
an Optimize sequence using fmincon, there is no way to stop GMAT and you have to
shut GMAT down. Fortunately, there are some procedures you can employ to avoid this
situation. You should use multiple stopping conditions so that a long propagation cannot
occur. For example, if fmincon controls variable, myVar, and we know myVar should
never be more than 2, then do this.
724
Targeting/Parameter Optimiza- Reference Guide
tion
Examples
725
Reference Guide Targeting/Parameter Optimiza-
tion
SNOPT
The Sequential Quadratic Programming (SQP) optimizer, SNOPT
Description
Fields
Field Description
MajorFeasibilityTol- Specifies how accurately the nonlinear constraints should be
erance satisfied.
726
Targeting/Parameter Optimiza- Reference Guide
tion
Field Description
MajorOptimalityTol- Specifies the final accuracy of the dual variables. See the
erance SNOPT user guide for further details.
727
Reference Guide Targeting/Parameter Optimiza-
tion
Field Description
ReportStyle Determines the amount and type of data written to the message
window and to the report specified by field ReportFile for each
iteration of the solver (When ShowProgress is true). Current-
ly, the Normal, Debug, and Concise options contain the same
information: the values for the control variables, the constraints,
and the objective function. In addition to this information, the
Verbose option also contains values of the optimizer-scaled
control variables.
728
Targeting/Parameter Optimiza- Reference Guide
tion
Field Description
TotalIterationsLimit The maximum number of minor iterations allowed.
GUI
The SNOPT dialog box allows you to specify properties of a SNOPT such as as maxi-
mum iterations, cost function tolerance, feasibility tolerance, choice of reporting options,
and choice of whether or not to use the central difference derivative method.
To create a SNOPT resource, navigate to the Resources tree, expand the Solvers
folder, highlight and then right-click on the Optimizers sub-folder, point to Add and
then select SNOPT. This will create a new SNOPT resource, SNOPT1. Double-click on
SNOPT1 to bring up the SNOPT dialog box shown below.
729
Reference Guide Targeting/Parameter Optimiza-
tion
Remarks
GMAT currently uses SNOPT 7.2-12.2. This optimizer is not included as part of the
nominal GMAT installation and is only available if you have created and installed the
SNOPT plug-in or obtained SNOPT from the vendor.
The Specs file contains a list of options and values in the following general form:.
Begin options
Iterations limit 500
Minor feasibility tolerance 1.0e-7
Solution Yes
End options
The file starts with the keyword Begin and ends with End. The file is in free format. Each
line specifies a single option, using one or more items as follows:
The items may be entered in upper or lower case or a mixture of both. Some of the
keywords have synonyms, and certain abbreviations are allowed, as long as there is no
ambiguity. Blank lines and comments may be used to improve readability. A comment
begins with an asterisk (*) anywhere on a line. All subsequent characters on the line are
ignored. The Begin line is echoed to the Summary file.
For a complete list of SNOPT options, see the SNOPT user guide.
When using SNOPT, the Upper and Lower bounds in the Vary commands are required
fields. By setting these values appropriately for your problem, you reduce the likelihood
that SNOPT will try values that are unphysical or that can result in numerical singularities
in the physical models. It is important to set bounds carefully when using SNOPT.
Aditionally, SNOPT is quite senstive to scaling and care must be taken to provide accept-
able values of AdditiveScaleFactor and MultiplicativeScaleFactor in the Vary com-
mands. When using SNOPT, derivatives are computed by SNOPT via the optimizer's
built-in finite differencing. If an optimization problem is not appropriately scaled, opti-
mization may fail, or take an un-nesessarily long time. Note that SNOPT has built-in
scaling options that can be set via the Specs file and are described in further detail in
the SNOPT user guide.
730
Targeting/Parameter Optimiza- Reference Guide
tion
Warning
GMAT's Vary command is a generic interface designed to support many op-
timizers and not all settings supported by the Vary command are supported
by SNOPT. See the Vary command documentation for details on the which
Vary command settings are supported by SNOPT.
The SNOPT resource can only be used in the context of optimization-type commands.
Please see the documentation for Optimize, Vary, NonlinearConstraint, and Minimize
for more information and worked examples.
Examples
A simple mathematical optimization problem using SNOPT.
Create Variable X1 X2 J G
BeginMissionSequence
731
Reference Guide Targeting/Parameter Optimiza-
tion
NonlinearConstraint NLP(G<=8)
EndOptimize
732
Targeting/Parameter Optimiza- Reference Guide
tion
VF13ad
The Sequential Quadratic Programming (SQP) optimizer, VF13ad
Description
Fields
Field Description
FeasibilityToler- Specifies the accuracy to which you want constraints to be sat-
ance isfied.
733
Reference Guide Targeting/Parameter Optimiza-
tion
Field Description
ReportStyle Determines the amount and type of data written to the message
window and to the report specified by field ReportFile for each
iteration of the solver (When ShowProgress is true). Current-
ly, the Normal, Debug, and Concise options contain the same
information: the values for the control variables, the constraints,
and the objective function. In addition to this information, the
Verbose option also contains values of the optimizer-scaled
control variables.
734
Targeting/Parameter Optimiza- Reference Guide
tion
Field Description
UseCentralDiffer- Allows you to choose whether or not to use central differencing
ences for numerically determining the derivative. For the default, 'false'
value of this field, forward differencing is used to calculate the
derivative.
GUI
The VF13ad dialog box allows you to specify properties of a VF13ad such as maximum
iterations, cost function tolerance, feasibility tolerance, choice of reporting options, and
choice of whether or not to use the central difference derivative method.
To create a VF13ad resource, navigate to the Resources tree, expand the Solvers
folder, highlight and then right-click on the Optimizers sub-folder, point to Add and
then select VF13ad. This will create a new VF13ad resource, VF13ad1. Double-click on
VF13ad1 to bring up the VF13ad dialog box shown below.
Remarks
This optimizer is not included as part of the nominal GMAT installation and is only avail-
able if you have created and installed the VF13ad plug-in.
735
Reference Guide Targeting/Parameter Optimiza-
tion
The VF13ad resource can only be used in the context of optimization-type commands.
Please see the documentation for Optimize, Vary, NonlinearConstraint, and Minimize
for more information and worked examples.
Examples
For an example of how a VF13ad resource can be used within an Optimization se-
quence, see the Optimize command examples.
736
Targeting/Parameter Optimiza- Reference Guide
tion
Yukon
The Sequential Quadratic Programming (SQP) optimizer, Yukon
Description
Yukon performs nonlinear constrained optimization and supports both linear and non-
linear constraints. To use this solver, you must configure the solver options including
convergence criteria, maximum iterations, and gradient computation method. In the mis-
sion sequence, you implement an optimizer such as Yukon by using an Optimize/En-
dOptimize sequence. Within this sequence, you define optimization variables by using
the Vary command, and define cost and constraints by using the Minimize and Non-
linearConstraint commands respectively.
Fields
Field Description
FeasibilityToler- The tolerance on the maximum non-dimensional constraint vio-
ance lation that must be satisfied for convergence.
737
Reference Guide Targeting/Parameter Optimiza-
tion
Field Description
HessianUp- The method used to approximate the Hessian of the Lagrangian.
dateMethod These methods are based on the BFGS but are more robust to
possible numerical issues that can occur using BFGS updates
with finite precision arithmetic.
738
Targeting/Parameter Optimiza- Reference Guide
tion
Field Description
OptimalityToler- The tolerance on the change in the gradient of the Lagrangian
ance to trigger convergence. If the gradient of the Lagrangian is less
than FeasibilityTolerance and the maximum (non-dimensional)
constraint violation is less than Optimality Tolerance, then the
algorithm terminates.
739
Reference Guide Targeting/Parameter Optimiza-
tion
Field Description
ShowProgress Determines whether data pertaining to iterations of the solver is
both displayed in the message window and written to the report
specified by the ReportFile field. When ShowProgress is true,
the amount of information contained in the message window and
written in the report is controlled by the ReportStyle field.
GUI
The Yukon dialog box allows you to specify properties of a Yukon such as as maximum
iterations, cost function tolerance, feasibility tolerance, choice of reporting options, and
choice of whether or not to use the central difference derivative method.
To create a Yukon resource, navigate to the Resources tree, expand the Solvers fold-
er, highlight and then right-click on the Optimizers sub-folder, point to Add and then
select Yukon. This will create a new Yukon resource, Yukon1. Double-click on Yukon1
to bring up the Yukon dialog box shown below.
740
Targeting/Parameter Optimiza- Reference Guide
tion
Remarks
Yukon Optimizer Availability
The Yukon resource can only be used in the context of optimization-type commands.
Please see the documentation for Optimize, Vary, NonlinearConstraint, and Minimize
for more information and worked examples.
Examples
Create a Yukon resource named Yukon1.
741
Reference Guide Targeting/Parameter Optimiza-
tion
Commands
742
Targeting/Parameter Optimiza- Reference Guide
tion
Achieve
Specify a goal for a Target sequence
Script Syntax
Description
The Achieve command is used in conjunction with the Target command as part of the
Target sequence. The purpose of the Achieve command is to define a goal for the
targeter (currently, the differential corrector is the only targeter available within a Target
sequence) to achieve. To configure the Achieve command, you specify the goal object,
its corresponding desired value, and an optional tolerance so the differential corrector
can find a solution. The Achieve command must be accompanied and preceded by a
Vary command in order to assist in the targeting process.
Options
Option Description
Arg1 Specifies the desired value for the Goal after the DifferentialCorrector
has converged.
743
Reference Guide Targeting/Parameter Optimiza-
tion
Option Description
Goal Allows you to select any single element user defined parameter, except
a number, as a targeter goal.
GUI
You use an Achieve command, which is only valid within a Target sequence, to define
your desired goal. More than one Achieve command may be used within a Target
command sequence. The Achieve command dialog box, which allows you to specify
the targeter, goal object, goal value, and convergence tolerance, is shown below.
Remarks
Command Interactions
A Target sequence must contain at least one Vary and one Achieve command.
744
Targeting/Parameter Optimiza- Reference Guide
tion
Vary com- Associated with any Achieve command is at least one Vary command.
mand The Vary command identifies the control variable used by the targeter. The
goal specified by the Achieve command is obtained by varying the control
variables.
Examples
As mentioned above, an Achieve command only occurs within a Target sequence. See
the Target command help for examples showing the use of the Achieve command.
745
Reference Guide Targeting/Parameter Optimiza-
tion
Minimize
Define the cost function to minimize
Script Syntax
Description
Options
Option Description
ObjectiveFunction Specifies the objective function that the optimizer will try to min-
imize.
GUI
746
Targeting/Parameter Optimiza- Reference Guide
tion
Double click on Minimize1 to bring up the Minimize command dialog box shown below..
You must provide two inputs for the Minimize command dialog box above:
• Choice of optimizer.
• Object (and associated variable) to be minimized. You can input an object directly or
you can click the Edit button to the right of this field to select the type of object from
three possible choices, Spacecraft, Variable, or Array.
Remarks
An Optimization sequence must contain one or more Vary commands. Vary commands
must occur before any Minimize or NonlinearConstraint commands.
Command Interactions
Vary command Every Optimization sequence must contain at least one Vary
command. Vary commands are used to define the control vari-
ables associated with an Optimization sequence.
NonlinearCon- NonlinearConstraint commands are used to define the con-
straint command straints (i.e., goals) associated with an Optimization sequence.
Note that multiple NonlinearConstraint commands are allowed
within an Optimization sequence.
Optimize command A Minimize command can only occur within an Optimize/En-
dOptimize command sequence.
747
Reference Guide Targeting/Parameter Optimiza-
tion
Examples
As mentioned above, the Minimize command only occurs within an Optimize sequence.
See the Optimize command help for complete examples showing the use of the Min-
imize command.
748
Targeting/Parameter Optimiza- Reference Guide
tion
NonlinearConstraint
Specify a constraint used during optimization
Script Syntax
Description
Options
Option Description
LHS Allows you to select any single element user defined parameter,
except a number, to define the constraint variable. The constraint
function is of the form LHS Operator RHS
749
Reference Guide Targeting/Parameter Optimiza-
tion
Option Description
RHS Allows you to select any single element user defined parame-
ter, including a number, to specify the desired value of the con-
straint variable. The constraint function is of the form LHS Op-
erator RHS
GUI
You must provide four inputs for the NonlinearConstraint command dialog box above:
• Choice of Optimizer.
• Constraint Object. Click the Edit button to the right of this field to select the type of
constraint object from three possible choices, Spacecraft, Variable, or Array.
• Logical operator. Select one from three choices, =, <=, or >=.
• Constraint Value.
Note that Inputs 2-4 define a logical expression. In the example above, we have:
DefaultSC.SMA = 7000
750
Targeting/Parameter Optimiza- Reference Guide
tion
Remarks
An Optimization sequence must contain one or more Vary commands. Vary commands
must occur before any Minimize or NonlinearConstraint commands.
Command Interactions
Examples
751
Reference Guide Targeting/Parameter Optimiza-
tion
Optimize
Solve for condition(s) by varying one or more parameters
Script Syntax
Description
The Optimize command in GMAT allows you to solve optimization problems by using
a solver object. Currently, you can choose from one of two available solvers, the Fmin-
conOptimizer solver object available to all GMAT users with access to the Matlab op-
timization toolbox and the VF13ad solver object plug-in that you must install yourself.
You use the Optimize and EndOptimize commands to define an Optimize sequence
to determine, for example, the maneuver components required to raise orbit apogee to
42164 km while simultaneously minimizing the DeltaV required to do so. Optimize se-
quences in GMAT are applicable to a wide variety of problems and this is just one exam-
ple. Let’s define the quantities that you don’t know precisely, but need to determine, as
the Control Variables. We define the conditions that must be satisfied as the Constraints
and we define the quantity to be minimized (e.g., DeltaV) as the Objective function.
An Optimize sequence numerically solves a boundary value problem to determine the
value of the Control Variables required to satisfy the Constraints while simultaneously
minimizing the Objective function. As was the case for the Target/EndTarget command
sequence, you define your control variables by using Vary commands. You define the
constraints that must be satisfied by using the NonlinearConstraint command and you
define the objective function to be minimized by using the Minimize command. The Op-
timize/EndOptimize sequence is an advanced command. The examples later in this
section give a more detailed explanation.
752
Targeting/Parameter Optimiza- Reference Guide
tion
Options
Option Description
ApplyCorrections The ApplyCorrections GUI button replaces the initial guess val-
ues specified in the Vary commands with those computed by the
optimizer during a run. If the Optimize sequence converged, the
converged values are applied. If the Optimize sequence did not
converge, the last calculated values are applied. There is one sit-
uation where the action specified above, where the initial guess
values specified in the Vary commands are replaced, does not
occur. This happens when the initial guess value specified in the
Vary command is given by a variable.
753
Reference Guide Targeting/Parameter Optimiza-
tion
Option Description
SolveMode Specifies how the optimization loop behaves during mission ex-
ecution. When SolveMode is set to Solve, the optimization loop
executes and attempts to solve the optimization problem. When
SolveMode is set to RunInitialGuess, the Optimizer does not
attempt to solve the optimization problem and the commands in
the Optimize sequence execute using the initial guess values
defined in the Vary commands.
GUI
The Optimize command allows you to use an optimization process to solve problems.
To solve a given problem, you need to create a so-called Optimize sequence which
we now define. When you add an Optimize command to the mission sequence, an
EndOptimize command is automatically added as shown below.
In the example above, the Optimize command sequence is defined as all of the com-
mands between the Optimize1 and EndOptimize1 commands, inclusive. Although not
shown above, an Optimize command sequence must contain a Vary command which
is used to define the control variables that can be varied in order to help solve our prob-
lem. An Optimize command must also contain a Minimize command and/or one or
more NonlinearConstraint commands. You use a Minimize command to define a cost
function that you wish to minimize and you use the NonlinearConstraint command to
define either an equality or inequality constraint that you want to be satisfied at the end
of the optimization process.
Double click on the Optimize1 command above to open the Optimize command dialog
box, shown below, which allows you to specify your choice of Solver (i.e., your choice
of optimizer), Solver Mode, and Exit Mode. As described in the Remarks section, the
Optimize command dialog box also allows you to apply corrections to your Optimize
command sequence.
754
Targeting/Parameter Optimiza- Reference Guide
tion
If you set ShowProgressWindow to true, then a dynamic display is shown during op-
timization that contains values of variables and constraints as shown below.
Remarks
There are some functional similarities between the Target/EndTarget and Opti-
mize/EndOptimize command sequences. In both cases, we define Control Variables
and Constraints. For both Target and Optimize sequences, we use the Vary command
to define the Control Variables. For the Target sequence, we use the Achieve com-
755
Reference Guide Targeting/Parameter Optimiza-
tion
mand to define the constraints whereas, for an Optimize sequence, we use the Non-
linearConstraint command. The big difference between the Target and Optimize se-
quences is that the Optimize sequence allows for the minimization of an Objective func-
tion through the use of the Minimize command.
Command Interactions
Vary command Every Optimize sequence must contain at least one Vary com-
mand. Vary commands are used to define the control variables
associated with an Optimize sequence.
NonlinearCon- NonlinearConstraint commands are used to define the con-
straint command straints associated with an Optimize sequence. Note that multi-
ple NonlinearConstraint commands are allowed within an Op-
timize sequence.
Minimize command A Minimize command is used within an Optimize sequence to
define the Objective function that will be minimized. Note that an
Optimize sequence is allowed to contain, at most, one Minimize
command. (An Optimize sequence is not required to contain a
Minimize command)
Examples
Use an Optimize sequence with the fmincon solver object to find the point, (x, y), on the
unit circle with the smallest y value. Note that the use of the FminconOptimizer solver
assumes you have access to the Matlab optimization toolbox.
BeginMissionSequence
Optimize SQP1
Vary SQP1(x = 1)
Vary SQP1(y = 1)
Circle = x*x + y*y
NonlinearConstraint SQP1(Circle = 1)
Minimize SQP1(y)
EndOptimize
Similar to the example given in the Target command Help, use an Optimize sequence
to raise orbit apogee. In the Target command example, we had one control variable,
the velocity component of an ImpulsiveBurn object, and the single constraint that the
position vector magnitude at orbit apogee equals 42164. For this example, we keep
this control variable and constraint but we now add a second control variable, the true
anomaly of where the burn occurs. In addition, we ask the optimizer to minimize the
Delta-V cost of the burn. As expected, the best (DV minimizing) orbit location to perform
an apogee raising burn is near perigee (i.e., nearTA = 0). In this example, since the
force model in use in not perfectly two body Keplerian, the optimal TA value obtained is
close to but not exactly 0. Note that the use of the VF13ad solver object in this example
756
Targeting/Parameter Optimiza- Reference Guide
tion
assumes that you have installed this optional plug-in. Finally, report the convergence
status to a file.
BeginMissionSequence
Optimize VF13ad1
Vary VF13ad1(aSat.TA = 100, {MaxStep = 10})
Vary VF13ad1(aBurn.Element1 = 1, {MaxStep = 1})
Maneuver aBurn(aSat)
Propagate aPropagator(aSat) {aSat.Apoapsis}
GMAT ApogeeRadius = aSat.RMAG
NonlinearConstraint VF13ad1(ApogeeRadius=42164)
GMAT DVCost = aBurn.Element1
Minimize VF13ad1(DVCost)
EndOptimize
Report aReport VF13ad1.SolverStatus VF13ad1.SolverState
757
Reference Guide Targeting/Parameter Optimiza-
tion
Target
Solve for condition(s) by varying one or more parameters
Script Syntax
Note
See the section called “Remarks” and the section called “Description” for this
complex command. Multiple Vary and Achieve commands are permitted.
Script statements can appear anywhere in the Target sequence.
Description
The Target and EndTarget commands are used to define a Target sequence to de-
termine, for example, the maneuver components required to raise the orbit apogee to
42164 km. Another common targeting example is to determine the parking orbit orien-
tation required to align a lunar transfer orbit with the moon. Target sequences in GMAT
are general and these are just examples. Let’s define the quantities whose values you
don’t know precisely, but need to determine, as the control variables. Define the condi-
tions that must be satisfied as the constraints. A Target sequence numerically solves
a boundary value problem to determine the value of the control variables required to
satisfy the constraints. You define your control variables by using Vary commands and
you define the problems constraints using Achieve commands. The Target/EndTarget
sequence is an advanced command. The examples later in this section give additional
details.
758
Targeting/Parameter Optimiza- Reference Guide
tion
Options
Option Description
ApplyCorrections This GUI button replaces the initial guess values specified in the
Vary commands. If the Target sequence converged, the con-
verged values are applied. If the Target sequence did not con-
verge, the last calculated values are applied. There is one situ-
ation where the action specified above, where the initial guess
values specified in the Vary commands are replaced, does not
occur. This happens when the initial guess value specified in the
Vary command is given by a variable. See the Remarks section
of the help for additional details.
759
Reference Guide Targeting/Parameter Optimiza-
tion
Option Description
SolveMode Specifies how the Target sequence behaves during mission ex-
ecution. When SolveMode is set to Solve, the Target sequence
executes and attempts to solve the boundary value problem sat-
isfying the targeter constraints (i.e, goals). When SolveMode is
set to RunInitialGuess, the targeter does not attempt to solve
the boundary value problem and the commands in the Target
sequence execute using the initial guess values defined in the
Vary commands.
GUI
The Target command allows you to use a differential correction process to solve prob-
lems. To solve a given problem, you need to create a so-called Target sequence which
we now define. When you add a Target command to the mission sequence, an End-
Target command is automatically added as shown below.
In the example above, the Target command sequence is defined as all of the com-
mands between the Target1 and End Target1 commands, inclusive. Although not
shown above, a Target command sequence must contain both a Vary command and
an Achieve command. The Vary command is used to define the control variables which
can be varied in order to achieve a certain goal. The Achieve command is used to de-
fine the desired goal. In order for the Target aequence to be well formed, there must
be at least one Vary command before any Achieve commands, so that the variable
760
Targeting/Parameter Optimiza- Reference Guide
tion
defined in the Vary command can affect the goal specified in the subsequent Achieve
commands. Double click on Target1 command above to bring up the Target command
dialog box, shown below, which allows you to specify your choice of Solver (i.e., your
choice of DifferentialCorrector), Solver Mode, and Exit Mode. As described in the
Remarks section, the Target command dialog box also allows you to apply corrections
to your Target command sequence.
If you set ShowProgressWindow to true, then a dynamic display is shown during tar-
geting that contains values of variables and constraints as shown below.
Remarks
A Target/EndTarget sequence must contain at least one Vary command and at least
one Achieve Command. See the Vary and Achieve command sections for details on
the syntax for those commands. The First Vary command must occur before the first
Achieve command. Target commands must be be coupled with one and only one End-
Target command. Each Target command field in the curly braces is optional. You can
omit the entire list and the curly braces and the default values will be used for Target
configuration fields such as SolveMode and ExitMode.
GMAT Target sequences can solve square problems (the number of Control Variables
equals the number of constraints), over-determined problems (the number of Control
Variables is less than the number of constraints) and under-determined problems (the
761
Reference Guide Targeting/Parameter Optimiza-
tion
number of Control Variables is greater than the number of constraints). In any of these
cases, there may not be a solution and the type of solution found depends on the selec-
tion of the targeter (currently, only differential correctors are supported). Assuming a so-
lution to the problem exists and assuming certain mathematical conditions are satisfied,
there is often one solution for a square problem and many solutions to an under-deter-
mined problem. Problems with more goals (i.e., constraints) than variables may not have
a solution. If your problem is under-determined, consider using an Optimize sequence
to find an optimal solution in the space of feasible solutions.
Caution
If you configure a Target sequence and get the error “Rmatrix error: matrix is
singular”, then your control variables defined in the Vary commands do not
affect the constraints defined in the Achieve commands. A common mistake
in this case is that you forgot to apply a maneuver.
After the Target sequence has been run, you may choose to apply corrections by nav-
igating to the Mission tree, right-clicking the Target command to bring up the Target
window, and clicking the Apply Corrections button. The Apply Corrections button re-
places the initial guess values specified in the Vary commands . If the Target sequence
converged, the converged values are applied. If the Target sequence did not converge,
the last calculated values are applied. Note that the Apply Corrections feature is only
currently available through the GUI interface.
There is one situation where the action specified above, where the initial guess values
specified in the Vary commands are replaced, does not occur. This happens, as illus-
trated in the example below, when the initial guess value specified in the Vary command
is given by a variable. In this situation, the Apply Corrections button has no affect since
GMAT does not allow variables to be overwritten.
Command Interactions
Vary com- Every Target sequence must contain at least one Vary command. Vary
mand commands are used to define the control variables associated with a Tar-
get sequence.
Achieve Every Target sequence must contain at least one Achieve command.
command Achieve commands are used to define the goals associated with a Target
sequence.
762
Targeting/Parameter Optimiza- Reference Guide
tion
Examples
Use a Target sequence to solve for a root of an algebraic equation. Here we provide
an initial guess of 5 for the Control Variable (or independent variable) x, and solve for
the value of x that satisfies the Constraint y = 0, where y :=3*x^3 + 2*x^2 - 4*x + 8.
After executing this example you can look in the message window to see the solution
for the variable x. You can easily check that the value obtained does indeed satisfy the
constraint.
Create Variable x y
Create DifferentialCorrector aDC
BeginMissionSequence
Target aDC
Vary aDC(x = 5)
y = 3*x^3 + 2*x^2 - 4*x + 8
Achieve aDC(y = 0,{Tolerance = 0.0000001})
EndTarget
Use a Target sequence to raise orbit apogee. Here the control variable is the velocity
component of an ImpulsiveBurn object. The Constraint is that the position vector mag-
nitude at orbit apogee is 42164. Report the convergence status to a file.
BeginMissionSequence
Target aDC
Vary aDC(aBurn.Element1 = 1.0, {Upper = 3})
Maneuver aBurn(aSat)
Propagate aPropagator(aSat,{aSat.Apoapsis})
Achieve aDC(aSat.RMAG = 42164)
EndTarget
Report aReport aDC.SolverStatus aDC.SolverState
Similar to the previous example, we use a Target sequence to raise orbit apogee except
that this time we use a finite burn. Here the control variable is the duration of the Velocity
component of a FiniteBurn object. The Constraint is that the position vector magnitude
at orbit apogee is 12000. Additional detail on the example below can be found in the
Target Finite Burn to Raise Apogee tutorial.
763
Reference Guide Targeting/Parameter Optimiza-
tion
BeginMissionSequence
764
Targeting/Parameter Optimiza- Reference Guide
tion
Vary
Specifies variables used by a solver
Script Syntax
Vary SolverName(<UserSelectedControl>=InitialGuess,
[{[Perturbation=Arg1], [MaxStep=Arg2],
[Lower=Arg3], [Upper=Arg4],
[AdditiveScalefactor=Arg5], [MultiplicativeScalefactor=Arg6]}])
Description
The Vary command is used in conjunction with either the Target or the Optimize com-
mand. The Vary command defines the control variable used by the targeter or optimiz-
er. The Target or Optimize sequence then varies these control variables until certain
desired conditions are met. Every Target or Optimize sequence must contain at least
one Vary command.
Options
Option Description
AdditiveScaleFactor Number used to nondimensionalize the independent vari-
able. The solver sees only the nondimensional form of the
variable. The nondimensionalization is performed using
the following equation: xn = m (xd + a). (xn is the non-di-
mensional parameter. xd is the dimensional parameter. a=
additive scale factor. m= multiplicative scale factor.) Note
the nondimensionalization process occurs after the per-
turbation to the control variable has been applied. Thus,
xd represents a perturbed control variable.
765
Reference Guide Targeting/Parameter Optimiza-
tion
Option Description
InitialGuess Specifies the initial guess for the selected Variable
766
Targeting/Parameter Optimiza- Reference Guide
tion
Option Description
MultiplicativeScaleFactor Number used to nondimensionalize the independent vari-
able. The solver sees only the nondimensional form of the
variable. The nondimensionalization is performed using
the following equation: xn = m (xd + a). (xn is the non-di-
mensional parameter. xd is the dimensional parameter. a=
additive scale factor. m= multiplicative scale factor.) Note
the nondimensionalization process occurs after the per-
turbation to the control variable has been applied. Thus,
xd represents a perturbed control variable.
767
Reference Guide Targeting/Parameter Optimiza-
tion
Option Description
SolverName Allows you to choose which solver to assign to the Vary
command. In the context of a Target sequence, you will
choose a DifferentialCorrector object. In the context of
an Optimize sequence, you will choose either a Fmin-
conOptimizer or VF13ad object.
768
Targeting/Parameter Optimiza- Reference Guide
tion
Option Description
UserSelectedControl Allows you to select any single element user-de-
fined parameter, except a number, to vary. For exam-
ple, DefaultIB.V, DefaultIB.N, DefaultIB.Element1,
DefaultSC.TA, Array(1,1), and Variable are all valid
values. The three element burn vector or multidimension-
al Arrays are not valid values.
GUI
The Vary command, only valid within either a Target or an Optimize sequence, is used
to define the control variables which will be used to solve a problem. The Vary command
dialog box is shown below.
769
Reference Guide Targeting/Parameter Optimiza-
tion
Remarks
The Vary command is designed to work with all three of the GMAT targeters and opti-
mizers (Differential Corrector, fmincon, and VF13AD). The solvers, which are developed
by different parties, all work slightly differently and thus have different needs. The table
below shows which command options are available for a given solver.
The Vary syntax allows you to specify the value of an option even if a particular solver
would not use the information.
770
Targeting/Parameter Optimiza- Reference Guide
tion
As shown in the example below, the Vary command accepts repeated parameters.
The accepted best practice is not to repeat parameters in any given command. However,
for the Vary command, if you accidentally sets the same parameter multiple times, the
last setting takes precedence. Thus, in the example above, the perturbation step size
is set to 0.001.
If you wish to use thruster parameters, such as thrust direction, in a Vary command,
then you must reference the cloned (child) object directly. In the example below, we
first show syntax, using the parent object that does not work. We then show the correct
syntax using the cloned (child) object.
Command Interactions
771
Reference Guide Targeting/Parameter Optimiza-
tion
Examples
As mentioned above, the Vary command only occurs within either a Target or an Op-
timize sequence. See the Target and Optimize command help for examples showing
the use of the Vary command.
772
Reference Guide
Orbit Determination
This chapter contains documentation for Resources and Commands related to orbit
determination.
Resources
773
Reference Guide Orbit Determination
AcceptFilter
Allows selection of data subsets for processing by the batch least squares estimator.
Description
The AcceptFilter object is used to create criteria for the inclusion of subsets of the
available data in the estimation process based on observation frequency, tracker, mea-
surement type, record number, or time. Instances of AcceptFilter are specified for use
on the DataFilters field of a TrackingFileSet or BatchEstimator object.
GMAT implements two levels of data editing for estimation. First-level editing criteria are
specified on the DataFilters field of the TrackingFileSet instance. At this level, the user
may choose what data is admitted into the overall pool of observations provided to the
estimator. Any data excluded at the tracking file set level will be immediately discarded
and not available to the estimation process.
A single AcceptFilter may employ multiple selection criteria (for example simultane-
ously thinning different stations or data types by differing intervals). Multiple criteria on
a single filter are considered in an AND sense. When multiple criteria are specified on
a single filter, an observation must meet all specified criteria to be accepted.
Fields
Field Description
DataTypes List of data types
774
Orbit Determination Reference Guide
Field Description
EpochFormat Allows user to select format of the epoch
775
Reference Guide Orbit Determination
Field Description
ObservedObjects List of user-created tracked objects (e.g., name of the Spacecraft
resource being tracked)
776
Orbit Determination Reference Guide
Field Description
ThinningFrequen- If ThinMode is Frequency, the integer 'n' is used to specify that
cy every nth data point should be accepted. For example, 3 spec-
ifies that every third data point, meeting all the accept criteria,
should be accepted and 1 specifies that every data point, meet-
ing all the accept criteria, should be accepted. If ThinMode is
Time, the integer 'n' is a number of seconds between accepted
observations, using the first available observation as the anchor
epoch. For example, a value of 300 means that observations will
be accepted every 300 seconds, starting from the first available
observation. This field is only applicable when the AcceptFilter
is used on a TrackingFileSet.
Remarks
Some fields of AcceptFilter are not applicable at either the first-level (tracking file set)
or second-level (estimator) editing stages. The RecordNumbers field has no function-
ality when applied to an accept filter at the tracking file set level. The FileNames, Thin-
ningFrequency, and ThinMode fields have no functionality when applied to an accept
filter at the estimator level.
Examples
The following examples illustrate use of an AcceptFilter for first-level data editing. At
this level, the AcceptFilter instance should be assigned to the DataFilters field of a
TrackingFileSet. In these examples, only data meeting the criteria specified by the
accept filter will be admitted through. All other data is immediately discarded.
777
Reference Guide Orbit Determination
This example shows how to create an AcceptFilter to sample the data at a frequency
of 1:10 (thinning the data to one tenth of its volume).
af.ThinningFrequency = 10;
estData.DataFilters = {af};
BeginMissionSequence;
The next example will accept all data from station GDS and accept every 5th observation
from station CAN. Only data from stations GDS and CAN will be accepted.
af1.Trackers = {'GDS'};
af2.Trackers = {'CAN'};
af2.ThinningFrequency = 5;
BeginMissionSequence;
The last example illustrates thinning data by time interval, using a 300-second thinning
interval.
af.ThinMode = 'Time';
af.ThinningFrequency = 300;
estData.DataFilters = {af};
BeginMissionSequence;
The following examples illustrate use of an AcceptFilter for second-level data editing.
At this level, the AcceptFilter instance should be assigned to the DataFilters field of
a BatchEstimator. In these examples, only data meeting the criteria specified by the
778
Orbit Determination Reference Guide
accept filter will be used in the estimation state update. Residuals will be computed for all
available data (all data admitted at the first level), but data not accepted at the estimator
level will be flagged as user edited.
This example shows how to create an AcceptFilter to accept specific data records by
record number.
bls.DataFilters = {af};
BeginMissionSequence;
The next example will accept only range data from station MAD over the time span 10
Jun 2012 02:56 to 13:59.
af.Trackers = {'MAD'};
af.DataTypes = {'Range'};
af.EpochFormat = UTCGregorian;
af.InitialEpoch = '10 Jun 2012 02:56:00.000';
af.FinalEpoch = '10 Jun 2012 13:59:00.000';
bls.DataFilters = {af};
BeginMissionSequence;
The last example illustrates accepting all data from station MAD and only range data
from station CAN.
af1.Trackers = {'MAD'};
af2.Trackers = {'CAN'};
af2.DataTypes = {'Range'};
BeginMissionSequence;
779
Reference Guide Orbit Determination
Antenna
Transmits or receives an RF signal.
Description
Note
For the R2020a release, new Antenna parameters are available for visual-
ization purposes only. Currently, none of the Antenna parameters have any
effect on orbit determination processing and do not need to be set. (e.g., Light
time solutions do not currently take into account Antenna location within the
spacecraft body.)
Fields
Field Description
FieldOfView Reference to optional field-of-view object which models
the area visible to the antenna.
780
Orbit Determination Reference Guide
Field Description
DirectionY Y-component of the field-of-view boresight vector ex-
pressed in spacecraft body coordinates.
781
Reference Guide Orbit Determination
Field Description
SecondDirectionZ Z-component of the vector, expressed in the body frame,
used to resolve the sensor's orientation about the boresite
vector.
Remarks
The antenna model supports mask, orientation and location settings. The mask is pro-
vided by the object designated by FieldOfView. The location is the position of the origin
of the sensor frame, expressed in the spacecraft body coordinate frame. The orientation
is represented as a direction cosine matrix that is initially computed from two non-colin-
782
Orbit Determination Reference Guide
ear vectors, provided by the user as Direction and SecondDirection components. The
three axes for the sensor coordinate frame expressed in Body coordinates are comput-
ed as follow:
Rsb is used as part of the chain checking if an object is in the field of view. The general
approach is to have a vector from the antenna to the object in a given reference frame
and do a series of rotations, the last of which would use Rsb to rotate the vector from
spacecraft to antenna coordinates.
Examples
783
Reference Guide Orbit Determination
784
Orbit Determination Reference Guide
BatchEstimator
A batch least squares estimator
Description
A batch least squares estimator is a method for obtaining an estimate for a parameter
vector, x0, such that a performance index, which is a function of that parameter, J =
J(x0), is minimized. For our application, x0 typically includes the spacecraft position and
velocity at a specific epoch and the performance index is a weighted sum of the squares
of the measurement residuals.
Fields
Field Description
AbsoluteTol Absolute Weighted RMS convergence criteria tolerance
785
Reference Guide Orbit Determination
Field Description
EstimationEpoch Estimation Epoch. This is the epoch associated with the "solve-
fors." The only allowed setting is FromParticipants, which defines
the estimation epoch to be the current (a priori) epoch of the satel-
lite to be estimated. The user should use a Propagate command
to advance the estimated satellite to the desired estimation epoch
prior to the RunEstimator command.
786
Orbit Determination Reference Guide
Field Description
ILSEMaximumIter- Specifies maximum number of iterations allowed for the inner
ations loop sigma editor (ILSE).
787
Reference Guide Orbit Determination
Field Description
MaximumIterations Specifies maximum number of iterations allowed for batch esti-
mation.
788
Orbit Determination Reference Guide
Field Description
OLSEUseRMSP Flag used to specify editing algorithm used for outer loop sig-
ma editing (OLSE) for iterations greater than 1. See Behavior
of Outer Loop Sigma Editing (OLSE) in the Remarks section
for details.
789
Reference Guide Orbit Determination
Field Description
ReportStyle Specifies the type of estimation report. The Normal style ex-
cludes reporting of observation TAI, partials, and frequency infor-
mation. Selection of Verbose mode requires the user to assign
RUN_MODE = Testing in the GMAT startup file.
790
Orbit Determination Reference Guide
Field Description
UseInitialCovari- If set true, a priori error covariance term is added
ance to the estimation cost function. This option should
be set to true when estimating with an applied
Spacecraft.OrbitErrorCovariance, Spacecraft.CdSigma,
Spacecraft.CrSigma, or ErrorModel.BiasSigma. See the Re-
marks section below for some restrictions on the use of this field.
Remarks
GMAT navigation requires use of fixed stepped propagation. The BatchEstimator re-
source has a Propagator field containing the name of the Propagator resource that
will be used during the estimation process. As shown in the Note below, there are some
hard restrictions on the choice of error control specified for the ForceModel resource
associated with your propagator.
Note
The ErrorControl parameter of the ForceModel used by the BatchEsti-
mator must be set to 'None.' Of course, when using fixed step control, the
user must choose a step size that yields the desired accuracy for the cho-
sen orbit regime and force profile. Step size for fixed-step integration is con-
figured on the Propagator.InitialStepSize and Propagator.MaxStep fields.
The smaller of the two values assigned to these parameters will be the inte-
gration step size. It is usually convenient to set both to the same value, to
avoid confusion.
791
Reference Guide Orbit Determination
GMAT has four input fields, RelativeTol, AbsoluteTol, MaximumIterations, and Max-
ConsecutiveDivergences that are used to determine if the estimator has converged
after each new iteration. Associated with these input fields are the two convergence
tests shown below:
where
RMSB = smallest Weighted RMS achieved during the current and previous iterations
Batch estimation is considered to have converged when either or both of the above
criteria is met within MaximumIterations iterations or less.
where the Weighted Measurement Residual for a single given measurement is given by
(O-C)/NoiseSigma
and where NoiseSigma is the input noise (one sigma) for the measurement type as-
sociated with the given measurement. On subsequent outer loop iterations, the data is
edited if
The editing algorithm above depends upon the user input value of OLSEUseRMSP. If
OLSEUseRMSP = True, then RMS = WRMSP where WRMSP is the predicted weighted
RMS calculated at the end of the previous iteration. Otherwise, If OLSEUseRMSP =
792
Orbit Determination Reference Guide
False, then RMS = WRMS where WRMS is the actual weighted RMS calculated at the
end of the previous iteration.
The inner loop, when enabled, runs immediately after each iteration of the outer loop
calculates which measurements to edit. The benefit of the inner loop lies in that it can
quickly iterate as it does not need to propagate the spacecraft each iteration. Instead,
it uses the measurement derivatives to compute a linearized approximation to the next
outer loop iteration residuals. This generally increases the amount of data sigma-edited
from the run, but the result is that in many cases a solution will require fewer outer loop
iterations to converge and may therefore run faster overall.
The value of RMS above again depends on the user input value of OLSEUseRMSP.
If OLSEUseRMSP = True, then RMS = WRMSP where WRMSP is the previously cal-
culated predicted weighted RMS . Otherwise, If OLSEUseRMSP = False, then RMS =
WRMS where WRMS is the previously calculated actual weighted RMS. On the first in-
ner loop iteration, these RMS values from the most recent outer loop are used, while on
subsequent inner loop iterations, they are taken from the previous inner loop iteration.
The inner loop converges when the selection of measurements edited exactly match
the selection of measurements edited by the previous inner loop iteration. The value of
ILSEMaximumIterations also provides an upper-bound on the number of iterations to
perform. Like the outer loop, data that is edited is not used to calculate the state vector
estimate for the current iteration but the data is available as a candidate measurement
for subsequent iterations. The inner loop can only remove measurements from estima-
tion, it does not reintroduce measurements that were previously edited.
GMAT has two input fields, FreezeMeasurementEditing and FreezeIteration, that are
used to determine if and when to 'freeze' (i.e., no longer change) the selection of mea-
surements which are edited out by the Outer Loop Sigma Editor. Freezing the measure-
ment editing only takes place when FreezeMeasurementEditing is true.
If freezing is enabled, the selection of measurements to edit is locked after the iteration
specified by FreezeIteration. If the value of FreezeIteration is 1, the estimator uses the
value of OLSEInitialRMSSigma, as defined above, to determine which measurements
are used to calculate the first iteration of the state vector deviation vector. Afterwards,
the same measurements edited out by the initial RMS sigma filter are edited out for the
remainder of the iterations. If the value of FreezeIteration is 2 or greater, the estimator
uses the above defined outer loop sigma editing to determine the state vector deviation
vector up to the iteration specified by FreezeIteration, at which point whichever mea-
surements are edited out by the outer loop sigma editor stay edited out for the remainder
of the iterations. If inner loop sigma editing is enabled, the measurements edited out by
793
Reference Guide Orbit Determination
the last iteration of the inner loop sigma editor will also be frozen. Frozen measurements
that are edited out will retain the edit flag the outer and inner loop sigma editor used the
iteration they were edited out.
Propagator Settings
The BatchEstimator resource has a Propagator field containing the name of the Prop-
agator resource that will be used during the estimation process. The minimum step size,
MinStep, of your propagator should always be set to 0.
UseInitialCovariance Restrictions
As mentioned in the Field spec above, if this field is set to true, then the a priori error
covariance term is added to the estimation cost function. For the current GMAT release,
there are some restrictions on the use of this field as given below.
1. The user must input the a priori orbit state covariance in the EarthMJ200Eq coordinate
system.
2. If the user is solving for the Cartesian orbit state, e.g., Sat.SolveFors = {CartesianS-
tate}, then the input a priori orbit state covariance must be in terms of Cartesian ele-
ments. Likewise, if the user is solving for the Keplerian orbit state, e.g., Sat.SolveFors
= {KeplerianState}, then the input a priori orbit state covariance must be in terms of
Keplerian elements.
3. If the user is solving for the Keplerian orbit state, e.g., Sat.SolveFors = {KeplerianS-
tate}, then the input a priori orbit state covariance must be expressed in terms in
terms of spacecraft Mean Anomaly (MA) and not True Anomaly (TA). To be more
specific, in this situation, the diagonal elements of the 6x6 orbit state error covariance
are the variance of the SMA (km^2), eccentricity (dimensionless), INC (deg^2), RAAN
(deg^2), AOP (deg^2), and MA (deg^2). Note that, in this case, we require the a priori
covariance to be input in terms of MA even though, for the current release of GMAT,
the associated orbit state can not be set using MA.
794
Orbit Determination Reference Guide
If MATLAB is installed and properly configured to interface with GMAT (see MATLAB
Interface), the user may generate a mat-file containing useful analysis data from the
BatchEstimator run. This option is enabled by specifying a path and filename for the
output file on the MatlabFile field of the configured BatchEstimator resource. The file
contains three top-level data structures - EstimationConfig, Iteration, and Observed.
Except as noted in the tables below, the units for data in the mat-file are the same as
those in the BatchEstimator output file; km, km/sec, DSN Range Units, Hz, and degrees.
Variable Description
CartesianStateNames Names of estimated parameters; spacecraft elements
names are Cartesian
FinalEpochUTC A 1x2 column vector containing the measurement end
epoch as a MATLAB datenum in the first row and GMAT
TAIModJulian in the second row
GravitationalParameter The gravitational parameter of the primary central body
of the run, in km^3/sec^2
InitialEpochUTC A 1x2 column vector containing the measurement start-
ing epoch as a MATLAB datenum in the first row and
GMAT TAIModJulian in the second row
KeplerianStateNames Names of estimated parameters; spacecraft elements
names are Keplerian
The Observed structure contains the tracking data observation measurement data.
Contents of the Observed structure are described in the table below. When working
with the mat-file, it is good to keep in mind that the GMAT output file indexes iterations,
observations, and residuals from 0 but MATLAB performs indexing starting with 1.
Variable Description
DopplerCountInterval For each Doppler-type measurement, the Doppler
counting interval. Set to NaN for other data types.
EpochTAI The TAI epoch of each measurement. Each member is
a column vector where the first row is the epoch as a
MATLAB datenum and the second row is the epoch as a
GMAT TAIModJulian date.
EpochUTC The UTC epoch of each measurement. Each member
is a column vector where the first row is the epoch as a
MATLAB datenum and the second row is the epoch as a
GMAT UTCModJulian date.
Frequency Signal receive frequency in Hertz. Set to NaN for
GPS_PosVec data.
795
Reference Guide Orbit Determination
Variable Description
Measurement Observed measurements. For GPS_PosVec, each cell
holds a 1x3 column vector of X, Y, Z measurements.
MeasurementNumber Measurement record number
MeasurementType The GMAT observation type name
MeasurementWeight Measurement weights (1/noise^2). For GPS_PosVec,
each cell holds a 1x3 column vector of X, Y, Z weights.
Participants For each measurement, a cell array whose members
are the ID's of the participants in the measurement path
RangeModulo For each DSN_SeqRange measurement, the range am-
biguity interval in Range Units. Set to NaN for other data
types.
Contents of the Iteration structure are described in the table below. The iteration struc-
ture is an array with one element for each iteration performed by the estimator. Each iter-
ation has the following fields. Some fields are not applicable to some measurement types
(for example Elevation, Frequency, and FrequencyBand do not apply for GPS_PosVec
measurements) and are set to NaN or zero.
Variable Description
CartesianCorrelation Cartesian correlation matrix at the end of the itera-
tion. The order of the rows and columns is given by
EstimationConfig.CartesianStateNames.
CartesianCovariance Cartesian covariance matrix at the end of the itera-
tion. The order of the rows and columns is given by
EstimationConfig.CartesianStateNames.
CartesianState Spacecraft Cartesian elements and other es-
timated parameters at the end of the iteration.
The order of elements matches that given in
EstimationConfig.CartesianStateNames.
Elevation Computed elevation in degrees at the measurement
epoch. Does not apply (set to 0) for GPS_PosVec data.
IonosphericCorrection The magnitude of the ionospheric measurement correc-
tion. Units are the same as the measurement. See note
below regarding media corrections for X/Y angle mea-
surements.
IterationNumber Numerical iteration count number, starting from 0
KeplerianCorrelation Keplerian correlation matrix at the end of the itera-
tion. The order of the rows and columns is given by
EstimationConfig.KeplerianStateNames.
KeplerianCovariance Keplerian covariance matrix at the end of the itera-
tion. The order of the rows and columns is given by
EstimationConfig.KeplerianStateNames.
796
Orbit Determination Reference Guide
Variable Description
KeplerianState Spacecraft Keplerian elements and other es-
timated parameters at the end of the iteration.
The order of elements matches that given in
EstimationConfig.KeplerianStateNames.
Measurement Computed measurements. For GPS_PosVec, each cell
holds a 1x3 column vector of X, Y, Z computed mea-
surements.
MeasurementEditFlag The string observation edit flag. 'N' indicates unedit-
ed/accepted observations
MeasurementNumber Measurement record number
MeasurementPartials A cell array of matrices. Each member is a matrix of the
partial derivatives of the measurement with respect to
each element of the state. The partials are taken with
respect to the element type selected on the Spacecraft
SolveFors field. For example, if the user has chosen to
estimate the KeplerianState, the partials are with respect
to the Keplerian elements. The order of elements match-
es that given in the EstimationConfig state names. For
GPS_PosVec data, each cell holds a 3xN matrix, where
N is the number of estimated states. Each row contains
the partials with respect to the X, Y, and Z GPS_PosVec
measurement in order.
PreviousCartesianState Spacecraft Cartesian elements and other esti-
mated parameters at the beginning of the itera-
tion. The order of elements matches that given in
EstimationConfig.CartesianStateNames.
PreviousKeplerianState Spacecraft Keplerian elements and other esti-
mated parameters at the beginning of the itera-
tion. The order of elements matches that given in
EstimationConfig.KeplerianStateNames.
Residual Measurement residuals. For GPS_PosVec, each cell
holds a 1x3 column vector of X, Y, Z residuals.
TroposphericCorrection The magnitude of the tropospheric measurement correc-
tion. Units are the same as the measurement. See note
below regarding media corrections for X/Y angle mea-
surements.
Many of the fields in the Iteration and Observations structures are cell arrays. In most
cases some simple MATLAB commands are all that are needed to extract the cell array
data to arrays for plotting and analysis. The code below shows a few examples.
797
Reference Guide Orbit Determination
t = Observed.EpochUTC(1,:);
y = cell2mat(Iteration(1).Residual);
plot(t, y, 'ko');
datetick;
parts = Iteration(1).MeasurementPartials;
parts = cat(1, parts{:});
plot(t, parts);
datetick;
% Compute WRMS
iter = Iteration(1);
dy = cell2mat(iter.Residual(IACC));
w = diag(cell2mat(Observed.MeasurementWeight(IACC)));
m = length(IACC);
Users might find it useful to work with ObsEditFlag or Type as MATLAB categorical
arrays. See the MATLAB help for the categorical command for more details.
Working with a MATLAB file containing GPS_PosVec data requires a little more atten-
tion. Some examples are shown below.
% We assume a BatchEstimator mat-file from a GPS_PosVec data
% run has already been loaded
t = Observed.EpochUTC(1,:);
y = cell2mat(Iteration(2).Residual);
plot(t, y, '.');
datetick;
parts = Iteration(1).MeasurementPartials;
parts = cat(3, parts{:});
part_x = parts(1,:,:);
798
Orbit Determination Reference Guide
part_x = squeeze(part_x);
plot(t, part_x);
When formulating computed angle measurements, GMAT applies ionosphere and tro-
posphere corrections as an elevation adjustment to the ground station to spacecraft
slant-range vector. All computed angle observables are then derived from the slant-
range vector. This process yields the exact correction applied to the Elevation angle, but
corrections to other angle measurement types are not directly computed and stored. To
provide the user with an estimate of these corrections for X/Y angles, approximate X/
Y angle corrections are computed from the elevation correction by an alternate method
and stored in the MATLAB file. The user should be aware that the media corrections
for X/Y data stored in the MATLAB file are not exactly consistent with the method used
in formulation of the X/Y computed measurement. The differences are less than 1%
for elevations greater than 5 degrees, but may be on the order of 100% for elevations
below 5 degrees.
Interactions
Resource Description
Tracking- Must be created in order to tell the BatchEstimator resource which data
FileSet re- will be processed
source
Propaga- Used by GMAT to generate the predicted orbit
tor re-
source
RunEsti- Must use the RunEstimator command to actually process the data defined
mator by the BatchEstimator resource
command
Examples
Below is an example of a configured batch estimator instance. In this example, estData
is an instance of a TrackingFileSet and ODProp is an instance of Propagator.
bat.ShowProgress = true;
bat.Measurements = {estData}
bat.AbsoluteTol = 0.000001;
bat.RelativeTol = 0.001;
bat.MaximumIterations = 10;
bat.MaxConsecutiveDivergences = 3;
bat.Propagator = ODProp;
bat.ShowAllResiduals = On;
bat.OLSEInitialRMSSigma = 3000;
bat.OLSEMultiplicativeConstant = 3;
799
Reference Guide Orbit Determination
bat.OLSEAdditiveConstant = 0;
bat.UseInnerLoopEditing = True;
bat.ILSEMaximumIterations = 15;
bat.ILSEMultiplicativeConstant = 3;
bat.InversionAlgorithm = 'Internal';
bat.EstimationEpochFormat = 'FromParticipants';
bat.EstimationEpoch = 'FromParticipants';
bat.ReportStyle = 'Normal';
bat.ReportFile = 'BatchEstimator_Report.txt';
BeginMissionSequence;
800
Orbit Determination Reference Guide
ErrorModel
Used to specify measurement noise for simulation and estimation, and to apply or esti-
mate measurement biases.
Description
The ErrorModel is used by both the simulator and the estimator. For a data simulation
run, the ErrorModel specifies the measurement type and noise employed when gen-
erating the simulated measurement. A bias may optionally be applied to the simulated
observations.
For an estimation run, the ErrorModel specifies the observation type, presumed obser-
vation noise, and an optional bias to be applied to the observation. An observation bias
may also be estimated by adding the keyword Bias to the ErrorModel.SolveFors list.
If the SolveFors list is empty, no bias will be estimated. The SolveFors list is ignored
by the simulator.
The ErrorModel resource does not currently support application or estimation of biases
for the GPS_PosVec data type.
801
Reference Guide Orbit Determination
Fields
Field Description
Bias The constant bias associated with the measurement. For simula-
tion, this bias is added to the measurement. As shown below, the
units used depend upon measurement type, ErrorModel.Type.
802
Orbit Determination Reference Guide
Field Description
Type Measurement data type.
Remarks
The following table shows the units to be used for Bias, BiasSigma, and NoiseSigma
for each measurement data type that GMAT supports.
Examples
This example shows how to create an error model for DSN Sequential Range observa-
tions and illustrates estimation of a range bias parameter.
% Create an ErrorModel
% Measurement noise is in Range Units
RangeModel.Type = 'DSN_SeqRange';
RangeModel.NoiseSigma = 11.;
RangeModel.Bias = 0.;
RangeModel.SolveFors = {Bias};
DSN.ErrorModels = {RangeModel};
BeginMissionSequence;
This example shows how to create an error model for on-board GPS observations.
803
Reference Guide Orbit Determination
% Create an ErrorModel
% Measurement noise is in kilometers. Bias estimation is not permitted.
PosVecModel.Type = 'GPS_PosVec';
PosVecModel.NoiseSigma = 0.010;
% Assign the error model to a receiver and add that receiver to a spacecraft.
GpsReceiver.Id = 800;
GpsReceiver.PrimaryAntenna = GpsAntenna;
GpsReceiver.ErrorModels = {PosVecModel};
BeginMissionSequence;
804
Orbit Determination Reference Guide
ExtendedKalmanFilter
An extended Kalman filter orbit determination estimator
Description
Warning
The ExtendedKalmanFilter is an alpha-level resource and should not be
used for operational support. Access to this resource is disabled by default.
To enable access to the ExtendedKalmanFilter resource, comment-in the
libEKF plug-in in the GMAT gmat_startup_file.txt file.
Fields
Field Description
DataFilters Defines data selection filters to be applied to the measurement
pool. One or more filters of either type (AcceptFilter, Reject-
Filter) may be specified. Rules specified by data filters on an
ExtendedKalmanFilter are applied to determine what measure-
ments are accepted or rejected from the computation of the state
update.
805
Reference Guide Orbit Determination
Field Description
DelayRectify- Defines a period of time, beginning from warm start or initializa-
TimeSpan tion, for which the reference trajectory is generated from the a-
priori or initial state. As always, any measurements are used to
update the estimated state, but the measurements will not be ap-
plied to the reference trajectory used for linearization. After the
delay rectify time span has elapsed, the a-priori state is discard-
ed, and the current filter estimated state is used as the reference
trajectory for linearization, in accordance with normal operation
of an extended Kalman filter.
This parameter can aid convergence when the initial state covari-
ance is very large and the measurement noise is small. Delaying
rectification until enough measurements have been processed to
assure an improved state estimate can keep the filter from imme-
diately diverging due to too-rapid collapse of the state covariance.
806
Orbit Determination Reference Guide
Field Description
MatlabFile File name for the output MATLAB file. Leaving this parameter
unset means that no MATLAB file will be generated. This file can
only be generated if GMAT is properly connected to MATLAB.
See remarks below for details on the contents of the estimator
MATLAB file.
807
Reference Guide Orbit Determination
Field Description
ProcessNoise- Time interval for process noise covariance updates. If equal to
TimeStep zero, the process noise is updated at each integration step.
808
Orbit Determination Reference Guide
Field Description
ScaledResidu- Scaled residual editing criteria. The scaled residual is a unit-
alThreshold less value representing the raw residual divided by the sum of
state noise (appropriately transformed) and measurement noise.
Schematically, Scaled Residual = Raw Residual / (HPH' + R).
Any measurement will be edited out (and not used in the estima-
tion) if the computed scaled residual is greater than the specified
threshold.
809
Reference Guide Orbit Determination
Field Description
WarmStartEpoch Initial epoch from which to begin processing, when processing
in warm start mode. GMAT will look for a record at this time in
the InputWarmStartFile. If a record at the specified epoch does
not exist in the InputWarmStartFile, the warm start record clos-
est to, but earlier than, the specified epoch will be used. The de-
fault setting is 'FirstMeasurement', which means GMAT will auto-
matically choose the closet input warm start record that is earlier
than the first available measurement in the run. The user may
also specify 'LastWarmStartRecord' to automatically use the last
record in the input warm start file.
Remarks
Navigation Requires Use of Fixed Step Numerical Integration
Note
The ErrorControl parameter of the ForceModel in use by the Extended-
KalmanFilter must be set to 'None.' Of course, when using fixed step con-
trol, the user must choose a step size, as given by the Propagator Ini-
tialStepSize field, that yields the desired accuracy for the chosen orbit
regime and force profile.
810
Orbit Determination Reference Guide
In cold start mode, the states and covariances assigned on the resources configured
in the script are used as the filter initial state and covariance. The spacecraft initial co-
variance is taken from the Spacecraft OrbitErrorCovariance parameter, and initial un-
certainties for other estimated parameters are taken from each parameter's associated
"sigma" value. For example the initial coefficient of drag is assigned on the Spacecraft
Cd parameter and the initial uncertainty in Cd is assigned on the Spacecraft CdSigma
parameter. The filter will run in cold start mode any time an InputWarmStart file is not
specified on the ExtendedKalmanFilter resource.
In warm start mode, the filter full state and covariance from a prior run are used as the
filter initial state and covariance. This mode allows the user to stop and start the filter in a
manner that allows continuous operation of the filter in a fully converged state. To enable
a warm start, the user should specify an InputWarmStartFile on the EKF resource.
The user may optionally also specify a WarmStartEpoch, to identify the time at which
the filter should begin processing. If a warm start epoch is given, the filter ignores all
measurements prior to the warm start epoch. If a warm start epoch is not given, the filter
will start up from the first measurement time, using the input warm start record closest
to, but earlier than, the first measurement time. The warm start epoch must be within
the time span of the input warm start file. The input warm start file should ideally be the
output warm start file from a prior filter run.
Propagator Settings
The Weighted RMS statistic reported for each data type in the Filter Measurement Statis-
tics report is the weighted RMS of pre-update residuals.
If MATLAB is installed and properly configured to interface with GMAT (see MATLAB
Interface), the user may generate a mat-file containing useful analysis data from the
ExtendedKalmanFilter run. This option is enabled by specifying a path and filename
for the output file on the MatlabFile field of the configured ExtendedKalmanFilter re-
source. The file contains four top-level data structures - EstimationConfig, Observed,
Computed, and Filter. Except as noted in the tables below, the units for data in the mat-
file are the same as those in the Kalman filter output file; seconds, km, km/sec, DSN
Range Units, Hz, and degrees.
811
Reference Guide Orbit Determination
Variable Description
InitialEpochUTC A 1x2 column vector containing the filter starting epoch
as a MATLAB datenum in the first row and GMAT TAI-
ModJulian in the second row.
FinalEpochUTC A 1x2 column vector containing the filter end epoch as a
MATLAB datenum in the first row and GMAT TAIModJu-
lian in the second row.
GravitationalParameter The gravitational parameter of the primary central body
of the run, in km^3/sec^2.
CartesianStateNames Names of estimated parameters; spacecraft elements
names are Cartesian.
KeplerianStateNames Names of estimated parameters; spacecraft elements
names are Keplerian.
The Observed structure contains the tracking data observation measurement data.
Contents of the Observed structure are described in the table below.
Variable Description
DopplerCountInterval For each Doppler-type measurement, the Doppler
counting interval. Set to NaN for other data types.
EpochTAI The TAI epoch of each measurement. Each member is
a column vector where the first row is the epoch as a
MATLAB datenum and the second row is the epoch as a
GMAT TAIModJulian date.
EpochUTC The UTC epoch of each measurement. Each member
is a column vector where the first row is the epoch as a
MATLAB datenum and the second row is the epoch as a
GMAT UTCModJulian date.
Frequency Signal receive frequency in Hertz. Set to NaN for
GPS_PosVec data.
Measurement Observed measurements. For GPS_PosVec, each cell
holds a 1x3 column vector of X, Y, Z measurements.
MeasurementNumber Measurement record number.
MeasurementType The GMAT observation type name.
MeasurementWeight Measurement weights (1/noise^2). For GPS_PosVec,
each cell holds a 1x3 column vector of X, Y, Z weights.
Participants For each measurement, a cell array whose members
are the ID's of the participants in the measurement path.
RangeModulo For each DSN_SeqRange measurement, the range am-
biguity interval in Range Units. Set to NaN for other data
types.
The Computed structure stores information about filter measurement updates. Con-
tents of the Computed structure are described in the table below. Some fields are not
812
Orbit Determination Reference Guide
applicable to some measurement types (for example Elevation, Frequency, and Fre-
quencyBand do not apply for GPS_PosVec measurements) and are set to NaN or zero.
The epoch of a record in the Computed structure can be determined by matching the
computed MeasurementNumber to the same measurement number in the Observed
structure.
Variable Description
Elevation Computed elevation in degrees at the measurement
epoch. Does not apply (set to 0) for GPS_PosVec data.
IonosphericCorrection The magnitude of the ionospheric measurement correc-
tion. Units are the same as the measurement. See note
below regarding media corrections for X/Y angle mea-
surements.
KalmanGain The Kalman gain matrix.
Measurement Computed measurements. For GPS_PosVec, each cell
holds a 1x3 column vector of X, Y, Z computed mea-
surements.
MeasurementEditFlag The string observation edit flag. 'N' indicates unedit-
ed/accepted observations.
MeasurementNumber Measurement record number.
MeasurementPartials A cell array of matrices. Each member is a matrix of the
partial derivatives of the measurement with respect to
each element of the state. The partials are taken with
respect to the element type selected on the Spacecraft
SolveFors field. For example, if the user has chosen to
estimate the KeplerianState, the partials are with respect
to the Keplerian elements. The order of elements match-
es that given in the EstimationConfig state names. For
GPS_PosVec data, each cell holds a 3xN matrix, where
N is the number of estimated states. Each row contains
the partials with respect to the X, Y, and Z GPS_PosVec
measurement in order.
PreUpdateCovariance Filter state covariance prior to measurement update.
PreUpdateCovarianceVNB Filter state covariance prior to measurement update, in
the VNB reference frame.
PreUpdateResidual Filter state residual prior to measurement update.
PreUpdateState Filter state prior to measurement update.
ScaledResidual A unitless value representing the raw residual divided by
the sum of state noise (appropriately transformed) and
measurement noise. Schematically, Scaled Residual =
Raw Residual / (HPH' + R).
813
Reference Guide Orbit Determination
Variable Description
TroposphericCorrection The magnitude of the tropospheric measurement correc-
tion. Units are the same as the measurement. See note
below regarding media corrections for X/Y angle mea-
surements.
The Filter structure stores information about processing that occurs at both measure-
ment and time updates. Contents of the Filter structure are described in the table below.
Variable Description
Covariance The filter state covariance (Cartesian), after the mea-
surement or time update.
CovarianceVNB The filter state covariance (VNB coordinates), after the
measurement or time update.
EpochTAI The TAI epoch of each filter record. Each member is
a column vector where the first row is the epoch as a
MATLAB datenum and the second row is the epoch as a
GMAT TAIModJulian date.
EpochUTC The UTC epoch of each filter record. Each member is
a column vector where the first row is the epoch as a
MATLAB datenum and the second row is the epoch as a
GMAT UTCModJulian date.
MeasurementNumber Measurement record number. Set to NaN for time up-
date steps.
ProcessNoise The filter process noise matrix.
State Filter state after the measurement or time update.
StateTransitionMatrix State transition matrix from ti-1 to ti, such that
When formulating computed angle measurements, GMAT applies ionosphere and tro-
posphere corrections as an elevation adjustment to the ground station to spacecraft
slant-range vector. All computed angle observables are then derived from the slant-
range vector. This process yields the exact correction applied to the Elevation angle, but
corrections to other angle measurement types are not directly computed and stored. To
provide the user with an estimate of these corrections for X/Y angles, approximate X/
Y angle corrections are computed from the elevation correction by an alternate method
and stored in the MATLAB file. The user should be aware that the media corrections
for X/Y data stored in the MATLAB file are not exactly consistent with the method used
in formulation of the X/Y computed measurement. The differences are less than 1%
for elevations greater than 5 degrees, but may be on the order of 100% for elevations
below 5 degrees.
814
Orbit Determination Reference Guide
Examples
EKF.ShowProgress = True;
EKF.Measurements = {EstData};
EKF.Propagator = Prop;
EKF.ShowAllResiduals = On;
EKF.ProcessNoiseTimeStep = 240.;
EKF.ScaledResidualThreshold = 3.;
EKF.DataFilters = {}
EKF.PredictTimeSpan = 86400.;
EKF.ReportFile = 'filter_report.txt';
EKF.MatlabFile = 'filter.mat';
EKF.OutputWarmStartFile = 'warm_start.csv';
BeginMissionSequence;
815
Reference Guide Orbit Determination
ProcessNoiseModel
Used to specify process noise for estimation when using the ExtendedKalmanFilter es-
timator.
Description
Warning
ProcessNoiseModel is an alpha-level resource and should not be used for
operational support. Access to this resource is disabled by default. To enable
access to the ProcessNoiseModel resource, comment-in the libEKF plug-in
in the GMAT gmat_startup_file.txt file.
Fields
Field Description
AccelNoiseSigma Three-axis process noise sigma. The root variance along each
axis of an assumed Gaussian white noise process.
816
Orbit Determination Reference Guide
Field Description
Type Process noise modeling type. See remarks below for additional
details.
Remarks
The StateNoiseCompensation process noise type implements the process noise al-
gorithm described in Tapley, Schutz, and Born, Statistical Orbit Determination, Section
4.9 and Appendix F. The process noise is assumed to be an additive Gaussian white
noise process applied to the total deterministic acceleration. For this scheme, the user
provides the diagonal elements of the following matrix in a chosen reference frame.
where q1, q2, and q3 are the squares of the elements of the specified AccelNoiseSigma
in the selected CoordinateSystem. The process noise S is then given by the matrix
Where is obtained from a time grid formed by the union of the input measurement
times and the chosen ExtendedKalmanFilter ProcessNoiseTimeStep. is the Q ma-
trix transformed into the coordinate system of integration. Process noise is added ac-
cording to this formulation at each time update and measurement update during filtering
and prediction.
Determination of appropriate values of q1, q2, and q3 often involves experimentation via
trial and error or a parametric analysis. References 1 and 2 indicate that an appropriate
starting point for such tuning, in the case of near-circular orbits dominated by along-
track error, can be derived from the following equation
817
Reference Guide Orbit Determination
Where is the along-track error per orbit period (perhaps determined empirically),
and T is the orbit period in seconds. Note that the square root of qAT is specified when
inputting the components of the AccelNoiseSigma. For State Noise Compensation, the
3/2
units of AccelNoiseSigma are km/second .
Examples
% Create a ProcessNoiseModel
SNC.Type = StateNoiseCompensation;
SNC.CoordinateSystem = EarthMJ2000Eq;
SNC.AccelNoiseSigma = [1e-8 1e-8 1e-8];
% Assign it to a Spacecraft
EstSat.ProcessNoiseModel = SNC;
EKF.ProcessNoiseTimeStep = 240.;
References
1. Carpenter, Russell and Chris D'Souza. Navigation Filter Best Practices. Technical
Report TP-2018-219822, NASA, April 2018.
2. Geller, David. Orbital Rendezvous: When is Autonomy Required?. Journal of Guid-
ance, Control, and Dynamics, Vol. 30, No.4. July-August 2007.
818
Orbit Determination Reference Guide
Receiver
Hardware that receives an RF signal.
Description
The receiver resource is also used as the host object for the GPS_PosVec measure-
ment error model. When using GPS_PosVec data for estimation or simulation, an Er-
rorModel instance specifying the GPS_PosVec measurement type should be assigned
on a Receiver object, and that receiver should be assigned to the associated Space-
craft object.
Fields
Field Description
ErrorModels User-defined list of ErrorModel objects that describe the mea-
surement error models used for this receiver. The only error mod-
el type currently supported is GPS_PosVec. This parameter is
only needed when simulating or estimating using GPS_PosVec
data.
819
Reference Guide Orbit Determination
Field Description
PrimaryAntenna Antenna resource used by Receiver or Spacecraft resource to
receive a signal
Examples
Receiver1.PrimaryAntenna = DSNReceiverAntenna;
820
Orbit Determination Reference Guide
RejectFilter
Allows selection of data subsets for processing by the batch least squares estimator.
Description
The RejectFilter object is used to create criteria for the exclusion of subsets of the avail-
able data in the estimation process based on tracker, observed object, measurement
type, or time. Instances of RejectFilter are specified for use on the DataFilters field of
a TrackingFileSet or BatchEstimator object.
GMAT implements two levels of data editing for estimation. First-level editing criteria are
specified on the DataFilters field of the TrackingFileSet instance. At this level, the user
may choose what data is admitted into the overall pool of observations provided to the
estimator. Any data excluded at the tracking file set level will be immediately discarded
and not available to the estimation process.
A single reject filter may employ multiple selection criteria (for example simultaneous
thinning by time and tracker). Multiple criteria on a single filter are considered in an AND
sense. When multiple criteria are specified in a single filter, an observation must meet
all specified criteria to be rejected. Multiple filters with different selection criteria may
be specified on a single TrackingFileSet or BatchEstimator. When multiple filters are
specified, these act in an OR sense. Data meeting criteria for any of the specified filters
will be rejected.
Fields
Field Description
DataTypes List of data types
821
Reference Guide Orbit Determination
Field Description
EpochFormat Allows user to select format of the epoch
822
Orbit Determination Reference Guide
Field Description
ObservedObjects List of user-created tracked objects (e.g., name of the Spacecraft
resource being tracked).
Remarks
Some fields of RejectFilter are not applicable at either the first-level (tracking file set) or
second-level (estimator) editing stages. The RecordNumbers field has no functionality
when applied to a reject filter at the tracking file set level. The FileNames field has no
functionality when applied to a reject filter at the estimator level.
Examples
The following examples illustrate use of a RejectFilter for first-level data editing. At
this level, the RejectFilter instance should be assigned to the DataFilters field of a
823
Reference Guide Orbit Determination
TrackingFileSet. In these examples, data meeting the criteria specified by the reject
filter will be immediately discarded. All other data is admitted.
This example shows how to create a RejectFilter to reject all observations from station
GDS.
rf.Trackers = {'GDS'};
estData.DataFilters = {rf};
BeginMissionSequence;
The next example will reject all DSN Doppler (i.e., DSN_TCP) tracking measurements
from station GDS, and all tracking of any type from station CAN. All other tracking mea-
surements will be accepted.
rf1.Trackers = {'GDS'};
rf1.DataTypes = {'DSN_TCP'};
rf2.Trackers = {'CAN'};
BeginMissionSequence;
The following examples illustrate use of a RejectFilter for second-level data editing.
At this level, the RejectFilter instance should be assigned to the DataFilters field of a
BatchEstimator. In these examples, data meeting the criteria specified by the reject
filter will excluded from the estimation state update. Residuals will be computed for all
available data (all data admitted at the first level), but data rejected at the estimator level
will be flagged as user edited.
824
Orbit Determination Reference Guide
bls.DataFilters = {rf};
BeginMissionSequence;
The next example shows how to simultaneously employ multiple reject filters. In this
example:
• MAD range data over the span 10 Jun 2012 02:56 to 13:59 is rejected
• All CAN DSN_TCP data is rejected
• All RangeRate data (from any station) is rejected
rf1.Trackers = {'MAD'};
rf1.DataTypes = {'Range'};
rf1.EpochFormat = UTCGregorian;
rf1.InitialEpoch = '10 Jun 2012 02:56:00.000';
rf1.FinalEpoch = '10 Jun 2012 13:59:00.000';
rf2.Trackers = {'CAN'};
rf2.DataTypes = {'DSN_TCP'};
rf3.DataTypes = {'RangeRate'};
BeginMissionSequence;
825
Reference Guide Orbit Determination
Simulator
Configures the generation of simulated tracking data measurements.
Description
Fields
Field Description
AddData A list of one or more TrackingFileSets.
826
Orbit Determination Reference Guide
Field Description
EpochFormat Epoch format of both the initial and final epoch.
827
Reference Guide Orbit Determination
Field Description
Measurement- Specifies time step in seconds between two consecutive simulat-
TimeStep ed observations.
Remarks
GMAT navigation requires use of fixed stepped propagation. The Simulator resource
has a Propagator field containing the name of the Propagator resource that will be
used during the simulation. As shown in the Note below, there are some hard restrictions
on the choice of error control specified for the ForceModel resource associated with
your propagator.
Note
For simulation, the ErrorControl parameter specified for the ForceModel
resource associated with the Simulator Propagator must be set to 'None.'
Of course, when using fixed step control, the user must choose a step size,
as given by the Propagator InitialStepSize field, for the chosen orbit
regime and force profile, that yields the desired accuracy.
Propagator Settings
The Simulator resource has a Propagator field containing the name of the Propaga-
tor resource that will be used during the simulation process. The minimum step size,
MinStep, of your propagator should always be set to 0.
The GMAT simulator will account for central body occultations for spacecraft orbiting
bodies other than the Earth. For example, for a Moon-centered spacecraft, simulated
828
Orbit Determination Reference Guide
measurements will exclude any times when the line of sight between the spacecraft and
the ground station is blocked by the Moon. Note however, that GMAT currently uses a
spherical shape model for this occultation check. GMAT will use the polar radius of the
central body when performing the occultation check and any body oblateness is ignored.
Interactions
Resource Description
Tracking- Must be created in order to tell the Simulator resource, via the AddData
FileSet re- field, which data types will be simulated and to specify the name of the
source output tracking data file (via FileName)
Propagator Used by GMAT to generate the simulated orbit
resource
RunSimula- Must use the RunSimulator command to actually create the data defined
tor com- by the Simulator resource
mand
Examples
The example below illustrates using the simulator to generate DSN range measure-
ments. This example is more detailed than usual as it can actually be run to produce a
file, simData.gmd, that contains a single range measurement for a fictional DSN ground
station. For a more comprehensive example of simulating measurements, see the Sim-
ulate DSN Range and Doppler Data tutorial.
%Create and Configure Spacecraft
Create Spacecraft SimSat;
SimSat.DateFormat = UTCGregorian;
SimSat.Epoch = '19 Aug 2015 00:00:00.000';
SimSat.X = -126544963;
SimSat.Y = 61978518;
SimSat.Z = 24133225;
SimSat.VX = -13.789;
SimSat.VY = -24.673;
SimSat.VZ = -10.662;
SimSat.AddHardware = {SatTransponder, SatTranponderAntenna};
829
Reference Guide Orbit Determination
BeginMissionSequence;
RunSimulator sim;
830
Orbit Determination Reference Guide
Smoother
A backwards filter yielding an improved estimate of states through weighted combination
of forward and reverse sequential estimation.
Description
Warning
The Smoother is an alpha-level resource and should not be used for opera-
tional support. Access to this resource is disabled by default. To enable ac-
cess to the Smoother resource, comment-in the libEKF plug-in in the GMAT
gmat_startup_file.txt file.
Fields
Field Description
DelayRectify- Defines a period of time, beginning from warm start or initializa-
TimeSpan tion, for which the reference trajectory is generated from the a-
priori or initial state. As always, any measurements are used to
update the estimated state, but the measurements will not be ap-
plied to the reference trajectory used for linearization. After the
delay rectify time span has elapsed, the a-priori state is discard-
ed, and the current filter estimated state is used as the reference
trajectory for linearization, in accordance with normal operation
of an extended Kalman filter.
831
Reference Guide Orbit Determination
Field Description
Filter The forward-run Filter instance containing the states and covari-
ances to process in the smoother.
832
Orbit Determination Reference Guide
Field Description
ReportStyle Specifies the level of report output from the smoother. If Normal
mode is selected, only the smoother report file is generated. If
Verbose mode is selected, an additional output report file will be
generated from smoother the backward filter run. Selection of
Verbose mode requires the user to assign RUN_MODE = Test-
ing in the GMAT startup file.
Remarks
Fraser-Potter Smoother
Note
For batch estimation, the ErrorControl parameter specified for the Force-
Model resource associated with the ExtendedKalmanFilter Propagator
must be set to 'None.' Of course, when using fixed step control, the user must
choose a step size, as given by the Propagator InitialStepSize field, for
the chosen orbit regime and force profile, that yields the desired accuracy.
If MATLAB is installed and properly configured to interface with GMAT (see MATLAB
Interface), the user may generate a mat-file containing useful analysis data from the
Smoother run. This option is enabled by specifying a path and filename for the output
file on the MatlabFile field of the configured Smoother resource. Except as noted in the
833
Reference Guide Orbit Determination
tables below, the units for data in the mat-file are the same as those in the Smoother
output file; seconds, km, km/sec, DSN Range Units, Hz, and degrees.
The Smoother MATLAB file EstimationConfig, and Observed structures are identical
to those from the Filter resource and are described in the Filter resource documenta-
tion (see the section called “Kalman Filter MATLAB Data File”). The output from the
smoother backward filter run is stored in the BackwardComputed and BackwardFilter
structures of the smoother output file. These have the same structure and contents as
the Computed and Filter structures in the forward filter MATLAB file, and again are
described in the Filter resource documentation.
The smoother MATLAB file Computed structure differs slightly from its Filter counter-
part. Contents of the smoother Computed structure are described in the table below.
Variable Description
Elevation Computed elevation in degrees at the measurement
epoch. Does not apply (set to 0) for GPS_PosVec data.
IonosphericCorrection The magnitude of the ionospheric measurement correc-
tion. Units are the same as the measurement. See note
below regarding media corrections for X/Y angle mea-
surements.
Measurement Computed measurements. For GPS_PosVec, each cell
holds a 1x3 column vector of X, Y, Z computed mea-
surements.
MeasurementEditFlag The string observation edit flag. 'N' indicates unedit-
ed/accepted observations.
MeasurementNumber Measurement record number.
MeasurementPartials A cell array of matrices. Each member is a matrix of the
partial derivatives of the measurement with respect to
each element of the state. The partials are taken with
respect to the element type selected on the Spacecraft
SolveFors field. For example, if the user has chosen to
estimate the KeplerianState, the partials are with respect
to the Keplerian elements. The order of elements match-
es that given in the EstimationConfig state names. For
GPS_PosVec data, each cell holds a 3xN matrix, where
N is the number of estimated states. Each row contains
the partials with respect to the X, Y, and Z GPS_PosVec
measurement in order.
PreUpdateCovariance Filter state covariance prior to measurement update.
PreUpdateCovarianceVNB Filter state covariance prior to measurement update, in
the VNB reference frame.
Residual Filter state residual prior to measurement update.
PreUpdateState Filter state prior to measurement update.
834
Orbit Determination Reference Guide
Variable Description
ScaledResidual A unitless value representing the raw residual divided by
the sum of state noise (appropriately transformed) and
measurement noise. Schematically, Scaled Residual =
Raw Residual / (HPH' + R).
TroposphericCorrection The magnitude of the tropospheric measurement correc-
tion. Units are the same as the measurement. See note
below regarding media corrections for X/Y angle mea-
surements.
Variable Description
Covariance The smoother state covariance (Cartesian), after the
measurement or time update.
CovarianceVNB The smoother state covariance (VNB coordinates), after
the measurement or time update.
EpochTAI The TAI epoch of each smoother record. Each member
is a column vector where the first row is the epoch as a
MATLAB datenum and the second row is the epoch as a
GMAT TAIModJulian date.
EpochUTC The UTC epoch of each smoother record. Each member
is a column vector where the first row is the epoch as a
MATLAB datenum and the second row is the epoch as a
GMAT UTCModJulian date.
MeasurementNumber Measurement record number. Set to NaN for initial or
time update steps.
State Smoother state after the measurement or time update.
UpdateType Filter update mode (Initial, Time, or Measurement).
Examples
SMO.Filter = EKF;
SMO.PredictTimeSpan = 86400.;
SMO.ReportFile = 'smoother_run.txt';
SMO.MatlabFile = 'smoother_run.mat';
BeginMissionSequence;
RunSmoother SMO;
835
Reference Guide Orbit Determination
References
1. Carpenter, Russell and Chris D'Souza. Navigation Filter Best Practices. Technical
Report TP-2018-219822, NASA, April 2018.
2. D. C. Fraser and J. E. Potter, "The Optimum Linear Smoother as a Combination of
Two Optimum Linear Filters", IEEE Trans. Automat. Contr., vol. AC-14, no. 4, pp.
387-390, Aug. 1969.
836
Orbit Determination Reference Guide
Spacecraft Navigation
There are a number of Spacecraft fields that are used exclusively to support GMAT's
navigation (orbit determination) capability.
Description
Fields
Field Description
AddHardware List of Antenna, Transmitter, Receiver, and Transponder ob-
jects attached to a Spacecraft
837
Reference Guide Orbit Determination
Field Description
CrSigma Standard deviation of the coefficient of reflectivity, Cr. This field
is only used if the UseInitialCovariance field of the BatchEsti-
mator resource is set to True and Cr is being solved for.
838
Orbit Determination Reference Guide
Field Description
ProcessNoiseMod- An instance of ProcessNoiseModel. This is used by an Extend-
el edKalmanFilter to account for general force modeling errors.
Remarks
839
Reference Guide Orbit Determination
variance must represent a Keplerian covariance. Note that Keplerian covariance input
employs Mean Anomaly (MA) instead of True Anomaly. The current release of GMAT
only supports input of Keplerian orbit elements using TA and does not permit explicitly
setting an initial MA.
For more details, see the section called “UseInitialCovariance Restrictions” in the Batch
Estimator resource.
Examples
BeginMissionSequence
RunEstimator bat
Solve for Cd and the spacecraft Cartesian state assuming that the a priori information
is included in the estimation state vector.
BeginMissionSequence
Initial_6x6_covariance = ...
diag([1e-6 1e70 1e70 1e70 1e70 1e70]) %X pos known very well
Sat.OrbitErrorCovariance = Initial_6x6_covariance
Sat.CrSigma = 1e-6 %Cr known very well
RunEstimator bat
840
Orbit Determination Reference Guide
TrackingFileSet
Manages the observation data contained in one or more external tracking data files.
Description
A TrackingFileSet is required for both simulator and estimator runs. For a data simu-
lation run, the user must specify the desired tracking strings for the simulated data (via
AddTrackingConfig) and provide an output file name for the simulated tracking obser-
vations (via FileName). In simulation mode, the user may specify a range modulo con-
stant, Doppler count interval, and other parameters, depending on the type of tracking
data being simulated. See the remarks below for more details. For both the simulator
and estimator, measurement and media corrections may optionally be applied.
When running the estimator, the FileName parameter specifies the path to a pregener-
ated external tracking data file. It is not necessary to explicitly specify tracking configu-
rations when running the estimator; GMAT will examine the specified external tracking
data file and attempt to determine the tracking configurations automatically. GMAT will
throw an error message if it is unable to uniquely identify all objects found in the tracking
data file.
When running the estimator, one or more AcceptFilters and/or RejectFilters may be
employed to select from all available observations a smaller subset for use in the esti-
mation process.
Fields
Field Description
AberrationCorrec- Apply an aberration correction to angle measurements. This cor-
tion rection applies only to the angle measurement types.
841
Reference Guide Orbit Determination
Field Description
AddTrackingCon- One or more signal paths and measurement types for simulation
fig or estimation. See the Remarks section below for details on the
Tracking Strand specification.
842
Orbit Determination Reference Guide
Field Description
SimDopplerCoun- Specifies the Doppler count interval used for Doppler and range-
tInterval rate measurements. This value is only used in simulation mode.
843
Reference Guide Orbit Determination
Field Description
UseRelativityCor- Flag specifying if General Relativistic corrections should be made
rection to the computed measurements. If this flag is set, GMAT will ad-
just the computed light time to include the effects due to the co-
ordinate velocity of light and bending of the signal path. See Re-
marks below for more details.
Remarks
See Tracking Data Types for OD for a detailed listing of all tracking data types and
tracking data file formats supported by GMAT for orbit determination.
The SimRangeModuloConstant field is used only in the simulation of DSN range track-
ing data. The user may specify a value to be used for this field or may omit it, in which
case the default value is used. This field is not applicable to estimation. In estimation,
this value is provided in the input tracking data file.
When displaying or saving a TrackingFileSet object using the Write command, GMAT
will display a number of items relevant to simulating TDRS data formats. These options
are not implemented in the current release and should be ignored or manually removed
from the output file.
When simulating tracking data, at least one tracking strand must be specified using
the AddTrackingConfig parameter. The tracking strand must be enclosed within curly
braces. The format of the tracking strand depends on the measurement data type being
generated. Use the following table as a guide.
844
Orbit Determination Reference Guide
Measurement Corrections
The TrackingFileSet object is used to specify various corrections GMAT may apply
when deriving a computed measurement. Some corrections are not applicable to some
measurement types, and some are not implemented for certain measurement types.
You can use the following table to determine which corrections may be applied to each
measurement type. Selecting an inapplicable correction will not result in an error, but
no correction will be applied.
Examples
This example illustrates use of the TrackingFileSet object for simulation of DSN tracking
data. Specification of the tracking configurations (AddTrackingConfig) is optional when
running the estimator. If omitted, GMAT will attempt to automatically detect the tracking
configurations present in the tracking data file.
In this example, the frequency ramp table file dsn.ramp must be a preexisting ramp ta-
ble. GMAT will not simulate ramp table records. Alternatively, the user may omit speci-
fication of a ramp table when simulating data. If the ramp table is omitted, the simulator
will use the frequency specified on the Transmitter object attached to each GroundS-
tation.
Create TrackingFileSet dsnObs;
845
Reference Guide Orbit Determination
dsnObs.DataFilters = {af};
BeginMissionSequence;
PosVecObs.FileName = {'posvec_obs.gmd'};
PosVecObs.AddTrackingConfig = {{SimSat.GpsReceiver}, 'GPS_PosVec'};
SimMeas.DataFilters = {};
BeginMissionSequence;
846
Orbit Determination Reference Guide
Transmitter
Defines the electronics hardware, attached to a GroundStation resource, that transmits
an RF signal.
Description
A ground station needs a Transmitter to transmit the RF signal to both user space-
craft and to navigation spacecraft such as TDRS. A Transmitter is assigned on the
AddHardware list of an instance of a GroundStation.
Fields
Field Description
Frequency Transmit frequency
Remarks
Examples
847
Reference Guide Orbit Determination
Transmitter1.PrimaryAntenna = DSNAntenna;
Transmitter1.Frequency = 7186.3;
BeginMissionSequence;
848
Orbit Determination Reference Guide
Transponder
Defines the electronics hardware, typically attached to a spacecraft, that receives and
automatically re-transmits an incoming signal.
Description
The spacecraft Transponder model is required for modeling two-way coherent range
and Doppler data types. The Transponder object includes modeling of a retransmission
delay due to the spacecraft transponder electronics. You can also specify a turn around
ratio which is a multiplicative ratio describing how the frequency of the retransmitted
signal differs from the received frequency. The incoming and outgoing frequencies are
designed to be different so as to avoid RF interference between the signal transmitted
by the ground station to the spacecraft and the return signal from the spacecraft to the
ground station.
Fields
Field Description
HardwareDelay Transponder electronics delay between receiving time and trans-
mitting time at the transponder. It is applied for both simulation
and estimation, with or without ramp table use.
849
Reference Guide Orbit Determination
Field Description
TurnAroundRatio Transponder turn around ratio which is used in both simulation
and estimation. For the DSN Doppler data type where an input
ramp table is not used, changing the transponder turn around
ratio appreciably changes the measurement. For all DSN data
types, changing the turn around ratio affects the media correction
calculations which will typically result in a small change in the
measurement. See the RunSimulator and RunEstimator help
for additional details.
Remarks
Suppose you are given a signal with multiple ‘n’ legs. In order to calculate the media
(ionosphere) corrections for a given leg, we need to know the associated frequency for
that leg. The turn-around ratio is used to calculate the frequency for legs 2 through n. If
media corrections are modeled, then, for both DSN range and Doppler measurements,
the value of the turn-around ratio, as set in the Transponder resource, will have an
effect on the measurements and thus both simulation and estimation processes will be
affected.
Independent of media corrections, how does the turn around ratio, as set in the
Transponder resource, affect DSN measurements?
Assume that media corrections are turned off so that we can ignore any, typically small,
changes to the DSN measurements caused by media corrections. We make the follow-
ing observations.
850
Orbit Determination Reference Guide
As mentioned above, the DSN Doppler (TRK-2-34 Type 17) data type observation value
depends upon the transponder turn-around ratio. As shown in the tables in the RunSim-
ulator and RunEstimator help, for ramped Doppler data, GMAT only allows for the use
of the standard S-band (240/221) and X-band (880/749) turn-around ratios. For Doppler
data where a ramp table is not used, setting the Transponder turn-around ratio will
correctly model the Doppler data. GMAT cannot currently accommodate custom turn-
around ratios for ramped Doppler data.
Examples
Transponder1.PrimaryAntenna = HGA;
Transponder1.HardwareDelay = 0.0;
Transponder1.TurnAroundRatio = '240/221';
Commands
851
Reference Guide Orbit Determination
RunEstimator
Ingests navigation measurements and generates an estimated state vector
Script Syntax
RunEstimator BatchEstimator_InstanceName
RunEstimator ExtendedKalmanFilter_InstanceName
Description
Remarks
As part of the estimation process, GMAT must calculate the so-called observation resid-
ual, “O-C,” where “C” is the “Computed” measurement. As discussed in the RunSimu-
lator help, GMAT calculates the DSN range “C” measurement as
where
where
852
Orbit Determination Reference Guide
The value of C and M2 used to calculate the computed range or Doppler measurement
depends upon the data type and whether the data being ingested is ramped or non-
ramped according to the table below. The value of the transmit frequency used to calcu-
late the computed measurement depends upon whether or not the data being ingested
is ramped or non-ramped.
If you want the estimator to calculate a Doppler or range rate type of measurement (e.g.,
DSN_TCP and RangeRate) residual precisely, you will need to set the Earth nutation
update interval to 0 as shown below.
Earth.NutationUpdateInterval = 0
It is good general practice to set the Earth nutation update interval to zero for all mea-
surement types.
853
Reference Guide Orbit Determination
Examples
BeginMissionSequence
RunEstimator myBatchEstimator
854
Orbit Determination Reference Guide
RunSimulator
Generates simulated navigation measurements
Script Syntax
RunSimulator Simulator_InstanceName
Description
Remarks
After the RunSimulator command has finished execution, one or more output files, as
defined in the specified Simulator object, will be created. Each row of data in an output
file contains information about one specific measurement at a given time. The format
for a given row of data is described fully in the TrackingFileSet resource help.
Currently, GMAT supports two DSN data types, DSN TRK-2-34 type 7 (sequential
range) and DSN TRK-2-34 type 17 (Total count phase). As shown in the TrackingFileSet
resource help, for a type 7 measurement, a row of data has the following GMAT internal
file format.
TAIMJD DSN_SeqRange 9004 [Downlink Station ID] [S/C ID] [Range Observable (RU)] [Uplink Band] [Uplink Freq (Hz)] [Range Modulo (RU)]
where [Uplink Band] species the frequency band of the transmitting station as shown
in the table below.
Uplink Description
Band Value
0 Unknown or not applicable
1 S-band
2 X-band
3 Ka-band
4 Ku-band
5 L-band
855
Reference Guide Orbit Determination
where
As shown in the TrackingFileSet resource help, for a DSN TRK-2-34 type 17 measure-
ment, a row of data has the following GMAT internal file format.
# TAIMJD_t3e DSN_TCP 9006 [Downlink Station ID] [S/C ID] [Uplink Band] [DopplerCountInterval_seconds] [DopplerMeas_Hz]
where [Uplink Band] has been previously described and where DopplerMeas_Hz, the
Doppler measurement, is calculated according to
where
Note that (t3e - t3s) is known as the Doppler Count Interval and is an input field, Sim-
DopplerCountInterval, for the TrackingFileSet resource.
When you simulate DSN range or Doppler, you can choose whether or not the frequency
from the transmitting Ground Station is Non-ramped or Ramped. If you wish to model
ramped data, you must supply an input ramp table. The format of the input ramp table
is discussed in the TrackingFileSet resource help.
The table below shows how the values of Uplink Band, C, M2, and transmit frequency
are calculated. The second column shows how the Uplink Band, which is included in
the output file for both range and Doppler measurements, is calculated. For S-band, a
“1” is output and for X-band, a “2” is output.
The output GMAT Measurement Data (GMD) file contains the observable value which
is calculated using the equations shown above. The third column shows how the value
of C or M2, which is used to calculate the observation value shown in the GMD file, is
calculated.
Finally, the fourth column shows how the transmit frequency, which shows up directly
in the GMD file (for DSN range but not DSN Doppler) and is also used to calculate the
observation value given in the GMD file, is calculated.
856
Orbit Determination Reference Guide
As discussed in the Transponder Help, for both ramped and non-ramped data, the turn
around ratio set on the Transponder object, Transponder.TurnAroundRatio, will be
used to calculate the media corrections needed to determine the value of the simulated
range and Doppler measurements.
857
Reference Guide Orbit Determination
If you want to simulate a Doppler or range rate type of measurement (e.g., DSN_TCP
and RangeRate) precisely, you will need to set the Earth nutation update interval to 0
as shown below.
Earth.NutationUpdateInterval = 0
It is good general practice to set the Earth nutation update interval to zero for all mea-
surement types.
Examples
Run simulation.
%Perform a simulation
BeginMissionSequence
RunSimulator mySim
For a comprehensive example of running a simulation, see the Simulate DSN Range
and Doppler Data tutorial.
858
Orbit Determination Reference Guide
RunSmoother
Runs a sequential smoother estimator.
Script Syntax
RunSmoother Smoother_InstanceName
Description
Warning
Smoother is an alpha-level resource and should not be used for opera-
tional support. Access to this resource is disabled by default. To enable ac-
cess to the Smoother resource, comment-in the libEKF plug-in in the GMAT
gmat_startup_file.txt file.
Remarks
GMAT currently implements only one type of smoother, using the Fraser-Potter al-
gorithm. This algorithm runs a backwards filter starting from the last measurement
processed by the forward ExtendedKalmanFilter estimator and then generates an im-
proved state estimate by weighted average of the forward and reverse sequential filters.
Examples
BeginMissionSequence
RunEstimator myEKF
RunSmoother myFPSmoother
System
859
Reference Guide Orbit Determination
860
Orbit Determination Reference Guide
The GMAT measurement type names listed are the string names to be used in instances
of ErrorModel, AcceptFilter, RejectFilter, and TrackingFileSet, and in the GMAT
GMD-format tracking data file to identify each measurement type to GMAT.
GMAT uses a native ASCII tracking data file format called a “GMAT Measurement Data
File”, or GMD file. Each GMD file consists of a series of space-delimited ASCII records.
Details of the GMD file format for each observation type are provided in the following
sections. A single GMD file may contain one or more of the record types described
below, but ramp records must be in a separate file.
For further details on the TRK-2-34 raw data formats referenced below, please consult
Reference 2.
Angle Measurements
All angle measurement types (Azimuth, Elevation, XEast, YNorth, XSouth, and YEast)
share the same GMD file format. The generic angle observation is measured in degrees
and represents rotation angles in the topocentric reference frame depicted in Figure 9-2
of Reference 1. The GMD record format for angle observation data is shown in the table
below.
Field Description
1 Observation receive time in TAIModJulian
2 Observation type name - Azimuth, Elevation, XEast, YNorth, XSouth, or
YEast
861
Reference Guide Orbit Determination
Field Description
3 Observation type index number:
A sample of GMD data records for Azimuth and Elevation data is shown below.
% - 1 - - 2 - 3 4 5 - 6 -
26088.5524768518518518444200 Azimuth 9016 MAD LEOSat 4.8265973546050333e+001
26088.5524768518518518444200 Elevation 9017 MAD LEOSat 1.2679724467383584e+001
26088.5531712962962962888639 Azimuth 9016 MAD LEOSat 5.9562253624641066e+001
26088.5531712962962962888639 Elevation 9017 MAD LEOSat 1.6962633728400046e+001
26088.5538657407407407333080 Azimuth 9016 MAD LEOSat 7.4485459451069659e+001
26088.5538657407407407333080 Elevation 9017 MAD LEOSat 2.0586055229649272e+001
26088.5545601851851851777532 Azimuth 9016 MAD LEOSat 9.2442509281488796e+001
26088.5545601851851851777532 Elevation 9017 MAD LEOSat 2.2241223403621646e+001
Field Description
1 Observation receive time in TAIModJulian
2 Observation type name - DSN TRK-2-34 Type 7 Sequential Range =
DSN_SeqRange
3 Observation type index number - 9004 = DSN_SeqRange (TRK-2-34)
4 Downlink Ground station pad ID
5 Spacecraft ID
6 Range observable (meas_rng or rng_obs from TRK-2-34 Sequential
Range CHDO, with appropriate corrections applied)
7 Uplink frequency band indicator - 0 = unknown, 1 = S-band, 2 = X-band,
3 = Ka-band, 4 = Ku-band, 5 = L-band
8 Uplink frequency in Hz
9 Range modulo value (rng_modulo from TRK-2-34 Sequential Range
CHDO)
862
Orbit Determination Reference Guide
The transmit frequency specified in the TRK-2-34 range data GMD file is only used if a
frequency ramp table is not available. If a transmit frequency ramp record file is provided
on the TrackingFileSet.RampTable field, the transmit frequency will be determined
from the ramp table and the frequency specified in the range data GMD file will be
ignored. A sample of GMD data records for TRK-2-34 Sequential Range data is shown
below.
% - 1 - - 2 - 3 4 5 - 6 - 7 - 8 - - 9 -
27236.157789352 DSN_SeqRange 9004 45 59 +9.810325186004e+005 1 +2.091414432000e+009 +1.048576000000e+006
27236.158240741 DSN_SeqRange 9004 45 59 +5.813243487947e+005 1 +2.091414432000e+009 +1.048576000000e+006
27236.158692130 DSN_SeqRange 9004 45 59 +1.863046908683e+005 1 +2.091414432000e+009 +1.048576000000e+006
27236.159143519 DSN_SeqRange 9004 45 59 +8.450116485521e+005 1 +2.091414432000e+009 +1.048576000000e+006
DSN TRK-2-34 Total Count Phase employs the DSN_TCP measurement type. As
shown below, the GMAT Doppler measurement type, measured in Hz, is derived from
successive Total Phase Count (TCP) observations.
where
The GMD record format for DSN_TCP tracking data is shown in the table below.
Field Description
1 Observation receive time in TAIModJulian
2 Observation type name - DSN TRK-2-34 Type 17 Total Count Phase =
DSN_TCP
3 Observation type index number - 9006 = DSN_TCP (TRK-2-34)
4 Downlink ground station pad ID
5 Spacecraft ID
6 Uplink frequency band indicator - 0 = unknown, 1 = S-band, 2 = X-band,
3 = Ka-band, 4 = Ku-band, 5 = L-band
7 Doppler count interval in seconds
8 Observation value - Doppler observable derived from Total Count Phase
(TCP) TRK-2-34 Type 17 measurements
A sample of GMD data records for TRK-2-34 Total Count Phase derived Doppler data
is shown below.
% - 1 - - 2 - 3 4 5 6 7 - 8 -
27226.011944444 DSN_TCP 9006 15 6241 1 10 -2.2445668331979342e+09
27226.012060185 DSN_TCP 9006 15 6241 1 10 -2.2445668330920730e+09
27226.012175926 DSN_TCP 9006 15 6241 1 10 -2.2445668329843016e+09
27226.012291667 DSN_TCP 9006 15 6241 1 10 -2.2445668328729177e+09
863
Reference Guide Orbit Determination
GMAT supports DSN tracking utilizing both constant and ramped transmit frequencies.
If the transmit frequency is constant, GMAT will use the transmit frequency specified on
the DSN_SeqRange measurement records for the computation of the range observation
and a ramp table file is not required. If the transmit frequency is ramped, the user must
generate a GMD file of ramp records from TRK-2-34 Type 9 raw data, and provide the
GMD ramp table on the TrackingFileSet.RampTable object field. If a ramp table is
provided, GMAT ignores the frequency specified on the DSN_SeqRange records and
instead computes the transmit frequency from the ramp records.
The record format for ground-based range-rate tracking data is shown in the table below.
Field Description
1 Ramp record epoch in TAIModJulian
2 Ground station pad ID
3 Spacecraft ID
4 Uplink frequency band indicator - 0 = unknown, 1 = S-band, 2 = X-band,
3 = Ka-band, 4 = Ku-band, 5 = L-band
5 Ramp type - 0 = snap, 1 = start of new ramp, 2 = medial report, 3 = pe-
riodic report, 4 = end of ramps, 5 = ramping terminated by operator, 6 =
invalid/unknown
6 Ramp frequency in Hz
7 Ramp rate in Hz/sec
% - 1 - 2 3 4 5 - 6 - - 7 -
27238.640625000 34 234 2 1 +7.186571173393e+09 +6.010599999990e-01
27238.654513889 34 234 2 1 +7.186571894665e+09 +5.822699999990e-01
27238.659664352 34 234 2 3 +7.186572153775e+09 +5.822699999990e-01
27238.668402778 34 234 2 1 +7.186572593389e+09 +5.590199999990e-01
27238.682291667 34 234 2 1 +7.186573264213e+09 +5.315100000000e-01
Field Description
1 Observation receive time in TAIModJulian
2 Observation type name - GPS_PosVec
3 Observation type index number - 9014 = GPS_PosVec
4 GPS receiver ID
864
Orbit Determination Reference Guide
Field Description
5 Earth-fixed position X component (km)
6 Earth-fixed position Y component (km)
7 Earth-fixed position Z component (km)
The GMAT user should be aware that the GPS_PosVec measurement is currently treat-
ed as a vector quantity. The vector components are not treated as independent obser-
vations. If any component of a vector observation (X, Y, or Z) is edited from the solution
by the user or by autonomous sigma editing, the other components associated with that
observation will also be edited out, regardless of their quality.
% - 1 - - 2 - 3 4 - 5 - - 6 - - 7 -
26112.586516203704 GPS_PosVec 9014 800 -3575.594419 -5758.828897 1440.891615
26112.587210648147 GPS_PosVec 9014 800 -3257.134099 -5984.420574 1265.579859
26112.587905092594 GPS_PosVec 9014 800 -2926.558570 -6187.149174 1084.793371
26112.588599537037 GPS_PosVec 9014 800 -2585.076391 -6366.230816 899.311591
26112.589293981480 GPS_PosVec 9014 800 -2233.950454 -6520.997704 709.941434
Two-way range measurements that pass through a Spacecraft transponder use the
Range measurement type. Range is an unambiguous round-trip range observation
measured in kilometers. The measurement model in GMAT will include the Spacecraft
Transponder.HardwareDelay, but the HardwareDelay may be set to zero. The GMD
record format for Range data is shown in the table below.
Field Description
1 Observation receive time in TAIModJulian
2 Observation type name - Range
3 Observation type index number - 9002 = Range
4 Downlink ground station pad ID
5 Spacecraft ID
6 Two-way (round-trip) range observation in kilometers
% - 1 - - 2 - 3 4 5 - 6 -
27182.022395833334 Range 9002 117 322 +7.447171160686e+04
27182.022511574076 Range 9002 117 322 +7.447456623065e+04
27182.022627314815 Range 9002 117 322 +7.447742325277e+04
27182.022743055557 Range 9002 117 322 +7.448028087448e+04
Two-way range measurements that do not pass through a Spacecraft transponder use
the Range_Skin measurement type. Range_Skin is an unambiguous round-trip range
observation measured in kilometers. Users of tracking data in raw 46-character or NO-
865
Reference Guide Orbit Determination
RAD B3 format should be aware that these formats encode a one-way range value, so
the reported range measurement must be converted to a two-way value (by multiplying
the observed range by 2) when formatting this data into a GMD file. The GMD record
format for Range_Skin data is shown in the table below.
Field Description
1 Observation receive time in TAIModJulian
2 Observation type name - Range_Skin
3 Observation type index number - 9024 = Range_Skin
4 Receive ground station pad ID
5 Spacecraft ID
6 Two-way (round-trip) range observation in kilometers
% - 1 - - 2 - 3 4 5 - 6 -
27182.022395833334 Range_Skin 9024 117 322 +7.447171160686e+04
27182.022511574076 Range_Skin 9024 117 322 +7.447456623065e+04
27182.022627314815 Range_Skin 9024 117 322 +7.447742325277e+04
27182.022743055557 Range_Skin 9024 117 322 +7.448028087448e+04
Two-Way Range-Rate
Field Description
1 Observation receive time in TAIModJulian
2 Observation type name - RangeRate
3 Observation type index number - 9012 = RangeRate
4 Downlink ground station pad ID
5 Spacecraft ID
6 Uplink frequency band indicator - 0 = unknown, 1 = S-band, 2 = X-band,
3 = Ka-band, 4 = Ku-band, 5 = L-band
7 Doppler averaging interval in seconds
8 Range-rate observation in kilometers/second
866
Orbit Determination Reference Guide
References
1. Moyer, Theodore D., Formulation for Observed and Computed Values of Deep Space
Network Data Types for Navigation, (JPL Publication 00-7), Jet Propulsion Labora-
tory, California Institute of Technology, October 2000.
2. Shin, Dong., DSN Tracking System Data Archival Format, DSN Document 820-013,
Module TRK-2-34, Rev. P, 2017.
867
868
Reference Guide
Programming
This chapter contains documentation for Resources and Commands related to script
programming and customization functionality.
Resources
869
Reference Guide Programming
Array
A user-defined one- or two-dimensional array variable
Description
The Array resource is used to store a one- or two-dimensional set of numeric values,
such as a vector or a matrix. Individual elements of an array can be used in place of a
literal numeric value in most commands.
Arrays must be dimensioned at the time of creation, using the following syntax:
Array values are initialized to zero at creation. Values can be assigned individually using
literal numeric values or (in the Mission Sequence) Variable resources, Array resource
elements, resource parameters of numeric type, or Equation commands that evaluate
to scalar numeric values.
An Array can also be assigned as a whole in the Mission Sequence using another Array
resource or an Equation that evaluates to an array. Both sides of the assignment must
be identically-sized.
Fields
The Array resource has no fields; instead, the resource elements themselves are set
to the desired values.
Field Description
rows The number of rows (during creation), or the row being addressed. The
total size of the array is rows × columns. This field is required.
870
Programming Reference Guide
Field Description
columns The number of columns (during creation), or the column being addressed.
The total size of the array is rows × columns. This field is required.
GUI
The GMAT GUI lets you create multiple Array resources at once without leaving the
window. To create an Array:
1. In the Array Name box, type the desired name of the array.
2. In the Row and Column boxes, type the desired number of rows and columns, re-
spectively. To create a one-dimensional array, set Row to 1.
3. Click the => button to create the array and add it to the list on the right.
4. Click the Edit button to edit the array element values.
You can create multiple Array resources this way. To edit an existing array in this win-
dow, click it in the list on the right. Click Edit to change the element values, or edit the
Row and Column values. You must click the => button again to save changes to the
size of the array.
871
Reference Guide Programming
You can edit the elements of an Array by either clicking Edit while creating an array, or
by double-clicking the array in the resources tree in the main GMAT window. The edit
window allows you to change array elements individually using the row and column lists
and clicking Update, or by directly entering data in the table in the lower portion of the
window. The data table recognizes a few different mouse and keyboard controls:
Remarks
GMAT Array resources store an arbitrary number of numeric values organized into one
or two dimensions, up to a maximum of 1000 elements per dimension. Internally, the
elements are stored as double-precision real numbers, regardless of whether or not
fractional portions are present. Array resources can be created and assigned using one
or two dimension specifiers. This example shows the behavior in each case:
872
Programming Reference Guide
Examples
BeginMissionSequence
fib(1) = 0
fib(2) = 1
For i=3:9
idx1 = i-1
idx2 = i-2
fib(i) = fib(idx1) + fib(idx2)
EndFor
Report aReport fib
873
Reference Guide Programming
GMATFunction
Declaration of a GMAT function
Description
The GmatFunction resource declares a new GMAT function or can be used to load-
in a pre-existing GMAT function. This function can be called in the Mission Sequence
through GMAT's CallGmatFunction command. See the CallGmatFunction reference
for details.
Through this GMAT function, data can be passed in the function as input and received
as output. Data that is passed into the function as input or received from the function as
output can also be declared as global. See the Global reference for more details. See
also the Remarks and Examples sections for detailed discussion on GMAT functions
and how to use them.
Fields
Field Description
Function- Allows the user to define a valid function path. In the GUI, the Function-
Path Path field is activated after editing the function and then clicking on the
function's Save As button. The path of the function can be defined as either
absolute or relative.
GUI
1. In the Resources Tree, right click on the Functions folder, select Add -> GMAT
Function -> New
2. In the New GMAT function dialog box, type the desired name of your function.
874
Programming Reference Guide
The GmatFunction resource's GUI window is very simple. When a new GMAT function
is created through the GUI, the FunctionPath field is defined by first editing the function
and then clicking on the Save As button. This lets you graphically define the path.
Remarks
Input and Output Arguments
Arguments can be passed into a GMAT function as input and returned from a GMAT
function as output. You can pass GMAT objects as input to a function and receive entire
objects as output from the function. If a given GMAT object is not declared as global in
both the main script and in the function, then all objects that are passed into or received
as output from the function are considered to be local to that function and the main script.
In GMAT, you can use CallGmatFunction command to pass GMAT objects as input
arguments and receive objects as output from the function. In general, any objects in
GMAT's Resources tree can be passed as input to the function. Most common objects
that a user is likely to pass as input to the function are objects that are related to prop-
875
Reference Guide Programming
Below is a list of allowed objects that can be passed as input and output to and from
the function. Also see Examples section that show two distinct methods in two separate
examples of how to pass local objects as inputs to the function, perform an operation
inside the function, then receive local objects as outputs from the function.
In GMAT, objects can be declared as global by using the Global command in the Mis-
sion tree. All default objects present in GMAT's Resources tree or any new user-defined
resources can be declared as global. Currently any default or new user-defined coor-
dinate systems, SolarSystemBarycenter, SolarSystem, default or new user-defined
propagators are automatic global objects and not needed to be specifically declared as
global via the Global command.
Often times, there will be cases when you will propagate a spacecraft both in the main
script and from inside the GMAT function. Additionally users may want to report and/
or plot spacecraft's trajectory, parameters, variables, arrays and strings to same sub-
scribers both from the main script and/or solely from inside the function. If you want
to report and plot continuous set of data to any of the five subscribers (i.e. OrbitView,
GroundTrackPlot, XYPlot, ReportFile, EphemerisFile), then always declare your
Spacecraft object and subscriber objects as global both in the main script and inside
the function. Abiding by this rule draws plots, reports and ephemeris files correctly and
flow of data will be reported continuously to all the subscribers.
In general, a good scripting practice is that objects that have been declared global don't
need to be sent as input or output arguments to and from the function. For example,
if Spacecraft, all subscriber objects or objects that are used to perform propagation,
targeting or optimization have already been declared global, then you don't to be redun-
dant and send those global objects again as input or receive them as output from the
function. Having said that, GMAT does allow globally declared objects such as Space-
876
Programming Reference Guide
See Examples section that shows three examples of how to declare spacecraft, all five
subscribers and variables/arrays as global in both the main script and inside the function.
As you run the examples, notice that the flow of data reported to all five subscribers
is continuous.
GMAT allows you to use simple GMAT functions in the main script in an assignment
command mode. Below example snippet shows how to use simple GMAT functions
in mathematical statements. Note that in the below snippet, function path to GMAT
function's FunctionPath field was not specifically defined. Whenever the FunctionPath
field is not defined in the script mode, then preferred default path of these functions is
in the following directory where GMAT was installed: ..GMAT\userfunctions\gmat\
Create ReportFile rf
Create Variable x y z pi in
Create Array A[2,2] B[2,2]
BeginMissionSequence
A(1,1) = 1
A(1,2) = 3
A(2,1) = 4
A(2,2) = 2
% two inputs:
in = 0.5
y = Math_GmatAtan2(in, x)^2
Report rf y
877
Reference Guide Programming
% array input/output:
B = Math_GmatInv(A)'
Report rf B
Examples
Method 1 of how to pass local objects into the function and receiving local objects as
the output from the function. Pass local spacecraft, other local objects into the function,
perform hohmann targeting inside the function, receive updated local spacecraft, local
variables as output and finally report them to local subscribers in the main script. Since
the spacecraft and all five subscribers were only local objects (i.e. not declared as glob-
al), hence notice that all subscribers begin to draw and report data once the updated
spacecraft is returned back and propagated in the main script.
878
Programming Reference Guide
Create DifferentialCorrector DC
Create ReportFile rf
rf.Add = {aSat.UTCGregorian, aSat.EarthMJ2000Eq.X, ...
aSat.EarthMJ2000Eq.Y, aSat.EarthMJ2000Eq.Z, ...
aSat.EarthMJ2000Eq.VX, aSat.EarthMJ2000Eq.VY, aSat.EarthMJ2000Eq.VZ}
BeginMissionSequence;
% Pass local S/C, local objects into function and receive back
% updated local S/C and local variables:
'Hohmann Transfer'[DV1, DV2, aSat] ...
= Targeter_Inside_Function(aSat, aProp, TOI, GOI, DC)
TOI.Element1 = DV1
879
Reference Guide Programming
GOI.Element1 = DV2
BeginMissionSequence
dv1 = TOI.Element1
dv2 = GOI.Element1
Method 2 of how to pass local objects into the function and receiving local objects as the
output from the function. In this method, notice that we now only pass local spacecraft
as input to the function. Instead of passing additional local objects into the function, we
now create those required local objects inside the function itself. Similar to method 1, we
perform hohmann targeting inside the function, then send updated spacecraft and vari-
ables back to the main script as output from the function. Finally updated spacecraft is
propagated for one day in main script and reported by all subscribers. Since the space-
craft and all five subscribers were only local objects (i.e. not declared as global), hence
notice that all subscribers begin to draw and report data once the updated spacecraft
begins propagation in the main script.
880
Programming Reference Guide
Create DifferentialCorrector DC
Create ReportFile rf
rf.Add = {aSat.UTCGregorian, aSat.EarthMJ2000Eq.X, ...
aSat.EarthMJ2000Eq.Y, aSat.EarthMJ2000Eq.Z, ...
aSat.EarthMJ2000Eq.VX, aSat.EarthMJ2000Eq.VY, aSat.EarthMJ2000Eq.VZ}
BeginMissionSequence;
% Pass only local S/C into the function and receive back
% updated local S/C and local variables:
'Hohmann Transfer'[DV1, DV2, aSat] ...
= Targeter_Inside_Function(aSat)
881
Reference Guide Programming
TOI.Element1 = DV1
GOI.Element1 = DV2
Create DifferentialCorrector DC
BeginMissionSequence
882
Programming Reference Guide
dv1 = TOI.Element1
dv2 = GOI.Element1
In this example, we declare spacecraft, all subscribers and other objects as global in
both main script and in function. Propagate inside the function, perform targeting inside
function, and report local variables, global spacecraft state and global variable (DV1,
DV2) to global reportfile. Next, we continue to propagate in the main script and continue
to report spacecraft state to global reportfile in the main script. After running this exam-
ple, pay special attention to all subscribers. Note that spacecraft trajectory is plotted
continuously on three plotting subscribers and data is reported continuously as well to
both reportfiles and ephemerisfile.
Create DifferentialCorrector DC
Create ReportFile rf
rf.Add = {aSat.UTCGregorian, aSat.EarthMJ2000Eq.X, ...
aSat.EarthMJ2000Eq.Y, aSat.EarthMJ2000Eq.Z, ...
aSat.EarthMJ2000Eq.VX, aSat.EarthMJ2000Eq.VY, aSat.EarthMJ2000Eq.VZ}
883
Reference Guide Programming
BeginMissionSequence;
% Call function:
Global_Subscribers()
function Global_Subscribers()
Global aSat
Global aFM TOI GOI DC
Global anOrbitView GroundTrackPlot1 XYPlot1 rf rf2 anEphemerisFile
Global DV1 DV2
884
Programming Reference Guide
BeginMissionSequence
sc_epoch = aSat.UTCModJulian
utc_epoch = aSat.UTCGregorian
x = aSat.X
y = aSat.Y
z = aSat.Z
vx = aSat.VX
vy = aSat.VY
vz = aSat.VZ
dv1 = TOI.Element1
dv2 = GOI.Element1
% Report Global variables DV1 and DV2 to global 'rf2' in main script:
DV1 = TOI.Element1
DV2 = TOI.Element1
Just as previous example, we declare spacecraft, all subscribers and other objects as
global in both main script and in function. This time GMAT function is nested inside
control logic statements like While and If-EndIf. LEO station-keeping is performed inside
the function. As the example will be running, pay special attention to all subscribers.
Note that spacecraft trajectory is plotted continuously on three plotting subscribers and
data is reported continuously as well to both reportfiles and ephemerisfile.
885
Reference Guide Programming
Create DifferentialCorrector DC
Create ReportFile rf
886
Programming Reference Guide
TargetLEOStationKeeping.FunctionPath = ...
'C:\Users\rqureshi\Desktop\TargetLEOStationKeeping.gmf'
BeginMissionSequence
desiredRMAG = 6737
desiredECC = 0.00005
EndIf
EndWhile
function TargetLEOStationKeeping(desiredRMAG,desiredECC)
BeginMissionSequence
Global LEOsat
Global DC TCM1 TCM2 LEOprop_ForceModel
Global DefaultOrbitView XYPlot1 GroundTrackPlot1
Global rf rf2 anEphemerisFile
887
Reference Guide Programming
In this example, all arrays, string and a single subscriber are declared global both in
main script and inside function. Note that global arrays are passed into the function,
cross products are computed and computed global arrays (v5, v6) are sent back to the
main script. Also note that global arrays, string are reported to global report file in both
main script and inside the function.
Create ReportFile rf
rf.WriteHeaders = false
BeginMissionSequence
v1(1,1) = 1
v1(2,1) = 2
v1(3,1) = 3
v2(1,1) = 4
v2(2,1) = 5
v2(3,1) = 6
v3(1,1) = 8
v3(2,1) = 9
v3(3,1) = 10
v4(1,1) = 10
v4(2,1) = 11
v4(3,1) = 12
888
Programming Reference Guide
tempstring = '--------------------'
Report rf tempstring
BeginMissionSequence
Global v1 v2 v3 v4 v5 v6 tempstring rf
v1 = v1 + 1
v2 = v2*2
v3 = v3/2
v4 = v4 + v4
889
Reference Guide Programming
MatlabFunction
Declaration of an external MATLAB function
Description
The MatlabFunction resource declares to GMAT that the name given refers to an ex-
isting external function in the MATLAB language. This function can be called in the Mis-
sion Sequence like a built-in function, with some limitations. See the CallMatlabFunc-
tion reference for details. Both user-created functions and built-in functions (like cos or
path) are supported.
GMAT supports passing data to and from MATLAB through the function. It requires that
a supported and properly configured version of MATLAB exist on the system. See the
MATLAB Interface documentation for general details on the interface.
Fields
Field Description
Function- Paths to add to the MATLAB search path when the associated function is
Path called. Separate multiple paths with semicolons (on Windows) or colons
(on other platforms).
GUI
The MatlabFunction GUI window is very simple; it has a single file input box for the
function path, and a Browse button that lets you graphically select the path.
890
Programming Reference Guide
Remarks
Search Path
If multiple MATLAB functions are called within a run, the FunctionPath fields for each
are prepended to the search path at the time of the function call.
Multiple paths can be combined in the FunctionPath field by separating the paths with
a semicolon (on Windows) or a colon (on Mac OS X and Linux).
Working Directory
When MATLAB starts in the background, its working directory is set to the GMAT bin
directory.
Examples
BeginMissionSequence
x = 1
[y] = sinh(x)
891
Reference Guide Programming
BeginMissionSequence
% propagate to apoapsis
Propagate aProp(aSat) {aSat.Apoapsis}
BeginMissionSequence
[pathStr] = path
[pwdStr] = pwd
892
Programming Reference Guide
String
A user-defined string variable
Description
The String resource is used to store a string value for use by commands in the Mission
Sequence.
Fields
The String resource has no fields; instead, the resource itself is set to the desired value.
Field Description
value The value of the string variable.
'STRING_PARAMETER_UNDEFINED' (script)
Units N/A
Interfaces GUI, script
GUI
893
Reference Guide Programming
The GMAT GUI lets you create multiple String resources at once without leaving the
window. To create a String:
1. In the String Name box, type the desired name of the string.
2. In the String Value box, type the initial value of the string. This is required and must
be a literal string value. Quotes are not necessary when setting the value.
3. Click the => button to create the string and add it to the list on the right.
You can create multiple String resources this way. To edit an existing string in this
window, click it in the list on the right and edit the value. You must click the => button
again to save your changes.
You can also double-click an existing String in the resources tree in the main GMAT
window. This opens the string properties box above that allows you to edit the value of
that individual string.
Remarks
String resources can (in the Mission Sequence) be set using numeric Variable re-
sources. The numeric value of the Variable is converted to a string during the assign-
ment. The numeric value is converted to a string representation in either floating-point
or scientific notation (whichever is more appropriate) with a maximum of 16 significant
figures.
Examples
BeginMissionSequence
894
Programming Reference Guide
Variable
A user-defined numeric variable
Description
The Variable resource is used to store a single numeric value for use by commands
in the Mission Sequence. It can be used in place of a literal numeric value in most
commands. Variable resources are initialized to zero on creation, and can be assigned
using literal numeric values or (in the Mission Sequence) Variable resources, Array
resource elements, resource parameters of numeric type, or Equation commands that
evaluate to scalar numeric values.
Fields
The Variable resource has no fields; instead, the resource itself is set to the desired
value.
Field Description
value The value of the variable.
GUI
The GMAT GUI lets you create multiple Variable resources at once without leaving the
window. To create a Variable:
1. In the Variable Name box, type the desired name of the variable.
895
Reference Guide Programming
2. In the Variable Value box, type the initial value of the variable. This is required and
must be a literal numeric value.
3. Click the => button to create the variable and add it to the list on the right.
You can create multiple Variable resources this way. To edit an existing variable in this
window, click it in the list on the right and edit the value. You must click the => button
again to save your changes.
You can also double-click an existing variable in the resources tree in the main GMAT
window. This opens the Variable properties box above that allows you to edit the value
of that individual variable.
Remarks
GMAT Variable resources store a single numeric value. Internally, the value is stored
as a double-precision real number, regardless of whether or not a fractional portion is
present.
Examples
BeginMissionSequence
896
Programming Reference Guide
BeginMissionSequence
step = 60
totalDuration = 24*60^2 % one day
nSteps = totalDuration / step
Commands
897
Reference Guide Programming
Assignment (=)
Set a variable or resource field to a value, possibly using mathematical expressions
Script Syntax
settable_item = expression
Description
The assignment command (in the GUI, the Equation command) allows you to set a
resource field or parameter to a value, possibly using mathematical expressions. GMAT
uses the assignment operator ('=') to indicate an assignment command. The assignment
operator uses the following syntax, where LHS denotes the left-hand side of the opera-
tor, and RHS denotes the right-hand side of the operator:
LHS = RHS
In this expression, the left-hand side (LHS) is being set to the value of the right-hand
side (RHS). The syntax of the LHS and RHS expressions vary, but both must evaluate to
compatible data types for the command to succeed.
Left-hand side
The left-hand side of the assignment command must be a single item of any of the
following types:
See the documentation for a particular resource to determine which fields and parame-
ters can be set.
Right-hand side
The right-hand side of the assignment command can consist of any of the following:
• literal value
• resource (e.g. Spacecraft, Variable, Array)
• resource field (e.g. Spacecraft.Epoch, Spacecraft.DateFormat)
• resource parameter (e.g. Spacecraft.X, ChemicalThruster.K1)
• Array or Array element
• mathematical expression (see below)
MATLAB function calls are considered distinct from the assignment command. See the
reference pages for more information.
898
Programming Reference Guide
GUI
The assignment command in the script language corresponds to the Equation com-
mand in the GUI. The Equation properties box allows you to input both sides of the
expression into free-form text boxes. The default values on each side are “Not_Set”;
these are placeholders only, and are not valid during the mission run. You can type into
each box the same syntax described above for the script language. When you click OK
or Apply, GMAT validates each side of the expression and provides feedback for any
warnings or errors.
Remarks
In general, the data types of the left-hand side and the right-hand side must match after
all expressions are evaluated. This means that a Spacecraft resource can only be set
to another Spacecraft resource, numeric parameters can only be set to numeric values,
and String resources can only be set to string values. Additionally, the dimension of
Array instances must match for the command to succeed. For numeric quantities, the
assignment command does not distinguish between integers and floating-point values.
Parameters
Parameters can be used on either side of an assignment command, but there may be
certain restrictions.
On the right-hand side of the command, any parameter can be used. If a parameter ac-
cepts a dependency (such as Spacecraft.CoordinateSystem.X) and the dependency
is omitted, a default dependency value will be used. For coordinate-system-dependent
parameters, the default is EarthMJ2000Eq. For central-body-dependent parameters,
the default is Earth.
On the left-hand side, only settable (writable) parameters can be used. Furthermore,
no dependency can be specified, except in the special case that the dependencies on
both sides of the assignment command are equivalent. On the left-hand side, the default
values of omitted dependencies are automatically taken to be the current values of the
CoordinateSystem field of the referenced Spacecraft and its origin.
899
Reference Guide Programming
aSat2.CoordinateSystem = 'EarthFixed'
Create Variable x
BeginMissionSequence
x = aSat1.EarthFixed.X % Valid: Parameter with dependency on RHS
x = aSat1.EarthMJ2000Eq.X % Valid: This and next statement are equiv.
x = aSat1.X % Valid: Default dep. value is EarthMJ2000Eq.
% DANGEROUS! Valid, but sets EarthMJ2000Eq RHS values to EarthFixed LHS param.
aSat2.X = aSat1.EarthMJ2000Eq.X
Mathematical Expressions
The assignment command supports the use of inline mathematical expressions on the
right-hand side of the command. These expressions follow the general syntax rules of
MATLAB expressions, and can use a variety of operators and built-in functions.
Parsing
Data Types
• literal values
• numeric resources (Variable, Array)
• gettable resource parameters (e.g. Spacecraft.X, ChemicalThruster.K1)
• Array elements
• calculation parameters (e.g. Spacecraft.OrbitPeriod)
• nested mathematical expressions
900
Programming Reference Guide
Several of GMAT’s operators and functions are vectorized, so they operate on full Array
resources as well as scalar numeric values.
Operators
Vector- + Addition or unary plus. X+Y adds X and Y. X and Y must have the same
ized oper- dimensions unless either is a scalar.
ators - Subtraction or unary minus. -X is the negative of X, where X can be any
size. X-Y subtracts Y from X. X and Y must have the same dimensions
unless either is a scalar.
* Multiplication. X*Y is the product of X and Y. If both X and Y are scalars,
this is the simple algebraic product. If X is a matrix or vector and Y
is a scalar, all elements of X are multiplied by Y (and vice versa). If
both X and Y are non-scalar, X*Y performs matrix multiplication and the
number of columns in X must equal the number of rows in Y.
' Transpose. X' is the transpose of X. If X is a scalar, X' is equal to X.
Scalar op- / Division. X/Y divides X by Y. If both X and Y are scalars, this is the simple
erators algebraic quotient. If X is a matrix or vector, each element is divided by
Y. Y must be a non-zero scalar quantity.
^ Power. X^Y raises X to the Y power. X and Y must be scalar quantities.
A special case is X^(-1), which when applied to a square matrix X,
returns the inverse of X.
When multiple expressions are combined, GMAT uses the following order of operations.
Operations begin with those operators at the top of the list and and continue downwards.
Within each level, operations proceed left-to-right.
1. parentheses ()
2. transpose ('), power (^)
3. unary plus (+), unary minus (-)
4. multiplication (*), division (/)
5. addition (+), subtraction (-)
Built-in Functions
901
Reference Guide Programming
902
Programming Reference Guide
903
Reference Guide Programming
%[flags][width]
[.precision][length]specifier
904
Programming Reference Guide
Integer specifiers are not supported as GMAT does not have an integer
data type in the script language.
905
Reference Guide Programming
906
Programming Reference Guide
Examples
Evaluate a basic algebraic equation:
Create Variable A B C x y
x = 1
Create ReportFile aReport
BeginMissionSequence
A = 10
B = 20
C = 2
y = A*x^2 + B*x + C
Report aReport y
Matrix manipulation:
A(1,1) = 10
A(2,1) = 5
A(1,2) = .10
A(2,2) = 1
x(1,1) = 2
x(2,1) = 3
BeginMissionSequence
B = inv(A)
C = B'
y = C*x
Report aReport A B C x y
Cloning a resource:
BeginMissionSequence
Sat2 = Sat1
Report aReport Sat2.Cd Sat2.DryMass
907
Reference Guide Programming
Create Variable pi x y1 y2 y3
Create Array A[3,3]
Create Spacecraft aSat
Create ReportFile aReport
BeginMissionSequence
pi = acos(-1)
aSat.TA = pi/4
x = pi/4
A(1,1) = pi/4
y1 = sin(x)
y2 = sin(aSat.TA)
y3 = sin(A(1,1))
Report aReport y1 y2 y3
908
Programming Reference Guide
BeginMissionSequence
Begin the mission sequence portion of a script
Script Syntax
BeginMissionSequence
Description
GUI
Remarks
Examples
BeginMissionSequence
909
Reference Guide Programming
BeginScript
Execute free-form script commands
Script Syntax
BeginScript
[script statements]
…
EndScript
Description
The BeginScript and EndScript commands (ScriptEvent in the GUI) allow you to write
free-form script statements in the mission sequence without the statements being shown
as individual commands in the GMAT GUI. This is useful as a way to group and label
a complex sequence of statements as one unit, or to write small sequences of script
statements when otherwise using the GUI to create the mission sequence. Within the
script itself, there is no difference in the execution of statements within a BeginScript/
EndScript block and those outside of it.
GUI
The ScriptEvent GUI window divides the command into three parts: an initial comment,
fixed BeginScript and EndScript commands, and the content of the block itself. The
scripting window is a miniature version of the main script editor, and features line num-
bers, syntax highlighting, code folding, and all of the editing tools available in the full
910
Programming Reference Guide
editor. See the the section called “Script Editor” documentation for more information.
The ScriptEvent window performs script syntax validation when changes are applied.
Nested BeginScript/EndScript blocks in the script language are collapsed into a sin-
gle ScriptEvent when loaded into the GUI, and are saved to a single BeginScript/
EndScript block when saved to a script.
Examples
Perform a calculation inside a BeginScript/EndScript block. When loaded into the GUI,
the calculations within the BeginScript/EndScript block will be contained within a single
ScriptEvent command.
BeginMissionSequence
% perform burn 1
aBurn.Element1 = dv_1
Maneuver aBurn(aSat)
% perform burn 2
aBurn.Element1 = dv_2
Maneuver aBurn(aSat)
911
Reference Guide Programming
CallGmatFunction
Call a GMAT function
Script Syntax
GmatFunction()
GmatFunction(input_argument[, input_argument]...)
[output_argument[, output_argument]...] = GmatFunction
[output_argument[, output_argument]...] = ...
GmatFunction(input_argument[, input_argument]...)
Description
GMAT provides a special command that allows you to call a GMAT function which is
written via GMAT's GmatFunction resource. In the GUI, the GMAT function is called
through the CallGmatFunction command.
GUI
The CallGmatFunction GUI provides two input boxes for input and output arguments
and a list to select a GMAt function to call.
The Output box lists all configured output argument parameters. These must be select-
ed by clicking Edit, which displays a ParameterSelectioDialog window. See the Cal-
culation Parameters reference for details on how to select a parameter.
912
Programming Reference Guide
The Input box is identical in behavior to Output, but lists all configured input arguments
to the function. Arguments must be selected by clicking Edit. The Function list displays
all functions that have been declared as GmatFunction resources in the Resources
tree. Select a function from the list to call it.
When the changes are accepted, GMAT does not perform any validation of input or
output arguments. This validation is performed when the mission is actually run.
Remarks
GMAT objects can be passed into the GMAT function as input and can also be returned
from the function as output. If a given GMAT object is not declared as global in both
the main script and inside the GMAT function, then all objects that are passed into or
received as output from the function are considered to be local to that function and the
main script.
Below is a list of allowed arguments that can be passed as input to the function and
received as output from the function. Also see GmatFunction resource's Remarks and
Examples sections for more details and distinct examples that show how to pass objects
as inputs to the function, perform an operation inside the function, then receive objects
as outputs from the function. Note, a GMAT function file must contain one and only one
function definition.
The input arguments (input_argument values in the syntax description) can be any of
the following types:
Examples
Call two different functions. One function performs a simple cross product and the sec-
ond function performs a dot product.
Create ReportFile rf
rf.WriteHeaders = false
913
Reference Guide Programming
dot_product.FunctionPath = ...
'C:\Users\rqureshi\Desktop\dot_product.gmf'
Create Variable v6
Create String tempstring
BeginMissionSequence
v1(1,1) = 1
v1(2,1) = 2
v1(3,1) = 3
v2(1,1) = 4
v2(2,1) = 5
v2(3,1) = 6
v4(1,1) = 1
v4(2,1) = 2
v4(3,1) = 3
v5(1,1) = 4
v5(2,1) = -5
v5(3,1) = 6
Report rf v3
tempstring = '---------'
Report rf tempstring
Report rf v6
BeginMissionSequence
914
Programming Reference Guide
Create Variable c
BeginMissionSequence
Call GMAT function and pass local spacecraft as input, perform simple operation inside
the function, then send out updated, local spacecraft to the main script. Finally report
spacecraft old and updated position vector to the local report file subscriber:
Create ReportFile rf
rf.WriteHeaders = false
BeginMissionSequence
915
Reference Guide Programming
BeginMissionSequence
916
Programming Reference Guide
CallMatlabFunction
Call a MATLAB function
Script Syntax
MatlabFunction()
MatlabFunction(input_argument[, input_argument]...)
[output_argument[, output_argument]...] = MatlabFunction
[output_argument[, output_argument]...] = ...
MatlabFunction(input_argument[, input_argument]...)
Description
GMAT provides a special command that allows you to call a function written in the MAT-
LAB language or provided with the MATLAB software. In the GUI, this is the CallMat-
labFunction command.
GUI
The CallMatlabFunction GUI provides two input boxes for input and output arguments
and a list to select a function to call.
The Output box lists all configured output argument parameters. These must be select-
ed by clicking Edit, which displays a parameter selection window. See the Calculation
Parameters reference for details on how to select a parameter.
917
Reference Guide Programming
The Input box is identical in behavior to Output, but lists all configured input arguments
to the function. Arguments must be selected by clicking Edit. The Function list displays
all functions that have been declared as MatlabFunction resources in the Resources
tree. Select a function from the list to call it.
When the changes are accepted, GMAT does not perform any validation of input or
output arguments. This validation is performed when the mission is run, when MATLAB
has been started.
Remarks
The input arguments (input_argument values in the syntax description) can be any of
the following types:
The output arguments (output_argument values in the syntax description) can be any
of the following types:
Data type conversion is performed for the following data types when values are passed
between MATLAB and GMAT. When data is passed from GMAT to MATLAB as input
arguments, the following conversions occur.
GMAT MATLAB
real number (e.g. Spacecraft.X, Variable, double
Array element)
string (e.g. Spacecraft.UTCGregorian, char array
String resource)
Array resource double array
When data is passed from MATLAB to GMAT as output arguments, the following con-
versions occur.
MATLAB GMAT
char array string
double real number
double array Array resource
918
Programming Reference Guide
Examples
BeginMissionSequence
x = 1
[y] = sinh(x)
BeginMissionSequence
% propagate to apoapsis
Propagate aProp(aSat) {aSat.Apoapsis}
BeginMissionSequence
[pathStr] = path
[pwdStr] = pwd
919
Reference Guide Programming
920
Programming Reference Guide
CallPythonFunction
Call a Python function
Script Syntax
Python.PythonModule.PythonFunction()
Python.PythonModule.PythonFunction(input_argument[, input_argument]...)
[output_argument[, output_argument]...] = Python.PythonModule.PythonFunction
[output_argument[, output_argument]...] = Python.PythonModule.PythonFunction(in
Description
GMAT provides a special command that allows you to call a function written in the
Python language. In the GUI, this is the CallPythonFunction command.
In the syntax description, the preface Python is a keyword used to tell GMAT that the
scripting is calling into the Python system. The PythonModule identifies a Python file,
with the name PythonModule.py, containing the function that is to be called. Python-
Function is the function that is called inside of that file. Arguments can be passed into
and returned from the function, following the guidelines described below. See Remarks
for details.
When a Python function is called, GMAT loads the Python engine in the background.
This functionality requires that a compatible installation of Python be properly installed
and configured on your system. Once GMAT has loaded the engine, it remains in mem-
ory until GMAT is closed.
GUI
The CallPythonFunction GUI provides a single text entry field used to enter the Python
function as a line of script.
The syntax for the CallPythonFunction is as described in the Script Syntax section
above. GMAT's Python interface accepts Variables, Strings, numerical object parame-
ters, and one dimensional arrays as input parameters. It returns Variables, Arrays, and
Strings, either as a single value or as a collection of values. The interface calls into
Python scripts, identified by the PythonModule field, that define the function to be ac-
cessed. The receiving function is responsible for validating the inputs, based on the type
conversions described in the Remarks below.
921
Reference Guide Programming
When the user accepts the entries on the panel, GMAT does not perform any validation
of input or output arguments. This validation is performed when the mission is run, after
Python has been started.
Remarks
The input arguments (input_argument values in the syntax description) can be any of
the following types:
The output arguments (output_argument values in the syntax description) can be any
of the following types:
Data type conversion is performed for the following data types when values are passed
between Python and GMAT. When data is passed from GMAT to Python as input argu-
ments, the following conversions occur.
GMAT Python
real num- float
ber (e.g.
Spacecraft.X,
Variable,
Array ele-
ment)
string (e.g. str
Spacecraft.UTCGregorian,
String re-
source)
Array re- memoryview
source
When data is passed from Python to GMAT as output arguments, the following conver-
sions occur.
Python GMAT
str String
float real number
float array Array resource
Examples
Call a simple Python function:
922
Programming Reference Guide
Create Variable x y
BeginMissionSequence
x = 1
y = Python.MyMath.sinh(x)
BeginMissionSequence
% propagate to apoapsis
Propagate aProp(aSat) {aSat.Apoapsis}
923
Reference Guide Programming
CommandEcho
Toggle the use of the Echo command
Script Syntax
CommandEcho EchoSetting
Description
The EchoCommand command is used to toggle the use of the Echo on and off through-
out a mission sequence. This allows for specific parts of a mission sequence to be dis-
played to the message window and the generated log file. This command is a part of
the ScriptTools plugin.
Options
Option Description
EchoSetting Specifies whether the current EchoSetting of the Echo com-
mand should be on or off.
GUI
The CommandEcho command to toggle the Echo on or off at any point in a mission
sequence. Any number of this command can be placed throughout a mission sequence.
The message box shown below will appear when setting the EchoSetting through the
GUI. To set the command on, simply replace Off with On in the text. Note that if the
command is renamed, the new name will appear in this GUI display with quotation marks
surrounding it.
924
Programming Reference Guide
For
Execute a series of commands a specified number of times
Script Syntax
Description
The For command is a control logic statement that executes a series of commands
a specified number of times. The command argument must have one of the following
forms:
Index = Start:End
This syntex increments Index from Start to End in steps of 1, repeating the script state-
ments until Index is greater than End. If Start is greater than End, then the script state-
ments do not execute.
Index = Start:Increment:End
This syntax increments Index from Start to End in steps of Increment, repeating the
script statements until Index is greater than End if Increment is positive and less than
End if Increment is negative. If Start is less than End and Increment is negative, or
if Start is greater than End and Increment is positive, then the script statements do
not execute.
Options
Option Description
Index Independent variable in a for loop. Index is computed according to the
arithmetic progression defined by the values for Start, Increment, and
End.
925
Reference Guide Programming
Option Description
Start Initial value for the Index parameter
GUI
The For command GUI panel contains fields for all of its parameters: Index, Start,
Increment, and End. To edit the values, click the field value you wish to change and type
the new value (e.g. 5, anArray(1,5), or Spacecraft.X). Alternately, you can either
right-click the field value or click the ellipses (…) button to the left of the field. This
displays the ParameterSelectDialog window, which allows you to choose a parameter
from a list.
926
Programming Reference Guide
Remarks
The values of the Index, Start, Increment, and End parameters can be any of the
following types:
with the extra requirement that if a Resource parameter is used for Index, the parameter
must be settable.
Changes made to the index variable inside of a For loop are overwritten by the For loop
statement. For example, the output from the following snippet:
For I = 1:1:3
I = 100
Report aReport I
EndFor
is:
100
927
Reference Guide Programming
100
100
Changes made to the the Start, Increment, and End parameters made inside of a loop
do not affect the behavior of the loop. For example, the output from the following snippet:
J = 2
K = 2
L = 8
For I = J:K:L
J = 1
K = 5
L = 100
Report aReport I
EndFor
is:
2
4
6
8
Examples
BeginMissionSequence
For I = 1:1:3
Propagate aPropagator(aSat, {aSat.Apoapsis})
EndFor
Create Variable I J
Create Array anArray[10,5]
BeginMissionSequence
For I = 1:10
For J = 1:5
anArray(I,J) = I*J
EndFor
EndFor
928
Programming Reference Guide
Global
Declare Objects as global
Script Syntax
Global ObjectList
ObjectList
ObjectList List all GMAT objects that you want to declare as global.
Description
In GMAT you can use a special command that allows you to declare GMAT objects as
global. By using the Global command, you can declare GMAT's objects as global either
through the GUI or the script mode.
The syntax for declaring objects as global is very simple. After using the Global com-
mand, simply list the name of the objects that needs global declaration. Once the Gmat-
Function resource has been declared during initialization, arguments can be passed to
and from the function as input/output by using GMAT's CallGmatFunction command.
Data that is passed into the function as input or received from the function as output
can be declared as global by using the Global command. See the Remarks section for
more details on the Global command.
GUI
Figure below shows default settings of the Global command. By default, only Space-
craft object is checked and declared as global. As more objects are created by the user
in GMAT's Resources tree, the list of objects that are available to be declared as global
increases.
929
Reference Guide Programming
Notice in the above figure that GMAT by default already considers objects such as the
default coordinate systems, SolarSystemBarycenter, DefaultProp and SolarSystem
as automatic global objects. Furthermore whenever new coordinate systems or propa-
gators are created in the Resources tree, GMAT automatically declares the newly cre-
ated coordinate systems and propagators as global objects. Since GMAT always de-
clares default or newly created coordinate systems and propagators as global, hence
you do not need to use Global command on coordinate system and propagator objects.
Remarks
Declaration of Global Objects
GMAT objects can be passed into the GMAT function as input and can also be returned
from the function as output. Refer to both GmatFunction resource and CallGmatFunc-
tion command's Remarks sections to learn more about list of allowed objects that can
be passed as input and output to and from the function. By default, in GMAT any objects
that are created inside the main script are considered local to the main script. Similarly
any objects that may be created inside the GMAT function are considered local to that
function. In GMAT, in order to declare objects as global, you must declare the objects
as global in both your main script and inside the function. It is a good practice to declare
objects as global right after the BeginMissionSequence line in both the main script and
inside the function.
930
Programming Reference Guide
If a given GMAT object is not declared as global in both the main script and in the
function, then all objects that are passed into the function as input and/or received as
output from the function are considered to be local to that function and the main script.
Often times, you will propagate a spacecraft, perform differential correction (DC) or op-
timization routines interchangeably from both the main script and inside the function.
Whenever you want to plot continuous set of spacecraft trajectory data and report pa-
rameters to same subscribers interchangeably from both inside the main script and
the function, then always declare your Spacecraft object and subscriber objects (i.e.
OrbitView, GroundTrackPlot, XYPlot, ReportFile, EphemerisFile) as global both in
the main script and inside the function. Abiding by this rule draws plots, reports and
ephemeris files correctly and flow of data will be reported continuously to all the sub-
scribers.
Refer to GmatFunction resource's Examples section that shows three more examples
of how to declare spacecraft, five subscribers, arrays/variables/strings as global in both
the main script and inside the function.
Examples
Declare spacecraft, all subscribers and variables as global. Global variables are passed
as input and received as global output from the function. As you run the example, notice
that data is reported continuously to all 5 subscribers.
Create DifferentialCorrector DC
931
Reference Guide Programming
Create ReportFile rf
rf.Add = {aSat.UTCGregorian, aSat.EarthMJ2000Eq.X, ...
aSat.EarthMJ2000Eq.Y, aSat.EarthMJ2000Eq.Z, ...
aSat.EarthMJ2000Eq.VX, aSat.EarthMJ2000Eq.VY, aSat.EarthMJ2000Eq.VZ}
Create Variable T X Y Z VX VY VZ
BeginMissionSequence
Global aSat
Global aFM TOI GOI DC
Global anOrbitView GroundTrackPlot1 XYPlot1 rf rf2 anEphemerisFile
Global T X Y Z VX VY VZ
T = aSat.UTCModJulian
X = aSat.X
Y = aSat.Y
Z = aSat.Z
VX = aSat.VX
VY = aSat.VY
VZ = aSat.VZ
932
Programming Reference Guide
Report rf2 T X Y Z VX VY VZ
BeginMissionSequence
Global aSat
Global aFM TOI GOI DC
Global anOrbitView GroundTrackPlot1 XYPlot1 rf rf2 anEphemerisFile
Global T X Y Z VX VY VZ
933
Reference Guide Programming
If
Conditionally execute a series of commands
Script Syntax
If logical expression
[script statement]
…
EndIf
If logical expression
[script statement]
…
Else
[script statement]
…
EndIf
Description
The If command is a control logic statement that executes a series of commands if the
value of the provided logical expression is true. The syntax of the logical expression is
described in the script language reference.
The If command can optionally contain an Else clause that defines a series of com-
mands to execute if the associated logical expression is false.
GUI
934
Programming Reference Guide
The If command GUI panel features a table in which you can build a complex logical
expression. The rows of the table correspond to individual relational expressions in a
compound logical expression (up to 10), and the columns correspond to individual ele-
ments of those expressions. The first line automatically contains a default statement:
The first column of the first row contains a placeholder for the If command name. This
cannot be changed. The first column of each additional row contains the logical operator
(&, |) that joins the expression in that row with the one above it. To select a logical op-
erator, double-click or right-click in the appropriate box in the table to display a selection
window. Click the correct operator and click OK to select it.
The Left Hand Side column contains the left-hand side of each individual expression.
Double-click the cell to type a parameter name. To set this value from a parameter
selection list instead, either click “…” to the left of the cell you want to set, or right-click
the cell itself. A ParameterSelectDialog window will appear that allows you to choose
a parameter.
935
Reference Guide Programming
The Condition column contains the conditional operator (==, ~=, <, etc.) that joins the
left-hand and right-hand sides of the expression. To select a relational operator, dou-
ble-click or right-click in the appropriate box in the table, and a selection window will
appear. Click the correct operator and click OK to select it.
Finally, the Right Hand Side column contains the right-hand side of the expression.
This value can be modified the same way as the Left Hand Side column.
936
Programming Reference Guide
When you are finished, click Apply to save your changes, or click OK to save your
changes and close the window. The command will be validated when either button is
clicked.
Examples
A simple If statement:
BeginMissionSequence
937
Reference Guide Programming
Stop
Stop mission execution
Description
The Stop command stops execution of the current mission at the point that the command
is encountered and returns control to the GMAT interface. The effect is similar to that
of the Stop button on the GUI toolbar.
GUI
The Stop command can be inserted into and deleted from Mission tree, but the com-
mand has no GUI panel of its own.
Remarks
The Stop command stops execution of the current mission, not the GMAT application.
All data displayed to the point, at which the script was stopped (e.g. OrbitView win-
dows, GroundTrackPlot windows), remain available for manipulation. Using the Stop
command within a loop or solver structure will stop execution at the first iteration during
which the command is encountered.
Examples
BeginMissionSequence
938
Programming Reference Guide
BeginMissionSequence
Target aDC
Vary aDC(anIB.Element1 = 0.5)
Maneuver anIB(aSat)
Propagate aProp(aSat) {aSat.Periapsis}
If aSat.aTank.FuelMass < 10
Stop
EndIf
Achieve aDC(aSat.Altitude = 1000)
939
Reference Guide Programming
While
Execute a series of commands repeatedly while a condition is met
Script Syntax
Description
The While command is a control logic statement that executes a series of commands
repeatedly as long as the value of the provided logical expression is true. The logical
expression is evaluated before every iteration of the loop. If the expression is initially
false, the loop is never executed. If the while loop is empty, it is skipped and a warning
message is posted to the user. The syntax of the expression is described in the script
language reference.
GUI
The While command GUI panel features a table in which you can build a complex logical
expression. The rows of the table correspond to individual relational expressions in a
compound logical expression, and the columns correspond to individual elements of
those expressions. The first line automatically contains a default statement:
940
Programming Reference Guide
The first column of the first row contains a placeholder for the While command name.
This cannot be changed. The first column of each additional row contains the logical
operator (&, |) that joins the expression in that row with the one above it. To select
a logical operator, double-click or right-click in the appropriate box in the table, and a
selection window will appear. Click the correct operator and click OK to select it.
The Left Hand Side column contains the left-hand side of each individual relational
expression. Double-click the cell to type a parameter name. To set this value from a
parameter selection list instead, either click “…” to the left of the cell you want to set, or
right-click the cell itself. A ParameterSelectDialog window will appear that allows you
to choose a parameter.
941
Reference Guide Programming
The Condition column contains the conditional operator (==, ~=, <, etc.) that joins the
left-hand and right-hand sides of the expression. To select a relational operator, dou-
ble-click or right-click in the appropriate box in the table, and a selection window will
appear. Click the correct operator and click OK to select it.
Finally, the Right Hand Side column contains the right-hand side of the expression.
This value can be modified the same way as the Left Hand Side column.
942
Programming Reference Guide
When you are finished, click Apply to save your changes, or click OK to save your
changes and close the window. The command will be validated when either button is
clicked.
Examples
BeginMissionSequence
System
943
Reference Guide Programming
#Include Macro
Load or import a script snippet
Script Syntax
#Include './Define_Path_to_Script_Snippet_File_In_SingleQuotes.txt'
Description
Using the #Include macro, GMAT now allows you to load GMAT resources and script
snippets from external files during the script initialization and mission execution. This is
a powerful feature that allows you to reuse configurations across multiple users and/or
scripts. This feature can be used to simplify automation for operations and Monte-Carlo
and parametric scanning that have use cases with a lot of common data but some data
that changes from one execution to the next.
The script snippet external files that you can now load using the #Include macro can
be defined with any file extensions, although most common file extensions are (*.script)
or (*.txt). The #Include macro can be used to load snippets from external files either
before or after the BeginMissionSequence script command. The #Include macro can
only be used through the script mode and its usage is not allowed via the GUI.
GUI
There are two rules in regards to how GMAT's GUI behaves whenever we use the
#Include macro:
Whenever you load and run GMAT scripts that may use an #Include macro before
BeginMissionSequence command, (i.e. Rule # 1 defined above), then GMAT’s Re-
sources, Mission and Output trees will change color to a light olive green and a Non-
Savable GUI Mode message will show up in red color at the top center of the main
GMAT screen. This light olive green color change and Non-Savable GUI Mode mes-
sage is simply telling you that GMAT's GUI is editable, runnable but you cannot save
changes to your GMAT script via GMAT GUI's Save button.
If your GMAT script only contains #Include macro(s) after BeginMissionSequence (i.e.
Rule # 2 defined above), then no color changes occur in GMAT's Resources, Mission
and Output trees and you can save changes to your scripts either from GUI or script
mode.
944
Programming Reference Guide
Remarks
In GMAT, the default method of defining the file path of the external file(s) that you want
to load using the #Include macro is: './My_Script_Snippet.txt'. This is the easiest
and most convenient method of defining the path of your script snippet files as it simply
requires that both your main script and script snippet file be in the same directory. You
can also define both relative ('..\My_Script_Snippet.txt') and absolute paths to
your external script snippet files.
The Examples section shows you simple yet powerful examples of how to use the #In-
clude macro in simplifying your main GMAT scripts.
Examples
Initialize S/C from an external script snippet file called 'Initialize_Spacecraft.txt'. Run this
example by creating a .txt file and paste contents of 'Initialize_Spacecraft.txt' and put
this snippet script in same directory as the main GMAT script.
BeginMissionSequence
aSat.DateFormat = UTCGregorian
aSat.Epoch = '02 Jan 2000 11:59:28.000'
aSat.CoordinateSystem = EarthMJ2000Eq
aSat.DisplayStateType = Cartesian
aSat.X = 8000
aSat.Y = 2000
aSat.Z = 4000
aSat.VX = 0.5
aSat.VY = 7.5
aSat.VZ = 1.5
aSat.DryMass = 1000
aSat.Cd = 2.2
aSat.Cr = 1.8
aSat.DragArea = 20
aSat.SRPArea = 1
945
Reference Guide Programming
aSat.NAIFId = -10009001
aSat.NAIFIdReferenceFrame = -9009001
aSat.OrbitColor = Yellow
aSat.TargetColor = Teal
aSat.Id = 'SatId'
aSat.Attitude = CoordinateSystemFixed
aSat.SPADSRPScaleFactor = 1
aSat.ModelFile = 'aura.3ds'
aSat.ModelOffsetX = 0
aSat.ModelOffsetY = 0
aSat.ModelOffsetZ = 0
aSat.ModelRotationX = 0
aSat.ModelRotationY = 0
aSat.ModelRotationZ = 0
aSat.ModelScale = 1
aSat.AttitudeDisplayStateType = 'Quaternion'
aSat.AttitudeRateDisplayStateType = 'AngularVelocity'
aSat.AttitudeCoordinateSystem = EarthMJ2000Eq
aSat.EulerAngleSequence = '321'
In this example, we call an external file through #Include macro which is used only after
the BeginMissionSequence command. Perform a finite burn from an external script
snippet file called 'Perform_FiniteBurn.txt'. Run this example by creating a .txt file and
paste contents of 'Perform_FiniteBurn.txt' and put this snippet script in same directory
as the main GMAT script.
aSat.Thrusters = {aThruster}
aSat.Tanks = {aFuelTank}
946
Programming Reference Guide
Create ReportFile rf
rf.Add = {aSat.UTCGregorian, aFB.TotalAcceleration1, ...
aFB.TotalAcceleration2, aFB.TotalAcceleration3, ...
aFB.TotalMassFlowRate, aFB.TotalThrust1, ...
aFB.TotalThrust2, aFB.TotalThrust3, ...
aSat.aThruster.MassFlowRate, ...
aSat.aThruster.ThrustMagnitude, aSat.aThruster.Isp}
BeginMissionSequence
BeginFiniteBurn aFB(aSat)
Propagate aProp(aSat) {aSat.ElapsedSecs = 1800, OrbitColor = Yellow}
EndFiniteBurn aFB(aSat)
In this example, we call external files through #Include macros which are used
both before and after the BeginMissionSequence. Note that all objects in the Re-
sources tree are imported and initialized from an external script snippet file called
'Entire_Resources_Tree.txt'. Similarly, all commands in the Mission tree are loaded from
an external snippet file called 'Entire_Mission_Tree.txt'. Run this example by creating
a .txt file and paste contents of 'Entire_Resources_Tree.txt'. Next create another .txt
file and paste contents of 'Entire_Mission_Tree.txt'. Put both of these snippet scripts in
same directory as the main GMAT script and then run the main GMAT script.
BeginMissionSequence
947
Reference Guide Programming
Target aDC
Vary aDC(TOI.Element1 = 0.24, {Perturbation = 0.001, ...
Lower = 0.0, Upper = 3.14159, MaxStep = 0.5})
Maneuver TOI(aSat)
Propagate aProp(aSat) {aSat.Earth.Apoapsis}
Achieve aDC(aSat.Earth.RMAG = 42165)
EndTarget
948
Programming Reference Guide
MATLAB Interface
Interface to MATLAB system
Description
The MATLAB interface provides a link to the Mathworks MATLAB environment, allowing
GMAT to run MATLAB functions as if they were native functions in the GMAT script
language.
The interface cannot be controlled directly through the script language, though it can
be in the GMAT GUI. Instead, GMAT starts the interface automatically when it calls a
MATLAB function.
There are two GMAT components that provide user access to the interface. For details
on declaring a MATLAB function, see the MatlabFunction reference. For details on
calling a function and passing data, see the CallMatlabFunction reference.
GUI
The MATLAB interface provides an icon in the Interfaces folder in the Resources tree
that can be used to control the interface. Right-clicking the icon shows two options:
Open and Close.
The Open menu item causes GMAT to open a connection to the MATLAB Engine, which
in turns displays a MATLAB command window in the background. This connection is
then used for all communication between GMAT and MATLAB until the connection is
closed. Only one connection can be open at a time.
949
Reference Guide Programming
The Close menu item causes GMAT to close any open connection to the MATLAB
Engine. If no connection is open, it has no effect.
Remarks
Interface Setup
The following conditions must be true for GMAT to successfully initiate communication
with MATLAB. All conditions must be true for the same instance of MATLAB.
matlab -regserver
export DYLD_LIBRARY_PATH=$MATLAB/bin/maci64:$DYLD_LIBRARY_PATH
export PATH=$PATH:$MATLAB/bin
Note
64-bit GMAT must be used to interface with MATLAB after version
R2010a.
950
Programming Reference Guide
• On Linux:
• The MATLAB interface on Linux requires that the C shell, csh, be installed. This
is a requirement from the MathWorks for startup of the MATLAB engine, used for
the interface. If your system does not have csh installed, the package manager for
your Linux installation should include csh as an installation option.
The MATLAB interface needs to be able to locate the MATLAB shared libraries
libeng.so (and related libraries) and libMatlabEngine.so. For MATLAB R2019a, the
former is in the MATLAB bin/glnxa64 folder and the latter in MATLAB's extern/bin/
glnxa64 folder. One way to start GMAT and apply the library path settings is to
launch the application with a library path. From the Linux terminal, the command
(for MATLAB installed in the default /usr/local/MATLAB/R2019a folder)
LD_LIBRARY_PATH=/usr/local/MATLAB/R2019a/extern/bin/glnxa64:/usr/
local/MATLAB/R2019a/bin/glnxa64 ./GMAT
accomplishes this task, starting the GMAT GUI with the settings needed to run the
MATLAB interface.
Note
Common troubleshooting tips on Windows:
• If you are using the officially-released 32-bit version of GMAT, make sure
you have the 32-bit version of MATLAB installed.
• If the path above exists in your system Path variable, try place it at the
front.
• Make sure the same instance of MATLAB is referenced both in the Path
variable and when running matlab -regserver.
Warning
Caution: GMAT does not close the MATLAB Command Window it creates
after a run has completed. This allows manual inspection of the MATLAB
workspace, but it can lead to confusing behavior if MATLAB functions or
paths are changed and rerun in the same window.
When GMAT runs a mission that contains a MATLAB function call, it opens a connection
to the MATLAB engine before it makes the function call. It then reuses this connection
for the rest of the GMAT session.
The MATLAB Engine can be controlled manually through the Open and Close options
available by right-clicking the Matlab item in the Resources tree.
951
Reference Guide Programming
Examples
952
Programming Reference Guide
Python Interface
Interface to the Python programming language
Description
The Python interface provides a link to the Python programming language, allowing
GMAT to run Python functions as if they were native functions in the GMAT script lan-
guage.
The interface cannot be controlled directly through the script language. Instead, GMAT
starts the Python interface automatically when it calls a Python function.
The Python interface is accessed using GMAT's CallPythonFunction command. For de-
tails on calling a function and passing data, see the CallPythonFunction reference.
GUI
The Python interface in GMAT is launched and driven internally. Users do not have
direct access to the interface from the GMAT graphical user interface.
Remarks
Interface Setup
The following conditions must be true for GMAT to successfully initiate communication
with Python. All conditions must be true for the same instance of Python.
Python
Python/Scripts
953
Reference Guide Programming
• The following path (where Python is the path to the installed version of Python)
must be present in the PYTHONPATH environment variable.
Python/Lib/site-packages
• On Mac OS X:
• Currently, GMAT will be able to interface with Python if your Python is installed in-
to a specific directory (default location for python.org installations): /Library/Frame-
works/Python.framework/Versions/3.7
GMAT has also been tested using the anaconda installation of Python 3.7.7.
GMAT currently does NOT support using the Anaconda installation of Python.
• On Linux:
• The Python release used in the GMAT build must be the default Python package
(e.g. Python 3.6) accessed from the terminal.
Users that enable the MATLAB interface may find that the Python interface does
not load because of a library conflict. If the Python interface reports the issue
there is a conflict between the expat library that is included with MATLAB and the
library required for the distribution's Python 3 installation. This issue can be correct-
ed by loading the system expat library before GMAT starts using the LD_PRELOAD
command. The command
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libexpat.so ./GMAT
loads the expat library and then launches GMAT, resolving the issue for systems
like Ubuntu 18.04.
Note
Common troubleshooting tips on Windows:
• If you are using the officially-released 32-bit version of GMAT, make sure
you have the 32-bit version of Python installed.
• If the path above exists in your system Path variable, try placing it at the
front of the path specification.
954
Programming Reference Guide
Warning
GMAT does not close the Python interface after a run has completed. This
feature prevents anomalous behavior that can occur when loading some
Python modules repeatedly during a run, but it can lead to confusing behav-
ior if Python files are changed and rerun in the same GMAT session.
When GMAT runs a mission that contains a Python function call, it loads Python into
memory as an embedded system in GMAT before it makes the function call. It then
reuses this system for the rest of the GMAT session.
Examples
955
956
Reference Guide
Optimal Control
User Guide
Note
The user guide for the optimal control components including CSALT and
GMAT optimal control are written in Sphinx and located in the GMAT distri-
bution here: gmat/docs/GMAT_OptimalControl_Specification.pdf
957
958
Reference Guide
System
This chapter contains documentation for Resources and Commands related to the sys-
tem and for system setup and execution.
959
Reference Guide System
Calculation Parameters
Resource properties available for use by commands and output
Description
Parameters are named resource properties that can be used to obtain data for use
by Mission Sequence commands or by output resources. Some parameters, such as
the Altitude parameter of Spacecraft, are calculated values that can only be used to
retrieve data. They cannot be set directly. Others, such as the Element1 parameter of
ImpulsiveBurn, share the same name as a resource field and can be used both to set
data and retrieve it. Parameters are distinguished from resource fields by their extra
functionality: fields are static resource properties that are usually set in initialization (or
in the GUI Resources tree), while parameters can be calculated on the fly and used in
plots, reports, and mathematical expressions.
If a dependency is used when retrieving the value of the parameter, as in the follow-
ing line, the value of Altitude is calculated at Mars before setting it to the variable x.
If the dependency is omitted, Earth and EarthMJ2000Eq are assumed unless noted
otherwise.
x = DefaultSC.Mars.Altitude
If a dependency is used when setting the value of a parameter, the value of the para-
meter is first converted based on the value of the dependency, then the value is set.
For example, in the following line, the value of SMA is first calculated at Mars, then it
is set to the value 10000 in that context. If the dependency is omitted when setting the
value, the default is assumed to be the central body or coordinate system of the parent
resource (in this case, DefaultSC).
DefaultSC.Mars.SMA = 10000
960
System Reference Guide
The individual parameters are resource-specific, and are documented in the tables be-
low. The GUI has a parameter selection interface that is common to all parameters. This
interface is documented in GUI, below.
GUI
Parameters can be used as input in several places throughout GMAT, such as the Re-
portFile and XYPlot resources and the If/Else, Propagate, and Report commands. In
the GUI, all of these use a common interface called the ParameterSelectDialog that al-
lows for interactive parameter selection. A basic ParameterSelectDialog window looks
like the following:
The ParameterSelectDialog window is used to build a parameter, along with any de-
pendencies, for use in a command or resource. Some resources and commands have
different requirements for the types of parameters that can be used, so the ParameterS-
electDialog can take slightly different forms, depending on where it's used. This section
will describe the generic interface, then mention any resource- or command-specific
exceptions.
961
Reference Guide System
General Usage
The first step in choosing a parameter is to select the object (or resource) type from
the Object Type list in the upper left. Seven types can appear in this list: Spacecraft,
SpacePoint, ImpulsiveBurn, FiniteBurn, Variable, Array, and String.
Once you've selected a type, The Object List box is populated with all existing re-
sources of that type. Use this list to choose the specific resource you'd like to reference.
If the Spacecraft type is selected, the Attached Hardware List appears below the Ob-
ject List. This list displays any hardware (such as ChemicalTank or ChemicalThruster
resources) attached to the selected Spacecraft. If the Array type is selected, Row and
Col boxes appear. Use these to specify a row and column to select an individual array
element, or check Select Entire Object to choose the entire array.
Once a resource is selected, the Object Properties list is populated with all available
parameters provided by that resource. Some resources, such as instances of Variable
or Array, are themselves parameters, so this list remains empty.
Parameters with different dependency types are commingled in the Object Properties
list. When you select one, the appropriate dependency (if any) appears below the list.
For example, after selecting the Spacecraft AOP parameter, a CoordinateSystem list
appears. After selecting the Spacecraft Apoapsis parameter, a Central Body list ap-
pears. And after selecting the Spacecraft Cd parameter, no dependency list appears.
To select a range of parameters from the Object Properties list, hold down the Shift
key while selecting the second endpoint of the range. To select multiple individual pa-
rameters, hold down the Ctrl key while making each selection.
To select a parameter, select the appropriate Object Type, the specific resource from
the Object List or Attached Hardware List, the desired parameter from the Object
Properties list, and the required dependency, and add it to the Selected Value(s) list
on the right. There are six buttons available to control this list:
• UP: Move the selected item in the Selected Value(s) list up one position (if allowed).
• DN: Move the selected item in the Selected Value(s) list down one position (if al-
lowed).
• ->: Add the selected item in the Object Properties list to the Selected Value(s) list.
• <-: Remove the selected item in the Selected Value(s) list.
• =>: Add all items to the Selected Value(s) list.
• <=: Remove all items from the Selected Value(s) list.
When finished, the Selected Value(s) list contains the final selected parameters. Click
OK to accept the selection.
The ordering of the Selected Value(s) list is significant in certain circumstances (such
as in the Add field of ReportFile), but not in others. See the documentation for each
resource or command for details.
Special Considerations
Some resources and commands (such as the Propagate command Parameter argu-
ment) only accept a single parameter as input; in this context the ParameterSelectDi-
962
System Reference Guide
alog only allows one parameter in the Selected Value(s) list and does not allow use
of the UP, DN, and => buttons.
In some instances (such as in the Vary command), only parameters that are also fields
(and so can be set in the Mission Sequence) can be used. In this case only the allowed
parameters will be shown in the Object Properties list.
Parameters
Spacecraft
963
Reference Guide System
964
System Reference Guide
965
Reference Guide System
966
System Reference Guide
967
Reference Guide System
968
System Reference Guide
969
Reference Guide System
970
System Reference Guide
971
Reference Guide System
972
System Reference Guide
973
Reference Guide System
974
System Reference Guide
975
Reference Guide System
976
System Reference Guide
977
Reference Guide System
978
System Reference Guide
979
Reference Guide System
980
System Reference Guide
981
Reference Guide System
982
System Reference Guide
983
Reference Guide System
984
System Reference Guide
FuelTank
ChemicalTank parameters are accessible only after attaching the ChemicalTank re-
source to a Spacecraft, like so:
985
Reference Guide System
All Resources that have coordinates in space have Cartesian position and velocity para-
meters, so you can access ephemeris information. This includes all built-in solar system
bodies and other Resources such as CelestialBody,Planet, Moon, Asteroid, Comet,
Barycenter, LibrationPoint, and GroundStation :
• CelestialBody.CoordinateSystem.X
• CelestialBody.CoordinateSystem.Y
• CelestialBody.CoordinateSystem.Z
• CelestialBody.CoordinateSystem.VX
• CelestialBody.CoordinateSystem.VY
• CelestialBody.CoordinateSystem.VZ
Warning
Note that to use these parameters, you must first set the epoch of the Re-
source to the desired epoch at which you want the data. Additionally, the
epoch should be set after the BeginMissionSequence Command. See the
following example.
Create ReportFile rf
BeginMissionSequence
Luna.Epoch.A1ModJulian = 21545
Report rf Luna.EarthMJ2000Eq.X Luna.EarthMJ2000Eq.Y Luna.EarthMJ2000Eq.Z ...
Luna.EarthMJ2000Eq.VX Luna.EarthMJ2000Eq.VY Luna.EarthMJ2000Eq.VZ
986
System Reference Guide
Note
Spacecraft parameters are treated slightly different than Space Point para-
meters primarly because Spacecraft Cartesian state parameters are set-
table, and all other Space Point Cartesian parameters are only gettable.
When requesting state information for Space Points other than Space-
craft, the coordinates are computed based on the model configured for that
Resource. Additionally, not all epoch configuration options supported for
Spacecraft are supported for Space Points (i.e. Epoch and DateFormat).
987
Reference Guide System
988
System Reference Guide
Thruster
989
Reference Guide System
990
System Reference Guide
991
Reference Guide System
992
System Reference Guide
993
Reference Guide System
994
System Reference Guide
ImpulsiveBurn
Maneuver myImpulsiveBurn(mySat)
In the case that an ImpulsiveBurn has not been applied, GMAT will output zeros for
the ImpulsiveBurn components and issue a warning.
Maneuver myImpulsiveBurn(mySat)
myVar = mySat.MyCoordinateSystem.Element1
The above usage avoids issues that may occur if the ImpulsiveBurn coordinate system
is time varying, and the ImpulsiveBurn parameters are requested after further manip-
ulation of the participants using other commands (such as Propagate). In that case, it
is possible that the participants are no longer at the epoch of the maneuver, and unex-
pected results can occur due to epoch mismatches.
995
Reference Guide System
FiniteBurn
To compute FiniteBurn parameters, GMAT requires that a FiniteBurn has been exe-
cuted using a BeginFiniteBurn command like this:
In the case that a FiniteBurn has not been applied, GMAT will output zeros for all
reportable FiniteBurn parameters to a report file. All finite burn parameters will report
zeros whenever a finite burn is not turned on. The table below shows reportable finite
burn parameters:
996
System Reference Guide
Solver
Solver parameters allow you to query a Solver for its convergence state to determine
if the Solver converged. There are both string and numeric parameters which are de-
scribed in further detail in the table below the following usage example using solver pa-
rameters before and after a Target sequence.
997
Reference Guide System
EarthView.ViewScaleFactor = 5
BeginMissionSequence
Report aReport aDC.SolverStatus aDC.SolverState
Target aDC
Vary aDC(aBurn.Element1 = 1.0, {Upper = 3})
Maneuver aBurn(aSat)
Propagate aPropagator(aSat,{aSat.Apoapsis})
Achieve aDC(aSat.RMAG = 42164)
EndTarget
Report aReport aDC.SolverStatus aDC.SolverState
998
System Reference Guide
Array, String, and Variable resources are themselves parameters, and can be used as
any other parameter would. All of these are writable parameters, though only Variable
resources and individual elements of Array resources can be plotted.
BeginMissionSequence
Sat.Epoch.TAIModJulian = 35000
EndWhile
Examples
Using parameters in the Mission Sequence:
BeginMissionSequence
999
Reference Guide System
Create Variable i
BeginMissionSequence
BeginMissionSequence
1000
System Reference Guide
Command-Line Usage
Starting the GMAT application from the command line
Synopsis
GMAT [option...] [script_file]
Description
The GMAT command starts the GMAT graphical interface. If run with no arguments,
GMAT starts with the default mission loaded. If script_file is specified, and is a valid
path to a GMAT script, GMAT loads the script and remains open, but does not run it.
The GMATConsole command starts the GMAT console interface. See below for options
supported by each interface.
Options
-b, --batch
Runs multiple scripts listed in specified file.
-h, --help
Start GMAT and display command-line usage information in the message window if
using the GUI version, or in the terminal if using the console interface.
-l <filename>, --logfile <filename>
Specify the log file (ignored in Console interactive mode.
-m, --minimize
Start GMAT with a minimized interface.
-ns, --no_splash
Start GMAT without the splash screen showing.
-r <filename>, --run <filename>
Automatically run the specified script after loading.
--save <filename>
Saves current script (interactive mode only).
--start-server
Starts GMAT Server on start-up (ignored for Console).
-s <filename>, --startup_file <filename>
Specify the startup file (ignored in Console interactive mode).
--summary
Writes command summary (interactive mode only).
--verbose
Dump info messages to screen during run (default is on).
-v, --version
Start GMAT and display version information in the message window.
-x, --exit
Exit GMAT after running the specified script. If specified with only a script name (i.e.
NO –run option), GMAT simply opens and closes.
1001
Reference Guide System
Precedence Rules
Some file locations, the log file for example, can be set in multiple locations. The prece-
dence rules are as follows. Command line settings have the highest precedence, and
those values are always used if set. The second precedence is taken by script level set-
tings, for example, GmatGlobal.LogFile = C:\myLog.txt. Finally, if no other method
is set, the value in the startup file is used.
There are additional precedence rules that apply when the startup file is configured to
use RUN_MODE = TESTING. In that case, the log file name from the startup file has
precedence, and the output path can be overwritten by settings avialalble in the GUI
Set File Paths option in the File menu, or in the Run Scripts option avialable in
the Scripts menu in the Resource Tree.
Examples
GMAT MyScript.script
1002
System Reference Guide
Keyboard Shortcuts
Keyboard shortcuts in the graphical user interface
Description
The GMAT graphical user interface (GUI) offers many keyboard shortcuts for easy ac-
cess to common commands. See the tables below for details.
General shortcuts
These keyboard shortcuts are available any time when using GMAT.
Key Meaning
Ctrl+Shift+<number> Open recent script <number> (1–5).
Ctrl+N Create a new mission.
Ctrl+Shift+N Create a new empty script.
Ctrl+O Open the Open dialog box.
Ctrl+S Save the current mission.
F1 Open the Help documentation.
Ctrl+F1 Open the Welcome Page.
F5 Run the current mission.
F9 Animate the current graphics window.
F12 Open the Save As dialog box.
These keyboard shortcuts are available when navigating the Resources, Mission, and
Output trees.
Key Meaning
Enter Open.
Space Open.
Delete Delete.
Ctrl+Shift+C Clone (only available for resources).
F2 Rename.
Ctrl+Page Up View the next tab.
Ctrl+Page Down View the previous tab.
These keyboard shortcuts are available when interacting with dialog boxes, such as the
property windows for the Spacecraft resource or the Propagate command.
1003
Reference Guide System
Key Meaning
Tab Move to the next item.
Shift+Tab Move to the previous item.
Ctrl+C Copy.
Ctrl+V Paste.
Ctrl+W Close.
F1 Open feature-specific help.
F7 Show script.
These keyboard shortcuts are available when using the script editor.
• Hold down Ctrl while rotating the wheel button to increase or decrease the font size.
1004
System Reference Guide
Script Language
The GMAT script language
Script Structure
A GMAT script is a text file consisting of valid script syntax elements, such as initialization
statements, Mission Sequence commands, and comments. These syntax elements are
described later in this specification.
At the highest level, a GMAT script is made up of two sections: Initialization and the
Mission Sequence. These sections each contain statements, but they have different
rules about which sorts of statements are valid. The BeginMissionSequence command
defines the beginning of the Mission Sequence section.
Initialization
The first section in a script file, referred to as Initialization, is responsible for creating
resources and setting their initial state. The Initialization section can contain the following
types of statements:
Only literal assignments are allowed in this section; no execution of commands or eval-
uation of parameters is done. In the GUI, the Initialization section maps directly to the
Resources tree. All resources created, and all fields set, in this section appear as re-
sources in the GUI when the script is loaded.
1005
Reference Guide System
Mission Sequence
The Mission Sequence section contains the Mission Sequence, or the list of GMAT com-
mands that are executed sequentially when the mission is run. The Mission Sequence
section can contain the following types of statements:
• command statements
The Mission Sequence begins at the first instance of the BeginMissionSequence com-
mand; therefore, this must be the first command statement in the script file. For back-
wards compatibility, if the BeginMissionSequence command is missing, the Mission
Sequence begins with the first command encountered.
In the GUI, the Mission Sequence section maps directly to the Mission tree. Each state-
ment in the script (with the exception of the BeginScript/EndScript compound com-
mand) is displayed as a single element in the tree.
Basic Syntax
Source Text
A GMAT script consists of a single file containing characters from the 7-bit US-ASCII
character set. The script language is case-sensitive, so this line creates four different
Variable resources:
Create Variable x X y Y
• empty
• a comment (see Comments, below)
• a statement (see Statements)
Statement lines can be split over multiple physical lines with the continuation marker
(“...”).
Line Termination
Script lines are terminated by any of the following ASCII character sequences:
White Space
White space can appear above or below any line, before or after any statement within
a line, and many other places in a script. The following characters are recognized as
white space:
1006
System Reference Guide
Horizontal tab characters are preserved in string literals, but are replaced by spaces in
some other contexts (e.g. equations, comments).
Comments
Comments begin with the percent symbol (“%”, hex: 25) and extend to the end of the
line. There is no multi-line or embedded comment in the script language.
File Paths
Several resource types have fields that accept file paths as input. The general syntax
of such paths is common to the language, but some specific behavior is specified by
each resource.
Forward slashes and backslashes can be used interchangeably within GMAT, and can
be mixed in a single path. The following three paths are considered identical:
data/planetary_ephem/spk/de421.bsp
data\planetary_ephem\spk\de421.bsp
data\planetary_ephem/spk\de421.bsp
Absolute paths are passed to the underlying operating system as-is, aside from normal-
izing the slashes.
For input files, relative paths are first considered relative to the script file, then to a
location defined by each resource type separately, and usually defined in the GMAT
startup file. For details, see the reference documentation for each resource type.
For output files, relative paths are considered relative to the script file. If only a filename
is specified, the file is placed into the output location defined in the GMAT startup file
(usually GMAT's output folder).
File paths are written as string literals (see Strings under Data Types). Quotes are
mandatory if the path contains spaces, but are optional otherwise.
Data Types
Literals
Integers
Integers are written as a sequence of literal digits, with no decimal. Preceding zeros and
prepended signs (+ or -) are allowed. Scientific notation is not permitted.
Real Numbers
• 12 (whole number)
• 12.5 (decimal)
1007
Reference Guide System
In all formats, the base can contain preceding or trailing zeros. In scientific notation, the
exponent can be prepended by a sign (+ or -) and can contain preceding zeros, but
cannot contain a decimal. The exponent delimiter is case-insensitive (e.g. "e" or "E").
Strings
All language-supported characters are allowed in strings, with the exceptions below.
There are no escape characters or character substitute sequences (such as “\n” for
line feed).
In the Mission Sequence, the following characters are not allowed in string literals:
Quotes are generally optional, but are mandatory in Initialization if the string contains
whitespace, any script language symbols, or any GMAT-recognized elements (e.g. key-
words, resource names). They are mandatory in the Mission Sequence in the same in-
stances, and additionally if the string contains mathematical operators and certain non-
printable characters. We recommend quoting all string literals.
Booleans
Enumerated Values
References
References to resources and resource parameters are indicated by the name of the
resource or resource parameter. References are written as string literals. Quotes are
1008
System Reference Guide
always optional, as resource names and parameters cannot contain spaces or special
characters.
Resources
Resource Types
Resources in GMAT are instances of a base resource type that are given user-defined
names and store data independently of other resources of the same type. Resource
types include Spacecraft, GroundStation, and Variable. They cannot be used directly;
they must first be instantiated with the Create statement. For example:
In the example, Spacecraft is the resource type and aSat is the resource. This is similar
to the concept of classes and objects in object-oriented programming, where GMAT’s
resource types are analogous to classes and its resources are analogous to objects.
Naming Rules
• Name must be made up of ASCII letters, numbers, or the underscore character (“_”).
This corresponds to hex values 30–39, 41–5A, 5F, and 61–7A.
• Name must begin with a letter (A–Z or a–z, hex: 41–5A or 61–7A)
• Name cannot be a reserved keyword or command name
Shadowing
When the same name is used for multiple purposes in a script, the shadowing rules
apply to determine how a reference to the name is interpreted.
Resource names must be unique within a script. If a script attempts to create multiple
resources that have the same case-sensitive name, the first Create statement in the
script with that name is executed and all subsequent ones are ignored. The conflict is
noted in a warning message.
Caution
GMAT does not test to ensure that Resource names and function names are
unique. Care should be taken to use unique names for user-defined GMAT,
MATLAB, and Python functions to avoid name clashes.
Command names and keywords are reserved. They cannot be used as resource names.
See the Keywords section for a list of keywords.
Built-in function names (like sin or cos) can be used as resource names with one ex-
ception: a reference to, for example, “sin(1)” on the right-hand side of an equal sign will
be interpreted as a call to the sin built-in function, not element 1 of an Array resource
named sin. The same is true for the other built-in functions.
1009
Reference Guide System
Resource type names (like “Spacecraft”) can be used as resource names. In such an
instance, the conflict is resolved by the context. For example:
In the example, GMAT knows by context that in the second Create statement, the ar-
gument “Spacecraft” refers to the resource type, not the resource instance created in
the first statement.
Compound Types
Array of Literals
Arrays of literals are accepted as input by some resources. Arrays of booleans, integers,
and real numbers are surrounded by square brackets (“[“ and “]”, hex: 5B and 5D). Arrays
of strings are surrounded by curly brackets (“{“ and “}”, hex: 7B and 7D). In all cases,
the values are separated by whitespace or commas. Only one-dimensional arrays of
literals are supported. See the following examples.
Arrays of References
Some resources accept arrays of references to other resources or resource fields. These
reference arrays are surrounded by curly brackets (“{“ and “}”, hex: 7B and 7D) and
the values are separated by whitespace or commas. Only one-dimensional arrays of
references are supported. The values can optionally be surrounded by single quotes.
See the following example.
Conversion
In contexts that accept a real number, integer literals (those with no fractional value) are
automatically converted to the equivalent floating-point value upon execution.
There is no built-in conversion between string values and numeric values, though such
a conversion may be implemented by individual commands.
Keywords
• Create
• GMAT
1010
System Reference Guide
• function
In addition, all command names are reserved, including commands created by active
plugins.
Expressions
The only types of expressions common to multiple commands are logical expressions,
which are used by the If/Else and While commands. They are documented here instead
of in both command references.
Relational Operators
The relational operators are scalar operators; they do not operate on Array resources
(only individual elements).
Each relational operator operates on the values of its arguments, not on their identity.
Consider the example:
Create Variable x y
x = 5
y = 5
BeginMissionSequence
If x == y
% body
EndIf
Logical Operators
The logical AND operator exhibits short-circuit behavior. That is, if the left-hand side
of the operator evaluates to false, the right-hand side is not evaluated, though it is still
parsed for syntactic validity.
1011
Reference Guide System
Logical Expressions
Logical expressions are composed of relational expressions combined with logical op-
erators.
Relational expressions must contain one relational operator and two valid arguments.
Literal boolean values are not supported, and numeric values are not interpreted as truth
or falsehood. See the following examples:
1 == 5 % false
1 ~= 5 % true
true % error
1 % error
A % where "A" is an Array resource; error
1 == 5 <= 3 % error
Logical expressions must contain at least one relational expression. Multiple relational
expressions are combined using logical operators. All relational expressions are evalu-
ated first, from left to right, then the full logical expression is evaluated from left to right,
though the short-circuit AND operator (“&”) may terminate the full evaluation. Parenthe-
ses are not allowed. See the following examples:
1 == 1 % true
2 ~= 4 | 3 == 3 % true
8 >= 3 & 3 < 4 % true
2 < 4 & 1 > 3 | 5 == 5 % true
2 < 4 & (1 > 3 | 5 == 5) % error
1 & 1 % error
true | false % error
Statements
Statement Structure
Any statement in the script may be prefixed by the characters “GMAT “. This prefix is
optional and has no effect, but is supported for backward compatibility.
A statement can be split over multiple physical lines by using the line continuation mark-
er, three sequential period characters (“...”, hex: 2E2E2E), before each line break
within the statement.
Any statement may be terminated with a semicolon character (“;”, hex: 3B). The semi-
colon is optional and has no effect, but is supported for backward compatibility. Multiple
statements cannot be combined on a line.
1012
System Reference Guide
White space may occur before or after a statement, or between any of the components
listed above. It is also generally allowed anywhere inside of a statement, and any ex-
ceptions are noted in the documentation specific to that statement.
The Create statement is a special statement that creates resources and assigns them
names. It is only valid in the Initialization section of the script. It has the following com-
ponents:
1. Create keyword
2. Resource type
3. Resource name(s)
The Create keyword indicates the start of the statement. It is followed by the resource
type, which indicates the type of resource to create. This is followed by a resource name,
a user-defined name that is then used to refer to that particular resource. This name
must follow the resource naming rules, listed previously.
The only exception to this syntax is when creating an Array resource, in which case the
dimension of the resource must also be specified
Multiple resource names are allowed, in which case multiple resources of the same type
will be created. Multiple names are separated by white space or by commas (“,”, hex:
2C).
Initialization Statements
Initialization statements are special statements that assign initial values to resource
fields. They are only valid in the Initialization section of the script, and generally take
the following form:
resource.field = value
ForceModel.GravityField.PrimaryBody.Degree = value
1. Resource name
2. Period character (“.”, hex: 2E)
3. Field name, potentially in multiple-dotted form
1013
Reference Guide System
The resource name must refer to a resource created previously in same script.
The field name must refer to a valid field that exists for the associated resource type.
Parameters cannot be set with an initialization statement, though it is valid to set a dual-
mode field (one that can also be a parameter). Fields and parameters are listed in the
documentation for each resource type.
All values are taken literally; no evaluation is performed. Therefore, numeric and string
values must be specified as literals, and resource names and parameters are stored as
references. See the following example:
x = 7100 % valid
aSat.X = 7100 % valid
aSat.X = 7100 + 2 % error (mathematical expression)
For backwards compatibility, there is one exception to the literal-value rule: Spacecraft
resources can copied with an initialization statement like:
Fields that have no assigned value in the Initialization section of the script remain at
their default values, as specified in the documentation for each resource type.
Command Statements
Command statements invoke GMAT commands. They must appear in the Mission Se-
quence section of the script. One special command, BeginMissionSequence, initiates
the Mission Sequence.
Command statements are displayed by the GUI as individual line items in the Mission
tree. The only exception is the BeginScript/EndScript compound command; this is
displayed as a single ScriptEvent item by the GUI.
1014
System Reference Guide
3. Command arguments
The command name is the name of the command being invoked (e.g. Propagate or
BeginFiniteBurn). The command name is mandatory with one exception: the assign-
ment command is indicated by its structure (“LHS = RHS”) instead of its name.
A command label is an optional string literal that can be added immediately after the
command name. This label is used by the GUI to “name” the statement in the Mission
tree, and is intended for a short text description to aid the user. It must be single-quoted,
whether or not it contains spaces. The command label may contain any ASCII character
except certain non-printable characters (NUL, SUB), line termination characters (LF,
CR), the percent sign (“%”), and the single quote (“'“). If the command label is omitted,
the Mission tree statement is given a default label made up of the command name and
an ID number. For example, if the third Propagate command in the script is unlabeled,
it will be given the default label “Propagate3”.
The command arguments control the behavior of the command. The syntax of the argu-
ments is specified by each command individually, and is documented separately. Some
commands, such as Stop, have no arguments.
Compound Statements
Compound statements are command statements that control the execution of other
command statements. Compound statements are composed of three elements:
1. Begin statement
2. Body
3. End statement
The begin statement carries the name of the command itself, while the end statement
begins with the string “End”. For example, the While command is a compound command
composed of two statements:
If ['label'] arguments
[body]
Else
[body]
EndIf
1015
Reference Guide System
Processing
GMAT processes a script in two phases: interpretation and execution. This section gives
an overview of the processing sequence; low-level details are documented in Chapter
17 of the GMAT Architectural Specification.
Interpretation
GMAT interprets a script in two stages: a parsing stage and a validation stage. In the
parsing stage, GMAT reads and interprets each line of the script sequentially. As it inter-
prets a line, it checks it for syntactic correctness and performs any initialization needed
by the line. For example, if the line being interpreted is a Create statement, the related
resource is created. If GMAT encounters an initialization line, it assigns the appropri-
ate value to the indicated resource field. And if it encounters a command statement,
it creates the command structure and interprets its arguments. All language, resource
initialization, and command syntax errors are caught during this parsing stage.
In the validation stage, GMAT checks that all references between resources are valid.
For example, if the script indicates that a Spacecraft resource should be defined in
relation to a specific CoordinateSystem resource, the reference is validated during this
stage. The validation checks that all referenced resources exist and are of the correct
type.
The two-stage interpretation method affects the order of statements in the script. For ex-
ample, Create statements must appear in the script above any initialization statements
that reference the resource being created. But because validation is performed sepa-
rately, the Create statement for a CoordinateSystem resource can appear in the script
below an initialization line that references this resource. See the following examples:
% This is valid; the aSat resource has been created by the line above.
aSat.DateFormat = TAIGregorian
% This is invalid; the aReport resource has not yet been created.
aReport.Filename = 'report.txt'
Create ReportFile aReport
1016
System Reference Guide
Once both stages have completed, the script has been loaded into GMAT. In the GUI,
if any, the Resources tree is populated with the resources created in the Initialization
section of the script, and the Mission tree is populated with the command statements
in the Mission Sequence.
The interpretation phase is also sometimes called the “build” phase or the “load” phase.
Execution
When a mission is run, GMAT first builds interconnections between resources, then
performs command execution. In this phase, all commands in the Mission Sequence
are executed sequentially, in the order of definition in the script. When a command
statement is executed, its arguments are fully processed by the command, and any
remaining errors are reported. Examples of execution-phase errors include mismatched
data types, out-of-bounds array references, and divide-by-zero errors.
Processing Errors
If GMAT encounters an error during the interpretation stage (parsing or validation), the
mission is not loaded. Instead, GMAT reverts to a minimum mission consisting of:
• SolarSystem
• Default CoordinateSystem resources: EarthMJ2000Eq, EarthMJ2000Ec, Earth-
Fixed, EarthICRF
1017
Reference Guide System
Startup File
The gmat_startup_file.txt configuration file
Description
The startup file must be located in the same location as the GMAT executable, and must
be named gmat_startup_file.txt. GMAT loads the startup file once during program
initialization.
File Format
Basic Syntax
The startup file is a text file containing characters from the 7-bit US-ASCII character set.
The startup file is case-sensitive.
White space can appear above or below any line and before or after any key or value.
The following characters are recognized as white space:
Comments begin with the number sign (“#”) and must appear on their own line. Inline
comments are not allowed.
Setting Properties
Properties are specified via key-value pairs, with the following syntax:
PROPERTY = VALUE
Properties are one word, with no spaces. Values extend from the first non-whitespace
character after the equal sign to the end of the line. At least one whitespace character
is required on both sides of the equal sign.
1018
System Reference Guide
The value of any property ending in “_PATH” (including custom ones) can be referenced
by other values. To reference a value, include the property name as part of the value.
Repeated slash characters are collapsed. For example:
ROOT_PATH = ../
OUTPUT_PATH = ROOT_PATH/output/
File Paths
Forward slashes and backslashes can be used interchangeably, and can be mixed in a
single path. The following three paths are considered identical:
data/planetary_ephem/spk/de421.bsp
data\planetary_ephem\spk\de421.bsp
data\planetary_ephem/spk\de421.bsp
Absolute paths are passed to the underlying operating system as-is, aside from normal-
izing the slashes.
Properties
The available properties are shown here, with default values where appropriate.
System
ROOT_PATH=../
Path to GMAT root directory.
Plugins
PLUGIN
Path to plugin library, without extension. Multiple PLUGIN properties are allowed, one
per plugin.
User Functions
GMAT_FUNCTION_PATH
Search path for GMAT function files (.gmf files). May occur multiple times to add
multiple paths.
1019
Reference Guide System
MATLAB_FUNCTION_PATH
Search path for MATLAB function files (.m files). May occur multiple times to add
multiple paths.
PYTHON_MODULE_PATH
Search path for Python modules. May occur multiple times to add multiple paths.
Output
LOG_FILE=OUTPUT_PATH/GmatLog.txt
Path of application log file
MEASUREMENT_PATH=OUTPUT_PATH/
Path of simulated measurement data files. Only used with the libGmatEstimation
plugin.
OUTPUT_PATH=../output/
Output directory path for ReportFile resources.
SCREENSHOT_FILE=OUTPUT_PATH/OUTPUT_PATH
Output path and base filename for screenshots. The base filename is appended
with “_###.png”, where “###” is a number sequence starting from 001. If the base
filename is missing, it defaults to “SCREEN_SHOT”.
VEHICLE_EPHEM_PATH=OUTPUT_PATH/
Default output directory path for EphemerisFile resources.
Data Files
Note this section only discusses the paths that can be set via the startup file. See Con-
figuring Data Files or a discussion of file contents of data files that are regularly updated
and how to maintain those files.
CELESTIALBODY_POT_PATH=DATA_PATH/gravity/celestialbody/
Search path for gravity potential files for CELESTIALBODY. CELESTIALBODY is the
name of any celestial body defined in a given GMAT mission. This property has no
default for user-defined celestial bodies.
ATMOSPHERE_PATH
Path to directory containing atmosphere model data.
BODY_3D_MODEL_PATH
Path to directory containing CelestialBody 3D model files.
CSSI_FLUX_FILE
Path to default CSSI solar flux file.
DATA_PATH=ROOT_PATH/data/
Path to directory containing data files.
DE405_FILE=DE_PATH/leDE1941.405
Path to DE405 DE-file ephemeris file.
DE421_FILE
Path to DE421 DE-file ephemeris file.
DE424_FILE
Path to DE424 DE-file ephemeris file.
EGM96_FILE=EARTH_POT_PATH/EGM96.cof
Path to EGM-96 Earth gravity potential file.
1020
System Reference Guide
EOP_FILE
Path to IERS “EOP 08 C04 (IAU1980)” Earth orientation parameters file.
ICRF_FILE
Path to data required for computing rotation matrix from FK5 to ICRF
(ICRF_Table.txt).
JGM2_FILE=EARTH_POT_PATH/JGM2.cof
Path to JGM-2 Earth gravity potential file.
JGM3_FILE=EARTH_POT_PATH/JGM3.cof
Path to JGM-3 Earth gravity potential file.
LEAP_SECS_FILE=TIME_PATH/tai-utc.dat
Path to cumulative leap seconds file from http://maia.usno.navy.mil.
LP165P_FILE=LUNA_POT_PATH/LP165P.cof
Path to LP165P Moon gravity potential file.
LSK_FILE
Path to SPICE leap second kernel.
MARINI_TROPO_FILE
Path to file containing location specific atmospheric data needed for the Marini tro-
pospheric model.
MARS50C_FILE=MARS_POT_PATH/Mars50c.cof
Path to Mars50c Mars gravity potential file.
MGNP180U_FILE=VENUS_POT_PATH/MGNP180U.cof
Path to MGNP180U Venus gravity potential file.
NUTATION_COEFF_FILE=PLANETARY_COEFF_PATH/NUTATION.DAT
Path to nutation series data for FK5 reduction (NUTATION.DAT).
PLANETARY_COEFF_PATH=DATA_PATH/planetary_coeff/
Path to directory containing planetary coefficient files.
PLANETARY_EPHEM_DE_PATH
Path to directory containing DE ephemeris files.
PLANETARY_EPHEM_SPK_PATH
Path to directory containing SPICE planetary ephemeris files.
PLANETARY_PCK_FILE
Path to SPICE planetary constants kernel for default celestial bodies.
PLANETARY_SPK_FILE
Path to SPICE ephemeris kernel for default celestial bodies.
SCHATTEN_FILE
Path to default Schatten solar flux predict file.
SPACECRAFT_MODEL_FILE
Default spacecraft 3D model file.
SPAD_PATH
Path to directory containing SPAD data files.
SPAD_SRP_FILE
Path to default SPAD SRP model.
TIME_PATH=DATA_PATH/time/
Path to directory containing leap-second files.
VEHICLE_EPHEM_CCSDS_PATH
Path to directory containing spacecraft CCSDS-OEM ephemeris files.
1021
Reference Guide System
VEHICLE_EPHEM_SPK_PATH
Path to directory containing spacecraft SPK ephemeris files.
VEHICLE_MODEL_PATH
Path to directory containing 3D spacecraft models.
Application Files
CELESTIALBODY_TEXTURE_FILE=TEXTURE_PATH/DefaultTextureFile.jpg
Path to texture file for CELESTIALBODY. CELESTIALBODY is the name of any of
the built-in celestial bodies in GMAT. DefaultTextureFile is the default texture file
defined for that celestial body.
BORDER_FILE
Path to constellation border catalog.
CONSTELLATION_FILE=STAR_PATH/inp_Constellation.txt
Path to constellation catalog.
GUI_CONFIG_PATH=DATA_PATH/gui_config/
Path to directory containing GUI configuration files.
HELP_FILE
Path to help file.
ICON_PATH=DATA_PATH/graphics/icons/
Path to directory containing application icons.
MAIN_ICON_FILE
Path to GUI icon.
PERSONALIZATION_FILE=DATA_PATH/gui_config/MyGmat.ini
Path to GUI configuration and history file.
SPACECRAFT_MODEL_FILE=MODEL_PATH/aura.3ds
Path to default Spacecraft 3D model file.
SPLASH_FILE=SPLASH_PATH/GMATSplashScreen.tif
Path to GUI splash image.
SPLASH_PATH=DATA_PATH/graphics/splash/
Path to directory containing splash file.
STAR_FILE=STAR_PATH/inp_StarCatalog.txt
Path to star catalog.
STAR_PATH=DATA_PATH/graphics/stars/
Path to directory containing star and constellation catalogs.
TEXTURE_PATH=DATA_PATH/graphics/texture/
Path to directory containing celestial body texture files.
Program Settings
MATLAB_APP_PATH
[OS X only] Path to MATLAB app (.app).
MATLAB_MODE=SHARED
MATLAB interface connection mode. The available options are:
NO_MATLAB
Disables the MATLAB interface.
SHARED
Each GMAT instance shares a single MATLAB connection. Default.
1022
System Reference Guide
SINGLE
Each GMAT instance uses its own MATLAB connection.
WRITE_GMAT_KEYWORD=ON
Write “GMAT “ prefix before assignment lines when saving a GMAT script file. Ac-
cepted values are ON and OFF.
WRITE_PERSONALIZATION_FILE=ON
Write data on window locations and other local configuration settings to the GMAT.ini
file. Setting to OFF avoids issues encountered when simultaneous instances of
GMAT try to write to the user config file at the same time, resulting in a system error.
Accepted values are ON and OFF.
Debug Settings
DEBUG_FILE_PATH=OFF
Debug file path handling. Accepted values are ON and OFF.
DEBUG_MATLAB=OFF
Debug MATLAB Interface connection. Accepted values are ON and OFF.
DEBUG_PARAMETERS=OFF
Write table of available parameters to log file on startup. Accepted values are ON
and OFF.
HIDE_SAVEMISSION=TRUE
Hide the SaveMission command from the GUI. Accepted values are TRUE and
FALSE.
PLOT_MODE
XYPlot window placement mode. The only accepted value is TILE, which will cause
GMAT to ignore plot window placement fields and tile the windows.
RUN_MODE
GMAT execution mode. The available options are:
EXIT_AFTER_RUN
When GMAT is called with the -r or --run command-line argument, automati-
cally exit after the run is finished.
TESTING
Shows testing options in the GUI.
TESTING_NO_PLOTS
Same as TESTING, but also disables all graphical output in the GUI.
ECHO_COMMANDS
Write commands to log file as they are executed. Accepted values are TRUE and
FALSE.
NO_SPLASH
Skip showing the splash screen on GMAT startup. Accepted values are TRUE and
FALSE.
1023
1024
Release Notes
GMAT R2020a Release Notes ............................................................................. 1025
GMAT R2018a Release Notes ............................................................................. 1037
GMAT R2017a Release Notes ............................................................................. 1041
GMAT R2016a Release Notes ............................................................................. 1046
GMAT R2015a Release Notes ............................................................................. 1049
GMAT R2014a Release Notes ............................................................................. 1057
GMAT R2013b Release Notes ............................................................................. 1063
GMAT R2013a Release Notes ............................................................................. 1068
GMAT R2012a Release Notes ............................................................................. 1072
GMAT R2011a Release Notes ............................................................................. 1079
Below is a more detailed summary of key changes in this release. Please see the full
R2020a Release Notes on JIRA for a complete list.
• On May 1, 2018, the Lunar Reconnaissance Orbiter (LRO) project held an Operational
Readiness Review (ORR) to evaluate GMAT as a replacement for GTDS as the pri-
1025
Release Notes
mary operational orbit determination (OD) tool for LRO. GMAT was approved for this
purpose at this ORR and LRO began using GMAT for operational OD in June 2018.
• In April 2018, the Transiting Exoplanet Survey Satellite (TESS) mission launched.
TESS used GMAT as its primary tool for mission design and maneuver planning from
proposal development through operations. For more information about TESS, includ-
ing a discussion of how GMAT was used, see the published paper.
• The GMAT team is currently developing an Extended Kalman Filter Smoother (EK-
FS) orbit determination capability for future release. In late 2020, a low Earth NASA
mission that uses the GPS point solution data type will help operationally test our new
EKFS capability. A publicly available version of GMAT, with EKFS capabilities for all
data types supported by GMAT, is planned for the R2021a release.
• The GMAT team is currently integrating CSALT into GSFC's Core Flight System (cFS)
to demonstrate the ability to perform optimal control onboard.
New Features
General Capabilities
• Force models now support Solar Radiation Pressure (SRP) N-Plate force modeling
(alpha/beta level). See the Force Model section for details.
• Attitude propagation models now support kinematic attitude propagation using initial
atittude and angular velocity. See the Spacecraft Attitude section for details.
• Hardware models (e.g., antennae, sun sensors) are extended to support fields of view
including
• The orientation of the hardware relative to the spacecraft body
• Field-of-view masks for conical, rectangular and custom fields of view
• Visibility model for points represented as unit vectors
• Visualization of sensor cones in OpenFrames graphics
• Force models now include the ability to use continuous thrust files
during numerical propagation. For details, see the new ThrustSeg-
ment and ThrustHistoryFile sections and the sample script sam-
ples/Ex_R2020a_Propagate_ThrustHistoryFile.script for an example demon-
strating the use of finite-thrust modeling in propagation. The thrust history model sup-
ports:
• Interpolation of finite thrust (low, medium, or high continuous thrust) or accelerations
• Optional integration of mass flow rate in propagation
• Choice of coordinate system for input thrust/acceleration
• Scaling of selected inputs
• Choice of interpolation methods
• The drag model now supports interpolation of a SPAD drag model for attitude de-
pendent drag modelling. SPAD files are created by ray-tracing CAD models to
compute an attitude-dependent area profile that is interpolated during numerical
propagation. For more information on how to configure a force model and space-
craft to use a SPAD drag model, see the Force Model and Spacecraft Ballis-
tic/Mass Properties sections, respectively, and the sample script samples/Naviga-
tion/Ex_R2020a_Estimate_SPADDragScaleFactor.script
1026
Release Notes
• The OD subsystem has undergone significant refactoring to prepare for a future re-
lease of an extended Kalman Filter with smoother.
• The ionosphere media correction model is faster via correction caching. GMAT re-
uses computed ionosphere correction to light-time when multiple independent mea-
surements (such as range, range-rate, and angles) occur from the same station at
the same epoch.
• The Batch Least Squares (BLS) now supports inner-loop sigma editing. After each
BLS iteration, an iterative linearized approximation is used to predict measurements
likely to be edited on the next BLS iteration and to correct the state accordingly. This
can accelerate convergence and help to reduce the overall number of BLS iterations
required. See the UseInnerLoopEditing option to the BatchEstimator resource.
• The Batch Least Squares (BLS) now removes unobservable states from the normal
matrix before attempting inversion. This is useful, for example, when the user con-
figures estimation of a measurement bias but all observations of the bias are edited
out. GMAT now removes the unobservable state and continues processing instead
of terminating with a matrix inversion error.
• Several new measurement types are supported for OD simulation and estimation.
See the User Guide section on Tracking Data Types for OD for more details on the
new supported measurement types, including:
• Azimuth, Elevation angles
• XEast, YNorth angles
• XSouth, YEast angles
• Range_Skin (C-band, non-transponder range)
• The Batch Least Squares (BLS) measurement statistics report now includes summary
statistics on user-edited data.
• The estimation subsystem now supports ThrustHistoryFile and ThrustSegment re-
sources to model finite burns in the estimation arc for BLS OD, and can optionally
estimate a scale factor correction to the nominal finite burn profile.
• The structure of the BLS MATLAB data file has changed. See the BatchEstimator re-
source documentation in the Orbit Determination section of the User Guide for details.
• New ExtendedKalmanFilter and Smoother resources are available in Testing mode.
These resources are currently under development and should not be used in opera-
tional support.
• The estimation subsystem now supports a (beta) N-Plate area model for solar radi-
ation pressure (SRP). The user may configure a detailed multi-plate area model for
SRP modeling for both prediction and estimation. The model includes specular and
diffuse reflectivity, support for moving panels, like solar arrays, and estimation of one
or more SRP correction scale factors. This model is currently under development and
should not be used in operational support. See the Plate resource for more details on
activating and configuring this model.
• The estimation subsystem now supports the ablity to solve for SPAD drag/SRP co-
efficients.
1027
Release Notes
GMAT’s orbit determination (OD) capability has been significantly enhanced. As with
all new releases, missions that use GMAT’s OD capability should perform a baseline
set of regression/performance tests prior to using the new version of GMAT OD for
operational purposes. GMAT is distributed with several examples that demonstrate new
orbit determination capability in this release, including:
samples/Navigation/Ex_R2020a_Alpha_FilterSmoother.script
samples/Navigation/Ex_R2020a_Estimate_AngleData.script
See samples/Navigation/Ex_R2020a_Estimate_RangeSkin.script
samples/Navigation/Ex_R2020a_Estimate_SPADDragScaleFactor.script
samples/Navigation/Ex_R2020a_Estimate_SPADSRPScaleFactor.script
samples/Navigation/Ex_R2020a_Estimate_ThrustScaleFactor.script
• The new OFI graphics component supports all functionaliy in GMAT's legacy 3D
graphics, as well as significant new functionality.
• The system now supports user-defined views of any spacecraft or celestial body.
Views can be body-fixed, coordinate system-fixed, or look from one body towards
another. Additionally, the user can switch between views in a single graphics window.
• Multithreaded visualizations now make use of multiple processor cores, resulting in a
general computation speedup throughout GMAT when compared to OrbitView.
1028
Release Notes
• The 3D graphics now supports full control over simulation time. View scene at any
time, animate at various time scales, and synchronize time between multiple Open-
FramesInterface windows.
• The system supports granular control over displayed objects, including optionally plot-
ting axes, bodies, trajectories, or many other per-body graphics options.
• Graphics option changes no longer require a mission rerun. This includes switching
between user-defined views and enabling/disabling displayed objects.
• Graphics now support high-fidelity rendering, including multisample antialiasing
(MSAA), lighting, accurate star map with star colors and sizes (HYGv3 database)
• The system now supports vectors to objects in 3D graphics: body-fixed direction or
pointing towards another object.
• The OFI interface now supports visualizing sensor fields of view, including conical,
rectangular, and custom fields of view.
• The system supports Virtual Reality visualization via OpenVR. Any scene can be vi-
sualized on OpenVR-compatible hardware, including the Oculus Rift or HTC Vive.
There is an extensive set of samples scripts illustrating how to use the new graphics
capability in GMAT located in samples/NeedOpenFramesInterface. A few scripts of
particular interest are:
samples/NeedOpenFramesInterface/Ex_R2020a_OFI_RealTimeMOC.script
samples/NeedOpenFramesInterface/Ex_R2020a_OFI_FieldOfView.script .
samples/NeedOpenFramesInter-
face/Ex_R2020a_OFI_VR_2017SolarEclipse.script
samples/NeedOpenFramesInter-
face/Ex_R2020a_OFI_CustomSegmentColors.script
Note
The OFI is now the default 3D visualization component in GMAT. OrbitView
will continue to be supported for backward compatibility purposes but will
only be modified for critical bug fixes.
GMAT has a new subsystem for trajectory optimization, including new techniques and a
new C++ and script interface, (The legacy parameter optimzation functionality is still sup-
1029
Release Notes
There are two new proprietary plugins -- CsaltInterface and EMTGModels -- for space-
craft trajectory optimization. Together with the CSALT library, those features com-
bine to form the new GMAT optimal control capability. The CsaltInterface plugin con-
tains GMAT's interface to the collocation transcriptions and optimization capabilities in
CSALT. The EMTGModels plugin allows GMAT to use spacecraft power and engine
models implemented in the Evolutionary Mission Trajectory Generator (EMTG). Togeth-
er, those components provide extensive support for analytic partial derivatives of opti-
mal control functions, including orbital dynamcs and thrust models. When analytic de-
rivatives are not provided, the system uses optimal finite differencing.
The user guide for the optimal control components including CSALT and GMAT optimal
control is written in restructured text (rst) and located in the GMAT distribution here:
gmat/docs/GMAT_OptimalControl_Specification.pdf. Extensive training materi-
als, beyond the reference material, is available for GMAT optimal control functionality
and CSALT. Below is a brief summary of the new capability.
• CSALT solves the generic optimal control problem, supporting dynamics, Lagrange
form of the cost function, path, and boundary constraints. CSALT does not assume
the problem is low-thrust and can solve general problems including but not limited to
6-DOF optimization, classical optimal control problems, low-thrust, high-finite thrust,
formation and constellation, and re-entry problems. CSALT is distributed with a limit-
ed set of models. In general, when using CSALT, the user must provide models of
dynamics, cost, and constraint functions. (NOTE: the GMAT optimal control subsys-
tem is used to solve low-thrust trajectory problems in GMAT.)
• The GMAT plugins CsaltInterface and EMTGModels support low-thrust trajectory op-
timization.
• The GMAT interface to CSALT is fully contained in the GMAT scripting language.
GMAT script users do not need to write low-level C++ code. (However, those familiar
with C++ can call CSALT directly via the C++ interface.)
• The system can optimize a constrained spacecraft trajectory using one of several
collocation transcriptions, with mesh refinement.
• The system supports a trajectory composed of multiple “phases,” each of which may
be defined by a different dynamics model. Phases may be “linked” through user-set-
table constraints (e.g., full-state/time linkage between the end of one phase and the
beginning of another phase to enforce continuity).
• Users have the ability to set optimization settings from within a GMAT script. Examples
of settable parameters include feasibility/optimality tolerances, upper/lower bounds
on states, and initial collocation mesh settings.
• Users can choose from one of multiple commonly used merit functions (e.g., maximum
final mass, minimum time of flight).
• Thrust models now include constant thrust and specific impulse (Isp), fixed efficiency,
polynomials, and smoothed throttle tables.
1030
Release Notes
• Users may include in their trajectory multiple commonly used spacecraft trajectory
constraints, such as an integrated flyby or a celestial body rendezvous.
• There is alpha-level support for scalar inline expressions in optimal control functions.
I.e., a user may specify a constraint in a script based on GMAT variables if a built-in
constraint does not satisfy the user’s needs.
• New sample scripts and examples of supporting files are included in the release in
gmat/samples/OptimalControl (for sample scripts) and gmat/data/misc and gmat/da-
ta/emtg (for supporting files).
Note
The source code for GMAT optimal control and CSALT can be distributed,
but is currently not included in the public release as they depend on the non-
linear programming solver software SNOPT. Source code for those compo-
nents can be provided upon request but the user must obtain SNOPT from
Standford Business Software to compile those components.
There is an extensive set of sample scripts illustrating optimal control functionality dis-
tributed with GMAT in the folder samples/OptimalControl/. (Note: For CSALT C++
examples and tutorials see the user guide referenced above.) A few scripts of particular
interest are:
samples/OptimalCon-
trol/Ex_R2020a_EarthToMarsSOI_C3Eq0_CSALTTutorial.script
samples/OptimalCon-
trol/Ex_R2020a_PCLaunch_ConstrainedC3AndDLA_EarthLaunch_EarthOrigin.script
samples/OptimalControl/Ex_R2020a_Phase_Type_ImplicitRKOrder6.script
samples/OptimalControl/Ex_R2020a_IntegratedFlyby_MarsFlyby.script
samples/OptimalControl/Ex_R2020a_EMTGSpacecraft_SCOpt_*.script
API
GMAT now provides access to many of its internal components from Python and Ja-
va, and from MATLAB using the Java-based API. This new Beta-quality functionality
enables interoperablity between NASA's GMAT, Copernicus, and MONTE software ap-
1031
Release Notes
plications. The user guide for the API is written in restructured text (rst) and located in
the GMAT distribution here:docs/GMAT_API_UsersGuide.pdf. A summary of key API
features is shown below.
• Users can now load GMAT scripts, modify parameters, and execute the loaded script
via an API interface.
• After running a script, users can now access the objects from the run and retrieve
the results of the run.
• Users can now create GMAT objects directly via the API.
• Created objects can be configured using a syntax similar to GMAT scripting.
• Object-to-object connections are made by calling an initialization function.
• Initialized objects provide data that matches the computations performed by GMAT
during a run.
• Users can interact with GMAT objects from their platform’s console interface - that is,
from the MATLAB console, a Python console (Spyder, ipython, or the default Python
console application).
• The API can be accessed using Jupyter notebooks.
• The GMAT API provides live help during use.
• Examples of all of these features are included in the api folder for the release.
Note
The compiled API resources for Python were built using Python 3.7 on Win-
dows and Mac, and the platform-supplied Python 3.6 libraries on Linux.
There is an extensive set of sample scripts illustrating API functionality distributed with
GMAT in the folder gmat/api. A few scripts of particular interest are:
gmat/api/Ex_R2020a_CompleteForceModel.*
See gmat/api/Ex_R2020a_RangeMeasurement.*
samples/OptimalControl/Ex_R2020a_RangeMeasurement.*
Improvements
• There are several new built-in GMAT functions: Pause, SystemTime, ConvertTime,
Num2str, Str2num, RotationMatrix, and Sign.
• There is a preliminary interface to use the GMAT python interface and python sockets
to bring in raw telemetry data into GMAT.
• A new graphical interface, DynamicDataDisplay, allows display of numeric and text
data during system execution and can optionally color code the data based on user
defined constraints.
1032
Release Notes
• There is a new, minimally tested interface to SNOPT that allows users to provide pre-
compiled versions of SNOPT 7.5. Previous versions of GMAT had SNOPT compiled
directly into the SNOPT plugin, which prohibits release.
• Updates to the beta polyhedral gravity model allow polyhedral regions with non-uni-
form density.
• The script editor now supports syntax highlighting.
• A ground station can now be placed on any celestial body (not only Earth as in pre-
vious releases).
• When compiling GMAT, dependency configuration is now unified on all platforms via
a Python 3 script. Previous versions used bash and windows .bat files.
• There are numerous improvements to the GMAT build system: easier to incorporate
external plugins (e.g. OpenFramesInterface), and CMake automatically downloads
some dependencies (currently Boost). This makes it easier for developers to compile
GMAT.
• The SPAD SRP model supports improved interpolation.
Compatibility Changes
• The BatchEstimatorInv resource has been renamed BatchEstimator. BatchEsti-
matorInv will continue to be recognized for R2020a but will be deprecated in the next
major release.
• The structure of the BatchEstimator MATLAB data file has changed. See the Batch-
Estimator resource documentation for details.
Fixed Issues
Over 150 bugs were closed in this release. See the "Critical Issues Fixed in R2020a"
report for a list of critical bugs and resolutions in R2020a. See the "Minor Issues Fixed for
R2020a" report for minor issues addressed in R2020a. Some fixes in R2020a include:
• The simulator now accounts for occultation of the central body of the orbit when other
than the Earth. (GMT-6134).
• An error affecting the ability to simulate data for durations longer than three weeks
has been corrected. (GMT-6649)
• Solve-for parameters may now be specified in any order on the
Spacecraft.SolveFors field. (GMT-6658)
• The BatchEstimator ResetBestRMSIfDiverging setting now works. (GMT-7036)
• The MarsGRAM atmosphere model now works correctly for Mac and Linux users.
(GMT-5044)
• GMAT now properly interpolates UT1-UTC on the day of a leap second. (GMT-5954)
Known Issues
See the "All Known Issues for R2020a" report for a list of all known issues in R2020a.
There are several known issues in this release that we consider to be significant:
1033
Release Notes
ID Description
GMT-5417 Adaptive step size control behaves inconsistently when used in GMAT's
navigation system. Fixed-step integration is currently required for simu-
lation and estimation.
GMT-6202 Spikes of up to 1 mm/sec may be observed in some cases in DSN_TCP
and Doppler ionospheric corrections. The IRI2007 model has some
jumps in the electron density when moving through time. Spikes are
caused when the start and end signal paths are located on different sides
of these jumps.
GMT-7207 The GMAT python interface is only designed to work with a standard
python installation from python.org. (For Mac and Windows, we recom-
mend use of Python 3.7. For Linux, we recommend the use of Python
3.6 or 3.7). In the future, we would like to allow the user the choice to
install either python.org python or Anaconda python. Note that prelim-
inary testing shows that, for Windows, the user may be able to use the
Anaconda python interface by (1) deleting system variable references to
python.org python and (2) creating the System Variable PYTHONHOME
and setting it to the folder where python.exe resides. Note that this is not
fully tested and it is not known if this can cause other problems.
1034
Release Notes
1035
Release Notes
1036
Release Notes
Below is a summary of key changes in this release. Please see the full R2018a Release
Notes on JIRA for a complete list.
• GMAT is now used as the primary system for maneuver planning and product gener-
ation for the Solar Dynamics Observatory (SDO).
• GMAT is now used as the primary operational tool for orbit determination for the Solar
and Heliospheric Observatory (SOHO) mission.
• GMAT is now used as the primary operational tool for maneuver planning, orbit de-
termination, and product generation for the Advanced Composition Explorer (ACE)
mission.
• GMAT is now used as the primary operational tool for maneuver planning, orbit de-
termination, and product generation for the Wind mission.
• In April 2018, the Transiting Exoplanet Survey Satellite (TESS) mission is planned to
launch. TESS has used GMAT as its primary tool for mission design and maneuver
planning from proposal development through operations.
• In April 2018, the LRO project will hold an operational readiness review to perform final
evaluation of GMAT to replace GTDS as the primary operational orbit determination
(OD) tool for the Lunar Reconnaissance Orbiter (LRO).
New Features
Orbit Determination Enhancements
The following new features and capabilities have been added to GMAT's estimation
system.
• The batch estimator now supports a capability that freezes the measurements used
for estimation after a user-specified number of iterations. This functionality avoids
estimator chatter that can occur near solutions when some measurements are near
the sigma edit boundary and are repeatedly removed during one iteration and then
added back in the next iteration.
• Numerics are improved when calculating Doppler and DSN_TCP measurement resid-
uals, improving noise behavior in the residuals.
• The GroundStation object supports a new troposphere model, the Marini model,
matchig the implementation used in GTDS. One operational advantage of the Marini
model is that it doesn’t require input of weather data at the Ground station. (Models
that do accept weather data may have more accuracy.)
• Time is now modeled using three data members, a day number, seconds of day,
and fraction of second. High precision time is surgically implemented in appropriate
models such as Earth rotation, planetary ephemerides and others.
1037
Release Notes
• Range differences are computed using a Taylor series and differenced Chebyshev
polynomials.
• Measurement simulation now accounts for central body occultation when orbiting bod-
ies other than the Earth.
• Estimation now supports solving for the Keplerian state estimation with a priori con-
straints.
• For BLS estimation, the user may choose to perform measurement editing using ei-
ther the weighted root-mean-square (WRMS) of residuals, or the predicted weighted
root-mean-square (WRMSP) of residuals. Residuals of elevation edited data are now
reported.
• The batch estimator report now shows the name of input files used in the configuration
and the observation time span. Additionally, spacecraft hardware configurations and
new measurement statistics information are included.
• GMD file improvements
As shown by the new features above, GMAT’s orbit determination (OD) capability has
been significantly enhanced. As with all new releases, missions that use GMAT’s OD
capability should perform a baseline set of regression/performance tests prior to using
the new version of GMAT OD for operational purposes.
Example scripts:
Built-in Optimizer
GMAT now contains a built-in optimizer called Yukon, developed by the GMAT team.
The algorithm uses an SQP line search algorithm with an active set QP-subproblem
algorithm. Yukon is designed for small scale problems and is not applicable to large,
sparse optimization problems. See the Yukon reference for more information.
Improvements
• Tide modeling is improved, and GMAT now supports lunar tides.
• STM propagation now includes variational terms from drag models.
• The degree and order of STM contributions from harmonic gravity is now settable by
the user and defaults to the maximum order on the gravity file or 100, whichever is
lower.
• The buffer size that determines the number of plot points stored by the OrbitView
Resource is now exposed to the user.
• Significant performance improvements have been made in the IRI2007 ionosphere
model.
• The script editor highlights errors and warnings found on the first pass of parsing.
• GMAT now supports body fixed and TOD coordinate systems for Code 500
Ephemerides and supports all central bodies in the Code 500 Ephemeris format.
• The CommandEcho command has been added to GMAT to support printing com-
mands to the message window and log file as they are executed in a mission se-
1038
Release Notes
quence. This command is particularly useful when debugging user scripts. See the
CommandEcho reference for more information.
• The Code500 propagator type now automatically detects the endianness when read-
ing Code500 files.
• The STK ephemeris propagator now uses Hermite interpolation, and includes velocity
information in the position interpolation for segments that contain fewer than 7 rows of
data. Velocity interpolation for segments with fewer than 7 rows of data is performed
by forming the hermite interpolating polynomial for position, and then differentiating
the position interpolating polynomial to obtain the velocity.
• You can now set the step size of an ephemeris propagator during mission execution
(i.e. after the BeginMissionSequence command).
• The startup file now allows optional updating of the user configuration file. This avoids
issues encountered when simultaneous instances of GMAT try to write to the user
config file at the same time, resulting in a system error.
• The Python data file utility now updates data files used by the IRI2007 model.
• The GMAT CMake based build system now supports plugin components developed
by external groups.
• GMAT now supports GUI plugin components.
Compatibility Changes
• Batch estimation now requires the use of fixed step integration.
• The RotationDataSource on CelestialBody Resources is deprecated and no longer
has an effect.
• The Spacecraft EstimationStateType parameter is deprecated.
• The EphemerisFile OutputFormat options ‘UNIX’ and ‘PC’ are deprecated. ‘BigEndi-
an’ and ‘LittleEndian’ should be used instead.
• The EarthTideModel on the ForceModel Resource has been renamed to TideModel
• GMAT now returns error codes via the command line interface to indicate if issues
were encountered during system execution.
• When using the Write command to write Resource properties to a ReportFile, only
scalar, real quantities are written. Properties that are either not real or are arrays are
ignored and a warning is issued.
• The STK ephemeris propagator now correctly handles segments with fewer than 5
rows of data.
• STK ephemeris files that contain event boundaries now correctly count the number of
ephemeris rows represented in the NumberOfEphemerisPoints keyword value pair.
1039
Release Notes
Known Issues
See the "All Known Issues for R2018a" report for a list of all known issues in R2018a.
There are several known issues in this release that we consider to be significant:
ID Description
GMT-5417 Adaptive step size control behaves inconsistently when used in GMAT's
navigation system. Fixed step integration is currently required for simu-
lation and estimation.
GMT-6202 Spikes of up to 1 mm/sec may be observed in some cases in DSN_TCP
and Doppler ionospheric corrections. The IRI2007 model has some
jumps in the electron density when moving through time. Spikes are
caused when the start and end signal paths are located on different sides
of these jumps.
GMT-6367 For Macs with a Touch Bar (GUI issue only): there appears to be an issue
with WxWidgets, the third party GUI library used by GMAT, and the Mac
Touch Bar. Crashes occur frequently and the traceback indicates that the
issue lies in Apple code, related to the Touch bar specifically, possibly
caused by a NULL string pointer. Our analysis suggests this issue cannot
be addressed by the GMAT team or by WxWidgets; however, we will
continue to investigate. In the meantime, the GMAT Console version will
continue to work, and the GUI version (Beta) will work on Macs without
a Touch Bar.
1040
Release Notes
Below is a summary of key changes in this release. Please see the full R2017a Release
Notes on JIRA for a complete list.
New Features
Orbit Determination Enhancements
The following new features and capabilities have been added to GMAT.
• Three new data types can now be processed in GMAT; GPS point solution
(GPS_PosVec), range data (Range), and range rate (RangeRate) data. Note that all
of these data types have been through regression testing but only the DSN range
data type has been through substantial operational testing. Thus, the DSN range data
type is the most validated data type available in GMAT.
• A minimally tested and documented alpha version of an extended Kalman filter algo-
rithm is now available for experimental use. This plugin is available but turned off by
default. To use, enable the "libEKF" plugin in the startup file.
• A second-level data editing capability has been added. This feature allows you to
choose observations that are computed and reported but not used in the estimation
state update.
1041
Release Notes
% Load GMAT
scriptFileName = fullfile(pwd, 'gmat.script');
[myMod, gmatBinPath, result] = load_gmat(scriptFileName);
1042
Release Notes
Improvements
• You can now define the name and location of the gmat startup and log file via the
command line interface. This is useful when running multiple GMAT sessions simul-
taneously or when you have complex, custom file configurations.
• You can now write STK ephem files with units in meters (previously, only km was
supported).
• You can now write STK ephem files without discrete event boundaries.
Compatibility Changes
• GMAT now requires Python version 3.6.x.
• Schatten files no longer require the "PREDICTED SOLAR DATA" keyword at the top
of the file.
• The names and locations of several data files used by GMAT are no longer hard coded
and their names and locations are set in the file gmat_startup_file.txt located
in the bin directory. If you use custom startup files, you MUST add the lines below
to your startup file before GMAT will start. Note that the startup files distributed with
GMAT have these lines added. This backwards compatiblity issue only affects users
who customize their startup file.
EARTH_LATEST_PCK_FILE = PLANETARY_COEFF_PATH/earth_latest_high_prec.bpc
EARTH_PCK_PREDICTED_FILE = PLANETARY_COEFF_PATH/SPICEEarthPredictedKernel.bpc
EARTH_PCK_CURRENT_FILE = PLANETARY_COEFF_PATH/SPICEEarthCurrentKernel.bpc
LUNA_PCK_CURRENT_FILE = PLANETARY_COEFF_PATH/SPICELunaCurrentKernel.bpc
LUNA_FRAME_KERNEL_FILE = PLANETARY_COEFF_PATH/SPICELunaFrameKernel.tf
• The syntax for navigation functionality has been significantly changed for consistency
throughout the system. See the Deprecated Measurement Type Names section of
the Tracking Data Types for OD Help for more details.
1043
Release Notes
GMAT Stuff
Don't forget you can purchase clothing and other items with the GMAT logo via ©Land's
End, Inc at the GSFC Store . Once, you've chosen an item, make sure to select the
GMAT logo!
Known Issues
All known issues that affect this version of GMAT can be seen in the "Known Issues in
R2017a" report in JIRA.
There are several known issues in this release that we consider to be significant:
ID Description
GMT-5269 Atmosphere model affects propagation at GEO.
GMT-2561 UTC Epoch Entry and Reporting During Leap Second is incorrect.
GMT-3043 Inconsistent validation when creating variables that shadow built-in math
functions
GMT-3289 First step algorithm fails for backwards propagation using SPK propaga-
tor
GMT-3350 Single-quote requirements are not consistent across objects and modes
GMT-3669 Planets not drawn during optimization in OrbitView
GMT-3738 Cannot set standalone FuelTank, Thruster fields in CallMatlabFunction
GMT-4520 Unrelated script line in Optimize changes results (causes crash)
GMT-4398 Coordinate System Fixed attitudes are held constant in SPAD SRP mod-
el during a propagation step
GMT-5600 Numerical Issues when calculating the Observation Residuals
1044
Release Notes
ID Description
GMT-6040 Correct the code for the RunSimulator and RunEstimator commands so
that they respect the scripted propagator settings
GMT-5881 Error in Ionosphere modeling
1045
Release Notes
Below is a summary of key changes in this release. Please see the full R2016a Release
Notes on JIRA for a complete list.
New Features
Orbit Determination
GMAT now supports orbit determination with a focus on batch estimation of DSN data
types including range and Doppler. We’ve been working on navigation functionality for
several releases, but this is the first production release containing navigation function-
ality. Orbit determination functionality has undergone a rigorous QA process including
shadow testing in GSFC’s Flight Dynamics Facility and is extensively documented in tu-
torials and reference material. Navigation components include BatchEstimator, Simula-
tor, ErrorModel, StatisticsAcceptFilter, StatisticsRejectFilter, TrackingDataSet, and the
RunEstimator and RunSimulator Commands. We recommend taking the tutorials first
then reviewing the reference material for orbit determination components to get started.
GMAT now supports a propagator that uses GSFC’s Code 500 ephemeris file format.
The Code 500 file format is legacy format still used by some systems at GSFC. This
functionality allows users of GSFC legacy systems to simulate and analyze trajectories
computed in systems such as GTDS.
Write Command
You can now export GMAT resources to files during the mission sequence execution.
This is a powerful feature that allows you to save configurations at any point in a session
for use by in later sessions or by other users.
#Include Macro
You can now load GMAT resources and script snippets from external files during the
script initialization and mission execution. This is a powerful feature that allows you to
reuse configurations across multiple users and/or scripts. This feature can also greatly
simplify automation for operations and Monte-Carlo and parametric scanning that have
1046
Release Notes
use cases with a lot of common data but some data that changes from one execution
to the next.
Using the built-in GetEphemStates function, you can now query SPICE, Code-500 and
STK .e ephemeris types and for a spacecraft’s initial epoch, initial state, final epoch and
final state in any GMAT supported epoch formats and coordinate systems. This allows
you to perform numerical propagation using states off of ephemiris files for comparison
and other analysis.
Improvements
• You can now define the EOP file location in a script.
• The system now supports finite burn parameters that report the thrust component da-
ta for a finite burn. The parameters include total thrust from all thrusters in the three
coordinate directions, the total acceleration from all thrusters in the three coordinate
directions, and the total mass flow rate. Furthermore, you can now also report indi-
vidual thruster parameters such as thrust magnitude, Isp and mass flow rate.
• GMAT now contains built-in string manipulations functions sprintf, strcmp, strcat,
strfind, strrep.
• Several new built in math functions are implemented including a built-in cross product
function. For manipulation of numeric data we've implemented mod, ceil, floor, fix. For
random number generation we've implemented rand, randn, and SetSeed.
• You can now model finite burns that employ multiple tanks. Previous versions were
limited to a single tank.
• GMAT now supports generation of STK's “.e” ephemeris format in addition those sup-
ported previously such as CCSDS-OEM, SPK and Code-500 formats.
• We've written over 130 pages of new, high-quality user documentation!
• The behavior of the GUI when using large fonts has been improved.
Compatibility Changes
• You can now override the default NAIFId on a CelestialBody to allow using body
centers or barycenters as the reference for built-in celestial bodies. Previously this
field was read-only.
We updated the CMake-based build system that is used on all platforms. The CMake
configuration is maintained by the GMAT team and distributed with the source code.
Thanks to CMake, it is much easier to compile GMAT. See the wiki documentation for
details. Note that old build files are no longer supported and are considered obsolete.
1047
Release Notes
GMAT Stuff
Don't forget you can purchase clothing and other items with the GMAT logo via ©Land's
End, Inc at the GSFC Store . Once, you've chosen an item, make sure to select the
GMAT logo!
Known Issues
All known issues that affect this version of GMAT can be seen in the "Known Issues in
R2016a" report in JIRA.
There are several known issues in this release that we consider to be significant:
ID Description
GMT-5269 Atmosphere model affects propagation at GEO.
GMT-2561 UTC Epoch Entry and Reporting During Leap Second is incorrect.
GMT-3043 Inconsistent validation when creating variables that shadow built-in math
functions
GMT-3289 First step algorithm fails for backwards propagation using SPK propaga-
tor
GMT-3350 Single-quote requirements are not consistent across objects and modes
GMT-3669 Planets not drawn during optimization in OrbitView
GMT-3738 Cannot set standalone FuelTank, Thruster fields in CallMatlabFunction
GMT-4520 Unrelated script line in Optimize changes results (causes crash)
GMT-4520 Coordinate System Fixed attitudes are held constant in SPAD SRP mod-
el during a propagation step
1048
Release Notes
Below is a summary of key changes in this release. Please see the full R2015a Release
Notes on JIRA for a complete list.
New Features
GMAT Functions
You can now write functions (sub-routines) in the GMAT script language. This powerful
feature greatly expands the practical capability of the system and makes maintaining
complex configurations simpler. This feature also enables sharing GMAT script utilities
among among projects. If you need a new math computation, want to isolate a complex
section of code, or re-use code, GMAT functions are a great solution.
Eclipse Location
GMAT now supports eclipse location. Under the hood GMAT calls NAIF SPICE routines.
Thanks to the NAIF for making this great functionality available.
1049
Release Notes
GMAT now supports station contact location. Under the hood GMAT calls NAIF SPICE
routines. Thanks to the NAIF for making this great functionality available.
Python Interface
GMAT now supports an interface with Python. The power of the Python ecosystem can
now be used with GMAT.
1050
Release Notes
Electric Propulsion
GMAT now supports modelling of electric propulsion systems. Below is an examle show-
ing GMAT modelling a cube-sat with electric propulsion in a lunar weak-stablity orbit.
You can model electric tanks, thrusters, and power systems (both Solar and nuclear).
SNOPT Optimizer
1051
Release Notes
You can now provide flux files for drag modelling including Schatten historical files and
Center for Space Standards and Innovation (CSSI) Space Weather Files. This greatly
improves long term orbital predictions and reconstructions in the Earth's atmosphere.
You can now use a 3D model for celestial bodies in 3-D graphics.
1052
Release Notes
GMAT now displays a window showing solver variables and constraint values during
execution. This helps track the progress of targeters and optimizers and is an important
aid in troubleshooting convergence issues.
Improvements
Documentation
We've written over 70 pages of new, high-quality user documentation! We've also written
two conference papers documenting our verification and validation process and results,
and the flight qualification program and results for the Advanced Composition Explorer
(ACE). Conference papers are located in the "docs" folder of the distribution.
1053
Release Notes
Training Videos
We've posted training videos on YouTube . You can now take GMAT training even if
you are unable to attend the live classes!
Other Improvements
• You can now optionally apply an ImpulsiveBurn in the backwards direction which is
convenient when targeting backwards in time.
• GMAT is distributed with beta plugin Polyhedral gravity model.
• The system now looks in the working directory for scripts run from the command line
• You can now reference supporting files relative to the script file location for ease in
sharing complex configurations.
• You can now define an minimum elevation angle for a groundstation used in event
location and estimation.
• The appearance of constellations in 3-D graphics has been improved.
1054
Release Notes
• The 3-D model scaling sensitivity in the GUI has been improved.
• The behavior of the GUI when using large fonts has been improved.
Compatibility Changes
• The ChemicalTank Resource has been renamed to ChemicalTank to distinguish
between chemical and electric systems.
• The ChemicalThruster Resource has been renamed to ChemicalThruster to dis-
tinguish between chemical and electric systems.
• The sensitivity of Spacecraft Resource settings such as ModelOffsetX, ModelRo-
tationY, and ModelScale has changed in 3-D graphics.
• When applying an ImpulsiveBurn during backwards targeting, GMAT now attempts
to compute maneuver values that are consistent with a forward targeting approach.
The maneuver values reference the pre-manevuer velocity components instead of
the post-maneuver components.
GMAT Stuff
You can now purchase clothing and other items with the GMAT logo via ©Land's End,
Inc at the GSFC Store . Once, you've chosen an item, make sure to select the GMAT
logo!
1055
Release Notes
Known Issues
All known issues that affect this version of GMAT can be seen in the "Known Issues in
R2015a" report in JIRA.
There are several known issues in this release that we consider to be significant:
ID Description
GMT-5253 GMAT stuck in script state after bad script load.
GMT-5269 Atmosphere model affects propagation at GEO.
GMT-2561 UTC Epoch Entry and Reporting During Leap Second is incorrect.
GMT-3043 Inconsistent validation when creating variables that shadow built-in math
functions
GMT-3289 First step algorithm fails for backwards propagation using SPK propaga-
tor
GMT-3350 Single-quote requirements are not consistent across objects and modes
GMT-3669 Planets not drawn during optimization in OrbitView
GMT-3738 Cannot set standalone FuelTank, Thruster fields in CallMatlabFunction
GMT-4520 Unrelated script line in Optimize changes results (causes crash)
GMT-4408 Failed to load icon file and to open DE file
GMT-4520 Coordinate System Fixed attitudes are held constant in SPAD SRP mod-
el during a propagation step
1056
Release Notes
Below is a summary of key changes in this release. Please see the full R2014a Release
Notes on JIRA for a complete list.
New Features
In GMAT R2014a, you can now specify colors for each segment of your trajectory in-
dependently, so you can clearly see where a segment begins and ends. This can help
define portions of a trajectory, such as before or after maneuvers. All color handling has
also been moved from the graphics resources (OrbitView and GroundTrackPlot) to
the resources and commands controlling the trajectory (e.g. Spacecraft, Planet, Prop-
agate).
On Spacecraft, the color specification has moved to the Visualization tab. See the circled
area in the screenshot below. Colors for celestial bodies (Planet, Moon, Asteroid, etc.)
are specified similarly.
The trajectory color associated with a particular trajectory segment can be changed by
changing the color for that particular Propagate command. It will override the color for
the Spacecraft being propagated for that segment only, and it will return to the default
color afterwards.
1057
Release Notes
Additionally, colors can now be specified either by name ('Blue') or by RGB value ([0
0 255]).
This release also adds participant labels in the graphics as well. As long as
OrbitView.ShowLabels is enabled, each celestial body or Spacecraft in the plot will
show its name next to it.
BeginMissionSequence
% plots in blue
Propagate aProp(aSat) {aSat.ElapsedSecs = 900}
aSat.OrbitColor = 'Green'
% plots in green
Propagate aProp(aSat) {aSat.ElapsedSecs = 900}
% plots in red
Propagate aProp(aSat) {aSat.ElapsedSecs = 900, OrbitColor = Red}
1058
Release Notes
See the Color reference, as well as the individual Spacecraft, CelestialBody, Propagate,
and OrbitView references, for more information.
GMAT now supports six new common orbit state representations, developed with sup-
port by the Korea Aerospace Research Institute (KARI). The new representations are:
The new representations are available as options in the Spacecraft "State Type" list,
and as options to the Spacecraft.DisplayStateType field.
1059
Release Notes
• Precessing spinner
• Nadir pointing
• CCSDS Attitude Ephemeris Message (AEM)
The new representations are available as options in the Spacecraft "Attitude" list, and
as options to the Spacecraft.DisplayStateType field.
• Prince Dormand 853 integrator. See the Propagator reference for more information.
• Mars-GRAM density model. See the Propagator reference for more information.
• High-fidelity, attitude dependent SRP dynamics model. See the Propagator reference,
and the Spacecraft Ballistic and Mass Properties reference for more information.
Below is a script example that illustrates the new algorithm and parameter options.
1060
Release Notes
BeginMissionSequence
Improvements
Dependencies in Assignment Command
You can now define settable parameters by using a dependency on the LHS of an
assignment command:
BeginMissionSequence
aSat.EarthFixed.X = 7000
aSat.EarthMJ2000Eq.VZ = 1
Other Improvements
• You can now set true retrograde orbits when using the Keplerian representation.
• You can now use the quaternion Rvector parameter on the right hand side of an
assignment command.
• You can now use a Spacecraft body fixed coordinate system as the coordinate sys-
tem for an OrbitView.
• The number of Spacecraft that that can be displayed in OrbitView is no longer limited
to 30.
• The documentation for OrbitView has been significantly expanded. See the Orbit
View reference for details.
• You can now save an XY plot graphics window to an image file.
• The supported set of keyboard shortcuts has been greatly expanded. See the Key-
board Shortcuts reference for more information.
• You can now use many more common ASCII characters in GMAT strings.
• You can now generate orbit state command summary reports using coordinate sys-
tems that have any point type as the origin of the selected coordinate system. Previ-
ously the origin had to be a Celestial Body.
Compatibility Changes
• Color settings for Resources displayed in graphics are now configured on the Re-
source and via the Propagate command. OrbitColor and TargetColor fields on
1061
Release Notes
graphics resources are no longer used.. See the Spacecraft Visualization reference,
and Propagate command reference for details.
• AtmosDensity is now reported in units of kg/km^3. See the Calculation Parameter
reference for details.
Known Issues
All known issues that affect this version of GMAT can be seen in the "Known Issues in
R2014a" report in JIRA.
There are several known issues in this release that we consider to be significant:
ID Description
GMT-2561 UTC Epoch Entry and Reporting During Leap Second is incorrect.
GMT-3043 Inconsistent validation when creating variables that shadow built-in math
functions
GMT-3108 OrbitView with STM and Propagate Synchronized does not show space-
craft in correct locations
GMT-3289 First step algorithm fails for backwards propagation using SPK propaga-
tor
GMT-3350 Single-quote requirements are not consistent across objects and modes
GMT-3556 Unable to associate tank with thruster in command mode
GMT-3629 GUI starts in bad state when started with --minimize
GMT-3669 Planets not drawn during optimization in OrbitView
GMT-3738 Cannot set standalone FuelTank, Thruster fields in CallMatlabFunction
GMT-4520 Unrelated script line in Optimize changes results (causes crash)
GMT-4408 Failed to load icon file and to open DE file
GMT-4520 Coordinate System Fixed attitudes are held constant in SPAD SRP mod-
el during a propagation step
1062
Release Notes
Below is a summary of key changes in this release. Please see the full R2013b Release
Notes on JIRA for a complete list.
New Features
GMAT now can load Spacecraft state and physical properties data directly from a data
file. A new resource, FileInterface, controls the interface to the data file, and the new
Set command lets you apply the data as a part of the Mission Sequence.
BeginMissionSequence
GMAT's EphemerisFile resource can now write a Code-500 format ephemeris file. The
Code-500 format is a binary ephemeris format defined by the NASA Goddard Space
Flight Center Flight Dynamics Facility.
1063
Release Notes
Create Spacecraft sc
Create Propagator prop
Create EphemerisFile ephem
ephem.Spacecraft = sc
ephem.Filename = 'ephem.eph'
ephem.FileFormat = 'Code-500'
ephem.StepSize = 60
ephem.OutputFormat = 'PC'
BeginMissionSequence
1064
Release Notes
Improvements
• Spacecraft.ForceModel.Acceleration
• Spacecraft.ForceModel.AccelerationX
• Spacecraft.ForceModel.AccelerationY
• Spacecraft.ForceModel.AccelerationZ
• Spacecraft.ForceModel.AtmosDensity
All Resources that have coordinates in space now have Cartesian position and velocity
parameters, so you can access ephemeris information. This includes all built-in solar
1065
Release Notes
• CelestialBody.CoordinateSystem.X
• CelestialBody.CoordinateSystem.Y
• CelestialBody.CoordinateSystem.Z
• CelestialBody.CoordinateSystem.VX
• CelestialBody.CoordinateSystem.VY
• CelestialBody.CoordinateSystem.VZ
Note that to use these parameters, you must first set the epoch of the Resource to the
desired epoch at which you want the data. See the following example:
Create ReportFile rf
BeginMissionSequence
Luna.Epoch.A1ModJulian = 21545
Report rf Luna.EarthMJ2000Eq.X Luna.EarthMJ2000Eq.Y Luna.EarthMJ2000Eq.Z ...
Luna.EarthMJ2000Eq.VX Luna.EarthMJ2000Eq.VY Luna.EarthMJ2000Eq.VZ
Compatibility Changes
• EphemerisFile.InitialEpoch now cannot be later than
EphemerisFile.FinalEpoch. See the EphemerisFile reference for details.
• When EphemerisFile.FileFormat is set to 'SPK',
EphemerisFile.CoordinateSystem must have MJ2000Eq as the axis system. Other
axis systems are no longer allowed with this ephemeris format. See the Ephemeris-
File reference for details.
• The deprecated fields Thruster.Element{1–3} have been removed. Use
Thruster.ThrustDirection{1–3} instead. See the Thruster reference for details.
• Tab characters in strings are now treated literally, instead of being changed to spaces.
See GMT-3336 for details.
Known Issues
All known issues that affect this version of GMAT can be seen in the "Known Issues in
R2013b" report in JIRA.
There are several known issues in this release that we consider to be significant:
ID Description
GMT-2561 UTC Epoch Entry and Reporting During Leap Second is incorrect.
1066
Release Notes
ID Description
GMT-3043 Inconsistent validation when creating variables that shadow built-in math
functions
GMT-3108 OrbitView with STM and Propagate Synchronized does not show space-
craft in correct locations
GMT-3289 First step algorithm fails for backwards propagation using SPK propaga-
tor
GMT-4097 Ephemeris File is Not Chunking File At Some Discontinuty Types
GMT-3350 Single-quote requirements are not consistent across objects and modes
GMT-3556 Unable to associate tank with thruster in command mode
GMT-3629 GUI starts in bad state when started with --minimize
GMT-3669 Planets not drawn during optimization in OrbitView
GMT-3738 Cannot set standalone FuelTank, Thruster fields in CallMatlabFunction
GMT-3745 SPICE ephemeris stress tests are not writing out ephemeris for the entire
mission sequence
1067
Release Notes
Licensing
GMAT is now licensed under Apache License, Version 2.0. According to the Open
Source Proliferation Report, the Apache License 2.0 is one of the most widely-used
open source licenses, thereby making GMAT compatible with more existing software
and projects.
Major Improvements
Production Status
Release R2013a is a major release of GMAT that transitions from beta to production
status. Most of our efforts have been devoted to improving the quality of the software and
its documentation. This year we made a complete sweep through the system, starting
by updating engineering specifications for all features, identifying test gaps, writing new
tests, addressing known and newly found bugs, and completing user documentation.
Tutorials
The GMAT User Guide now contains 5 in-depth tutorials that show how to use GMAT
for end-to-end analysis. The tutorials are designed to teach you how to use GMAT in the
context of performing real-world analysis and are intended to take between 30 minutes
and several hours to complete. Each tutorial has a difficulty level and an approximate
duration listed with any prerequisites in its introduction, and is arranged in a general
order of difficulty. The simplest tutorial shows you how to enter orbital initial conditions
and propagate to orbit perigee, while more advanced tutorials show how to perform
finite-maneuver targeting, Mars B-plane targeting, and lunar flyby optimization.
Reference Guide
We have written a complete reference manual for GMAT for R2013a. The reference
manual contains detailed information on all GMAT components. Whether you need de-
tailed information on syntax or application-specific examples, go here. For each GMAT
resource (e.g. Spacecraft, ChemicalThruster, XYPlot) and command (e.g. Optimize,
Propagate), the following information is documented:
1068
Release Notes
• Tables with detailed options, variable ranges and data types, defaults, and expected
behavior
• Copy-and-paste-ready examples
The guide also contains general reference material about the system, such as:
Testing
We have spent much of our time preparing for R2013a on testing. Our script and GUI-
based regression test systems doubled in size in the last year. They now contain:
GUI test are performed using SmartBear’s TestComplete software. Script tests are per-
formed using a custom MATLAB-based automated test system. A complete execution
of the regression test system now takes almost four days of computer time.
Minor Enhancements
While most of our effort has been focused on quality for this release, we have included
some new features.
• ICRF is now supported for input and output of orbit state data:
1069
Release Notes
• Improved mouse controls for interactive 3-D graphics. See the OrbitView reference
for details.
• Improved 3ds model support
• Improved error messages system-wide
• New BodySpinSun axis system for asteroid survey missions
• Improved system modularization by moving more features to plugins
Compatibility Changes
Our last release, R2012a, was beta software. R2013a is mature, production software.
We made some changes that may cause backwards compatibility issues with scripts
written in previous beta versions. Examples of changes in R2013a that affect backwards
compatibility with previous beta versions include:
In addition, there were some features that did not meet quality expectations for this
release and have been turned off in the release package. Most of these features can
be turned on for analysis purposes, but they are not fully tested and should be used
with caution.
1070
Release Notes
Known Issues
All known issues that affect this version of GMAT can be seen in the "Known issues in
R2013a" report in JIRA.
There are several known issues in this release that we consider to be significant:
ID Description
GMT-2561 UTC Epoch Entry and Reporting During Leap Second is incorrect.
GMT-3043 Inconsistent validation when creating variables that shadow built-in math
functions
GMT-3108 OrbitView with STM and Propagate Synchronized does not show space-
craft in correct locations
GMT-3289 First step algorithm fails for backwards propagation using SPK propaga-
tor
GMT-3321 MATLAB uses stale version of function if command window isn't restarted
between runs
GMT-3350 Single-quote requirements are not consistent across objects and modes
GMT-3556 Unable to associate tank with thruster in command mode
GMT-3629 GUI starts in bad state when started with --minimize
GMT-3669 Planets not drawn during optimization in OrbitView
GMT-3738 Cannot set standalone FuelTank, Thruster fields in CallMatlabFunction
GMT-3745 SPICE ephemeris stress tests are not writing out ephemeris for the entire
mission sequence
1071
Release Notes
This is a beta release. It has undergone extensive testing in many areas, but is not
considered ready for production use.
New Features
GMAT can now show the ground track of a spacecraft using the new GroundTrackPlot
resource. This view shows the orbital path of one or more spacecraft projected onto a
two-dimensional map of a celestial body, and can use any celestial body that you have
configured. Here's an example of the plot created as part of the default mission:
Orbit Designer
Sometimes you need to create a spacecraft in a particular orbit but don't exactly know
the proper orbital element values. Before, you had to make a rough estimate, or go back
to the math to figure it out. Now, GMAT R2012a comes with a new Orbit Designer that
does this math for you.
The Orbit Designer helps you create one of six different Earth-centered orbit types,
each with a flexible array of input options:
• sun-synchronous
• repeat sun-synchronous
• repeat ground track
• geostationary
• molniya
• frozen
1072
Release Notes
Once you've created your desired orbit, it is automatically imported into the Spacecraft
resource for later use. Here's an example of a sun-synchronous orbit using the Designer.
To open the Orbit Designer, click the button on the Spacecraft properties window.
We've done significant work toward having a robust eclipse location tool in GMAT, but
this work is not complete. This release comes with an alpha-stage plugin (disabled by
default) called libEventLocator. When enabled, this plugin adds a new EclipseLo-
cator resource that can be configured to calculate eclipse entry and exit times and du-
rations with respect to any configured Spacecraft and celestial bodies. The eclipse data
can be reported to a text file or plotted graphically. Some known limitations include an
assumption of spherical celestial bodies and a lack of light-time correction. This feature
has not been rigorously tested, and may be brittle. We've included it here as a preview
of what's coming in future releases.
1073
Release Notes
C Interface [alpha]
Likewise, we've included an experimental library and plugin that exposes a plain-C in-
terface to GMAT's internal dynamics model functionality. This interface is intended to fill
a very specific need: to expose force model derivates from GMAT to external software,
especially MATLAB, for use with an external integrator (though GMAT can do the prop-
agation also, if desired). The interface is documented by an API reference for now.
Improvements
Dynamics Models
We've made lots of improvements to GMAT's already capable force model suite. Here's
some highlights:
• GMAT now models Earth ocean and pole tides. This is a script-only option that can
be turned on alongside an Earth harmonic gravity model; turn it on with a line like this:
ForceModel.GravityField.Earth.EarthTideModel = 'SolidAndPole'
• You can now apply relativistic corrections using the checkbox on the properties for
Propagator.
Solar System
GMAT can now use the DE421 and DE424 ephemerides for the solar system. These
files are included in the installer, but are not activated by default. To use either of these
ephemerides, double-click the SolarSystem folder and select it from the Ephemeris
Source list. Or include the following script line:
SolarSystem.EphemerisSource = 'DE421'
1074
Release Notes
TDB Input
You can now input the epoch of a Spacecraft orbit in the TDB time system (in both
Modified Julian and Gregorian formats).
Mission Tree
We've made significant improvements to the mission tree to make it more user-friendly
to heavy users. The biggest improvement is that you can now filter the mission sequence
in different ways to make complex missions easier to understand, for example by hiding
non-physical events or collapsing the tree to only its top-level elements.
GMAT also now lets you name your mission sequence commands. Thus, instead
of a sequence made up of commands like "Optimize1" and "Propagate3", you
can label them "Optimize LOI" and "Prop to Periapsis". This example shows the
Ex_HohmannTransfer.script sample with labeled commands.
1075
Release Notes
Finally, we added the ability to undock the mission tree so you can place it and the
resources tree side by side and see both at the same time. To undock the tree, right-
click the Mission tab and drag it from its docked position. To dock it again, just close
the new Mission window.
Mission Summary
You can now change the coordinate system shown in the Mission Summary on the
fly: just change the Coordinate System list at the top of the window and the numbers
will update. This feature can use any coordinate system currently defined in GMAT,
including user-defined ones.
There's also a new Mission Summary - Physics-Based Commands that shows only
physical events (Propagate commands, burns, etc.), and further data was added to
both Mission Summary types.
Window Persistency
The locations of output windows are now saved with the mission in the script file. This
means that when running a mission, all the output windows that were open when the
mission was last saved will reappear in their old positions.
1076
Release Notes
In addition, the locations of certain GMAT windows, like the mission tree, the script
editor, and the application window itself are saved to the user preferences file
(MyGMAT.ini).
With this release, the official GMAT binaries for Windows are now compiled with Mi-
crosoft Visual Studio 2010 instead of GCC. The biggest benefit of this is in performance;
we've seen up to a 50% performance improvement in certain cases in unofficial test-
ing. It also leads to more a industry-standard development process on Windows, as the
MinGW suite is no longer needed.
New Icons
The last release saw a major overhaul of GMAT's GUI icons. This time we've revised
some and added more, especially in the mission tree.
Training Manual
The non-reference material in the GMAT User Guide has been overhauled, partially
rewritten, and reformatted to form a new GMAT Training Manual. This includes the "Get-
ting Started" material, some short how-to articles, and some longer tutorials. All of this
information is included in the GMAT User Guide as well, in addition to reference material
that is undergoing a similar rewrite later this year.
Infrastructure
The GMAT project has implemented several infrastructure improvements in the last
year. The biggest of these was switching from our old Bugzilla system to JIRA for issue
tracking.
This year also saw the creation of the GMAT Blog and the GMAT Plugins and Extensions
Blog with a fair number of posts each, plus reorganizations for the wiki and the forums.
We reactivated our two mailing lists, gmat-developers and gmat-users, but haven't seen
much usage of each yet. And finally, we created a new mailing list, gmat-buildtest, for
automated daily build and test updates.
1077
Release Notes
Compatibility Changes
Application Control Changes
The command-line arguments for the GMAT executable have changed. See the follow-
ing table for replacements.
All known issues that affect this version of GMAT can be seen in the "Known issues in
R2012a" report in JIRA.
1078
Release Notes
This is the first release since September 2008, and is the 4th public release for the
project. In this release:
New Features
OrbitView
GMAT's old OpenGLPlot 3D graphics view was completely revamped and renamed
OrbitView. The new OrbitView plot supports all of the features of OpenGLPlot, but adds
several new ones:
All existing scripts will use the new OrbitView object automatically, with no script
changes needed. Here's a sample of what can be done with the new graphics:
1079
Release Notes
Users can now define their own celestial bodies (Planets, Moons, Asteroids, and
Comets) through the GMAT interface, by right-clicking on the Sun resource (for Planets,
Asteroids, and Comets) or any other Solar System resource (for Moons). User-defined
celestial bodies can be customized in many ways:
Ephemeris Output
GMAT can now output spacecraft ephemeris files in CCSDS-OEM and SPK formats by
using the EphemerisFile resource. For each ephemeris, you can customize:
• Coordinate system
• Interpolation order
• Step size
• Epoch range
Spacecraft in GMAT can now be propagated using data from a SPICE kernel rather
than by numerical integration. This can be activated on the SPICE tab of the Spacecraft
resource, or through the script. The following SPICE kernels are supported:
• SPK/BSP (orbit)
1080
Release Notes
• CK (attitude)
• FK (frame)
• SCLK (spacecraft clock)
Plugins
New features can now be added to GMAT through plugins, rather than being compiled
into the GMAT executable itself. The following plugins are included in this release, with
their release status indicated:
libMatlabPlugin Beta
libFminconOptimizer (Windows only) Beta
libGmatEstimation Alpha (preview)
GUI/Script Synchronization
For those that work with both the script and the graphical interface, GMAT now makes it
explicitly clear if the two are synchronized, and which script is active (if you have several
loaded). The possible states are:
• Synchronized (the interface and the script have the same data)
• GUI or Script Modified (one of them has been modified with respect to the other)
• Unsynchronized (different changes exist in each place)
The only state in which manual intervention is necessary is Unsynchronized, which must
be merged manually (or one set of changes must be discarded). The following status
indicators are available on Windows and Linux (on Mac, they appear as single charac-
ters on the GMAT toolbar).
Estimation [Alpha]
GMAT R2011a includes significant new state estimation capabilities in the libGmatEs-
timation plugin. The included features are:
• Measurement models
• Geometric
• TDRSS range
• USN two-way range
• Estimators
1081
Release Notes
• Batch
• Extended Kalman
• Resources
• GroundStation
• Antenna
• Transmitter
• Receiver
• Transponder
Note
This functionality is alpha status, and is included with this release as a pre-
view only. It has not been rigorously tested.
User Documentation
GMAT’s user documentation has been completely revamped. In place of the old wiki, our
formal documentation is now implemented in DocBook, with HTML, PDF, and Windows
Help formats shipped with GMAT. Our documentation resources for this release are:
• Help (shipped with GMAT, accessed through the Help > Contents menu item)
• Online Help (updated frequently, http://gmat.sourceforge.net/docs/)
• Video Tutorials (http://gmat.sourceforge.net/docs/videos.html)
• Help Forum (http://gmat.ed-pages.com/forum/)
• Wiki (for informal and user-contributed documentation, samples, and tips: http://
gmat.ed-pages.com/wiki/tiki-index.php)
Screenshot ( )
GMAT can now export a screenshot of the OrbitView panel to the output folder in PNG
format.
Improvements
Automatic MATLAB Detection
1082
Release Notes
cutables with and without MATLAB integration. Most recent MATLAB versions are sup-
ported, though configuration is necessary.
All included dynamics models have been thoroughly tested against truth software (AGI
STK, and A.I. Solutions FreeFlyer, primarily), and all known numeric issues have been
corrected.
GMAT’s integrated script editor on Windows is much improved in this release, and now
features:
Regression Testing
The GMAT project developed a completely new testing system that allows us to do
nightly, automated tests across the entire system, and on multiple platforms. The new
system has the following features:
The project is also regularly testing the GMAT graphical interface on Windows using the
SmartBear TestComplete tool. This testing occurs approximately twice a week, and is
1083
Release Notes
focused on entering and running complete missions through the interface and checking
that the results match those generated in script mode.
Visual Improvements
Compatibility Changes
Platform Support
• Windows XP
• Windows Vista
• Windows 7
• Mac OS X Snow Leopard (10.6)
• Linux (Intel 64-bit)
With the exception of the Linux version, GMAT is a 32-bit application, but will run on
64-bit platforms in 32-bit mode. The MATLAB interface was tested with 32-bit MATLAB
2010b on Windows, and is expected to support 32-bit MATLAB versions from R2006b
through R2011a.
Mac: MATLAB 2010a was tested, but version coverage is expected to be identical to
Windows.
Linux: MATLAB 2009b 64-bit was tested, and 64-bit MATLAB is required. Otherwise,
version coverage is expected to be identical to Windows.
The BeginMissionSequence command will soon be required for all scripts. In this re-
lease a warning is generated if this statement is missing.
1084
Release Notes
The following syntax elements are deprecated, and will be removed in a future release:
ImpulsiveBurn
FiniteBurn V Element1
ImpulsiveBurn N Element2
B Element3
FuelTank PressureRegulated PressureModel = Pres-
sureRegulated
OpenGLPlot OrbitView
OrbitView EarthSunLines SunLine
OrbitView ViewDirection = Vector ViewDirection = [0 0 1]
ViewDirection = [0 0 1]
OrbitView ViewPointRef ViewPointReference
OrbitView ViewPointRef = Vector ViewPointReference = [0
0 1]
ViewPointRefVector =
[0 0 1]
OrbitView ViewPointVector = Vec- ViewPointVector = [0 0
tor 1]
ViewPointVectorVector
= [0 0 1]
SolarSystem Ephemeris EphemerisSource
1085
Release Notes
Y_Direction ThrustDirection2
Z_Direction ThrustDirection3
Element1
Element2
Element3
XYPlot Add YVariable
XYPlot Grid ShowGrid
XYPlot IndVar XVariable
Fixed Issues
733 bugs were closed in this release, including 368 marked “major” or “critical”. See the
full report for details.
Known Issues
There remain 268 open bugs in the project’s Bugzilla database, 42 of which are marked
“major” or “critical”. These are tabulated below.
1086
Release Notes
1087
Release Notes
1088
Release Notes
1089
1090
ElectricThruster, 327
Index Else, 934
EndFileThrust, 566
Symbols EndFiniteBurn, 567
#Include Macro, 944 EndFor, 925
EndIf, 934
EndScript, 910
A
EndTarget, 758
AcceptFilter, 774
EndWhile, 940
Achieve, 743
EphemerisFile, 600
AddHardware, 837
Equation, 898
Antenna, 780
ErrorModel, 801
Array, 870
ExtendedKalmanFilter, 805
Assignment, 898
B F
FieldOfView, 345
Barycenter, 228
FileInterface, 615
BatchEstimator, 785
FindEvents, 568
BeginFileThrust, 556
FiniteBurn, 340
BeginFiniteBurn, 561
FminconOptimizer, 721
BeginMissionSequence, 909
For, 925
BeginScript, 910
Force Model, 398
Formation, 351
C
Calculation Parameters, 960
CallGmatFunction, 912
G
GetEphemStates(), 671
CallMatlabFunction, 917
Global, 929
CallPythonFunction, 921
gmat_startup_file.txt, 1018
CdSigma, 837
GMAT command, 1001
CelestialBody, 233
GroundStation, 354
ChemicalTank, 251
GroundTrackPlot, 618
ChemicalThruster, 261
ClearPlot, 668
Code500 Ephemeris Orbit Propagation, 426 I
Color, 697 If, 934
CommandEcho, 924 ImpulsiveBurn, 365
Command-Line Usage, 1001 Installation, 9
Command Summary, 30
ContactLocator, 280 K
CoordinateSystem, 293 Keyboard shortcuts, 1003
CrSigma, 838
L
D LibrationPoint, 374
DifferentialCorrector, 716
DynamicDataDisplay, 592 M
Maneuver, 574
E MarkPoint, 676
EclipseLocator, 313 MatlabFunction, 890
ElectricTank, 323 MATLAB Interface, 949
1091
Index
1092
Index
VF13ad, 733
W
While, 940
Write, 693
X
XYPlot, 662
Y
Yukon, 737
1093
1094