# How does one design a trajectory involving a lunar and Earth flyby and Lagrange points? What tools are used to calculate the initial guesses?

I'm trying to design a trajectory that takes a spacecraft from Sun-Earth L2 to a lunar flyby, to an Earth flyby and then to Mars (two flybys might be too complex, I might just do one). I've optimized a variety of interplanetary trajectories in GMAT with initial guesses generated from a simple software called Trajectory Optimization Tool, which uses patched conics to give the user dates for the arrival at the various planets in the trajectory (see image for an example of its inputs and outputs).

The problem is that it uses patched conics and can only do interplanetary trajectories (so no Earth-Moon trajectories and the like), meaning it can't be used for what I'm trying to do. So how do mission designers go about getting a "first glance" or low-fidelity analysis of the dates they should be looking for for such trajectories? What software does what the one on the image does, but with Lagrange points and Earth-centered trajectories?

• “I’ve optimized … in GMAT…”. Was this a manual procedure? GMAT has optimization routines you can minimize duration / fuel with. It’s not out of box ready to do that’s, but I think at least one of the demo missions does this.
– cms
Aug 16, 2022 at 0:21
• @cms I made a GMAT script that tries to optimize the trajectory described in the question but I can't get it to work, I think GMAT is only meant to be used to optimize with initial guesses. Hence me looking for a tool that can do what Trajectory Optimization Tool does but more advanced. Here (imgur.com/a/TrqIiYr) you can find an example of a similar script I did for an SEL2-Earth flyby-Mars trajectory, which also didn't vary the variables the way I wanted it to. Is my intuition correct that GMAT simply can't do this, or am I doing something wrong with its optimization settings? Aug 16, 2022 at 12:51
• Generally speaking, the sort of people who do this for real already have a suite of custom in-house tools (e.g., the top-notch stuff NASA explicitly does not make available open-source, unlike GMAT) or have paid hundreds of thousands of dollars in software licensing fees to one of the very small number of commercial vendors who specialize in this extremely niche application. AGI will happily teach you "free" classes giving you instructions how to use STK to do it, but if you can't afford their tool, that doesn't help. Aug 19, 2022 at 23:14

## 2 Answers

One of the tools used is Copernicus. I happen to know that it's been used for Artemis mission trajectory optimization, but it's a pretty general tool that (as the page mentions) has been used to create entries to Global Trajectory Optimization Competitions.

Unfortunately it isn't available to everyone, but certain users can request it.

You could consider the Circular Restricted Three Body Problem. I believe Artemis is going to fly that type of orbit. These types of orbits are calculated using numerical integration. I use MATLAB.

https://en.wikipedia.org/wiki/Three-body_problem#Circular_restricted_three-body_problem

• Since GMAT depends on Matlab to run, I'm pretty sure the OP knew this already. Matlab is something which could be used to make a tool, but it's not ready-made for this application off the shelf, the way a few other things (ODTK, FreeFlyer, and a couple others) are. Aug 19, 2022 at 23:26
• Go to Mathworks and you will find CR3BP Matlab code. Or better yet write it yourself and learn something. Aug 21, 2022 at 0:11