This project simulates and visualizes the Three-Body Problem using various numerical methods in Python, including Euler, Runge-Kutta 4, and Bogacki–Shampine algorithms. Developed in Visual Studio Code, it offers comparative insights into the behavior and accuracy of each numerical solver.
The Three-Body Problem involves predicting the motion of three gravitationally interacting bodies. This classic problem in celestial mechanics has no general analytical solution, making numerical methods essential. This repository contains:
- Numerical simulations of the three-body problem
- Implementation of various ODE solvers
- Orbit animations and visual plots
- Comparative analysis between solvers
Each simulation can be run individually:
▶️ Run a specific solverpython "Algorithms/3_body_problem_RK4_left.py"
- 🎞 Animate the orbits
python "Output/Animations/Animation_RK4_left.py"
- 📈 Compare multiple methods
python "Output/MI_Equa_Diff_Methods&Curves_Comparison.py"
- Graphical plots of orbits and positions
- Energy evolution and error metrics
- Output files and images stored in
Output/
Additional reference documents and theoretical background can be found in the /Documents
directory. This includes:
- Research paper :
PHSC_2001__5_2_161_0.pdf
- Methodological guide :
equa-diff.pdf
- Euler Method
- Runge-Kutta 4th Order
- Bogacki–Shampine Method (adaptive step size)
- Solver comparison and analysis scripts
- Language: Python 3.x
- IDE: Visual Studio Code
- Libraries:
- numpy
- matplotlib
- Clone the repository
git clone https://github.com/Joliaus/three-body-problem-python.git cd three-body-problem-python
- (Optional) Create a virtual environment
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate
- Install the required libraries
pip install numpy matplotlib