This is a niche technical question about using the GMAT API.

After digging through all of the official GMAT documentation and videos, I finally decided to use my Java application as a script driver for interacting with the GMAT API.

Once I load the GMAT API correctly in my Java application, I then proceed to "build up" a script one command at a time, line by line. I then load and run the script, and then read my reports as files (which I have specified to be comma separated).

This seems to be the easiest way to use the API, but I feel I'm missing something.

Does anyone have a good idea or a sample in Python/Matlab/Java on how to programmatically create and execute the mission sequence without resorting to the scripting interface as I do?

Ideally, I would like to know how to instantiate all the relevant objects correctly, linking them with each other correctly, executing the mission sequence, and then collect somehow the "Runtime Object" of the mission sequence?

I know that it's possible to modify Resources by getting their Runtime Object, but there is no example on how to do that for the Mission Sequence, and then execute it. Very often, we want to modify the Mission Sequence itself, in addition to the Resources (i.e. change the "Achieve" objectives, the "Vary" parameters etc..

Thank you in advance! Manny


1 Answer 1


I am in a similar boat, trying to leverage the API but getting stuck on the lack of documentation and resorting to interfacing with scripts to get the architecture of my script setup. Based on reading some of the tickets on the GMAT Jira, I believe the best way to create mission sequence components is through the moderator instance and the CreateDefaultCommand method. An example I had found (in python) uses gmat.Moderator.Instance().CreateDefaultCommand('Propagate', 'Prop').

Based on some of the discussions, it appears that these interfaces are being reworked for the next release of the API, so hopefully there will be more documentation and easier ways to accomplish these components.

Additionally, I know you are working in Java, but a developer that seems to have a solid understanding of the internals of the GMAT API has created this python wrapper: gmat_py_simple

Since most of the interfaces with the API are consistent across the different implementations, it could provide more information/insight on how to set up misison sequences.

  • 1
    $\begingroup$ Thank you for your idea on looking into GMAT Jira tickets, and also for the extra Python wrapper link! I will take a deeper look into that wrapper and try to adapt for Java if it's more efficient! $\endgroup$
    – Manny
    Commented Apr 24 at 15:43
  • 2
    $\begingroup$ Thanks for answering so many of the open GMAT questions. I've worried they've been neglected but haven't been able to bring myself to learn it $\endgroup$
    – Erin Anne
    Commented Apr 24 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.