Gravity-assist Trajectory Optimization - SNOPT version

A MATLAB Script for Interplanetary Patched-Conic, Single Gravity-Assist Trajectory Design, Analysis and Optimization
2.8K Downloads
Updated 7 Apr 2025

View License

This submission a MATLAB script named flyby_snopt that can be used to optimize interplanetary, patched-conic trajectories that include a zero sphere of influence (ZSOI) single gravity assist maneuver. The user specifies the departure, flyby and arrival planets along with initial guesses for the departure, flyby and arrival calendar dates, and lower and upper bounds for the flyby altitude. This script searches for a patched-conic, gravity-assist trajectory that satisfies the flyby mission constraints (V-infinity matching and bounded flyby altitude) and minimizes the departure, arrival or total impulsive heliocentric delta-v for the mission. The type of trajectory optimization is specified by the user.
The software provides a simple two-dimensional graphic display of the heliocentric planet orbits and the interplanetary transfer trajectory. It also provides a three-dimensional graphic display of the flyby trajectory relative to the gravity-assist planet along with the corresponding classical orbital elements.
This MATLAB script reads JPL lunar and solar ephemerides in a machine-independent binary format (kernels) which are available from the SPICE web site and by anonymous ftp from ftp://ssd.jpl.nasa.gov/pub/eph/planets/bsp. These *.bsp ephemeris files are IEEE-Little Endian style of binary kernel. This is the binary form native to PC/Linux, PC/Windows and MAC/Intel machines. Additional information about JPL ephemerides can be found at http://naif.jpl.nasa.gov/naif/.
The flyby_snopt script uses routines from the MICE software suite to read and evaluate the JPL ephemeris file. Platform-specific MICE mex files, support functions and binary ephemeris files are available at naif.jpl.nasa.gov/naif/toolkit_MATLAB.html. MICE is a MATLAB implementation of the SPICE library created by JPL.
In this MATLAB script the optimization is performed using the SNOPT nonlinear programming (NLP) algorithm. Information about MATLAB versions of SNOPT for several computer platforms can be found at Professor Philip Gill’s web site which is located at https://ccom.ucsd.edu/~optimizers.

Cite As

David Eagle (2025). Gravity-assist Trajectory Optimization - SNOPT version (https://www.mathworks.com/matlabcentral/fileexchange/39462-gravity-assist-trajectory-optimization-snopt-version), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Environmental Models in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
2.2.0.0

Updated several functions and PDF documentation. Added graphics of the planet-centered flyby orbital elements and speed.

2.1.0.0

Updated source code and PDF documentation

2.0.0.0

Script is now "data file driven". Added asteroid or comet as arrival body. Updated PDF document and added several new example missions.

1.6.0.0

MATLAB source code updates (new keywords, etc.)

1.5.0.0

Fixed bug in code that calculated the heliocentric orbital elements and state vector of the departure planet. (emu replaced with smu in the calling argument).

1.4.0.0

UPDATED LINKS

SNOPT ccom.ucsd.edu/~optimizers/

Binary Ephemeris Files

https://www.dropbox.com/sh/hul0g7ia6nhspwo/AAATqfVXb5ClZODfGGvEbRZEa?dl=0

1.3.0.0

Bug fixes. Added three-dimensional graphics for the flyby trajectory. Updated PDF document.

1.2.0.0

Added main script (flyby_matlab_64bit.m) that uses the March 17, 2014 version of SNOPT.

1.1.0.0

MICE version included in flyby_mice.zip archive.

1.0.0.0