Trajectory Optimization from Earth to an Asteroid - OTB

MATLAB script for optimizing two-body, ballistic trajectories from Earth to the an asteroid using the fmincon algorithm.
118 Downloads
Updated 1 Mar 2025

View License

This submission is a MATLAB script called ipto_asteroid_otb that can be used to design and optimize two-body, ballistic interplanetary trajectories between the Earth and an asteroid. This type of trajectory analysis ignores the gravitational effect of both the launch and arrivals planets on the heliocentric transfer trajectory. This technique involves the solution of Lambert's problem relative to the Sun. This MATLAB script also includes the option to enforce user-defined mission constraints such as departure energy, time-of-flight, and so forth during the trajectory optimization.
The ipto_asteroid_otb MATLAB script also performs a graphical primer vector analysis of the solution. This program feature displays the behavior of the primer vector magnitude and primer derivative magnitude as a function of mission elapsed time in days from departure. This script uses the fmincon nonlinear programming (NLP) algorithm available in the Mathworks Optimization Toolbox to solve this classic astrodynamics problem.
This script reads JPL planetary 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 ipto_asteroid_otb script uses routines from the MICE software suite to read and evaluate the JPL binary ephemeris file. Platform-specific MICE mex files, support functions and the 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.

Cite As

David Eagle (2025). Trajectory Optimization from Earth to an Asteroid - OTB (https://www.mathworks.com/matlabcentral/fileexchange/106060-trajectory-optimization-from-earth-to-an-asteroid-otb), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.2.0

Script is now data-driven by a simulation definition data file. Updated several MATLAB functions and PDF documentation.

1.1.0

Added additional asteroids. Updated source code and PDF user's guide.

1.0.0