An orbital dynamics simulation that models the docking manoeuvre of two spacecraft using differential equations, optimises fuel usage and transfer time with gradient descent, and estimates uncertainty using MCMC-based random walkers.
- 🧠 Project Motivation
- 📐 Technologies Used
- 🔭 Project Scope
- ⚙️ How It Works
- 📊 Visualisations
- 🚧 Challenges
- 🎯 Intended Use
- 📌 Limitations
- 🤝 Credits
This project emerged from my final-year research at the University of Hertfordshire, where I aimed to apply theoretical astrophysics to a practical engineering problem—docking optimisation in multi-body orbital mechanics. The goal was to simulate and improve autonomous spacecraft docking via algorithmic optimisation and probabilistic modelling.
- Python
numpy,scipy– numerical methods, ODE solversmatplotlib,seaborn– plotting and animationemcee– Markov Chain Monte Carlo for uncertainty quantificationPyMC– Bayesian regression (optional extension)LaTeX– scientific documentation and reporting
This simulation models:
- Orbital parameters (e.g. positions & velocities in
x,y&z-axis) of an interceptor spacecraft - Optimal velocity (
v) and trajectory angle (θ) using gradient descent - Cost function
J(v, θ)minimised iteratively - Uncertainty quantification via Bayesian inference using MCMC
- Animated visualisation of convergence and trajectory paths
- Define physical model: orbital mechanics via Newtonian physics
- Formulate cost function: based on docking constraints
- Optimise: gradient descent updates
(v, θ)iteratively - Quantify uncertainty: use
emceeto explore the posterior distribution - Visualise: plot contours, convergence, and trajectory path
🔬 See my Jupyter notebook for a step-by-step walkthrough.
- Descent path over cost surface
- Convergence of cost function
- Posterior distributions of burn parameters
- Optimised Trajectory
Fig. 1: Gradient descent over the contour surface plot of the cost function
J. The white dashed line on the left shows the cost of a classic Hohmann transfer.
Fig. 2: Changes in the cost function
Jover gradient descent steps. Notice that it is not a perfectly horizontal line after reaching the valley (around 130 steps) of the cost function. The descent process becomes much slower when the minimum is close.
Fig. 3: Simulation of random walkers to search for the final converged parameters
(v, θ). We observe a sign of stable convergence at around 150 iterations (red dashed lines) for both parameters.
Fig. 4: Results of the optimised transfer. Note that a heavier penalty (grey dashed line '---') allows for faster transfer.
- Dealing with stiffness in ODE solvers
- Tuning learning rate and momentum in gradient descent
- Ensuring MCMC convergence and burn-in
- High computational time for repeated sampling
- Academic: share with peers, mentors, and for viva demonstration
- Public: open-source learning resource for aerospace and AI students
- Portfolio: showcase numerical optimisation and simulation capabilities
- Assumes a 2D docking plane and a simplified gravitational model
- Ignores fuel leakage, actuator delay, or collision dynamics
- MCMC assumes Gaussian noise
- Tszon Tseng – project author
- Supervised by Dr. James Collett and Professor Detlef Mueller
- Inspired by orbital mechanics applications & gradient-based ML methods in Deep Learning
- MCMC logic adapted from emcee GitHub
Feel free to reach out via LinkedIn or raise an issue if you'd like to collaborate or suggest improvements.