User Guide R2013a: WWW - Nasa.gov
User Guide R2013a: WWW - Nasa.gov
User Guide R2013a: WWW - Nasa.gov
GMAT
User Guide
R2013a
www.nasa.gov
General Mission
Analysis Tool (GMAT)
User Guide
R2013a
General Mission Analysis Tool (GMAT): User Guide
Table of Contents
Documentation Overview ........................................................................................... vii
Using GMAT .............................................................................................................. 1
Welcome to GMAT ............................................................................................. 3
Features Overview ....................................................................................... 3
Licensing ..................................................................................................... 4
Platform Support ......................................................................................... 4
Development Status and Usage ..................................................................... 4
Contributors ................................................................................................ 4
Getting Started .................................................................................................... 7
Installation ................................................................................................... 7
Running GMAT .......................................................................................... 7
Sample Missions .......................................................................................... 8
Getting Help ............................................................................................... 8
Tour of GMAT ................................................................................................... 9
User Interfaces Overview ............................................................................. 9
Resources Tree ........................................................................................... 14
Mission Tree .............................................................................................. 17
Command Summary ................................................................................... 25
Output Tree ............................................................................................... 27
Script Editor .............................................................................................. 27
Configuring GMAT ............................................................................................ 33
File Structure ............................................................................................. 33
Configuring Data Files ................................................................................ 35
Tutorials .................................................................................................................... 37
Simulating an Orbit ............................................................................................ 39
Objective and Overview ............................................................................. 39
Configure the Spacecraft ............................................................................. 39
Configure the Propagator ............................................................................ 40
Configure the Propagate Command ............................................................. 42
Run and Analyze the Results ....................................................................... 43
Simple Orbit Transfer ......................................................................................... 45
Objective and Overview ............................................................................. 45
Configure Maneuvers, Differential Corrector, and Graphics ............................ 45
Configure the Mission Sequence .................................................................. 46
Run the Mission ......................................................................................... 52
Target Finite Burn to Raise Apogee ..................................................................... 55
Objective and Overview ............................................................................. 55
Create and Configure Spacecraft Hardware and Finite Burn ............................ 55
Create the Differential Corrector and Target Control Variable ......................... 60
Configure the Mission Sequence .................................................................. 61
Run the Mission ......................................................................................... 65
Mars B-Plane Targeting ...................................................................................... 69
Objective and Overview ............................................................................. 69
Configure Fuel Tank, Spacecraft properties, Maneuvers, Propagators, Differ-
ential Corrector, Coordinate Systems and Graphics ........................................ 71
Configure the Mission Sequence .................................................................. 76
Run the Mission with first Target Sequence .................................................. 85
Run the Mission with first and second Target Sequences ................................ 95
Optimal Lunar Flyby using Multiple Shooting ....................................................... 99
Objective and Overview ............................................................................. 99
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 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 ma-
neuver targeting.
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-
vii
Documentation Overview
cific features, go here. It also includes system-level references that describe the script language
syntax, parameter listings, external interfaces, and configuration files.
The Resources section provides general information on GMAT Resources such as Spacecraft,
Propagators, Coordinate Systems, and EphemerisFiles to name just a few. Go here for de-
tails regarding syntax, options, variable ranges and data types, defaults, and expected behavior.
Each section contains detailed, copy-and-paste ready examples.
The Commands section provides general information on GMAT Commands such as Maneuver,
Assignment, Optimize, and Propagate to name just a few. Go here for details regarding syntax,
options, variable ranges and data types, defaults, and expected behavior. Each section contains
detailed, copy-and-paste ready examples.
The System section provides information on system configuration, external interfaces, the script
language, and the command line interface.
Note
This document uses two typographical conventions throughout:
• Graphical user interface (GUI) elements and resource and command names are
presented in bold.
• Filenames, script examples, and user input are presented in monospace.
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 describes some
fundamental aspects of how GMAT works.
Using GMAT
Welcome to GMAT
Do you want to go Mars but don't know when to leave or how much to bring? Do you want
to study Earth protection by planning a mission to a near-Earth asteroid? The General Mission
Analysis Tool (GMAT) is an open-source space mission design tool to answer just those types
of questions. GMAT is designed to model and optimize spacecraft trajectories 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 engineering studies, as a tool for education and public engagement, and starting in
Sept. 2013 to fly operational spacecraft.
Features Overview
GMAT is a feature rich system containing high fidelity space system models, optimization 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.
Programming Infrastructure
• User defined variables, arrays, and strings
3
Using GMAT Welcome to GMAT
• 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
• Built in parameters and calculations in multiple coordinate systems
Interfaces
• Fully featured, interactive GUI that makes simple analysis quick and easy
• Custom scripting language that makes complex, custom analysis possible
• Matlab interface for custom external simulations and calculations
• Command line interface for batch analysis
Licensing
GMAT is licensed under the Apache License 2.0.
Platform Support
GMAT has been rigorously tested on the Windows 7 platform and we perform nightly regression
tests running almost 11,000 test cases for the script engine and over 4000 test cases for the GUI
interface.
While the system is routinely built on Mac and Linux, we consider the software to be in alpha
form on those plaforms. For release R2013a, we have only addressed issues on Mac and Linux
that also occur on the Windows 7 platform. Part of our planning effort for the next release will
be to access the future of GMAT on Mac and Linux.
GMAT has been used to optimize maneuvers for flight projects such as NASA’s LCROSS and
ARTEMIS missions, and the Lunar Reconnaissance Orbiter (LRO). ARTEMIS and LRO flew
trajectories optimized in GMAT and verified in the operational ground system. GMAT has been
used extensively for launch window verification for OSIRIS-REx. The MMS project has used
GMAT for formation maneuver planning and Monte Carlo analysis. GMAT has been used on
numerous concept studies from Earth-Sun libration point missions, LEO missions, lunar mis-
sions, and interplanetary missions to Venus, Mars, Jupiter, and near-Earth and Trojan asteroids.
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 development process includ-
ing requirements, algorithms, design, and testing. The Ground Software Systems Branch per-
forms design, implementation, and integration testing. Commecial particpants contribute to de-
sign, implementation, testing and documentation. Commercial participants for R2013a include:
4
Welcome to GMAT Using GMAT
The NASA Jet Propulsion Laboratory (JPL) has provided funding for integration of the SPICE
toolkit into GMAT. Additionally, the European Space Agency’s (ESA) Advanced Concepts team
has developed optimizer plug-ins for the Non-Linear Programming (NLP) solvers SNOPT
(Sparse Nonlinear OPTimizer) and IPOPT (Interior Point OPTimizer).
5
6
Using GMAT
Getting Started
Installation
Installers and application bundles are available on the GMAT SourceForge project page, located
at https://sourceforge.net/projects/gmat.
Mac OS X ✔
Linux ✔
Installer
To use the Windows installer, download the appropriate gmat-winInstaller-*.exe file
from the SourceForge download page and run it. You'll be asked a series of questions, and GMAT
will be installed to your local user account.
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 corre-
sponds to the C:\Users\username\AppData\Local folder. You are free to choose anoth-
er 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 per-
formed 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
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 R2013a item in the Start menu. If you installed GMAT
7
Using GMAT Getting Started
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 parameters are
available; see Command-Line Usage for details.
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 Tool-
box 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:
• 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]>
8
Using GMAT
Tour of GMAT
User Interfaces Overview
GMAT offers multiple ways to design and execute your mission. The two primary interfaces 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 desktop 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.
Menu Bar The menu bar contains File, Edit, Window and Help functionality.
On Windows, the File menu contains standard Open, Save, Save As,
and Exit functionality as well as Open Recent. The Edit menu con-
9
Using GMAT Tour of GMAT
tains functionality for script editing when the script editor is active. The
Window menu contains tools for organizing graphics windows and the
script editor within the GMAT desktop. Examples include the ability to
Tile windows, Cascade windows and Close windows. The Help menu
contains links to Online Help, Tutorials, Forums, and the Report An
Issue option links to GMAT’s defect reporting system, the Welcome
Page, and a Provide Feedback link.
Toolbar The toolbar provides easy access to frequently used controls such as
file controls, Run, Pause, and Stop for mission execution, and controls
for graphics animation. On Windows and Linux, the toolbar is located
at the top of the GMAT window; on the Mac, it is located on the left
of the GMAT frame. Because the toolbar is vertical on the Mac, some
toolbar options are abbreviated.
GMAT allows you to simultaneously edit the raw script file representa-
tion of your mission and the GUI representation of your mission. 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 Synchronization” section for fur-
ther 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 orga-
nizes them into logical groups. All objects created in a GMAT script us-
ing 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 desk-
top.
Mission Tree The Mission tree displays GMAT commands that control the time-
ordered sequence of events in a mission. The Mission tree contains
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.
10
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 maximized in the GMAT
desktop and the items relevant to script editing are labeled.
11
Using GMAT Tour of GMAT
12
Tour of GMAT Using GMAT
"views" of the same data: the resources and the mission command sequence. GMAT allows you
to switch between views (script and GUI) and have the same view open in an editable state
simultaneously. Below we describe the behavior, interactions, and rules of the script and GUI
interfaces so you can avoid confusion and potential loss of data.
GMAT allows you to simultaneously edit both the script file representation and the GUI repre-
sentation of your mission. It is possible to make inconsistent changes in these representations.
The GUI/Script Sync Status window located in the toolbar indicates the state of the two rep-
resentations. On the Mac, the status is indicated in abbreviated form in the left-hand toolbar.
Synchronized (green) indicates that the script and GUI contain the same information. GUI
Modified (yellow) indicates that there are changes in the GUI that have not been saved to the
script. Script Modified (yellow) indicates that there are changes in the script that have not been
loaded into the GUI. Unsynchronized (red) indicates that there are changes in both the script
and the GUI.
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.
Clicking the Save button in the toolbar saves the GUI representation to the script file; this is the
same file you edit when working in the script editor. GUI items that appear in the Resources
tree appear before the BeginMissionSequence command in a script file and are written in a
predefined order. GUI items that appear in the Mission Tree appear after the BeginMissionSe-
quence command in a script file in the same order as they appear in the GUI.
Caution
If you have a script file that has custom formatting such as spacing and data orga-
nization, 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.)
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 BeginMissionSequence. 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 mission sequence and appear in the Mission
tree in the GUI. Here is a brief script example to illustrate:
13
Using GMAT Tour of GMAT
Sat.X = 3000
BeginMissionSequence
Sat.X = 1000
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 BeginMissionSequence com-
mand in a script file. (GMAT considers in-line math statements to be an assignment com-
mand. 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 docu-
mentation.
Resources Tree
The Resources tree displays GMAT resources and organizes them into logical groups and rep-
resents 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).
14
Tour of GMAT Using GMAT
Organization
The Resources tree displays created resources organized into folders by object category. 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 FuelTank, 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 CelestialBody 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.
15
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).
Figure 7. Resource menu
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 prop-
erties 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:
16
Tour of GMAT Using GMAT
Delete
Resources can be deleted by right clicking the object and selecting “Delete”. Resources can-
not 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 represents the ordered
list of commands to be executed to model your mission. The hierarchical 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.
17
Using GMAT Tour of GMAT
Warning
Edits to the Mission Tree will be reflected in your script after it is synchronized 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.
In general, commands are executed only once. However, child commands grouped under the
loop commands (e.g. For and While) may execute multiple times. These commands 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 com-
mand, 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.
18
Tour of GMAT Using GMAT
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 view filters activate by clicking one of the view filter buttons to the right of the Mission
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 exclu-
sive 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 combine filter-by-branch-level filters with the
filter-by-command-type filters nor combine inclusive and exclusive command type filters. How-
ever, 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 com-
mand is not part of the viewable command set.
Also note that the Mission Tree automatically reconfigures to show all commands
when the user Appends or Inserts a new command.
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 behavior 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
19
Using GMAT Tour of GMAT
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 command
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 but-
tons so that they appear pressed down. This option will show all physics related and solver re-
lated 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 com-
mand 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 output-related filter but-
tons so that they appear pressed down.
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.
The Mission Tree has two context-sensitive popup menus, depending on whether you right-click
the Mission Sequence home item or a command in the Mission Tree. The Mission Sequence
popup menu primarily allows you to manipulate the Mission Tree window and the entire com-
mand sequence. It also enables appending (adding to the end) commands to the mission tree.
20
Tour of GMAT Using GMAT
Mission Sequence menu options are always available and active in the menu list.
Collapse All
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.
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 ver-
bose text. When the show detail menu option is checked, each command is displayed 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.
21
Using GMAT Tour of GMAT
The Show Mission Sequence menu option displays a streamlined text view of the mission se-
quence 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 infor-
mation, spacecraft physical properties, time information, planetodetic properties, and other or-
bit 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 summary for
physics related commands in the mission sequence. This summary information includes space-
craft state information, spacecraft physical properties, time information, planetodetic properties,
and other orbit data for each command. This information is only available after a mission simu-
lation is run and the data shows state information after the execution of the command. Note that
if you have physics-based commands such as Propagate or Maneuver inside a ScriptEvent
command, then summary information for those commands, are not displayed. Showing Mission
Summary data for a ScriptEvent 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 Dock Mission Tree menu option docks the Mission Tree window in the notebook con-
taining the Resources tree and Output tree. This option is only selectable if the Mission Tree is
currently floating or undocked. Please see the Docking/Undocking/Placement 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 selectable if the Mission Tree
is currently docked. Please see the the section called “Docking/Undocking/Placement” section
for more information.
22
Tour of GMAT Using GMAT
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 avail-
able under the menu change based on what command is selected and where in the tree the com-
mand 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 sequence.
23
Using GMAT Tour of GMAT
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 Append 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 inserted 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.
24
Tour of GMAT Using GMAT
Command Summary
The Command Summary menu option displays a mission simulation summary for the selected
command, including spacecraft state information, time information, planetodetic properties, and
other orbit data. This information is only available after a mission simulation 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.
Docking/Undocking/Placement
The Mission Tree window may be used as a floating window or docked with the Resource 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 execu-
tion 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 Command
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.
25
Using GMAT Tour of 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.
26
Tour of GMAT Using GMAT
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. GMAT currently requires that the origin
of the coordinate system is a celestial body (this will change in a future release) and the Coordi-
nateSystem cannot reference another spacecraft.
Output Tree
The Output tree contains data files and plots after a mission is executed. Files consist of out-
put from ReportFile and EphemerisFile resources. Plots consist of graphical OrbitView,
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
• Standard features like copy/paste, line numbering, find-and-replace, etc.
27
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 synchronized 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.
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.
28
Tour of GMAT Using GMAT
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 same data).
nized
Script The mission has been modified in the script representation, but has not been
Modified 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 to
fied 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 changes
chronized 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. The error
ror 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 para-
graphs describe the behavior of the Save,Sync button only, but the description 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.
If the GUI has existing modifications, a confirmation prompt will be displayed. If confirmed,
the GUI modifications will be overwritten.
29
Using GMAT Tour of GMAT
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
• Cut/Copy/Paste: Cut, copy, or paste over the current selection, or paste the current clip-
board 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 clip-
board 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 numbering to
the left of the script contents.
30
Tour of GMAT Using GMAT
The following keyboard shortcuts 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 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.
31
Using GMAT Tour of GMAT
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.
32
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 ori-
entation 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 also 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.
data
The data directory contains all required data files to run GMAT and is organized according to
data type, as shown in Figure 11 and described below.
33
Using GMAT Configuring GMAT
The graphics directory contains data files for GMAT’s visualization utilities, as well as appli-
cation icons and images. The splash directory contains the GMAT splash screen that is dis-
played briefly while GMAT is initializing. The stars directory contains a star catalogue used
for displaying stars in 3D graphics. The texture folder contains texture maps used for the 2D
and 3D graphics resources. The icons directory contains graphics files for icons and images
loaded at run time, such as the GMAT logo and GUI icons.
The gravity directory contains gravity coefficient files for each body with a default non-spher-
ical 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) provided
by the International Earth Rotation Service (IERS) and nutation coefficients for different nuta-
tion 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 planets,
the Moon, and Pluto developed and distributed by JPL. The spk directory contains the DE421
SPICE kernel and kernels for selected comets, asteroids and moons. All ephemeris files distrib-
uted 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 Specification. The
34
Configuring GMAT Using GMAT
GMAT User’s Guide is available in the help directory in PDF and HTML formats, and as a
Windows HTML Help file.
extras
The extras directory contains various extra convenience files that are helpful for working 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, including
the interface to the fmincon optimizer. All files in the matlab directory and its subdirectories
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 over 45 sample missions, ranging from a Hohmann transfer to
libration point station-keeping to Mars B-plane targeting. Example files begin with "Ex_" and
files that corresponde to GMAT tutorials begin with "Tut_". These files are intended to demon-
strate GMAT’s capabilities and to provide you with a potential starting point for building com-
mon 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 functions that are included in the GMAT
distribution. You can also store your own custom MATLAB functions in this folders.
35
Using GMAT Configuring GMAT
There are two leap second files provided with GMAT in the data/time directory. The
naif0010.tls file is used by the JPL SPICE libraries when computing ephemerides. When a
new leap second is added, you can replace this file with the new file from NAIF. GMAT reads
the tai-utc.dat file for all time computations requiring leap seconds that are not performed
by the SPICE utilities. When a new leap second is added, you can replace this file with the new
file from the US Naval Observatory. In addtion, you can modify the file if a new leap second
is added by simply duplicating the last row and updating it with the correct information for the
new leap second. For example, if a new leapsecond were added on 01 Jul 2013, you would add
the following line to the bottom of tai-utc.dat:
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.
36
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 orbital predictions (e.g. When
will the International Space Station be over my house?) to complex analyses that
determine the thruster firing sequence required 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:
39
Tutorials Simulating an Orbit
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.
40
Simulating an Orbit Tutorials
41
Tutorials Simulating an Orbit
2. In the three boxes to the right of View Point Vector, type the values -60000, 30000, and
20000 respectively.
3. Under Drawing Option to the left, clear Draw XY Plane. Your screen should now match
Figure 14.
4. Click OK.
Figure 14. DefaultOrbitView Configuration
42
Simulating an Orbit Tutorials
43
Tutorials Simulating an Orbit
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:
44
Tutorials
Note
One of the most common problems in space mission design is to design a trans-
fer from one circular orbit to another circular orbit that lie within the same orbital
plane. Circular coplanar transfers are used to raise low-Earth orbits that have de-
graded due to the effects of atmospheric drag. They are also used to transfer from a
low-Earth orbit to a geosynchronous orbit and to send spacecraft to Mars. There is
a well known sequence of maneuvers, called the Hohmann transfer, that performs
a circular, coplanar transfer using the least possible amount of fuel. A Hohmann
transfer employs two maneuvers. The first maneuver raises the orbital apoapsis (or
lowers orbital periapsis) to the desired altitude and places the spacecraft in an ellip-
tical transfer orbit. At the apoapsis (or periapsis) of the elliptical transfer orbit, a
second maneuver is applied to circularize the orbit at the final altitude.
In this tutorial, we will use GMAT to perform a Hohmann transfer from a low-Earth parking
orbit to a geosynchronous mission orbit. This requires a targeting sequence to determine 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:
45
Tutorials Simple Orbit Transfer
Table 2. DefaultOrbitView settings
Field Value
Solver Iterations, under Drawing Option Current
Axis, under View Up Defintion X
View Point Vector boxes, under View Definition 0, 0, and 120000 respectively
46
Simple Orbit Transfer Tutorials
Now create the commands necessary to perform the Target sequence. Figure 18 illustrates the
configuration of the Mission tree after you have completed the steps in this section. We’ll discuss
the Target sequence after it has been created.
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.
Command Name
Maneuver Perform TOI
Propagate Prop To Apoapsis
Achieve Achieve RMAG = 42165
Vary Vary GOI
Maneuver Perform GOI
Achieve Achieve ECC = 0.005
47
Tutorials Simple Orbit Transfer
Note
Let’s discuss what the Target sequence does. We know that two maneuvers are re-
quired to perform the Hohmann transfer. We also know that for our current mis-
sion, 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 magnitudes) 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 maneuvers) 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.
We need a Propagate command after the Target sequence so that we can see our final orbit.
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.
Now that the structure is created, we need to configure the various parts of the Target sequence
to do what we want.
48
Simple Orbit Transfer Tutorials
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 Veloc-
ity-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.
49
Tutorials Simple Orbit Transfer
50
Simple Orbit Transfer Tutorials
51
Tutorials Simple Orbit Transfer
52
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:
53
54
Tutorials
Note
One of the most common operational problems in space mission design is the de-
sign of a finite burn that achieves a given orbital goal. A finite burn model, as op-
posed 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.
55
Tutorials Target Finite Burn to Raise
Apogee
1. In the Resources tree, right-click on the Hardware folder, point to Add, and click
Thruster. A resource named Thruster1 will be created.
2. In the Resources tree, right-click on the Hardware folder, point to Add, and click Fu-
elTank. A resource named FuelTank1 will be created.
3. Double-click Thruster1 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 FuelTank1 as the fuel
source for Thruster1. Click OK.
Figure 29 below shows the default FuelTank1 configuration that we will use and Figure 30
shows the finished Thruster1 configuration.
Figure 29. FuelTank1 Configuration
56
Target Finite Burn to Raise Tutorials
Apogee
Figure 30. Thruster1 Configuration
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 poly-
nomials. 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
Thruster1 polynomial coefficients as follows.
57
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 Thruster 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.
58
Target Finite Burn to Raise Tutorials
Apogee
59
Tutorials Target Finite Burn to Raise
Apogee
1. In the Resources tree, right-click the Burns folder and add a FiniteBurn. A resource
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 Thruster1 as the thruster asso-
ciated with FiniteBurn1. Click OK.
The Target sequence we will later create uses the Vary command to adjust a user defined 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.
1. In the Resources tree, right-click the Variables/Arrays/Strings folder, point to Add, and
click Variable. A new window will come up with two input fields, Variable Name and
Variable Value. For Variable Name, input BurnDuration and for Variable Value, input
0. Click the Create button and then the Close button.
2. To verify that we have created this new variable correctly, double-click BurnDuration to
view its properties.
60
Target Finite Burn to Raise Tutorials
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.
61
Tutorials Target Finite Burn to Raise
Apogee
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. Re-
name the newly created command as Turn Thruster On.
5. Complete the Target sequence by inserting the commands shown in Table 4.
62
Target Finite Burn to Raise Tutorials
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.
63
Tutorials Target Finite Burn to Raise
Apogee
1. Double-click Turn Thruster Off to edit its properties. Notice that the command is already
set to end FiniteBurn1 as applied to the DefaultSC spacecraft, so we don’t need to change
anything here..
2. Click OK.
64
Target Finite Burn to Raise Tutorials
Apogee
65
Tutorials Target Finite Burn to Raise
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, Burn-
Duration. Verify that you obtained a similar value for BurnDuration.
BurnDuration = 1213.19316329
1. In the Mission tree, select Prop To Perigee, then right-click to open the associated Com-
mand Summary which describes the state of DefaultSC after the Prop To Perigee com-
mand 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 degrees. 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.
66
Target Finite Burn to Raise Tutorials
Apogee
a. We note that the mean anomaly is 180 degrees which proves that we are indeed 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 desired
tolerance of 0.1 km.
67
68
Tutorials
Note
One of the most challenging problems in space mission design is to design an in-
terplanetary transfer trajectory that takes the spacecraft within a very close vicinity
of the target planet. One possible approach that puts the spacecraft 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 addition, it must be perpendicular to the incoming
asymptote of the approach hyperbola. Figure 46 and Figure 47 show the geome-
try 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 example 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 Maneu-
ver (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.
69
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 maneu-
vers 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.
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.
70
Mars B-Plane Targeting Tutorials
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 Fuel Tank.
A new resource called FuelTank1 will be created.
2. Right-clickFuelTank1 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.
Table 5. MainTank settings
Field Value
Fuel Mass 1718
Fuel Density 1000
Pressure 5000
Volume 2
We need to make minor modifications to DefaultSC in order to define spacecraft’s initial state
and attach the fuel tank to the spacecraft.
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.
71
Tutorials Mars B-Plane Targeting
Table 6. MAVEN settings
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 Rename.
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.
10. For Origin field under Coordinate System, select Mars.
11. Check Decrement Mass under Mass Change.
12. For Tank field under Mass Change, select MainTank from the drop down menu.
13. Click OK to save these changes.
72
Mars B-Plane Targeting Tutorials
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.
Table 7. NearEarth settings
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
Table 8. DeepSpace settings
Field Value
Type under Integrator PrinceDormand78
Initial Step Size under Integrator 600
Accuracy under Integrator 1e-012
Min Step Size under Integrator 0
Max Step Size under Integrator 864000
Central Body under Force Model Sun
Primary Body under Force Model None
Point Masses under Force Model Add Earth, Luna, Sun,
Mars, Jupiter, Neptune,
Saturn, Uranus, Venus
Use Solar Radiation Pressure under Force Model Check this field
73
Tutorials Mars B-Plane Targeting
Table 9. NearMars settings
Field Value
Type under Integrator PrinceDormand78
Initial Step Size under Integrator 600
Accuracy under Integrator 1e-012
Min Step Size under Integrator 0
Max Step Size under Integrator 86400
Central Body under Force Model Mars
Primary Body under Force Model Mars
Model under Gravity Mars-50C
Degree under Gravity 8
Order under Gravity 8
Atmosphere Model under Drag None
Point Masses under Force Model Add Sun
Use Solar Radiation Pressure under Force Model Check this field
1. In the Resources tree, right-click the Coordinate Systems folder and click Add Coordi-
nate 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 SunEcliptic 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.
74
Mars B-Plane Targeting Tutorials
1. In the Resources tree, under Output folder, right-click DefaultOrbitView and click Re-
name.
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.
Table 10. EarthView settings
Field Value
View Scale Factor under View Definition 4
View Point Vector boxes, under View Definition 0, 0, 30000
Table 11. SolarSystemView settings
Field Value
From Celestial Object under View Object, add following Mars, Sun (Do not remove
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
75
Tutorials Mars B-Plane Targeting
Table 12. MarsView settings
Field Value
From Celestial Object under View Object, add following Mars (You don’t have to re-
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
The second Target sequence will perform the MOI maneuver so that the spacecraft can orbit
around Mars, but that sequence will be created later.
76
Mars B-Plane Targeting Tutorials
Note
Let’s discuss what the first Target sequence does. We know that a maneuver is re-
quired to perform the B-Plane targeting. We also know that the desired B-Plane co-
ordinate 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 precisely achieve the desired orbital
conditions. We use the Target sequence to solve for those precise maneuver values.
We must tell GMAT what controls are available (in this case, three controls associ-
ated with three components 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.
77
Tutorials Mars B-Plane Targeting
2. In the ExitMode list, click SaveAndContinue. This instructs GMAT to save the final
solution of the targeting problem after you run it.
3. Click OK to save these changes.
78
Mars B-Plane Targeting Tutorials
1. Double-click Vary TCM.V to edit its properties. Notice that the variable in the Variable
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.
79
Tutorials Mars B-Plane Targeting
1. Double-click Vary TCM.N to edit its properties. Notice that the variable in the Variable
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.
80
Mars B-Plane Targeting Tutorials
1. Double-click Vary TCM.B to edit its properties. Notice that the variable in the Variable
box is still TCM.Element1, which by default is the velocity component of TCM. We need
to insert TCM.Element3 which is the bi-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 Element3 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.Element3.
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.
81
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.
82
Mars B-Plane Targeting Tutorials
83
Tutorials Mars B-Plane Targeting
84
Mars B-Plane Targeting Tutorials
85
Tutorials Mars B-Plane Targeting
86
Mars B-Plane Targeting Tutorials
87
Tutorials Mars B-Plane Targeting
Since we are going to continue developing the mission tree by creating the second Target se-
quence, we will store the final solution of the first Target sequence as the initial conditions of
the TCM resource. This is so that when you make small changes, the subsequent runs will take
less time. To do this, follow these steps:
1. In the Mission tree, double-click Target desired B-plane Coordinates to edit its prop-
erties.
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.
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.
88
Mars B-Plane Targeting Tutorials
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 Sum-
mary.
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 coordi-
nates were achieved which result in a 90 degree inclined trajectory:
BdotT = -0.0000053320678 km
BdotR = -7000.0000019398 km
Recall that we still need to create second Target sequence in order to perform Mars Orbit
Insertion maneuver to achieve the desired capture orbit. In the Mission tree, we will create the
second Target sequence right after the first Target sequence.
Now let’s create the commands necessary to perform the second Target sequence. Figure 65 il-
lustrates the configuration of the Mission tree after you have completed the 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.
89
Tutorials Mars B-Plane Targeting
Command Name
Maneuver Apply MOI
Propagate Prop to Mars Apoapsis
Achieve Achieve RMAG
90
Mars B-Plane Targeting Tutorials
Note
Let’s discuss what the second Target sequence does. We know that a maneuver 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 mag-
nitude) of the MOI maneuver that will precisely achieve the desired orbital condi-
tions. 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.
1. In the Mission tree, right-click End Mars Capture, point to Insert After, and click Prop-
agate. 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
91
Tutorials Mars B-Plane Targeting
1. Double-click Vary MOI.V to edit its properties. Notice that the variable in the Variable
box is TCM.Element1. We want MOI.Element1 which is the velocity component 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.
92
Mars B-Plane Targeting Tutorials
93
Tutorials Mars B-Plane Targeting
94
Mars B-Plane Targeting Tutorials
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.
95
Tutorials Mars B-Plane Targeting
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 you make small
changes, the subsequent runs will take less time. To do this, follow these steps:
96
Mars B-Plane Targeting Tutorials
the solution as the initial condition. Now whenever you re-run the mission, both first and
second Target sequences will converge in just one iteration.
4. In the Mission tree, double-click Vary MOI.V, you will notice that the values in Initial
Value box have been updated to the final solution of the second Target sequence.
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
97
98
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 modern optimization techniques to
minimize fuel usage while simultaneously satisfying trajectory constraints. In this
tutorial, you will learn how to design flyby trajectories by writing a GMAT script
to perform multiple shooting optimization. As the analyst, your goal is to design
a lunar flyby that provides a mission 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 sensitive
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 under-
standing 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:
At lunar flyby, we only require that the flyby altitude is greater than 100 km. This constraint
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.
99
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
Note: (Phasing with the moon is important for these orbits but design considerations for lunar
phasing are beyond the scope of this tutorial)
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
100
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
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 patch point,
the six Cartesian state elements, and the epoch are varied for a total of 18 optimization variables.
At the MOI patch point, there is an additional optimization variable for the delta V to
Notice that while there are only three patch 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.
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:
101
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
4. Use the feasible solution as the initial guess and find an optimal solution.
5. Apply an altitude constraint at lunar orbit periapsis
%-------------------------------------------------------------------------
% Configure coordinate systems
%-------------------------------------------------------------------------
%-------------------------------------------------------------------------
% Configure spacecraft
%-------------------------------------------------------------------------
% The TOI control point
Create Spacecraft satTOI
satTOI.DateFormat = TAIModJulian
satTOI.CoordinateSystem = EarthMJ2000Eq
102
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
satMOI_Backward.CoordinateSystem = EarthMJ2000Eq
%------------------------------------------------------------------------
% Configure propagators and force models
%-------------------------------------------------------------------------
103
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
%-------------------------------------------------------------------------
% Configure maneuvers
%-------------------------------------------------------------------------
Create ImpulsiveBurn MOI
MOI.CoordinateSystem = Local
MOI.Origin = Earth
MOI.Axes = VNB
%-------------------------------------------------------------------------
% Create user data: variables, arrays, strings
%-------------------------------------------------------------------------
%-------------------------------------------------------------------------
% Configure solvers
%-------------------------------------------------------------------------
104
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
NLPOpt.Tolerance = 1e-004
NLPOpt.UseCentralDifferences = false
NLPOpt.FeasibilityTolerance = 0.1
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 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.
105
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
Create a ReportFile to allow reporting useful information to a text file for review after the
optimization process is complete.
106
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
Propagate spacecraft
Apply patch point constraints (i.e. after propagation)
Apply constraints on mission orbit
Apply cost function
EndOptimize
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
toiEpoch = 27698.1612435
flybyEpoch = 27703.7658714
moiEpoch = 27723.305398
satTOI.X = -6659.70273964
satTOI.Y = -229.327053112
satTOI.Z = -168.396030559
satTOI.VX = 0.26826479315
satTOI.VY = -9.54041067213
satTOI.VZ = 5.17141415746
satFlyBy_Forward.X = 869.478955662
satFlyBy_Forward.Y = -6287.76679557
satFlyBy_Forward.Z = -3598.47087228
satFlyBy_Forward.VX = 1.14619150302
satFlyBy_Forward.VY = -0.73648611256
satFlyBy_Forward.VZ = -0.624051812914
satMOI_Backward.X = -53544.9703742
satMOI_Backward.Y = -68231.6310266
satMOI_Backward.Z = -1272.76362793
satMOI_Backward.VX = 2.051823425
satMOI_Backward.VY = -1.91406286218
satMOI_Backward.VZ = -0.280408526046
MOI.Element1 = -0.0687322937282
EndScript
Initialize Variables
The script below is used to define some constants and to define the values for various constraints
applied to the trajectory. Pay particular attention to the constraint values and time values. For
example, the variable conTOIPeriapsis defines the periapsis radius at launch constraint to be
107
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
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 later in the script using lines like this patchOneEpoch = refEpoch +
patchOneElapsedDayspatchOneEpoch. 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 complexity of
the tutorial.
% Some constants
earthRadius = 6378.1363
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 optimization 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.
108
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
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.
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 con-
trol point in the middle of a segment, this assignment allows us to conveniently set the second
Spacecraft without independently varying its state properties.
109
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
110
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
to patchTwoEpoch. Notice that some Propagate commands are applied inside of If state-
ments to ensure that propagation is performed in the correct direction.%
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.
111
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
112
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
Stop
113
Tutorials Optimal Lunar Flyby using Multi-
ple 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 configu-
ration does not provide you with similar graphics, compare your script to the one provided for
this tutorial and address any differences.
114
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
1. Near the bottom of the script, comment out the Stop command.
2. In the configuration of EarthView, change ShowPlot to false.
115
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
After a few optimizer iterations you should see “NLPOpt converged to within target accuracy"
displayed in the GMAT message window and your XY plot graphics should appear 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 discontinuities
but does not apply constraints. We need to make a few small modifications to the script to find
an solution that meets the constraints.
1. Remove the “%” sign from the all NonlinearConstraint commands and the Minimize com-
mand:
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
116
Optimal Lunar Flyby using Multi- Tutorials
ple Shooting
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.
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.
launchEpoch = 27698.2503232
flybyEpoch = 27703.7774182
117
Tutorials Optimal Lunar Flyby using Multi-
ple Shooting
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
118
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 configuration files.
The Resources section provides general information on GMAT Resources such as Spacecraft, Propagators,
Coordinate Systems, and EphemerisFiles to name just a few. Go here for details regarding syntax, op-
tions, variable ranges and data types, defaults, and expected behavior. Each section contains detailed, copy-
and-paste ready examples.
The Commands section provides general information on GMAT Commands such as Maneuver, Assign-
ment, Optimize, and Propagate to name just a few. Go here for details regarding syntax, options, variable
ranges and data types, defaults, and expected behavior. Each section contains detailed, copy-and-paste ready
examples.
The System section provides information on system configuration, external interfaces, the script language,
and the command line interface.
Reference Guide
Resources
Table of Contents
Array ....................................................................................................................... 123
Barycenter ................................................................................................................ 127
CelestialBody ............................................................................................................ 131
CoordinateSystem ..................................................................................................... 141
DifferentialCorrector ................................................................................................. 155
EphemerisFile .......................................................................................................... 159
FiniteBurn ................................................................................................................ 169
FminconOptimizer ................................................................................................... 173
Formation ................................................................................................................ 179
FuelTank .................................................................................................................. 181
GroundStation .......................................................................................................... 191
GroundTrackPlot ...................................................................................................... 197
ImpulsiveBurn .......................................................................................................... 205
LibrationPoint .......................................................................................................... 211
MatlabFunction ........................................................................................................ 215
OrbitView ................................................................................................................ 219
Propagator ............................................................................................................... 235
ReportFile ................................................................................................................ 259
SolarSystem .............................................................................................................. 267
Spacecraft ................................................................................................................ 271
Spacecraft Attitude ................................................................................................... 273
Spacecraft Ballistic/Mass Properties ........................................................................... 289
Spacecraft Epoch ...................................................................................................... 293
Spacecraft Hardware ................................................................................................. 301
Spacecraft Orbit State ............................................................................................... 307
Spacecraft Visualization Properties ............................................................................. 323
String ....................................................................................................................... 327
Thruster .................................................................................................................. 329
Variable ................................................................................................................... 345
VF13ad .................................................................................................................... 347
XYPlot .................................................................................................................... 351
121
122
Reference Guide
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:
Create Array anArray[rows, columns]
Array values are initialized to zero at creation. Values can be assigned individually using literal nu-
meric 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.
anArray(row, column) = value
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.
anArray = array expression
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.
123
Reference Guide Array
Field Description
value The value of the array element being addressed.
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, respectively.
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 window, 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.
124
Array Reference Guide
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:
125
Reference Guide Array
Examples
Creating and reporting an array:
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
126
Reference Guide
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 Barycenter resource that allows
you to build a custom Barycenter such as the Earth-Moon barycenter. This resource cannot be
modified in the Mission Sequence.
Options
Option Description
BodyNames The list of CelestialBody resources included in the Barycenter.
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
127
Reference Guide Barycenter
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 mod-
ify its configuration. See the Remarks section for details regarding the model for the SolarSys-
temBarycenter.
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, position, and velocity of
the ith body in the barycenter, and rb and vb are respectively the position and velocity of the
barycenter.
128
Barycenter Reference Guide
Examples
Define the state of a spacecraft in SolarSystemBarycenter coordinates.
BeginMissionSequence
BeginMissionSequence
129
Reference Guide Barycenter
BeginMissionSequence
130
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 Celestial-
Body resource to model a planet, asteroid, comet, or moon. This resource cannot be modified
in the Mission Sequence.
Fields
Field Description
CentralBody The central body of the celestial body. The central body field is
used primarily by the GUI.
131
Reference Guide CelestialBody
Field Description
Flattening The body's polar flattening.
132
CelestialBody Reference Guide
Field Description
PosVelSource The model for user-defined body orbit ephemeredes. GMAT cur-
rently 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. This field has no effect for
built-in bodies.
133
Reference Guide CelestialBody
Field Description
SpinAxisDECConstant The declination of the body's spin axis at the orientation epoch.
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 others. For a built-in Celes-
tialBody, the Orbit and Orientation tabs are largely inactive and the behavior is discussed be-
low. To create a custom Asteroid - as an example of how to create a custom CelestialBody -
perform the following steps.
134
CelestialBody Reference Guide
The CelestialBody Properties tab is shown below. GMAT models all bodies as spherical ellip-
soids 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.
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.
135
Reference Guide CelestialBody
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.
136
CelestialBody Reference Guide
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.
137
Reference Guide CelestialBody
Remarks
Celestial Body Orientation Model
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 DE405 file. The remaining built-in celestial body
orientations are modeled 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 Satel-
lites: 2000".
The orientation of a custom CelestialBody is modeled by providing three angles and their
rates based on IAU/IAG conventions. The figure below illustrates the angles. The angles αo,
δo, and W, are respectively the SpinAxisRAConstant, SpinAxisDECConstant, and Rotation-
Constant. The angular rates are respectively SpinAxisRARate, SpinAxisDECRate, and Ro-
tationRate. All angles are referenced to the X-Y plane of the ICRF axis system. The constant
values SpinAxisRAConstant, SpinAxisDECConstant, and RotationConstant are defined to
be the values at the epoch defined in OrientationEpoch.
Below is an example illustrating how to configure a CelestialBody according to the IAU 2006
recommended values for Vesta. Note the orientation epoch typically used by the IAU is 01 Jan
2000 12:00:00.00.000 TDB and this must be converted to A1ModJulian which can easily be
performed using the Spacecraft Orbit dialog box.
Note: The orientation models available for Earth and Luna have additional fields for configura-
tion. Earth has an additional field called NutationUpdateInterval that controls the update fre-
quency for the Nutation matrix. For high fidelity applications, NutationUpdateInterval should
be set to zero. The RotationDataSource field for Earth and Luna defines the theory used for
138
CelestialBody Reference Guide
the rotation of those bodies. Currently, only FK5IAU1980 and DE405 are available for Earth
and Luna respectively and the field is displayed for information purposes only. Future versions
of GMAT will support DE421 for Luna and IAU-2000A theory for Earth.
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 indi-
vidual 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, CentralBody, 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
NIAF distributes SPICE kernels for many celestial bodies and each kernel is con-
sistent with a particular primary ephemeris release such as DE421. For high pre-
cision analysis, it is important to ensure that the ephemerides used for a cus-
tom 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:
Examples
Configure a CelestialBody to model Saturn's moon Titan. Note you must obtain the SPICE
kernel named "sat351.bsp" from here and place it in the directory identified in the script snippet
below
139
Reference Guide CelestialBody
140
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 numerous 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
Axes The axes of the CoordinateSystem.
141
Reference Guide CoordinateSystem
Field Description
Primary The primary body for an ObjectReferenced axis system. This field is only used
if Axes = ObjectReferenced. See the discussion below for more information on
how Primary and Secondary are used to compute ObjectReferenced axes.
142
CoordinateSystem Reference Guide
Field Description
Zaxis The z-axis for an ObjectReferenced axis system. This field is only used if Axes
= ObjectReferenced. See the discussion below for more information on how
the axes are computed for ObjectReferenced axis systems.
GUI
The New Coordinate System dialog box shown above appears when you add a new coordi-
nate system in the Resource Tree. You provide a name for the new CoordinateSystem in the
Coordinate System Name box and configure the CoordinateSystem 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.
143
Reference Guide CoordinateSystem
When editing an existing CoordinateSystem, you use the CoordinateSystem dialog box. The
default configuration is shown above.
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, CelestialBodies, or Barycenters to
name a few. See the discussion below for a detailed definition of the ObjectReferenced axis
system.
144
CoordinateSystem 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.
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 comput-
ed: 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 dynamics. 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 components 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.
145
Reference Guide CoordinateSystem
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 coordinate
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 below 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: International Terrestrial Reference
Frame (Earth Fixed), PEF: Pseudo Earth Fixed, TODEq: 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).
146
CoordinateSystem Reference Guide
The computation for the International Celestial Reference Frame (ICRF) and the International
Terestrial Reference Fame (ITRF) are computed using the IAU 2000A theory with the 2006 up-
date to precession. GMAT uses the Celestial Intermediate Origin (CIO) method of transforma-
tion which avoids issues associated with precession and nutation. In the CIO model, the Celestial
Intermediate Pole unit vector is modeled using the variables 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 an-
other object. The figure below defines the six principal directions of an Object Referenced 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}.
147
Reference Guide CoordinateSystem
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 example, 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 direction 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 accel-
eration are zero when computing ObjectReferenced rotation matrices.
148
CoordinateSystem Reference Guide
149
Reference Guide CoordinateSystem
150
CoordinateSystem Reference Guide
151
Reference Guide CoordinateSystem
Examples
Define a Spacecraft’s state in EarthFixed coordinates.
BeginMissionSequence
152
CoordinateSystem Reference Guide
RotatingSEML1Coord.ZAxis = N
RotatingSEML1Coord.Primary = Sun
RotatingSEML1Coord.Secondary = EarthMoonBary
BeginMissionSequence
153
154
Reference Guide
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 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
DerivativeMethod Chooses between one-sided and central differencing for numerically
determining the derivative.
155
Reference Guide DifferentialCorrector
Field Description
ReportFile Specifies the path and file name for the DifferentialCorrector report.
The report is only generated if ShowProgress is set to true.
GUI
The DifferentialCorrector dialog box allows you to specify properties of a DifferentialCor-
rector such as maximum iterations, choice of derivative method used to calculate the finite dif-
ferences, and choice of reporting options.
To create a DifferentialCorrector resource, navigate to the Resources tree, expand the Solvers
folder, right-click on the Boundary Value Solvers folder, point to Add, and click Differential-
Corrector. A resource named DC1 will be created. Double-click on the DC1 resource to bring
up the following Differential Corrector dialog box.
156
DifferentialCorrector Reference Guide
Remarks
Resource and Command Interactions
The DifferentialCorrector object can only be used in the context of targeting-type commands.
Please see the documentation for Target, Vary, and Achieve for more information and worked
examples.
Examples
Create a DifferentialCorrector object.
BeginMissionSequence
To see how the DifferentialCorrector object is used in conjunction with Target, Vary, and
Achieve commands to solve orbit problems, see the Target command examples.
157
158
Reference Guide
EphemerisFile
Generate spacecraft’s ephemeris data
Description
GMAT allows you to generate any number of ephemeris data files by creating multiple Epher-
misFile resources. Spacecraft’s ephemeris data is always provided in UTC epoch format. An
EphemerisFile resource can be created using either the GUI or script interface. GMAT also
provides the option of when to write and stop writing ephemeris data to a text file through
the Toggle On/Off commands. See the Remarks section below for detailed discussion of the
interaction between EphemerisFile resource and Toggle command.
Fields
Field Description
InterpolationOrder Allows you to set the interpolation order for the available interpolator
methods (Lagrange or Hermite) for either CCSDS-OEM or SPK
file formats. This field cannot be modified in the Mission Sequence.
159
Reference Guide EphemerisFile
Field Description
EpochFormat Allows you to select format of the epoch that the user defines in Ini-
tialEpoch and FinalEpoch fields. This field cannot be modified in the
Mission Sequence.
160
EphemerisFile 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 Se-
quence.
161
Reference Guide EphemerisFile
Field Description
Spacecraft Allows the user to generate ephemeris data of spacecraft(s) that are de-
fined in Spacecraft field. This field cannot be modified in the Mission
Sequence.
162
EphemerisFile Reference Guide
Field Description
Maximized Allows the user to maximize the generated ephemeris file window. This
field cannot be modified in the Mission Sequence.
GUI
The figure below shows the default settings for the EphemerisFile resource:
GMAT allows you to modify InitialEpoch, FinalEpoch and StepSize fields of Ephemeris-
File resource. Instead of always generating the ephemeris file at default time span settings 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:
163
Reference Guide EphemerisFile
Remarks
Behavior of Coordinate System Field for CCSDS File Format
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.
There is one important difference between GMAT and IAU conventions. By IAU convention,
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 CoordinateSystems specifications document to read
more about built-in coordinate systems and description of Axes types that GMAT supports.
164
EphemerisFile Reference Guide
only writes the ephemeris for the final solution 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 version 2 of CCSDS
ODM document now allows for ephemeris file to be generated backwards as well. Currently in
GMAT, when you propagate a spacecraft backwards in time, then the ephemeris is also generated
backwards.
Behavior of Ephemeris File When It Does Not Meet CCSDS File For-
mat Requirements
When an ephemeris file is generated, it needs to follow the Recommended Standard for ODMs
that has been prepared by the CCSDS. The set of orbit data messages described in the Recom-
mended Standard is the baseline concept of trajectory representation in data interchange appli-
cations that are cross-supported between Agencies of the CCSDS. CCSDS-ODM Recommend-
ed Standard documents establishes a common framework and provides a common basis for the
interchange of orbit data.
Currently, the ephemeris file that is generated by GMAT meets most of the recommended stan-
dards 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 dis-
play a warning in ephemeris file’s Header section. More specifically, 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.
Behavior of Interpolation Order Field for CCSDS and SPK File For-
mats
For CCSDS file formats, whenever there is not enough raw data available to support the request-
ed interpolation type and order, GMA 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 mes-
sage 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 segment and
then sent to SPK kernel writer. No interpolation takes place for SPK ephemeris file.
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’:
165
Reference Guide EphemerisFile
anEphmerisFile.Spacecraft = aSat
anEphmerisFile.Filename = 'EphemerisFile1.eph'
BeginMissionSequence
Examples
This example shows how to generate a simple ephemeris file. Ephemeris file is generated 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 differ-
ential 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)
166
EphemerisFile Reference Guide
EndTarget
167
168
Reference Guide
FiniteBurn
A finite burn
Description
The FiniteBurn resource is used when continuous propulsion is desired. Impulsive burns hap-
pen instantaneously through the use of the Maneuver command, while finite burns occur con-
tinuously starting at the BeginFiniteBurn command and lasting until the EndFiniteBurn com-
mand is reached in the mission sequence. In order to apply a non-zero Finite Burn, there must
be a Propagate command between the BeginFiniteBurn and EndFiniteBurn commands.
Fields
Field Description
Thruster The Thruster field allows the selection of which Thruster, from a list
of previously created thrusters, to use when applying a finite burn. Cur-
rently, 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. Using the scripting inter-
face, 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 asso-
ciate a Thruster, if one has been created, with the FiniteBurn. This
field cannot be modified in the Mission Sequence.
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.
169
Reference Guide FiniteBurn
Remarks
Configuring a FiniteBurn
To perform a finite burn, the FiniteBurn resource itself and a number of related resources
and commands must be properly configured. You must associate a specific Thruster hardware
resource with a created FiniteBurn. You must associate a specific FuelTank hardware resource
with the chosen Thruster. Finally, you must attach both the chosen Thruster and FuelTank
to the desired Spacecraft. See the example below for additional details.
Using the scripting interface, one can assign multiple thrusters to a single FiniteBurn resource.
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 associ-
source ated with at least one Thruster. Any Thruster created in the resource tree
can be incorporated into a FiniteBurn.
FuelTank re- To perform a finite burn, a FuelTank must be attached to the Spacecraft.
source (A FuelTank is needed to provide pressure and temperature data used when
modeling the thrust and specific impulse. A FuelTank is also needed if you
want to model mass depletion.)
BeginFinite- After a FiniteBurn is created, to apply it in the mission sequence, a Be-
Burn and ginFiniteBurn and EndFiniteBurn command must be appended to the
EndFiniteBurn mission tree.
command
Propagate com- In order to apply a non-zero finite burn, there must be a Propagate com-
mand mand between the BeginFiniteBurn and EndFiniteBurn commands.
Examples
Create a default Spacecraft and FuelTank Resource; Create a default Thruster that allows for
fuel depletion from the default FuelTank; Attach FuelTank and Thruster 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.
170
FiniteBurn Reference Guide
BeginMissionSequence
171
172
Reference Guide
FminconOptimizer
The Sequential Quadratic Processor (SQP) optimizer, fmincon
Description
Fields
Field Description
DiffMaxChange Upper limit on the perturbation used in MATLAB's finite differencing
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.
173
Reference Guide FminconOptimizer
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 maximum function evalua-
tions, fmincon outputs an ExitFlag of zero, and GMAT continues.
174
FminconOptimizer Reference Guide
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 in-
formation contained in the message window and written in the report is
controlled by the ReportStyle field.
GUI
To create a FminconOptimizer 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
SQP (fmincon). This will create a new FminconOptimizer resource, SQP1. Double-click on
SQP1 to bring up the FminconOptimizer dialog box shown below.
175
Reference Guide FminconOptimizer
Remarks
This optimizer is only available if you have access to both MATLAB and MATLAB's Optimiza-
tion 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.
The FminconOptimizer resource can only be used in the context of optimization-type com-
mands. Please see the documentation for Optimize, Vary, NonlinearConstraint, and Mini-
mize for more information and worked examples.
176
FminconOptimizer Reference Guide
Examples
Create a FminconOptimizer resource named SQP1.
For an example of how a FminconOptimizer resource can be used within an optimize sequence,
see the Optimize command examples.
177
178
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 dynamic
system. You can only propagate Formation resources using numerical-integrator type propaga-
tors. 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:
179
Reference Guide Formation
Note
A Spacecraft can only be added to one Formation.
Remarks
A Formation is a container object that allows you to model a group of Spacecraft as a coupled
system. You can add Spacecraft to a Formation using the Add field as shown in the script
examples below or in the GUI example above. The primary reasons to use a Formation Re-
source are (1) to simplify the propagation of multiple spacecraft and (2) for performance rea-
sons. GMAT’s propagation subsystem models Formations as a coupled dynamic system. Once
spacecraft have been added to a Formation, you can easily propagate all of the spacecraft by
simply including the formation in the Propagate command statement like this:
You can only propagate Formation resources using numerical-integrator type propagators.
GMAT does not support propagation of the orbit state transition matrix when propagating for-
mations.
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 Formation are
not equivalent to a tolerance of a few microseconds, GMAT will throw an error and execution
will stop.
Examples
Create two Spacecraft, add them to a Formation, and propagate the Formation.
BeginMissionSequence
180
Reference Guide
FuelTank
Model of a chemical fuel tank
Description
A FuelTank is a thermodynamic model of a tank and is required for finite burn modeling or for
impulsive burns that use mass depletion. The thermodynamic properties of the tank are modeled
using Boyle’s law and assume that there is no temperature change in the tank as fuel is depleted.
To use a FuelTank, you must first create the tank, and then attach it to the desired Spacecraft
and associate it with a Thruster as shown in the example below.
Fields
Field Description
AllowNegativeFuelMass This field allows the FuelTank 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.
181
Reference Guide FuelTank
Field Description
PressureModel The pressure model describes how pressure in the FuelTank
changes as fuel is depleted. This field cannot be modified in the
Mission Sequence.
GUI
The FuelTank 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 FuelTank dialog
box is shown below.
182
FuelTank Reference Guide
The Thruster resource is closely related to the FuelTank resource and thus, we also discuss
it here. The Thruster dialog box allows you to specify properties of a thruster including the
coordinate system of the Thrust acceleration direction vector, the thrust magnitude and Isp. The
layout of the Thruster dialog box is shown below.
183
Reference Guide FuelTank
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 FuelTank as shown below.
184
FuelTank Reference Guide
Thus far, we have created both a FuelTank and a Thruster, and we have associated a FuelTank
with our Thruster. We are not done yet. We must tell GMAT that we want to attach both the
FuelTank and the Thruster to a particular spacecraft. To do this, double click on the desired
spacecraft under the Spacecraft resource to bring up the associated GUI panel. Then click on
the Tanks tab to bring up the following GUI display.
185
Reference Guide FuelTank
Next, select the desired FuelTank and use the right arrow button to attach the FuelTank to
the spacecraft. Then, click the Apply button as shown below.
Similarly, to attach a Thruster to a spacecraft, double click on the desired spacecraft under the
Spacecraft resource and then select the Actuators tab. Then select the desired thruster and
186
FuelTank Reference Guide
use the right arrow to attach the thruster to the spacecraft. Finally, click the Apply button as
shown below.
Remarks
Use of FuelTank Resource in Conjunction with Maneuvers
A FuelTank is used in conjunction with both impulsive and finite maneuvers. To implement
an impulsive maneuver, one must first create an ImpulsiveBurn resource and (optionally) as-
sociate a FuelTank with it. The actual impulsive maneuver is implemented using the Maneuver
command. See the Maneuver command documentation for worked examples on how the Fu-
elTank resource is used in conjunction with impulsive maneuvers.
To implement a finite maneuver, you must first create both a Thruster and a FiniteBurn re-
source. You must also associate a FuelTank with the Thruster 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 FuelTank resource is used in con-
junction with finite maneuvers.
187
Reference Guide FuelTank
aTank.Volume = 0.75
aTank.FuelDensity = 1260
aTank.PressureModel = PressureRegulated
% Create a Thruster and assign it a FuelTank
Create Thruster aThruster
aThruster.Tank = {aTank}
As exhibited below, there are some subtleties associated with setting and getting parent vs.
cloned resources. In the example above, aTank is the parent FuelTank 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.
% Add the FuelTank and Thruster to a second Spacecraft
Create Spacecraft bSpacecraft
bSpacecraft.Tanks = {aTank}
bSpacecraft.Thrusters = {aThruster}
aTank.FuelMass = 900 %Can be performed in both resource and
%command modes
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.
% Create the Fuel Tank Resource
aTank.FuelMass = 756 %Fuel tank mass in both s/c set back to default
aSpacecraft.aTank.FuelMass = 1000 %Can only be performed in command mode.
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 exception 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
Create a default FuelTank and attach it to a Spacecraft and Thruster.
188
FuelTank Reference Guide
BeginMissionSequence
189
190
Reference Guide
GroundStation
A ground station model.
Description
A GroundStation models a facility fixed to the surface of a CelestialBody. There are several
state representations available for defining the location of a ground station including Cartesian
and spherical. This resource cannot be modified in the Mission Sequence.
Fields
Field Description
Altitude The altitude of the station with respect to the HorizonReference.
191
Reference Guide GroundStation
Field Description
Latitude The latitude of the station with respect to HorizonReference.
192
GroundStation Reference Guide
Field Description
Longitude The longitude of the station.
GUI
You can set the ground station location in several state representations. The Cartesian repre-
sentation 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:
193
Reference Guide GroundStation
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.
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
194
GroundStation Reference Guide
aGroundStation.Altitude = -15.99424674414058
195
196
Reference Guide
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 Ground-
TrackPlot through the Toggle On/Off command. See the Remarks section below for detailed
discussion of the interaction between GroundTrackPlot resource and the Toggle command.
GroundTrackPlot resource also allows you to display any number of user-defined ground sta-
tions onto the texture map of the central body.
Fields
Field Description
Add Allows the user to pick selected resources such as Spacecraft(s) or
GroundStation(s) whose ground track is drawn in GroundTrack-
Plot. To select multiple Spacecrafts or GroundStations, seperate
the list by comma and enclose the list in curly brackets. For Ex-
ample: DefaultGroundTrackPlot.Add = {aSat, bSat,
aGroundStaton, bGroundStation}. This field cannot be
modified in the Mission Sequence.
197
Reference Guide GroundTrackPlot
Field Description
DataCollectFrequency The number of integration steps to skip between plot points. This
field cannot be modified in the Mission Sequence.
198
GroundTrackPlot Reference Guide
Field Description
Size Allows the user to control the display size of GroundTrackPlot
window. First value in [0 0] matrix controls horizonal size and sec-
ond value controls vertical size of GroundTrackPlot display win-
dow. This field cannot be modified in the Mission Sequence.
199
Reference Guide GroundTrackPlot
Field Description
Upperleft Allows the user to pan the GroundTrackPlot display window in
any direction. First value in [0 0] matrix helps to pan the Ground-
TrackPlot window horizontally and second value helps to pan the
window vertically. This field cannot be modified in the Mission Se-
quence.
GUI
Default Name and Settings for the GroundTrackPlot Resource:
Remarks
Behavior when using GroundTrackPlot Resource & Toggle Command
The GroundTrackPlot resource draws the longitude and latitude time-history of a spacecraft at
each propagation step of the entire mission duration. If you want to report data to a Ground-
200
GroundTrackPlot Reference Guide
TrackPlot at specific points in your mission, then a Toggle On/Off command can be inserted
into the mission sequence to control when the GroundTrackPlot is to draw data. When Toggle
Off command is issued for a GroundTrackPlot, no ground track data is drawn until a Toggle
On command is issued. Similarly when a Toggle On command is used, ground track data is
drawn 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 GroundTrackPlot resource. GroundTrackPlot is turned off for the first 2 days
of the propagation:
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 GroundTrackPlot re-
source supports 3 options which are described in the table below:
SolverIterations Description
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 iter-
ations/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 cen-
tral body shape or its oblateness.
201
Reference Guide GroundTrackPlot
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:
202
GroundTrackPlot Reference Guide
aGroundTrackPlot.Add = {aSat}
aGroundTrackPlot.CentralBody = Mars
BeginMissionSequence
203
204
Reference Guide
ImpulsiveBurn
An impulsive maneuver
Description
The ImpulsiveBurn resource allows the spacecraft to undergo an instantaneous Delta-V (ΔV),
as opposed to a finite burn which is not instantaneous, by specifying the three vector compo-
nents of the Delta-V. You can configure the burn by defining its coordinate system and vector
component values. For Local coordinate systems, the user can choose the Origin and type of
Axes. Depending on the mission, it may be simpler to use one coordinate system over another.
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 Sequence.
205
Reference Guide ImpulsiveBurn
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.
206
ImpulsiveBurn Reference Guide
Field Description
N Deprecated. Y-component of the applied impulsive burn (Delta-V)
207
Reference Guide ImpulsiveBurn
GUI
The ImpulsiveBurn dialog box allows you to specify properties of an ImpulsiveBurn including
Delta-V component values and choice of Coordinate System. If you choose to model fuel loss
associated with an impulsive burn, you must specify choice of fuel tank as well as ISP value and
gravitational acceleration used to calculate fuel use. The layout of the ImpulsiveBurn dialog
box is shown below.
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 FuelTank used as the fuel
supply for mass depletion.
Remarks
Local Coordinate Systems
Here, a Local Coordinate System is defined as one that we configure "locally" using the Im-
pulsiveBurn resource interface as opposed to defining a coordinate system using the Coordi-
nate 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 avail-
able, 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
208
ImpulsiveBurn Reference Guide
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.
Similarly, Local Vertical Local Horizontal or LVLH is a non-inertial coordinate system based
upon the motion of the spacecraft with respect to the body specified in the Origin sub-field. If
you choose Earth as the origin, then the X-axis of this coordinate system points from the center
of the Earth to the spacecraft, the Z-axis is along the instantaneous orbit normal (with respect
to the Earth) of the spacecraft, and the Y-axis completes the right-handed set. For typical bound
orbits, the Y-axis is approximately aligned with the velocity vector. In the event of a perfectly
circular orbit, the Y axis is exactly along the velocity vector.
MJ2000Eq is the J2000-based Earth-centered Earth mean equator inertial Coordinate System.
Note that the Origin sub-field is not needed to define this coordinate system.
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.
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.
It is important to note that the V, N, B field names do not necessarily correspond to some
Velocity, Normal, Binormal coordinate system. The coordinate system of any ImpulsiveBurn is
always specified by the CoordinateSystem, Origin, and Axes fields. Because of the confusion
that the V, N, B field names can cause, their use will not be allowed in future versions of GMAT.
If you use the V, N, B field names in this version of GMAT, you will receive a warning to this
affect.
Interactions
Resource Description
Spacecraft Must be created in order to apply any ImpulsiveBurn
resource
FuelTank If you want to model mass depletion for an ImpulsiveBurn, attach a FuelTank
resource to the maneuvered Spacecraft as a source of fuel mass.
Maneuver Must use the Maneuver command to apply an ImpulsiveBurn to a Spacecraft.
command
209
Reference Guide ImpulsiveBurn
Resource Description
Vary com- If you want to allow the ImpulsiveBurn components to vary in order to achieve
mand some goal, then the Vary command, as part of a Target or Optimize command
sequence, must be used.
Examples
Create a default FuelTank and an ImpulsiveBurn that allows for fuel depletion, assign the
ImpulsiveBurn the default FuelTank, attach the FuelTank to a Spacecraft, and apply the
ImpulsiveBurn to the Spacecraft.
BeginMissionSequence
Maneuver DefaultIB(DefaultSC)
210
Reference Guide
LibrationPoint
An equilibrium point in the circular, restricted 3-body problem
Description
A LibrationPoint, also called a Lagrange point, is an equilibrium point in the circular restricted
three-body problem (CRTBP). There are five libration points, three of which are unstable in the
CRTBP sense, and two that are stable. See the discussion below for a detailed explanation of
the different libration points and for examples configuring GMAT for common libration point
regimes. This resource cannot be modified in the Mission Sequence.
Options
Option Description
Point The libration point index.
Secondary String
Allowed Values CelestialBody or Barycenter. Secondary cannot be
SolarSystemBarycenter and Primary cannot be the
same as Secondary.
Access set
Default Value Earth
Units N/A
Interfaces GUI, script
211
Reference Guide LibrationPoint
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 barycenters. You cannot
choose the SolarSystemBarycenter as either the Primary or Secondary and the Primary and
Secondary cannot be the same object.
Remarks
Overview of Libration Point Geometry
A LibrationPoint, also called a Lagrange point, is an equilibrium point in the Circular Restrict-
ed Three Body Problem (CRTBP). The definitions for the libration points used in GMAT are
illustrated in the figure below where the Primary and Secondary bodies are shown in a rotating
frame defined with the x-axis pointing from the Primary to the Secondary. GMAT is config-
ured for the full ephemeris problem and computes the location of the libration points by assum-
ing that at a given instant in time, the CRTBP theory developed by Lagrange and Szebehely can
be used to compute the location of the libration points using the locations of the primary and
secondary from the JPL ephemerides. The three collinear points (L1, L2, and L3) are unstable
(even in the CRTBP) and the triangular points (L4, and L5) are stable in CRTBP.
GMAT allows you to define the Primary and/or Secondary as a CelestialBody or Barycen-
ter (except SolarSystemBarycenter). This allows you to set the Primary as the Sun, and the
212
LibrationPoint Reference Guide
Secondary as the Earth-Moon barycenter for modelling Sun-Earth-Moon libration points. See
the examples below for details.
Examples
% Create the libration point and rotating libration point coordinate system
Create LibrationPoint EarthMoonL2
EarthMoonL2.Primary = Earth
EarthMoonL2.Secondary = Luna
EarthMoonL2.Point = L2
Create Variable I
BeginMissionSequence
213
Reference Guide LibrationPoint
BeginMissionSequence
214
Reference Guide
MatlabFunction
Declaration of an external MATLAB function
Description
The MatlabFunction resource declares to GMAT that the name given refers to an existing
external function in the MATLAB language. This function can be called in the Mission Sequence
like a built-in function, with some limitations. See the CallMatlabFunction 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 called.
Path Separate multiple paths with semicolons (on Windows) or colons (on other plat-
forms).
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.
Remarks
Search Path
When a function declared as a MatlabFunction is called, GMAT starts MATLAB in the back-
ground with a custom, configurable search path. MATLAB then searches for the named func-
215
Reference Guide MatlabFunction
tion in this search path. The search is case-sensitive, so the name of the function name and the
MatlabFunction resource must be identical.
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 semi-
colon (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 direc-
tory.
Examples
Call a simple built-in MATLAB function:
BeginMissionSequence
x = 1
[y] = sinh(x)
BeginMissionSequence
% propagate to apoapsis
Propagate aProp(aSat) {aSat.Apoapsis}
216
MatlabFunction Reference Guide
BeginMissionSequence
[pathStr] = path
[pwdStr] = pwd
217
218
Reference Guide
OrbitView
A user-defined resource that plots 3-Dimensional trajectories
Description
The OrbitView resource allows you to plot trajectories of a spacecraft or a celestial body. GMAT
also allows you to plot trajectories associated with multiple spacecrafts or celestial bodies. You
can create multiple OrbitView resources by using either the GUI or script interface of GMAT.
OrbitView plots also come with multiple options that allow you to customize the view of
spacecraft’s trajectories. See the Fields section below for detailed discussion on available plotting
and drawing options.
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 section be-
low 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 re-
sources is also mentioned in the Remarks section.
Fields
Field Description
Add This field allows you to add a Spacecraft, Celestial body, Libra-
tion Point, or Barycenter to a plot. When creating a plot, the
Earth is added as a default body and may be removed by the user.
The user can add a Spacecraft, Celestial body, Libration Point,
or Barycenter to a plot by using the name used to create the re-
source. 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 following 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 Sequence.
219
Reference Guide OrbitView
Field Description
Axes Allows the user to tell GMAT to draw the Cartesian axis system
associated with the coordinate system selected under the Coordi-
nateSystem field of an OrbitView plot. This field cannot be mod-
ified in the Mission Sequence.
220
OrbitView Reference Guide
Field Description
DrawObject The DrawObject field allows the user the option of displaying
Spacecraft or Celestial resources on the OrbitView plot. This
field cannot be modified in the Mission Sequence.
221
Reference Guide OrbitView
Field Description
NumPointsToRedraw When NumPointsToRedraw field is set to zero, all ephemeris
points are drawn. When NumPointsToRedraw is set to a positive
integer, say 10 for example, only the last 10 collected data points are
drawn. See DataCollectFrequency for explanation of how data is
collected for an OrbitView plot. This field cannot be modified in
the Mission Sequence.
222
OrbitView Reference Guide
Field Description
Size Allows the user to control the display size of OrbitViewPlot win-
dow. First value in [0 0] matrix controls horizonal size and second
value controls vertical size of OrbitViewPlot display window. This
field cannot be modified in the Mission Sequence.
223
Reference Guide OrbitView
Field Description
TargetColor Allows the user to select any available color for perturbing trajec-
tories during iterative processes such as Differential Correction
or Optimization. This field cannot be modified in the Mission Se-
quence.
224
OrbitView Reference Guide
Field Description
UseInitialView Allows the user to control the view of an OrbitView plot between
multiple runs of a mission sequence. The first time a specific Or-
bitView 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 the user changes the
view using the mouse, GMAT will retain this view upon rerunning
the mission as long as UseInitialView is set to false. If UseIni-
tialView is set to true, the view for an OrbitView plot will be re-
turned to the view defined by the initial settings. This field cannot
be modified in the Mission Sequence.
225
Reference Guide OrbitView
Field Description
ViewPointVector The product of ViewScaleFactor and ViewPointVector field de-
termines the view point location with respect to ViewPointRef-
erence. ViewPointVector can be a vector, or any of the follow-
ing resources: Spacecraft, Celestial body, Libration Point, or
Barycenter. The location of the view point in three-dimensional
space is defined as the vector addition of ViewPointReference
and the vector defined by product of ViewScaleFactor and View-
PointVector in the coordinate system chosen by the user. This field
cannot be modified in the Mission Sequence.
226
OrbitView Reference Guide
Field Description
ViewUpCoordinateSys- The ViewUpCoordinateSystem and ViewUpAxis fields are used
tem to determine which direction appears as up in an OrbitView plot
and together with the fields associated the the View Direction,
uniquely define the view. The fields associated with the View De-
finition allow the user to define the point of view in three-dimen-
sional space, and the direction of the line of sight. However, this
information alone is not enough to uniquely define the view. We
also must provide how the view is oriented about the line of sight.
This is accomplished by defining what direction should appear as
the up direction in the plot and is configured using the ViewUpCo-
ordinateSystem field and the ViewUpAxis field. The ViewUp-
CoordinateSystem allows the user to select a coordinate system
to define the up direction. Most of the time this system will be the
same as the coordinate system chosen under the CoordinateSys-
tem field. This field cannot be modified in the Mission Sequence.
GUI
The figure below shows the default settings for the OrbitView resource:
227
Reference Guide OrbitView
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
Behavior when using OrbitView Resource & Toggle Command
The OrbitView resource plots spacecraft’s trajectory at each propagation step of the entire mis-
sion duration. If you want to report data to an OrbitView plot at specific points in your mission,
then a Toggle On/Off command can be inserted into the mission sequence to control when
OrbitView is to plot a given trajectory. When Toggle Off command is issued for an OrbitView,
no trajectory is drawn until a Toggle On command is issued. Similarly, when a Toggle On com-
mand is used, trajectory is plotted at each integration step until a Toggle Off command is used.
228
OrbitView Reference Guide
BeginMissionSequence
SolverIterations Description
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 per-
turbed trajectories.
None Shows only the final solution after the end of an iterative process and plots
only that final trajectory.
Below is an example script snippet that shows how to plot trajectories of multiple spacecrafts
that use different propagators:
229
Reference Guide OrbitView
BeginMissionSequence
GMAT displays spacecraft models by reading model data from 3D Studio files describing 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 coordinates 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.
GMAT's implementation of the spacecraft model can display models consisting of up to 200,000
vertices that map up to 100,000 triangles. The GMAT model can use up 500 separate color or
texture maps to fill in these triangles.
When using OrbitView.Add field, if brackets are not populated with user-defined spacecrafts,
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:
230
OrbitView Reference Guide
BeginMissionSequence
Plotting orbit during an iterative process. Notice SolverIterations field is selected as All. This
means all iterations/perturbations will be plotted.
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
231
Reference Guide OrbitView
anOrbitView.CoordinateSystem = LunaMJ2000Eq
anOrbitView.ViewPointReference = Luna
anOrbitView.ViewDirection = Luna
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
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
232
OrbitView Reference Guide
aSat.VY = 5.935188001372066
aSat.VZ = -2.696272103530009
BeginMissionSequence
233
234
Reference Guide
Propagator
A propagator models spacecraft motion
GMAT's documentation for Propagator components is broken down into three sections:
Numerical Propagator
Overview
A Propagator object that uses a numerical integrator (as opposed to an ephemeris propagator)
is one of a few objects in GMAT that is configured differently in the scripting and in the GUI.
In the GUI, you configure the integrator and force model setting on the same dialog box. See
the Remarks section below for detailed discussion of GMAT’s numerical integrators as well
as performance and accuracy comparisons, and usage recommendations. This resource cannot
be modified in the Mission Sequence. However, you can do whole object assignment in the
mission,( i.e. myPropagator = yourPropagator ).
When working in the script, you must create a ForceModel object separately from the Propa-
gator and specify the force model using the “FM” field on the propagator object. See the Ex-
amples section later in this section for details.
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 Er-
rorControl metric.
235
Reference Guide Propagator
Option Description
FM Identifies the force model used by an integrator. If no force model is
provided, GMAT uses an Earth centered propagator with a 4x4 gravity
model.
236
Propagator Reference Guide
Option Description
MinStep The minimum allowable step size.
237
Reference Guide Propagator
GUI
Settings for the embedded Runge-Kutta integrators. Select the desired integrator from the Type
menu.
Remarks
The comparison data presented in a later section suggest that the PrinceDormand78 integra-
tor is the best all purpose integrator in GMAT. When in doubt, use the PrinceDormance78
integrator, and set MinStep to zero so that the integrator’s adaptive step algorithm controls the
minimum integration step size. Below are some important comments on GMAT’s step size con-
trol 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 performance and accuracy analysis documented later in this section to select
a numerical integrator for your application. You may need to perform further analysis and com-
parisons for your application.
238
Propagator Reference Guide
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, integrator performance will be
poor, for little if any improvement in the accuracy of the orbit integration. To find
the best balance between integration accuracy and performance, we recommend
you experiment with the accuracy setting for your selected integrator for your ap-
plication. 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 MinimumStep
setting. The Propagator flag StopIfAccuracyIsViolated determines the behavior
if Accuracy cannot be satisfied. If StopIfAccuracyIsViolated is true, GMAT will
throw an error and stop execution if integration accuracy is not satisfied. If StopI-
fAccuracyIsViolated is false, GMAT will only throw a warning that the integration
accuracy was not satisfied but will continue to propagate the orbit.
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.
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 co-
efficients developed by by Dormand, El-Mikkawy and Prince.
The integrator is a 9-stage Nystrom integrator, with error con-
trol on both the dependent variables and their derivatives. This
second order implementation will correctly integrate forces that
are non-conservative but it is not recommended for this use. See
the integrator comparisons below for numerical comparisons.
You cannot use this integrator to integrate mass during a finite
maneuver because the mass flow rate is a first order differential
equation not supported by this integrator.
239
Reference Guide Propagator
Option Description
RungeKutta56 An adaptive step, sixth order Runge-Kutta integrator with
fifth order error control. The coefficients were derived by E.
Fehlberg.
AdamsBashforthMoulton A fourth-order Adams-Bashford predictor / Adams-Moulton
corrector as described in Fundamentals of Astrodynamics 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 previous states of the variables. The
corrector uses derivative information evaluated for this state,
along with the derivative information at the original state and
two preceding states, to tune this state, giving the final, corrected
state. The ABM integrator uses the RungeKutta89 integrator to
start the integration process. The ABM is a low order integrator
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 integrators. 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 propagation 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 ErrorControl 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.
Comparing the run time data for each integrator shown in the table below we see that the Prince-
Dormand78 integrator was the fastest for 4 of the 6 cases and tied with the RungeKutta89 in-
tegrator for LEO test case. For the Lunar flyby case, the RungeKutta89 was the fastest integra-
tor, however, in this case the PrinceDormand78 integrator was at least 2 orders of magnitude
240
Propagator Reference Guide
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.
The AdamsBashforthMoulton integrator has two additional fields named TargetError and
LowerError that are only active when Type is set to AdamsBashforthMoulton. If you are
using another integrator type, those fields must be removed from your script file to avoid parsing
errors. When working in the GUI, this is performed automatically. See examples below for more
details.
Examples
BeginMissionSequence
Propagate using a fixed step configuration. Do this by setting InitialStepSize to the desired
fixed step size and setting ErrorControl to None. This example propagates in constant steps
of 30 seconds:
241
Reference Guide Propagator
aProp.Type = PrinceDormand78
aProp.InitialStepSize = 30
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 correc-
tions. A ForceModel is configured and attached to the Propagator object (see the Propagator
object for differences between script and GUI configuration when configuring a Propagator).
The Propagator, along with the Propagate 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 dis-
cussion below for detailed information on how to configure force models for your application.
This resource cannot be modified in the Mission Sequence.
242
Propagator Reference Guide
Fields
Option Description
CentralBody The central body of propagation. CentralBody must be a
celestial body and cannot be a LibrationPoint, Barycen-
ter, Spacecraft, or other special point.
243
Reference Guide Propagator
Option Description
Drag.MagneticIndex The geomagnetic index (Kp) used in density calculations.
Kp is a planetary 3-hour-average, geomagnetic index that
measures magnetic effects of solar radiation. This field is
only active if there is a PrimaryBody.
244
Propagator Reference Guide
Option Description
GravityField. The degree of the harmonic gravity field. This field is only
PrimaryBodyName.Degree active if there is a PrimaryBody.
245
Reference Guide Propagator
Option Description
PointMasses A list of celestial bodies to be treated as point masses in
the force model. A body cannot be both the PrimaryBody
and in the PointMasses list. An empty list "{}" removes all
points masses from the list.
246
Propagator Reference Guide
Option Description
SRP.Flux The value of SRP flux at 1 AU. This field is only active in
the script if SRP is on.
247
Reference Guide Propagator
GUI
Remarks
Overview of Primary Body/Central Body and Field Interactions
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 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 Earth tide models. On a Propa-
gator, all celestial bodies are classified into two mutually exclusive 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 primary 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 de-
fined 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 ap-
248
Propagator Reference Guide
plication 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
Below is an example script snippet for configuring a custom gravity model including Earth tides.
Create ForceModel aForceModel
aForceModel.CentralBody = Earth
aForceModel.PrimaryBodies = {Earth}
aForceModel.GravityField.Earth.Degree = 21
aForceModel.GravityField.Earth.Order = 21
aForceModel.GravityField.Earth.PotentialFile = 'c:\MyData\File.cof'
aForceModel.GravityField.Earth.EarthTideModel = 'SolidAndPole'
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 example -- are in-
cluded using custom plug-in components and are currently only supported in the script interface.
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.
Create ForceModel aForceModel
GMAT aForceModel.PrimaryBodies = {Earth}
GMAT aForceModel.Drag.AtmosphereModel = NRLMSISE00
GMAT aForceModel.Drag.F107 = 145
GMAT aForceModel.Drag.F107A = 160
GMAT aForceModel.Drag.MagneticIndex = 4
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 Drag.F107,
Drag.F107A, and Drag.MagneticIndex are inactive and must be removed from your script file
to avoid parsing errors. When working in the GUI, this is performed automatically.
The table below describes the limits on altitude for drag models supported by GMAT.
249
Reference Guide Propagator
GMAT uses a dual cone model to model central body shadowing of the spacecraft and models
solar radiation pressure using a spherical spacecraft model. 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.
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 mod-
el 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 information
on how to configure GMAT to compute the STM, see the Propagate command documentation.
250
Propagator Reference Guide
Caution
Caution: GMAT allows you to propagate the State Transition Matrix (STM) along
with the orbital state. However, not all variational terms are implemented for STM
propagation. The following are implemented: point mass perturbation, spherical
harmonics (with tide models), and solar radiation pressure. The following are NOT
implemented: drag and relativistic terms, and finite burns. Additionally, the SRP
variational term does not include the partial derivative of the percent shadow with
respect to orbital state. This approximation is acceptable for orbits with short
penumbra durations but is inaccurate for orbits that spend relatively long periods
of time in penumbra.
Examples
A ForceModel for point mass propagation.
BeginMissionSequence
BeginMissionSequence
251
Reference Guide Propagator
BeginMissionSequence
SPK-Configured Propagator
Description
252
Propagator Reference Guide
Fields
Field Description
CentralBody The central body of propagation. This field has no affect for SPK
propagators.
253
Reference Guide Propagator
Field Description
Type Specifies the integrator or analytic propagator used to model time
evolution of spacecraft motion.
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 including 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 propagator. 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 Spacecraft and
define the pacecraft's NAIFId. SPK Kernels for selected spacecraft are available here. Two
254
Propagator Reference Guide
sample vehicle spk kernels, (GEOSat.bsp and MoonTransfer.bsp) are distributed with GMAT
for example purposes. An example of how to add spacecraft kernels via the script interface is
shown below.
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 purposes only and are
not distributed with GMAT. In the script, you can use relative path or absolute path to define
the location of an SKP file. Relative paths are defined with respect to the GMAT bin directory
of your local installation.
255
Reference Guide Propagator
You can define the StartEpoch of propagation of an SPK-configured Propagator on either the
Propagator Resource or inherit the StartEpoch from the Spacecraft. Below is a script snippet
that shows how to inherit the StartEpoch from the Spacecraft. To inherit the StartEpoch
from the Spacecraft using the GUI
To explicitly define the StartEpoch on the Propagator Resource use the following syntax.
An SPK-configured Propagator works with the Propagate command in the same way numer-
ical propagators work with the Propagate command with the following exceptions:
• If a Propagate command uses an SPK propagator, then you can only propagate one space-
craft 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 Jacobian (A
matrix).
In the example below, we assume a Spacecraft named aSpacecraft and a Propagator named
spkProp have been configured a-priori. An example command to propagate aSpacecraft to
Earth Periapsis using spkProp is shown below.
Below is a script snippet that demonstrates how to propagate backwards using an SPK propa-
gator.
In general, ephemeris interpolation is less accurate near the boundaries of ephemeris files and
we recommend providing ephemeris for significant periods beyond the initial and final epochs
of your application for this and other reasons. When propagating near 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
256
Propagator Reference Guide
time using the Gregorian format (only accurate 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
Propagate a GEO spacecraft using an SPK-configured Propagator. Define the StartEpoch
from the spacecraft. Note: the SPK kernel GEOSat.bsp is distributed with GMAT.
BeginMissionSequence
Propagate spkProp(aSpacecraft) {aSpacecraft.TA = 90}
Propagate spkProp(aSpacecraft) {aSpacecraft.ElapsedDays = 2.4}
257
Reference Guide Propagator
BeginMissionSequence
Propagate spkProp(aSpacecraft) {aSpacecraft.ElapsedDays = 12}
258
Reference Guide
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 formatting properties of the out-
put 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 Toggle 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, Arrays,
Strings or Object Parameters to a report file. To add multiple 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.
259
Reference Guide ReportFile
Field Description
Filename Allows the user to define the file path and file name for a report file.
260
ReportFile Reference Guide
Field Description
Size Allows the user to control the display size of generated report file. First
value in [0 0] matrix controls horizonal size and second value controls
vertical size of report file window. This field cannot be modified in the
Mission Sequence.
261
Reference Guide ReportFile
Field Description
WriteReport This field specifies whether to write data to the report FileName.
GUI
Figure below shows default name and settings for the ReportFile resource:
Remarks
Behavior When using Filename field
GMAT allows you to specify the name of the report file in two ways. The default naming con-
vention for a report file when using FileName field is shown below:
262
ReportFile Reference Guide
aReport.WriteReport = true
An alternate method for naming a report file is to name the file without using any single quotes
around the report file’s name.
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 propagation
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
263
Reference Guide ReportFile
Now assume that at the same time, you decide to utilize Report command in the Mission 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.
SolverIterations Description
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 it-
erations/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.
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}
264
ReportFile Reference Guide
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 executed,
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 ab-
solute path by setting OUTPUT_PATH = C:/Users/rqureshi/Desktop/GMAT/mytest-
folder/. When the script is executed, report file named under FileName 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\mytestfolder\ReportFile.txt, then re-
port file will be saved in mytestfolder.
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.
BeginMissionSequence
265
Reference Guide ReportFile
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
BeginMissionSequence
266
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 sys-
tem 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.
Fields
Field Description
DEFilename The path and name of the DE file.
267
Reference Guide SolarSystem
Field Description
LSKFilename The path and name of the SPK leap second kernel.
GUI
The SolarSystem dialog box allows you to configure global properties for solar system mod-
elling and the default configuration is illustrated above. Use EphemerisSource 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.
268
SolarSystem Reference Guide
Warning
Caution: 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 EphemerisSource, the SolarSystem dialog box reconfigures to allow
you to define the SPK Kernel and the leap second kernel.
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 CelestialBody 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.
269
Reference Guide SolarSystem
Examples
Use DE421 for ephemeris.
BeginMissionSequence
BeginMissionSequence
270
Reference Guide
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 Spacecraft model also contains
the data that configures how the Spacecraft 3-D CAD model is used in an OrbitView. Space-
craft 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 information.
GMAT's documentation for Spacecraft is extensive and is broken down into the following
sections:
271
272
Reference Guide
Spacecraft Attitude
The spacecraft attitude model
Description
GMAT models the orientation and rate of rotation of a spacecraft using several different mathe-
matical models. Currently, GMAT assumes that a Spacecraft is a rigid body. The currently sup-
ported attitude models are Spinner, CoordinateSystemFixed, and SpiceAttitude. The Spin-
ner model is a simple, inertially fixed spin axis model. The CoordinateSystemFixed model
allows you to use any CoordinateSystem supported by GMAT as the attitude of a Spacecraft.
The SpiceAttitude model allows you to define the Spacecraft attitude based on SPICE attitude
kernels.
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.
273
Reference Guide Spacecraft Attitude
Field Description
Attitude The attitude mode for the Spacecraft.
274
Spacecraft Attitude Reference Guide
Field Description
DCM12 Component (1,2) of the Direction Cosine Matrix. DCM12 is
used for the following Attitude models: Spinner.
275
Reference Guide Spacecraft Attitude
Field Description
DCM31 Component (3,1) of the Direction Cosine Matrix. DCM31 is
used for the following Attitude models: Spinner.
276
Spacecraft Attitude Reference Guide
Field Description
EulerAngle3 The value of the third Euler angle. EulerAngle3 is used for the
following Attitude models: Spinner.
277
Reference Guide Spacecraft Attitude
Field Description
EulerAngleSequence The Euler angle sequence used for Euler angle input and out-
put..
278
Spacecraft Attitude Reference Guide
Field Description
Q2 Second 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. Q2 is used for the follow-
ing Attitude models: Spinner.
279
Reference Guide Spacecraft Attitude
Field Description
SCClockSpiceKernelName SPK Kernels for spacecraft clock. SPK clock kernels have ex-
tension ".TSC". This field cannot be set in the Mission Se-
quence.
Remarks
GMAT models the orientation and rate of rotation of a Spacecraft using several different math-
ematical models. Different attitude models require different information to fully configure the
model. For example, when you select the CoordinateSystemFixed model, the attitude and body
rates are entirely determined by the CoordinateSystem model and defining Euler angles or an-
gular velocity components are not required and have no effect. The table below describes which
interface elements such as the AttitudeCoordinateSystem, attitude representation, attitude rate
fields among others are required/supported for a given model. Attitude representations fields
include the DCM, EulerAngles, Quaternion, and MRPs (Modified Rodriguez Parameters).
Attitude rate fields include the body angular velocity and the Euler angle rates. If a field is marked
as inactive for a particular model, fields of that type have no effect for that model. Similarly,
fields marked as active do affect the attitude for a particular model.
Attitude Mod- Coord. Sys. Attitude Repressenta- Attitude Rate Euler Sequence
el tion
Spinner Inactive Active Active Active
Coordi- Active Inactive Inactive Active
nate-System-
Fixed
SpiceAttitude Inactive Inactive Inactive Active
Quaternion
The quaternion is a four element, non-singular attitude representation. 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. In assignment mode, you
can set the quaternions element by element like this
aSpacecraft.Q1 = 0.5
aSpacecraft.Q2 = 0.5
aSpacecraft.Q3 = 0.5
aSpacecraft.Q4 = 0.5
280
Spacecraft Attitude Reference Guide
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 between the x, y,
and z body axes and the x, y, and z inertial 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
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 Rodgriques parameters are a modification of the Euer Axis/Angle representation.
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.
281
Reference Guide Spacecraft Attitude
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.
aSpacecraft.AngularVelocityX = 5;
aSpacecraft.AngularVelocityY = 10;
aSpacecraft.AngularVelocityZ = 5;
The CoordinateSystemFixed model allows you to use any existing CoordinateSystem to de-
fine the attitude of a Spacecraft. The attitude uses the axes defined on the CoordinateSystem
to compute the body fixed to inertial matrix and attitude rate parameters such as the angular ve-
locity. To configure this attitude mode, select CoordinateSystemFixed, for Attitude. You can
define the EulerAngleSequence used when outputting EulerAngles and EulerAngle rates.
Warning
For the CoordinateSystemFixed attitude model, the attitude is completely de-
scribed by the selected coordinate system. If you are working in the script, setting
attitude parameters (Euler Angles, Quaternion etc.) or setting attitude rate parame-
ters 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.
282
Spacecraft Attitude Reference Guide
BeginMissionSequence
The Spinner attitude model propagates the attitude assuming the spin axis direction is fixed
in inertial space. 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 ve-
locity. When working with Euler angles, the rotation sequence is determined by the EulerAn-
gleSequence field.
Warning
Caution: If you are working in the script, setting the CoordinateSystem for the
Spinner attitude model has no effect.
283
Reference Guide Spacecraft Attitude
The example below configures a spacecraft to spin about the inertial z axis.
BeginMissionSequence
The SpiceAttitude model propagates the attitude using attitude SPICE kernels. To configure a
Spacecraft to use SPICE kernels select SpiceAttitude for the Attitude field as shown below.
284
Spacecraft Attitude Reference Guide
Warning
Caution: For the SpiceAttitude model, the attitude is completely described by the
spice kernels. When working in the script, setting the CoordinateSystem, 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 kernels, 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.
285
Reference Guide Spacecraft Attitude
The example below configures a Spacecraft to use SPK kernels to propagator the attitude for
Mars Express. The SPK kernels are distributed with GMAT.
Create Spacecraft MarsExpress
MarsExpress.NAIFId = -41
MarsExpress.NAIFIdReferenceFrame = -41001
MarsExpress.Attitude = 'SpiceAttitude'
MarsExpress.OrbitSpiceKernelName = ...
{'../data/vehicle/ephem/spk/MarsExpress_Short.BSP'}
MarsExpress.AttitudeSpiceKernelName = ...
{'../data/vehicle/ephem/spk/MarsExpress_ATNM_PTR00012_100531_002.BC'}
MarsExpress.SCClockSpiceKernelName = ...
{'../data/vehicle/ephem/spk/MarsExpress_MEX_100921_STEP.TSC'}
MarsExpress.FrameSpiceKernelName = ...
{'../data/vehicle/ephem/spk/MarsExpress_MEX_V10.TF'}
286
Spacecraft Attitude Reference Guide
BeginMissionSequence
287
288
Reference Guide
Description
The Spacecraft ballistic and mass properties include the drag and SRP areas and coefficients as
well as the spacecraft dry mass. These quantities are used primarily in orbital dynamics modelling.
Fields
Field Description
Cd The coefficent of drag used to compute the acceleration due to drag.
289
Reference Guide Spacecraft Ballistic/Mass Proper-
ties
Field Description
SRPArea The area used to compute acceleration due to solar radiation pressure.
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 dynamics modelling.
Remarks
Configuring Ballistic and Mass Properties
GMAT uses a cannonball model for drag and SRP. In the cannonball model, the area is assumed
to be independent of the spacecraft’s orientation with respect to the local velocity vector and
the sun vector. For more details on the computation and configuration of drag and SRP models
see the Force Model documentation.
290
Spacecraft Ballistic/Mass Proper- Reference Guide
ties
the total mass of a spacecraft to be negative. However, GMAT will allow the mass of a FuelTank
to be negative. See the FuelTank documentation for details.
Examples
Configure physical properties.
BeginMissionSequence
291
292
Reference Guide
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, coordinate 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.
293
Reference Guide Spacecraft Epoch
Field Description
A1ModJulian The Spacecraft orbit epoch in the A.1 system and the Modified
Julian format.
294
Spacecraft Epoch Reference Guide
Field Description
TAIModJulian The Spacecraft orbit epoch in the TAI system and the Modi-
fied Julian format.
295
Reference Guide Spacecraft Epoch
Field Description
UTCGregorian The Spacecraft orbit epoch in the UTC system and the Gre-
gorian format.
296
Spacecraft Epoch Reference Guide
Field Description
Epoch.TDBGregorian The Spacecraft orbit epoch in the TDB system and the Gre-
gorian format.
297
Reference Guide Spacecraft Epoch
Field Description
Epoch.UTCModJulian The Spacecraft orbit epoch in the UTC system and the Mod-
ified Julian format.
GUI
A change in EpochFormat causes an immediate update to Epoch to reflect the chosen time
system and format.
Remarks
GMAT supports five time systems or scales and two formats:
298
Spacecraft Epoch 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 appropri-
ate, 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 date format, the
leap second appears as a “60th second”: for example, “31 Dec 2008 23:59:60.000”. GMAT will
correctly output this epoch, and will accept it as input. GMAT’s Modified Julian format is based
on an 86,400-second day, however, and will repeat the first second of the following day. Input
of the leap second in Modified Julian format is not supported. (See Release Notes for a known
bug related to this functionality).
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.
299
Reference Guide Spacecraft Epoch
The tai-utc.dat file is periodically updated by the IERS when new leap sec-
onds 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 version 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
Setting the epoch for propagation
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedDays = 1}
300
Reference Guide
Spacecraft Hardware
Add hardware to a spacecraft
Description
The hardware fields allow you to attach pre-configured hardware models to a spacecraft. Current
models include FuelTank and Thruster. 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 command, 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.
As shown below, to add a FuelTank to your script, highlight the Hardware resource and then
right click to add a FuelTank.
301
Reference Guide Spacecraft Hardware
To add a Thruster to your script, highlight the Hardware resource and then right click to add
a Thruster.
302
Spacecraft Hardware Reference Guide
Thus far, we have created both a FuelTank and a Thruster. Next, we attach both the FuelTank
and the Thruster to a particular Spacecraft. To do this, double click on the desired Spacecraft
under the Spacecraft resource to bring up the associated GUI panel. Then click on the Tanks
tab to bring up the following GUI display.
303
Reference Guide Spacecraft Hardware
Next, select the desired FuelTank and use the right arrow button to attach the FuelTank to
the Spacecraft as shown below. Then click the Apply button.
Similarly, to attach a Thruster to a Spacecraft, double click on the desired Spacecraft under
the Spacecraft resource and then select the Actuators tab. Then select the desired Thruster
304
Spacecraft Hardware Reference Guide
and use the right arrow to attach the Thruster to the Spacecraft as shown below. Finally, click
the Apply button.
Remarks
To actually use the Thruster to apply a finite burn to a Spacecraft, additional steps are required.
For example, when you create the Thruster resource, you have to associate a FuelTank with
the Thruster. For details on this and related matters, see the help for the FuelTank, Thruster,
and FiniteBurn resources.
Examples
Create a default Spacecraft. Create FuelTank and Thruster resources and attach them to the
Spacecraft.
BeginMissionSequence
305
306
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 coordinate
systems, for example EarthMJ2000Eq and EarthFixed. GMAT provides three general state
types that can be used with any coordinate system: Cartesian, SphericalAZFPA, and Spher-
icalRADEC. There are three additional state types that can be used with coordinate systems
centered at a celestial body: Keplerian, ModifiedKeplerian, 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 CoordinateSystem and
Epoch fields. There are some limitations when setting the orbital state during initialization,
which are discussed in the section called “Remarks”. We also include examples for setting each
state type in commonly used coordinate systems.
Fields
Field Description
AOP The orbital argument of periapsis expressed in the coordinate system
chosen in the CoordinateSystem field.
307
Reference Guide Spacecraft Orbit State
Field Description
DECV The declination of orbital velocity expressed in the coordinate system
chosen in the CoordinateSystem field.
308
Spacecraft Orbit State Reference Guide
Field Description
EquinoctialP A measure of the orientation of the orbit. EquinoctialP and Equinoc-
tialQ together govern how an orbit is oriented. EquinotialP =
tan(INC/2)*sin(RAAN).
309
Reference Guide Spacecraft Orbit State
Field Description
OrbitSpiceKernel- SPK Kernels for spacecraft orbit. SPK orbit kernels have extension
Name ".BSP". This field cannot be set in the Mission Sequence.
310
Spacecraft Orbit State Reference Guide
Field Description
RAV The right ascension of orbital velocity expressed in the coordinate sys-
tem chosen in the CoordinateSystem field.
311
Reference Guide Spacecraft Orbit State
Field Description
VX The x-component of the Spacecraft velocity with respect to the coor-
dinate system chosen in the spacecraft's CoordinateSystem field.
312
Spacecraft Orbit State Reference Guide
Field Description
Z The z-component of the Spacecraft position with respect to the coor-
dinate system chosen in the spacecraft's CoordinateSystem field.
313
Reference Guide Spacecraft Orbit State
Field Description
Id The spacecraft Id used in tracking data files. This field is only used for
EstimationPlugin protype functionality.
GUI
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 defined 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.
The Keplerian, ModifiedKeplerian, and Equinoctial state types cannot be computed if the
CoordinateSystem does not have a central body at the origin, or if the CoordinateSystem
references the current spacecraft (resulting in a circular reference). For example, if you have
selected the Keplerian state type, coordinate systems for which the Keplerian elements cannot
be computed do not appear in the CoordinateSystem menu. Similarly, if you have selected a
314
Spacecraft Orbit State Reference Guide
CoordinateSystem that does not have a celestial body at the origin, Keplerian-based state types
will not appear as options in the StateType menu.
Remarks
Cartesian State
The Cartesian state is composed of the position and velocity components expressed with re-
spect to the selected CoordinateSystem.
The Keplerian and ModifiedKeplerian state types use the osculating Keplerian orbital ele-
ments with respect to the selected CoordinateSystem. To use either the Keplerian or Modi-
fiedKeplerian 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 Kepler-
ian 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 ele-
ment 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.
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 measured coun-
terclockwise. 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 pointing 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.
315
Reference Guide Spacecraft Orbit State
The Keplerian and ModifiedKeplerian state types have several singularities. The table below
describes the different singularities and how each is handled in the state conversion algorithms.
316
Spacecraft Orbit State Reference Guide
The SphericalAZFPA and SphericalRADEC state types are composed of the polar coordi-
nates of the spacecraft state expressed with respect to the selected CoordinateSystem. The
two spherical representations differ in how the velocity is defined. The SphericalRADEC state
type is composed of the following elements: RMAG, RA, DEC, VMAG, RAV, and DECV.
The SphericalAZFPA state type is composed of the following elements: 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 position
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.
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 velocity
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.
317
Reference Guide Spacecraft Orbit State
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 co-
ordinate 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 periapsis.
EquinoctialH and EquinoctialK together govern how ellipti-
cal an orbit is and where the periapsis is located. EquinotialH
= ECC * sin(AOP).
EquinoctialK A measure of the orbital eccentricity and argument of periapsis.
EquinoctialH and EquinoctialK together govern how elipti-
cal 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 oriented.
EquinotialP = tan(INC/2)*sin(RAAN).
318
Spacecraft Orbit State Reference Guide
Element Description
EquinoctialQ A measure of the orientation of the orbit. EquinoctialP
and EquinoctialQ together govern how an orbit is oriented.
EquinotialQ = tan(INC/2)*cos(RAAN).
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 el-
ements for true retrograde orbits.
ECC > 0.9999999 Equinoctial elements are not defined for parabolic or hyper-
bolic orbits.
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
aSpacecraft.X = 6000
319
Reference Guide Spacecraft Orbit State
MySat.Y = 0
MySat.Z = 1300
MySat.VX = 0
MySat.VY = 7.35
MySat.VZ = 1
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 spec-
ified 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 behavior is identical to
that of the spacecraft orbit dialog box in the GUI. Because the coordinate system in this case
is time varying, changing the spacecraft epoch has resulted in a change in the spacecraft's iner-
tial 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
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).
Examples
Define a Spacecraft’s Earth MJ2000Eq coordinates in the Keplerian representation:
320
Spacecraft Orbit State Reference Guide
aSpacecraft.INC = 30
aSpacecraft.RAAN = 45
aSpacecraft.AOP = 90
aSpacecraft.TA = 270
321
Reference Guide Spacecraft Orbit State
322
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. Spacecraft visualization prop-
erties 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.
323
Reference Guide Spacecraft Visualization Properties
Field Description
ModelRotationY Allows you to perform a fixed rotation of spacecraft's attitude w.r.t Y-
axis of central body's coordinate system.
GUI
The figure below shows the default settings for the Spacecraft Visualization Properties re-
source:
324
Spacecraft Visualization Properties Reference Guide
The GUI interface for Spacecraft Visualization Properties is contained on the Visualization
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 orien-
tation. 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 for-
mat. 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 trans-
late 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 run the mission. See OrbitView resource’s
user-specification document to learn more about OrbitView graphics window.
325
Reference Guide Spacecraft Visualization Properties
Examples
This example shows you how to configure Spacecraft Visualization Properties resource. All
values are non-default values.
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedSecs = 9000}
326
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
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.
327
Reference Guide String
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 resources. The
numeric value of the Variable is converted to a string during the assignment. 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
Creating a string and assigning it a literal value:
BeginMissionSequence
328
Reference Guide
Thruster
A chemical thruster model
Description
The Thruster resource is a model of a chemical thruster which uses polynomials to model the
thrust and specific impulse as a function of tank pressure and temperature. The Thruster model
also allows you to specify properties such as a duty cycle and scale factor and to connect a
Thruster with a FuelTank. You can flexibly define the direction of the thrust by specifying the
thrust components in coordinate systems such as (locally defined) SpacecraftBody or LVLH,
or by choosing any configured CoordinateSystem resource.
Fields
The constants Ci below are used in the following equation to calculate thrust (in Newtons), 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
Thruster. This field cannot be modified in the Mission Sequence
329
Reference Guide Thruster
Field Description
C1 Thrust coefficient.
330
Thruster Reference Guide
Field Description
C7 Thrust coefficient.
331
Reference Guide Thruster
Field Description
C13 Thrust coefficient.
332
Thruster Reference Guide
Field Description
DutyCycle Fraction of time that the thrusters are on during a maneuver. The thrust
applied to the spacecraft is scaled by this amount. Note that this scale
factor also affects mass flow rate.
333
Reference Guide Thruster
Field Description
K4 ISP coefficient.
334
Thruster Reference Guide
Field Description
K10 ISP coefficient.
335
Reference Guide Thruster
Field Description
K16 ISP coefficient.
336
Thruster Reference Guide
Field Description
ThrustDirection3 Z component of the spacecraft thrust vector direction.
Interactions
GUI
The Thruster dialog box allows you to specify properties of a Thruster including the Coor-
dinate System of the thrust acceleration direction vector, the thrust magnitude and Isp coeffi-
cients, and choice of FuelTank. The layout of the Thruster dialog box is shown below.
337
Reference Guide Thruster
When configuring the Coordinate System field, you can choose between existing coordinate
systems or use locally defined coordinate systems. The Axes field is only active 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 accelera-
tion 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.
338
Thruster Reference Guide
Selecting the Edit Thruster Coef. button brings up the following dialog box where you may
input the coefficients for the Thruster polynomial.
339
Reference Guide Thruster
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.
340
Thruster Reference Guide
Remarks
A Thruster resource is used only in association with finite maneuvers. To implement a finite
maneuver, you must first create both a FuelTank and a FiniteBurn resource. You must also
associate a FuelTank with the Thruster 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 documen-
tation for worked examples on how the Thruster resource is used in conjunction with finite
maneuvers.
Unscaled thrust, FT, and Isp, as a function of Pressure, in kPa, and Temperature, in degrees
Celsius, are calculated using the following polynomials.
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 noz-
zle) 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 Thruster
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 sys-
tem, 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
341
Reference Guide Thruster
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 system 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.
MJ2000Eq is the J2000-based Earth-centered Earth mean equator inertial coordinate system.
Note that the Origin sub-field is not needed to define this coordinate system.
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 determine the inertial thrust
direction. Note that the Origin sub-field is not needed to define this coordinate system.
Note also that the form of the Thrust and ISP polynomial has some behavior, when the Refer-
ence Temperature is near 0 degrees Centigrade, that you need to be aware of. Because of the
previously mentioned discontinuity, the polynomials do not vary smoothly when the Reference
Temperature is near zero. For example, consider the two Reference 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 Temperatures have the same magnitude but different signs. You may choose to set the
input Reference Temperature equal to the input Temperature, thus eliminating any dependence
of thrust and ISP with temperature when using the currently implemented FuelTank model
based upon Boyle’s Law where the fuel Temperature does not change as fuel is depleted.
Examples
Create a default FuelTank and a Thruster that allows for fuel depletion, assign the Thruster
the default FuelTank, and attach both the Thruster and FuelTank to a Spacecraft.
342
Thruster Reference Guide
BeginMissionSequence
343
344
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.
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.
345
Reference Guide Variable
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 dou-
ble-precision real number, regardless of whether or not a fractional portion is present.
Examples
Creating a variable and assigning it a literal value:
BeginMissionSequence
BeginMissionSequence
step = 60
totalDuration = 24*60^2 % one day
nSteps = totalDuration / step
346
Reference Guide
VF13ad
The Sequential Quadratic Processor (SQP) optimizer, VF13ad
Description
The VF13ad optimizer is a SQP-based Nonlinear Programming solver available in the Harwell
Subroutine Library. VF13ad performs nonlinear constrained optimization and supports both
linear and nonlinear constraints. To use this solver, you must configure the solver options includ-
ing convergence criteria, maximum iterations, and gradient computation method. In the mission
sequence, you implement an optimizer such as VF13ad by using an Optimize/EndOptimize
sequence. Within this sequence, you define optimization variables by using the Vary command,
and define cost and constraints by using the Minimize and NonlinearConstraint commands
respectively.
Fields
Field Description
FeasibilityTolerance Specifies the accuracy to which you want constraints to be satisfied.
347
Reference Guide VF13ad
Field Description
ReportStyle Determines the amount and type of data written to the message win-
dow and to the report specified by field ReportFile for each iteration
of the solver (When ShowProgress is true). Currently, the Normal,
Debug, and Concise options contain the same information: the val-
ues for the control variables, the constraints, and the objective func-
tion. In addition to this information, the Verbose option also contains
values of the optimizer-scaled control variables.
348
VF13ad Reference Guide
GUI
The VF13ad dialog box allows you to specify properties of a VF13ad 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 VF13ad resource, navigate to the Resources tree, expand the Solvers folder, high-
light 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
VF13ad Optimizer Availability
This optimizer is not included as part of the nominal GMAT installation and is only available if
you have created and installed the VF13ad plug-in.
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
Create a VF13ad resource named VF13ad1.
349
Reference Guide VF13ad
VF13ad1.UseCentralDifferences = false
VF13ad1.FeasibilityTolerance = 1e-003
For an example of how a VF13ad resource can be used within an Optimization sequence, see
the Optimize command examples.
350
Reference Guide
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 XYPlot 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.
351
Reference Guide XYPlot
Field Description
ShowGrid When the ShowGrid field is set to True, then a grid is drawn on an xy-
plot. When the ShowGrid field is set to False, then a grid is not drawn.
This field cannot be modified in the Mission Sequence.
352
XYPlot Reference Guide
Field Description
XVariable Allows the user to define the independent variable for an XYPlot. Only
one variable can be defined as an independent variable. For example, the
line MyXYPlot.XVariable = DefaultSC.A1ModJulian sets
the independent variable to be the epoch of DefaultSC in the A1 time
system and modified Julian format. This field cannot be modified in
the Mission Sequence.
GUI
The figure below shows the default settings for the XYPlot resource:
353
Reference Guide XYPlot
Remarks
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 com-
mands while using the XYPlot resource. Spacecraft’s position magnitude and semi-major-axis
are plotted as a function of time.
BeginMissionSequence
Spacecraft resource contains information about spacecraft’s orbit, its attitude, physical parame-
ters (such as mass and drag coefficient) and any attached hardware, including thrusters and fuel
354
XYPlot Reference Guide
tanks. Spacecraft resource interacts with XYPlot throughout the entire 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.
aXYPlot.XVariable = aSat.ElapsedDays
aXYPlot.YVariables = {}
BeginMissionSequence
Propagate aProp(aSat) {aSat.ElapsedDays = 2}
SolverIterations Description
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 itera-
tions/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 integrator step:
BeginMissionSequence
Plotting data during an iterative process. Notice SolverIterations field is selected as All. This
means all iterations/perturbations will be plotted.
355
Reference Guide XYPlot
BeginMissionSequence
356
Reference Guide
Commands
Table of Contents
Achieve .................................................................................................................... 359
Assignment (=) ......................................................................................................... 361
BeginFiniteBurn ....................................................................................................... 367
BeginMissionSequence .............................................................................................. 373
BeginScript ............................................................................................................... 375
CallMatlabFunction ................................................................................................... 377
ClearPlot .................................................................................................................. 381
EndFiniteBurn ......................................................................................................... 383
Equation .................................................................................................................. 385
For .......................................................................................................................... 387
If ............................................................................................................................ 391
Maneuver ................................................................................................................. 395
MarkPoint ................................................................................................................ 399
Minimize .................................................................................................................. 401
NonlinearConstraint .................................................................................................. 405
Optimize .................................................................................................................. 409
PenUpPenDown ....................................................................................................... 413
Propagate ................................................................................................................. 417
Report ..................................................................................................................... 427
Stop ........................................................................................................................ 431
Target ...................................................................................................................... 433
Toggle ..................................................................................................................... 439
Vary ........................................................................................................................ 443
While ....................................................................................................................... 451
357
358
Reference Guide
Achieve
Specify a goal for a Target sequence
Script Syntax
Achieve SolverName (Goal = Arg1, [{Tolerance = Arg2}])
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 com-
mand 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.
359
Reference Guide Achieve
Option Description
SolverName Specifies the DifferentialCorrector being used in the Target sequence
GUI
You use an Achieve command, which is only valid within a Target sequence, to define your de-
sired 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.
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.
360
Reference Guide
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 assign-
ment operator ('=') to indicate an assignment command. The assignment operator uses the fol-
lowing syntax, where LHS denotes the left-hand side of the operator, 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 parameters 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, Thruster.K1)
• Array or Array element
• mathematical expression (see below)
MATLAB function calls are considered distinct from the assignment command. See the refer-
ence pages for more information.
361
Reference Guide Assignment (=)
GUI
The assignment command in the script language corresponds to the Equation command 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 accepts
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 depen-
dency 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 depen-
dencies are automatically taken to be the current values of the CoordinateSystem field of the
referenced Spacecraft and its origin.
362
Assignment (=) Reference Guide
% 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
Mathematical expressions are recognized by the presence of any of the operators or built-in
functions described below. Before execution, all white space (e.g. spaces and tabs) is removed
from the expression.
Data Types
• literal values
• numeric resources (Variable, Array)
• gettable resource parameters (e.g. Spacecraft.X, Thruster.K1)
• Array elements
• calculation parameters (e.g. Spacecraft.OrbitPeriod)
• nested mathematical expressions
Several of GMAT’s operators and functions are vectorized, so they operate on full Array re-
sources as well as scalar numeric values.
363
Reference Guide Assignment (=)
Operators
Vectorized + Addition or unary plus. X+Y adds X and Y. X and Y must have the same di-
operators mensions unless either is a scalar.
- 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. Op-
erations 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
GMAT supports the following built-in functions in mathematical expressions. Such functions
are either scalar, meaning they accept a single value only, or are matrix functions that operate
on an entire matrix or vector.
364
Assignment (=) 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
365
Reference Guide Assignment (=)
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
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
366
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 Begin-
FiniteBurn command.
367
Reference Guide BeginFiniteBurn
Option Description
EndFiniteBurn - Burn Specifies the FiniteBurn object de-activated by the
EndFiniteBurn command.
GUI
The BeginFiniteBurn and EndFiniteBurn command dialog boxes allow you to implement
a finite burn by specifying which finite burn model should be used and which spacecraft the
finite burn should be applied to. The dialog boxes for BeginFiniteBurn and EndFiniteBurn
are shown below.
368
BeginFiniteBurn Reference Guide
Use the Burn menu to select the FiniteBurn model for the maneuver. Use the Spacecraft text
box to select the spacecraft for the finite burn. You can either type the spacecraft name in the
Spacecraft text box or click the Edit button and select the spacecraft using the ParameterS-
electDialog box.
Remarks
Configuring a Finite Burn
To use the BeginFiniteBurn and EndFiniteBurn commands in your mission sequence, you
must configure a FiniteBurn object along with FuelTank and Thruster objects as shown in
the examples below and as described in these steps:
Warning
Caution: If GMAT throws the error message “Propagator Exception: MassFlow is
not a known propagation parameter on DefaultSC”, then you have not configured
all of the required models to perform a finite burn. See detailed instructions above
and examples to configure models required by the EndFiniteBurn/BeginFinite-
Burn commands.
369
Reference Guide BeginFiniteBurn
The BeginFiniteBurn and EndFiniteBurn commands are NOT branch commands, meaning,
a BeginFiniteBurn command can exist without an EndFiniteBurn command (however, this
may result in depleting all the fuel in the spacecraft model). For behavior when fuel mass is fully
depleted during a finite burn see the FuelTank object.
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 Thruster aThruster
Create FuelTank aTank
Create FiniteBurn aFiniteBurn
Create Propagator aPropagator
BeginMissionSequence
% Create objects
Create Spacecraft aSat
Create Thruster aThruster
Create FuelTank aTank
Create FiniteBurn aFiniteBurn
Create Propagator aPropagator
370
BeginFiniteBurn Reference Guide
aThruster.ThrustDirection1 = 1
aThruster.ThrustDirection2 = 0
aThruster.ThrustDirection3 = 0
BeginMissionSequence
371
372
Reference Guide
BeginMissionSequence
Begin the mission sequence portion of a script
Script Syntax
BeginMissionSequence
Description
The BeginMissionSequence command indicates the end of resource initialization and the be-
ginning of the mission sequence portion of a GMAT script. It must appear once as the first
command in the script, and must follow all resource creation lines.
GUI
The BeginMissionSequence command is managed automatically when building mission se-
quences using the GUI mission tree. However, when editing the GMAT script directly, either
with the GMAT script editor or with an external editor, you must insert the BeginMissionSe-
quence command manually.
Remarks
The BeginMissionSequence is a script-only command that is not needed when working from
the GUI. It indicates to GMAT that the portion of the script above the command consists of
static resource initialization that can be performed in any order, and that the portion below the
command consists of mission sequence commands that must be executed sequentially. This and
other rules of the scripting language are discussed in detail in the script language reference.
Examples
A minimal GMAT script that propagates a spacecraft:
BeginMissionSequence
373
374
Reference Guide
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 win-
dow is a miniature version of the main script editor, and features line numbers, syntax highlight-
ing, code folding, and all of the editing tools available in the full 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 single ScriptEvent when loaded into the GUI, and are saved to a
single BeginScript/EndScript block when saved to a script.
375
Reference Guide BeginScript
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)
376
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 MATLAB
language or provided with the MATLAB software. In the GUI, this is the CallMatlabFunction
command.
When a MATLAB function is called, GMAT opens a MATLAB command-line window in the
background. This functionality requires that MATLAB be properly installed and configured on
your system.
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 selected by
clicking Edit, which displays a parameter selection window. See the Calculation Parameters ref-
erence for details on how to select a parameter.
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.
377
Reference Guide CallMatlabFunction
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 num- double
ber (e.g.
Spacecraft.X,
Variable,
Array ele-
ment)
string (e.g. char array
Spacecraft.UTCGregorian,
String re-
source)
Array re- double array
source
When data is passed from MATLAB to GMAT as output arguments, the following conversions
occur.
MATLAB GMAT
char array string
double real number
double array Array resource
Examples
Call a simple built-in MATLAB function:
378
CallMatlabFunction Reference Guide
BeginMissionSequence
x = 1
[y] = sinh(x)
BeginMissionSequence
% propagate to apoapsis
Propagate aProp(aSat) {aSat.Apoapsis}
BeginMissionSequence
[pathStr] = path
[pwdStr] = pwd
379
380
Reference Guide
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 XY-
Plot subscriber. When more than one subscriber is being used, the sub-
scribers need to be separated by a space.
GUI
Figure below shows default settings for ClearPlot command.
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
381
Reference Guide ClearPlot
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
382
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 Begin-
FiniteBurn command help.
383
384
Reference Guide
Equation
Perform an equation command
Synopsis
Description
The Equation command uses the Equation to make one variable equal to some combination of
previously defined variables and values. It is highly useful for storing values so that they aren't
lost. Additionally, it is very useful for advanced commands.
Options
Arg1 The Arg1 option allows the user to set Arg1 to Arg2.
Default None
Limits Spacecraft Parameter, Array element, Variable, or any other single element
user defined parameter
Units None
Arg2 The Arg2 option allows the user to define Arg1.
Default None
Limits Spacecraft Parameter, Array element, Variable, any other single element
user defined parameter, or a combination of the aforementioned parame-
ters using math operators
Units None
Examples
Script Syntax
GMAT Arg1 = Arg2;
Script Examples
% Setting a variable to a number
GMAT testVar = 24;
% Setting a variable to the value of a math statement
GMAT testVar = (testVar2 + 50)/2;
385
386
Reference Guide
For
Execute a series of commands a specified number of times
Script Syntax
For Index = Start:[Increment:]End
[script statement]
…
EndFor
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 statements
until Index is greater than End. If Start is greater than End, then the script statements 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 Incre-
ment 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.
387
Reference Guide For
Option Description
Increment The Increment parameter is used to compute the arithmetic progression of the
loop Index such that pass i through the loop is Start + i* Increment if the
resulting value satisfies the constraint defined by End.
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.
388
For Reference Guide
Remarks
The values of the Index, Start, Increment, and End parameters can be any of the following
types:
The index specification cannot contain mathematical operators or parentheses. After execution
of the For loop, the value of Index retains its value from the last loop iteration. If the loop does
not execute, the value of Index remains equal to its value before the loop was encountered.
Changes made to the index variable inside of a For loop are overwritten by the For loop state-
ment. For example, the output from the following snippet:
For I = 1:1:3
I = 100
Report aReport I
EndFor
is:
100
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
389
Reference Guide For
For I = J:K:L
J = 1
K = 5
L = 100
Report aReport I
EndFor
is:
2
4
6
8
Examples
Propagate a spacecraft to apogee 3 times:
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
390
Reference Guide
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 commands to
execute if the associated logical expression is false.
GUI
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 elements of those expressions.
The first line automatically contains a default statement:
391
Reference Guide If
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 operator, 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. Dou-
ble-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.
392
If Reference Guide
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, 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.
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.
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
393
394
Reference Guide
Maneuver
Perform an impulsive (instantaneous) maneuver
Script Syntax
Maneuver BurnName (SpacecraftName)
Description
Options
Option Description
ImpulsiveBurn- Allows the user to select which ImpulsiveBurn to apply. As an exam-
Name ple, to maneuver DefaultSC using DefaultIB, the script line would ap-
pear as Maneuver DefaultIB(DefaultSC).
GUI
The Maneuver command dialog box, as shown below, allows you to select which previously
created ImpulsiveBurn should be applied to which Spacecraft.
395
Reference Guide Maneuver
Remarks
Fuel Depletion
To model fuel depletion associated with your chosen ImpulsiveBurn, you must configure the
ImpulsiveBurn object as follows:
Interactions
Examples
Create a default Spacecraft and FuelTank and attach the FuelTank to the Spacecraft. Perform
a 100 m/s impulsive maneuver in the Earth VNB-V direction.
396
Maneuver Reference Guide
Create ImpulsiveBurn IB
IB.CoordinateSystem = Local
IB.Origin = Earth
IB.Axes = VNB
IB.Element1 = 0.1
IB.Element2 = 0
IB.Element3 = 0
IB.DecrementMass = true
IB.Tank = {FuelTank1}
IB.Isp = 300
IB.GravitationalAccel = 9.810000000000001
BeginMissionSequence
% Apply impulsive maneuver to DefaultSC
Maneuver IB(DefaultSC)
397
398
Reference Guide
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 sin-
gle 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:
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
399
Reference Guide MarkPoint
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
400
Reference Guide
Minimize
Define the cost function to minimize
Script Syntax
Minimize OptimizerName (ObjectiveFunction)
Description
Options
Option Description
ObjectiveFunction Specifies the objective function that the optimizer will try to minimize.
GUI
Double click on Minimize1 to bring up the Minimize command dialog box shown below..
401
Reference Guide Minimize
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
Number of Vary, NonlinearConstraint, and Minimize Commands With-
in an Optimization Sequence
An Optimization sequence must contain one or more Vary commands. Vary commands must
occur before any Minimize or NonlinearConstraint commands.
Command Interactions
The Minimize command is only used within an Optimize/EndOptimize Optimization se-
quence. See the Optimize command documentation for a complete worked example using the
Minimize command.
Vary command Every Optimization sequence must contain at least one Vary command.
Vary commands are used to define the control variables associated with
an Optimization sequence.
NonlinearConstraint NonlinearConstraint commands are used to define the constraints
command (i.e., goals) associated with an Optimization sequence. Note that multi-
ple NonlinearConstraint commands are allowed within an Optimiza-
tion sequence.
Optimize command A Minimize command can only occur within an Optimize/EndOp-
timize command sequence.
Examples
% Minimize the eccentricity of Sat, using SQP1
Minimize SQP1(Sat.ECC)
402
Minimize Reference Guide
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 Minimize com-
mand.
403
404
Reference Guide
NonlinearConstraint
Specify a constraint used during optimization
Script Syntax
NonlinearConstraint OptimizerName ({logical expression})
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
405
Reference Guide NonlinearConstraint
Option Description
RHS Allows you to select any single element user defined parameter, includ-
ing a number, to specify the desired value of the constraint variable.
The constraint function is of the form LHS Operator RHS
GUI
You use a NonlinearConstraint command, within an Optimize/EndOptimize sequence as
shown below, to define an equality or inequality constraint that you want to be satisfied at the
end of the optimization process.
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 con-
straint 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
Remarks
Number of Vary, NonlinearConstraint, and Minimize Commands With-
in an Optimization Sequence
An Optimization sequence must contain one or more Vary commands. Vary commands must
occur before any Minimize or NonlinearConstraint commands.
406
NonlinearConstraint Reference Guide
Command Interactions
The Minimize command is only used within an Optimize/EndOptimize Optimization se-
quence. See the Optimize command documentation for a complete worked example using the
NonlinearConstraint command.
Examples
% Constrain SMA of Sat to be 7000 km, using SQP1
NonlinearConstraint SQP1( Sat.SMA = 7000 )
407
408
Reference Guide
Optimize
Solve for condition(s) by varying one or more parameters
Script Syntax
Optimize SolverName [{[SolveMode = value], [ExitMode = value]}]
Vary command …
script statement …
NonlinearConstraint command …
Minimize command …
EndOptimize
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 FminconOptimizer
solver object available to all GMAT users with access to the Matlab optimization 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 de-
termine, for example, the maneuver components required to raise orbit apogee to 42164 km
while simultaneously minimizing the DeltaV required to do so. Optimize sequences in GMAT
are applicable to a wide variety of problems and this is just one example. Let’s define the quanti-
ties 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/End-
Target 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.
Options
Option Description
ApplyCorrections The ApplyCorrections GUI button replaces the initial guess values
specified in the Vary commands with those computed by the optimizer
during a run. If the Optimize sequence converged, the converged val-
ues are applied. If the Optimize sequence did not converge, the last cal-
culated values are applied. There is one situation where the action spec-
ified above, where the initial guess values specified in the Vary com-
mands are replaced, does not occur. This happens when the initial guess
value specified in the Vary command is given by a variable.
409
Reference Guide Optimize
Option Description
ExitMode Controls the initial guess values for Optimize sequences nested in con-
trol flow. If ExitMode is set to SaveAndContinue, the solution of
an Optimize sequence is saved and used as the initial guess for the next
time this Optimize sequence is run. The rest of the mission sequence is
then executed. If ExitMode is set to DiscardAndContinue, then the
solution is discarded and the initial guess values specified in the Vary
commands are used for each Optimize sequence execution. The rest
of the mission sequence is then executed. If ExitMode is set to Stop,
the Optimize sequence is executed, the solution is discarded, and the
rest of the mission sequence is not executed.
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 auto-
matically added as shown below.
In the example above, the Optimize command sequence is defined as all of the commands be-
tween 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
410
Optimize Reference Guide
variables that can be varied in order to help solve our problem. 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.
Remarks
Content of an Optimize/EndOptimize Sequence
An Optimize/EndOptimize sequence must contain at least one Vary command and at least
one of the following commands: NonlinearConstraint and Minimize. See the Vary, Nonlin-
earConstraint, and Minimize command sections for details on the syntax for those commands.
The first Vary command must occur before the first NonlinearConstraint or Minimize com-
mand. Each Optimize 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 Optimize configuration fields
such as SolveMode and ExitMode.
Command Interactions
Vary command Every Optimize sequence must contain at least one Vary command.
Vary commands are used to define the control variables associated with
an Optimize sequence.
NonlinearConstraint NonlinearConstraint commands are used to define the constraints
command associated with an Optimize sequence. Note that multiple Nonlin-
earConstraint commands are allowed within an Optimize sequence.
411
Reference Guide Optimize
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 com-
ponent of an ImpulsiveBurn object, and the single constraint that the position vector magni-
tude 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 addi-
tion, 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 assumes that you have installed this optional plug-in.
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
412
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 GroundTrackPlot sub-
scribers. 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
413
Reference Guide PenUpPenDown
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 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 PenDown 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 subscribers.
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 propa-
gation and then data is drawn for third day of the propagation:
414
PenUpPenDown Reference Guide
aPlot.XVariable = aSat.ElapsedDays
aPlot.YVariables = {aSat.Earth.SMA}
BeginMissionSequence
This example shows how to use PenUp and PenDown commands on a single XYPlot sub-
scriber. 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
If I == 960
PenDown aPlot1
EndIf
GMAT I = I +1
EndWhile
415
416
Reference Guide
Propagate
Propagates spacecraft to a requested stopping condition
Script Syntax
The Propagate command is a complex command that supports multiple Propagators, multiple
Spacecraft, and multiple stopping conditions. In the syntax definition below, SatList is a comma
separated list of spacecraft and StopList is a comma separated list of stopping conditions. The
general syntax of the Propagate command is:
or
Most applications propagate a single Spacecraft, forward, to a single stopping condition. In that
case, the syntax simplifies to:
Propagate PropagatorName(SatName,{StopCond});
or
Propagate PropagatorName(SatName){StopCond};
Description
The Propagate command controls the time evolution of spacecraft. GMAT allows you to propa-
gate single Spacecraft, multiple non-cooperative Spacecraft, and Formations in a single Prop-
agate command. The Propagate command is complex and controls the following aspects of
the temporal modelling of spacecraft:
417
Reference Guide Propagate
Options
Option Description
Mode Optional flag to time-synchronize propagation of Spacecraft per-
formed by multiple Propagators in a single Propagate command. See
the section called “Remarks” for more details.
418
Propagate Reference Guide
Option Description
StopTolerance Tolerance on the stopping condition root location. See the section
called “Remarks” for more details.
GUI
Introduction
The Propagate command GUI provides an interface to assign Spacecraft to Propagators used
for propagation and to define a set of conditions to terminate propagation. The GUI also allows
you to define the direction of propagation, the synchronization mode for multiple spacecraft,
and whether or not to propagate the STM and compute the A-Matrix.
To follow the examples below, you can load the following script snippet or create a new mis-
sion with three spacecraft (named sat1, sat2, and sat3) and two propagators (named prop1 and
prop2).
419
Reference Guide Propagate
1. In the Propagator list, click the ellipsis button in the second row to open the Propagator
Select Dialog.
420
Propagate Reference Guide
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.
4. In the Parameter list, click the ellipsis button in the second row to bring up the Parameter
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.
421
Reference Guide Propagate
Remarks
Introduction
The Propagate command documentation below describes how to propagate single and multi-
ple Spacecraft to desired conditions forward and backwards in time. To streamline the script
examples, the objects numSat, spkSat, numProp, and spkProp are assumed to be configured
as shown below. GMAT is distributed with the SPK kernels used in the examples.
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 propagate a single Spacecraft using a Propagator configured to use an SPK kernel use the
following:
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 Propagator docu-
mentation for more information on step size control.
Propagate numProp(numSat)
% or
Propagate spkProp(spkSat)
422
Propagate Reference Guide
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 Propa-
gate command configured above propagates all Spacecraft until Sat1 reaches Earth periapsis.
All Spacecraft propagated by the same Propagator are time synchronized during propagation.
By time synchronization, we mean that all Spacecraft are propagated across the same time step.
The Synchronized keyword tells GMAT to keep Spacecraft propagated by different Propa-
gators synchronized in time during propagation. Time synchronization among multiple Prop-
agators is performed by taking a single step for all Spacecraft controlled by the first Propaga-
tor (Prop1 in the above example), and then stepping all other Propagators to that time. When
the Synchronized keyword is omitted, 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
synchronization 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:
A second approach is to define a comma separated list of stopping conditions at the end of the
Propagate command like this.
423
Reference Guide Propagate
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.
The Propagate command currently requires that the left hand side of a stopping condition 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 propagate 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 function, 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 sat-
isfied and provides information on the achieved stopping value and the requested
tolerance.
Note: GMAT does not currently support tolerances on a per stopping condition ba-
sis. If you include StopTolerance multiple times in a single Propagate 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 condition 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 command. 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 be-
fore attempting to locate the stopping condition again. In the FSA, SafetyFactor = 10, and the
StopTolerance is from the second Propagate command. Continuing with the example above,
if abs(TA_Achieved - TA_Desired) < 1e-3 -- where TA_Achieved is the TA after the first Prop-
agate command and TA_Desired is the requested value of TA in the second Propagate com-
mand -- then the Propagate command will take one step before attempting to locate the stop-
ping condition. The first step algorithm works the same way for forward propagation, backwards
propagation, and changing propagation directions.
424
Propagate 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 conditions may not
behave as desired. For the FSA algorithm to work as designed, you must provide
StopTolerance values that are achievable.
GMAT does not currently support propagating the STM when propagating Formation re-
sources or when using SPK type propagators.
Examples
Propagate a single Spacecraft to Earth periapsis
BeginMissionSequence
425
Reference Guide Propagate
BeginMissionSequence
BeginMissionSequence
Propagate two Spacecraft, each using a different Propagator, but keep the Spacecraft syn-
chronized in time. Propagate until either Spacecraft reaches a mean anomaly of 45 degrees.
BeginMissionSequence
426
Reference Guide
Report
Allows you to write data to a text file
Script Syntax
Report ReportName DataList
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 sequence.
GMAT allows you to insert Report command into the Mission tree at any location. 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 ReportFile
for data output.
GUI
Figure below shows default settings for Report command:
427
Reference Guide Report
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
Report user-defined parameters such as variables, array elements and a string to a report file
using the Report command.
428
Report Reference Guide
BeginMissionSequence
While spacecraft propagates for less than a day, report spacecraft's true anomaly, eccentricity and
altitude after every 3600 seconds using the Report command:
BeginMissionSequence
429
430
Reference Guide
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 command 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 windows, Ground-
TrackPlot 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 en-
countered.
Examples
Stopping the execution of a script between commands:
BeginMissionSequence
BeginMissionSequence
431
Reference Guide Stop
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)
432
Reference Guide
Target
Solve for condition(s) by varying one or more parameters
Script Syntax
Target SolverName [{[SolveMode = value], [ExitMode = value]}]
Vary command …
script statement …
Achieve command …
EndTarget
Note
See the section called “Remarks” and the section called “Description” for this com-
plex command. Multiple Vary and Achieve commands are permitted. Script state-
ments can appear anywhere in the Target sequence.
Description
The Target and EndTarget commands are used to define a Target sequence to determine, for
example, the maneuver components required to raise the orbit apogee to 42164 km. Another
common targeting example is to determine the parking orbit orientation 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 conditions 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.
Options
Option Description
ApplyCorrections This GUI button replaces 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. 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 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.
433
Reference Guide Target
Option Description
ExitMode Controls the initial guess values for Target sequences nested in control
flow. If ExitMode is set to SaveAndContinue, the solution of a Tar-
get sequence is saved and used as the initial guess for the next Target
sequence execution. The rest of the mission sequence is then execut-
ed. If ExitMode is set to DiscardAndContinue, then the solution is
discarded and the initial guess values specified in the Vary commands
are used for each Target sequence execution. The rest of the mission
sequence is then executed. If ExitMode is set to Stop, the Target se-
quence is executed, the solution is discarded, and the rest of the mission
sequence is not executed.
GUI
The Target command allows you to use a differential correction process to solve problems. 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 EndTarget command is auto-
matically added as shown below.
434
Target Reference Guide
In the example above, the Target command sequence is defined as all of the commands be-
tween the Target1 and End Target1 commands, inclusive. Although not shown above, a Tar-
get 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 define 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 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.
Remarks
Content of a Target/EndTarget Sequence
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 EndTarget 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.
435
Reference Guide Target
than the number of constraints) and under-determined problems (the number of Control Vari-
ables 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 selection of the targeter (currently, only differ-
ential correctors are supported). Assuming a solution to the problem exists and assuming cer-
tain mathematical conditions are satisfied, there is often one solution for a square problem and
many solutions to an under-determined 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 navigating
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 replaces 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 illustrated 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 commands
mand are used to define the control variables associated with a Target sequence.
Achieve Every Target sequence must contain at least one Achieve command. Achieve
command commands are used to define the goals associated with a Target sequence.
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
436
Target Reference Guide
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 magnitude at orbit
apogee is 42164.
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
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.
BeginMissionSequence
437
Reference Guide Target
438
Reference Guide
Toggle
Allows you to turn data output off or on
Script Syntax
Toggle OutputNames Arg
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 se-
lect 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 Re-
portFile, XYPlot, OrbitView, GrounTrackPlot or EphemerisFile
to be toggled. When more than one subscriber is being toggled, they
need to be separated by a space.
GUI
Figure below shows default settings for Toggle command:
439
Reference Guide Toggle
Remarks
The subscribers such as ReportFile, XYPlot, OrbitView, GroundTrackPlot and Ephemer-
isFile report or plot data at each propagation step of the entire mission duration. If you want to
report data to any of these subscribers at specific points in your mission, then a Toggle On/Off
command can be inserted into the mission sequence to control when a subscriber reports or
plots data. For example, when a 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.
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
This example shows how to use Toggle Off and Toggle On commands while using the Re-
portFile resource. Spacecraft’s cartesian position vector is reported to the report file. Report file
is turned off for the first day of the propagation:
440
Toggle Reference Guide
aSat.EarthMJ2000Eq.Y aSat.EarthMJ2000Eq.Z}
BeginMissionSequence
This example shows how to toggle multiple subscribers. Toggle Off and Toggle On commands
are used on multiple subscribers like ReportFile, XYPlot and EphemerisFile. Subscribers are
turned off for first 3 days of the propagation:
BeginMissionSequence
441
442
Reference Guide
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 command.
The Vary command defines the control variable used by the targeter or optimizer. 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 variable.
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-dimensional parame-
ter. xd is the dimensional parameter. a= additive scale factor.
m= multiplicative scale factor.) Note the nondimensionaliza-
tion process occurs after the perturbation to the control vari-
able has been applied. Thus, xd represents a perturbed control
variable.
443
Reference Guide Vary
Option Description
InitialGuess Specifies the initial guess for the selected Variable
444
Vary Reference Guide
Option Description
MultiplicativeScaleFactor Number used to nondimensionalize the independent variable.
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-dimensional parame-
ter. xd is the dimensional parameter. a= additive scale factor.
m= multiplicative scale factor.) Note the nondimensionaliza-
tion process occurs after the perturbation to the control vari-
able has been applied. Thus, xd represents a perturbed control
variable.
445
Reference Guide Vary
Option Description
Upper The Upper option (only used for the DifferentialCorrec-
tor and FminconOptimizer solvers) is used to set the upper
bound of the control Variable. Lower must be less than Upper.
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.
446
Vary Reference Guide
Remarks
Vary Command Options
The Vary command is designed to work with all three of the GMAT targeters and optimizers
(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.
447
Reference Guide Vary
The Vary syntax allows you to specify the value of an option even if a particular solver would
not use the information.
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
448
Vary Reference Guide
Examples
As mentioned above, the Vary command only occurs within either a Target or an Optimize
sequence. See the Target and Optimize command help for examples showing the use of the
Vary command.
449
450
Reference Guide
While
Execute a series of commands repeatedly while a condition is met
Script Syntax
While logical expression
[script statement]
…
EndWhile
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.
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:
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, 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.
451
Reference Guide While
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.
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, 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.
452
While Reference Guide
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.
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
Propagate a spacecraft until it reaches a predefined altitude, reporting data at each periapsis
crossing:
BeginMissionSequence
453
454
Reference Guide
System
Table of Contents
Calculation Parameters .............................................................................................. 457
Command-Line Usage ............................................................................................... 481
MATLAB Interface .................................................................................................. 483
Script Language ........................................................................................................ 487
Startup File .............................................................................................................. 499
455
456
Reference Guide
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.
Central-body-dependent parameters, as the name suggests, have a value that is dependent on the
chosen celestial body. The Altitude parameter of Spacecraft is an example of this. To reference
this parameter, you must specify a central body, such as Spacecraft.Mars.Altitude. Any
built-in central body or user-defined Asteroid, Comet, Moon, or Planet is valid as a dependen-
cy. If the dependency is omitted, Earth is assumed.
The individual parameters are resource-specific, and are documented in the tables below. 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 ReportFile
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 allows for interactive
parameter selection. A basic ParameterSelectDialog window looks like the following:
457
Reference Guide Calculation Parameters
The ParameterSelectDialog window is used to build a parameter, along with any dependencies,
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 ParameterSelectDialog 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.
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. Five types can appear in this list: Spacecraft, ImpulsiveBurn, Vari-
able, Array, and String.
Once you've selected a type, The Object List box is populated with all existing resources 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 Object List.
This list displays any hardware (such as FuelTank 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 them-
selves 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 select-
ing the Spacecraft Apoapsis parameter, a Central Body list appears. 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 parameters, 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
458
Calculation Parameters Reference Guide
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 allowed).
• ->: 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 argument) only
accept a single parameter as input; in this context the ParameterSelectDialog 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.
In the Propagate command Parameter argument, only parameters of Spacecraft can be used.
In this case only Spacecraft will be shown in the Object Type list.
Parameters
Spacecraft
459
Reference Guide Calculation Parameters
460
Calculation Parameters Reference Guide
461
Reference Guide Calculation Parameters
462
Calculation Parameters Reference Guide
463
Reference Guide Calculation Parameters
464
Calculation Parameters Reference Guide
465
Reference Guide Calculation Parameters
466
Calculation Parameters Reference Guide
467
Reference Guide Calculation Parameters
468
Calculation Parameters Reference Guide
469
Reference Guide Calculation Parameters
470
Calculation Parameters Reference Guide
471
Reference Guide Calculation Parameters
FuelTank
FuelTank parameters are accessible only after attaching the FuelTank resource to a Spacecraft,
like so:
Create FuelTank aTank
Create Spacecraft aSat
aSat.Tanks = {aTank}
Then, FuelTank parameters are accessible by specifying the FuelTank name as the parameter
dependency:
Create ReportFile aReport
aReport.Add = {aSat.aTank.FuelMass}
472
Calculation Parameters Reference Guide
Thruster
Thruster parameters are accessible only after attaching the Thruster resource to a Spacecraft,
like so:
Then, Thruster parameters are accessible by specifying the Thruster name as the parameter
dependency:
473
Reference Guide Calculation Parameters
474
Calculation Parameters Reference Guide
475
Reference Guide Calculation Parameters
476
Calculation Parameters Reference Guide
ImpulsiveBurn
477
Reference Guide Calculation Parameters
Examples
Using parameters in the Mission Sequence:
BeginMissionSequence
Create Variable i
BeginMissionSequence
478
Calculation Parameters Reference Guide
BeginMissionSequence
479
480
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.
Options
-h, --help
Start GMAT and display command-line usage information in the message window.
-m, --minimize
Start GMAT with a minimized interface.
-r, --run
Automatically run the specified script after loading.
-v, --version
Start GMAT and display version information in the message window.
-x, --exit
Exit GMAT after running the specified script. This option has no effect if specified alone.
Examples
Start GMAT and run the script MyScript.script:
GMAT MyScript.script
481
482
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 de-
claring a MATLAB function, see the MatlabFunction reference. For details on calling a func-
tion 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.
The Close menu item causes GMAT to close any open connection to the MATLAB Engine. If
no connection is open, it has no effect.
483
Reference Guide MATLAB Interface
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.
• A compatible, licensed version of MATLAB must be installed on the same machine on which
GMAT is running. GMAT is tested with the latest version of MATLAB at the time of release,
though versions R2006b and newer have been known to work.
• The architecture (32-bit or 64-bit) of GMAT and the installed version of MATLAB must
match. For example, the 32-bit version of GMAT is compatible only with the 32-bit version
of MATLAB.
• On Windows:
• The following path (where MATLAB is the path to the installed version of MATLAB) must
be present in the Path environment variable. For some older versions of MATLAB, this
path must be present before the default Windows paths.
• MATLAB must be registered as a COM server. This is done automatically by the MATLAB
installer. To do it manually, open an elevated command window and run the command:
matlab -regserver. Make sure the proper instance of MATLAB is being run by this
command.
• On Mac OS X:
• The MATLABFORGMAT environment variable must exist and contain the full
path to the MATLAB application bundle (e.g. /Applications/MATLAB_R2010a/
MATLAB_R2010a.app).
Note that 64-bit GMAT must be used to interface with MATLAB after version R2010a.
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.
484
MATLAB Interface Reference Guide
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 avail-
able by right-clicking the Matlab item in the Resources tree.
Examples
See the MatlabFunction reference for common examples.
485
486
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 state-
ments:
Only literal assignments are allowed in this section; no execution of commands or evaluation 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 resources in the GUI when the
script is loaded.
Mission Sequence
The Mission Sequence section contains the Mission Sequence, or the list of GMAT commands
that are executed sequentially when the mission is run. The Mission Sequence section can contain
the following types of statements:
• command statements
487
Reference Guide Script Language
The Mission Sequence begins at the first instance of the BeginMissionSequence command;
therefore, this must be the first command statement in the script file. For backwards compati-
bility, 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 statement in
the script (with the exception of the BeginScript/EndScript compound command) 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:
When loading a script with tab characters into the GUI, all tabs are converted to spaces internally.
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.
488
Script Language Reference Guide
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 normalizing the
slashes.
Relative paths are considered relative 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.
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 prepend-
ed signs (+ or -) are allowed. Scientific notation is not permitted.
Real Numbers
• 12 (whole number)
• 12.5 (decimal)
• 1.25e1 or 1.25e-1 (scientific notation)
In all formats, the base can contain preceding or trailing zeros. In scientific notation, the expo-
nent 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:
489
Reference Guide Script Language
Quotes are generally optional, but are mandatory in Initialization if the string contains white-
space, any script language symbols, or any GMAT-recognized elements (e.g. keywords, resource
names). They are mandatory in the Mission Sequence in the same instances, and additionally if
the string contains mathematical operators and certain non-printable characters. We recommend
quoting all string literals.
Booleans
Enumerated Values
Many resource fields accept enumerated values. For example, Spacecraft.DateFormat accepts
one of 10 values (A1ModJulian, A1Gregorian, etc.). Enumerated values are written as string
literals. Quotes are always optional, as none contain spaces or special characters.
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 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
490
Script Language Reference Guide
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.
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 exception: 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.
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 argument
“Spacecraft” refers to the resource type, not the resource instance created in the first state-
ment.
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 sepa-
rated 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 auto-
matically converted to the equivalent floating-point value upon execution.
491
Reference Guide Script Language
There is no built-in conversion between string values and numeric values, though such a con-
version may be implemented by individual commands.
Keywords
• Create
• GMAT
• 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 in-
dividual 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
492
Script Language Reference Guide
| logical OR
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 syn-
tactic validity.
Logical Expressions
Logical expressions are composed of relational expressions combined with logical operators.
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 expres-
sions are combined using logical operators. All relational expressions are evaluated 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. Parentheses 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
Script statements consist of (in order):
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 marker, 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 semicolon
is optional and has no effect, but is supported for backward compatibility. Multiple statements
cannot be combined on a line.
493
Reference Guide Script Language
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 exceptions are noted
in the documentation specific to that statement.
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
4. Equal character (“=”, hex: 3D)
5. Initial field value
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
494
Script Language Reference Guide
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 Sequence
section of the script. One special command, BeginMissionSequence, initiates the Mission Se-
quence.
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.
The command name is the name of the command being invoked (e.g. Propagate or Begin-
FiniteBurn). The command name is mandatory with one exception: the assignment 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 char-
acters (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
495
Reference Guide Script Language
made up of the command name and an ID number. For example, if the third Propagate com-
mand 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 arguments 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
The body of a compound command may consist of independent command statements, possibly
including other compound statements. Certain compound commands may limit the commands
that can be present in the body, while other commands may only be contained within certain
compound commands. These limitations are documented separately for each command.
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 interprets 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
496
Script Language Reference Guide
encounters an initialization line, it assigns the appropriate 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 exam-
ple, 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 example,
Create statements must appear in the script above any initialization statements that reference the
resource being created. But because validation is performed separately, 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
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 sequen-
tially, in the order of definition in the script. When a command statement is executed, its argu-
ments 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, EarthFixed,
EarthICRF
497
Reference Guide Script Language
If an error is encountered during the execution stage (linking or command execution), execution
of the mission stops at the point of the error.
498
Reference Guide
Startup File
The gmat_startup_file.txt configuration file
Description
The GMAT startup file (gmat_startup_file.txt) contains basic configuration settings for
the GMAT application. This includes the locations of data files and plugins, search paths for
user-defined functions, and various options that control execution.
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 initial-
ization.
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 fol-
lowing 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.
The behavior of duplicate property entries is dependent on the individual property. In general:
499
Reference Guide Startup File
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 normalizing 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.
Output
EPHEM_PATH=OUTPUT_PATH/
Default output directory path for EphemerisFile resources.
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 plu-
gin.
500
Startup File Reference Guide
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”.
Data 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.
DATA_PATH=ROOT_PATH/data/
Path to directory containing data files.
DE_PATH=DATA_PATH/planetary_ephem/de/
Path to directory containing DE ephemeris 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.
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=TIME_PATH/naif0010.tls
Path to SPICE leap second kernel.
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_SPK_FILE
Path to SPICE ephemeris kernel for default celestial bodies.
501
Reference Guide Startup File
SPK_PATH
Path to directory containing SPICE ephemeris kernels
TIME_PATH=DATA_PATH/time/
Path to directory containing leap-second files.
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.
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.
MODEL_PATH=DATA_PATH/vehicle/models/
Path to directory containing 3D spacecraft models.
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_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.
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. Accepted
values are ON and OFF.
502
Startup File Reference Guide
Debug Settings
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, automatically
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.
503
504
Release Notes
GMAT R2013a Release Notes ................................................................................... 505
GMAT R2012a Release Notes ................................................................................... 509
GMAT R2011a Release Notes ................................................................................... 515
Licensing
GMAT is now licensed under Apache License, Version 2.0. According to the Open Source Pro-
liferation 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 spec-
ifications 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 detailed informa-
tion on syntax or application-specific examples, go here. For each GMAT resource (e.g. Space-
craft, Thruster, XYPlot) and command (e.g. Optimize, Propagate), the following information
is documented:
505
Release Notes
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 performed
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:
506
Release Notes
• Improved mouse controls for interactive 3-D graphics. See the OrbitView reference for de-
tails.
• 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 all cases, we modified GMAT to work correctly as specified in the documentation, but did not
always maintain backwards compatibility with previous versions. This was a one-time, “pull-of-
the-Band-Aid” approach, and future releases will maintain backwards compatibility with R2013a
or provide deprecation notifications of features that are no longer supported.
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.
507
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 func-
tions
GMT-3108 OrbitView with STM and Propagate Synchronized does not show spacecraft in
correct locations
GMT-3289 First step algorithm fails for backwards propagation using SPK propagator
GMT-3321 MATLAB uses stale version of function if command window isn't restarted be-
tween 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 mis-
sion sequence
508
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 re-
source. This view shows the orbital path of one or more spacecraft projected onto a two-dimen-
sional 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
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.
509
Release Notes
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 EclipseLocator resource that can
be configured to calculate eclipse entry and exit times and durations with respect to any config-
ured 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.
510
Release Notes
C Interface [alpha]
Likewise, we've included an experimental library and plugin that exposes a plain-C interface 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 propagation 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 Propa-
gator.
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'
There's also a new SolarSystem resource called SolarSystemBarycenter that represents the
barycenter as given by the chosen ephemeris source (DE405, DE421, SPICE, etc.). This resource
can be used directly in reports or as the origin of a user-defined coordinate system.
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
511
Release Notes
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.
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 Sum-
mary types.
512
Release Notes
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.
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 Microsoft
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 testing. 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 "Getting 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.
513
Release Notes
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.
Compatibility Changes
Application Control Changes
The command-line arguments for the GMAT executable have changed. See the following table
for replacements.
All known issues that affect this version of GMAT can be seen in the "Known issues in R2012a"
report in JIRA.
514
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 need-
ed. Here's a sample of what can be done with the new graphics:
515
Release Notes
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
• SPK/BSP (orbit)
• 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:
516
Release Notes
libMatlabPlugin Beta
libFminconOptimizer (Windows only) Beta
libGmatEstimation Alpha (preview)
Plugins can be enabled or disabled through the startup file (gmat_startup_file.txt), lo-
cated in the GMAT bin directory. All plugins are disabled by default.
GUI/Script Synchronization
For those that work with both the script and the graphical interface, GMAT now makes it ex-
plicitly 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 characters on the GMAT
toolbar).
Estimation [Alpha]
GMAT R2011a includes significant new state estimation capabilities in the libGmatEstimation
plugin. The included features are:
• Measurement models
• Geometric
• TDRSS range
• USN two-way range
• Estimators
• Batch
• Extended Kalman
• Resources
• GroundStation
• Antenna
• Transmitter
• Receiver
• Transponder
Note
This functionality is alpha status, and is included with this release as a preview only.
It has not been rigorously tested.
517
Release Notes
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
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:
518
Release Notes
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 Smart-
Bear TestComplete tool. This testing occurs approximately twice a week, and is focused on en-
tering and running complete missions through the interface and checking that the results match
those generated in script mode.
Visual Improvements
519
Release Notes
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 release
a warning is generated if this statement is missing.
The following syntax elements are deprecated, and will be removed in a future release:
ImpulsiveBurn
FiniteBurn V Element1
ImpulsiveBurn N Element2
B Element3
520
Release Notes
ViewDirection = [0 0
1]
OrbitView ViewPointRef ViewPointReference
OrbitView ViewPointRef = Vector ViewPointReference =
[0 0 1]
ViewPointRefVector =
[0 0 1]
OrbitView ViewPointVector = ViewPointVector = [0 0
Vector 1]
ViewPointVectorVector
= [0 0 1]
SolarSystem Ephemeris EphemerisSource
Spacecraft StateType DisplayStateType
Thruster X_Direction ThrustDirection1
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.
521
Release Notes
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.
Table 15. Multiple platforms
522
Release Notes
Table 16. Windows
Table 17. Mac OS X
523
Release Notes
Table 18. Linux
1851 On Linux, STC Editor crashes GMAT on
Close
1877 On Linux, Ctrl-C crashes GMAT if no
MDIChildren are open
524
I
Index If, 391
ImpulsiveBurn, 205
A Installation, 7
Achieve, 359
Array, 123 L
Assignment, 361 LibrationPoint, 211
B M
Barycenter, 127 Maneuver, 395
BeginFiniteBurn, 367 MarkPoint, 399
BeginMissionSequence, 373 MatlabFunction, 215
BeginScript, 375 MATLAB Interface, 483
Minimize, 401
Mission Tree, 17
C
Calculation Parameters, 457 N
CallMatlabFunction, 377 NonlinearConstraint, 405
CelestialBody, 131 Numerical Integrator, 235
ClearPlot, 381
Command-Line Usage, 481 O
Command Summary, 25
Optimize, 409
CoordinateSystem, 141
OrbitView, 219
Output Tree, 27
D
DifferentialCorrector, 155 P
PenDown, 413
E PenUp, 413
Else, 391 Propagate, 417
EndFiniteBurn, 383 Propagator, 235
EndFor, 387
EndIf, 391 R
EndScript, 375 Report, 427
EndTarget, 433 ReportFile, 259
EndWhile, 451 Resources Tree, 14
EphemerisFile, 159
Equation, 361, 385 S
Sample Missions, 8
F Script Editor, 27
FiniteBurn, 169 ScriptEvent, 375
FminconOptimizer, 173 Script Language, 487
For, 387 SolarSystem, 267
Force Model, 242 Spacecraft, 271
Formation, 179 Spacecraft Attitude, 273
FuelTank, 181 Spacecraft Ballistic/Mass Properties, 289
Spacecraft Epoch, 293
Spacecraft Hardware, 301
G Spacecraft Orbit State, 307
gmat_startup_file.txt, 499
Spacecraft Visualization Properties, 323
GMAT command, 481
SPICE Orbit Propagation, 252
GroundStation, 191
Startup File, 499
GroundTrackPlot, 197
Stop, 431
525
Index
String, 327
T
Target, 433
Thruster, 329
Toggle, 439
V
Variable, 345
Vary, 443
VF13ad, 347
W
While, 451
X
XYPlot, 351
526