Three body problem

Version 1.0.2 (3.83 KB) by andrea
Just a simple script to compute the trajectory of three bodies under their reciprocal gravitational influence.
Updated 29 Aug 2021

View License

This simple script was inspired by one of the Feynman lecture about Newton's law of dynamics. The aim is to show that just with the laws of motion and a basic numerical method is possible to find an approximate solution of a tremendously complex problem.
The theory can be found in the lecture:
Newton’s Laws of Dynamics
9–6 Numerical solution of the equations

Cite As

andrea (2024). Three body problem (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021a
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

The 2D version also implements the the Verlet algorithm.


bug fixed