Solar Lyapunov Guidance Algorithm
This repo contains a MATLAB implementation of my undergraduate thesis.
My thesis is about trajectory guidance for solar sail spacecraft in orbits around the Earth. My work figures out the best way to point a solar sail at a given instant in time, so that it can go from its current orbit to some target orbit.
Below is an example of a trajectory I propagated which performs a three-dimensional orbital transfer using a Lyapunov steering law developed by me.
- MATLAB 2023a (Any recent version of MATLAB should work; but newer versions with ode89 and ode113 are best)
- Clone the repo
- Open the root folder in MATLAB
- Run
init.m
to perform setup. This needs to be run every time MATLAB is restarted.
This code computes the LVLH steering angle in which to point the sail. There are currently two components to the steering algorithm:
- Modified Q Law - computes an optimal steering angle which decreases the control-Lyapunov potential function as quickly as possible
- Steering Angle Regularization - accounts for the position of the Sun, and adapts the steering angle proposed by the Lyapunov steering law to something a solar sail can achieve. e.g. Feathering the sail if the desired pointing direction is directly toward the Sun.
This folder includes equations of motion, ephemerides, and propulsion models used to "operate" the guidance law.
Used to interpolate, plot, and summarize the results of the simulations.
This folder includes functions for converting between coordinate frames, computing orbital elements, and other miscellaneous functions.
Various simulation cases to run.
- Run one of the mission cases inside
scripts
. - Wait for the sim to finish. Then, run
postprocess
to show plots. - Data will be saved to the
outputs
folder.
Code is formatted using MBeautifier.
From the main folder, in the MATLAB command window, run:
MBeautify.formatFiles(pwd, "*.m", true)
to format all .m files in the repo (takes about 1 minute)