How to Add an Orbit State Type to GMAT

Wendy C. Shoan
Goddard Space Flight Center

Introduction

GMAT provides the capability to model spacecraft orbits.  As of R2013a, there are six orbit state representations allowed in GMAT: Cartesian, Keplerian, Modified Keplerian, SphericalAZFPA, SphericalRADEC, and Equinoctial.  

This document will first give a brief overview of how GMAT handles these state types.  Then it will explain how to add a new orbit state type to GMAT.  Due to current design, new state types cannot be added by plugins and so GMAT base code must be modified.  The implementation of a new orbit state type will involve, at a high level:

State Type Overview

The user can set a spacecraft's orbital state in any of the above-mentioned representations via the script or the Orbit tab of the Spacecraft panel.  Internal computations are done in Cartesian.  The StateConversionUtil static class provides conversion methods between the available representations, usually going through the Cartesian state.  Uses can plot or report state data in any of the allowed representations.

Adding a State Type 

Step 1: Modify Spacecraft.hpp

There are minimal changes needed for the header file when adding a new state type.  The new elements must be added to the end of the MultipleReps enum, and the state type must be added to the end of the STATE_REPS enum.  For example, if we were adding the Delaunay type:

and

Step 2: Modify Spacecraft.cpp

You will need to add your new elements to the MULT_REP_STRINGS array to match the data you added to the header, e.g. 

You will need to modify other Spacecraft methods as follows:

Step 3: Modify StateConversionUtil

Step 4: Add the new parameters

You will need to add classes and modify others to add parameters for your new state type elements.

Step 5: Update the Orbit Panel

Code mods will be needed to OrbitPanel.  You will need to add/modify at least the following: