Orbits, Lagrange points and Poincaré sections of the restricted three-body problem.
A small Python exploration of the planar circular restricted three-body problem (think Earth, Moon and a spacecraft): trajectories in the rotating frame, the five Lagrange points, zero-velocity curves and Poincaré sections. It accompanies the review by Martins & Zanotello (2018).
git clone https://github.com/EngFlavioMartins/celestial-dynamics.git
cd celestial-dynamics
python run.pyrun.py computes an Earth-Moon orbit and its Poincaré section and saves them to outputs/demo/dynamics.png. The first time, it installs what it needs into a private .venv folder (a minute or so); after that it starts at once. All you need is Python 3.10 or newer.
Prefer conda?
conda env create -f environment.yml
conda activate celestial-dynamics
python -m celestial_dynamics.cliNext: Try python run.py --jacobi 3.1 for another energy level. The equations are in docs/method.md.
The effective potential of the Earth-Moon system with one orbit (amber), the zero-velocity curve and the five Lagrange points. The surface height is −log Ω, a display transform that keeps the wells, saddles and hills in place.
sh scripts/render/make_figure.sh # the figure
python scripts/render/make_animation.py # the animation at the topBoth need ParaView; the figure also needs LaTeX.
This code accompanies the review below. If you use it, please cite:
@article{martins2018threebody,
author = {Martins, Flavio A. C. and Zanotello, M.},
title = {Mec{\^a}nica Celeste e a Teoria dos Sistemas Din{\^a}micos: Uma Revis{\~a}o do Problema Circular Restrito de Tr{\^e}s Corpos},
journal = {Revista Brasileira de Ensino de F{\'\i}sica},
volume = {40},
number = {2},
pages = {e2310},
year = {2018},
doi = {10.1590/1806-9126-rbef-2017-0174}
}GitHub's Cite this repository button (from CITATION.cff) gives the same reference in other formats.
Apache 2.0: you are free to use, change and share this code, also commercially. If you pass it on, keep the NOTICE file with it; it says where the code comes from and how to cite it.
The bundled IBM Plex Sans fonts use the SIL Open Font Licence.

