Numerical solutions to the three-body problem using various numerical integration methods.
Module 1/
├── src/ # Source code
│ └── main.py # Main simulation script
├── outputs/ # Generated visualizations
│ ├── *.png # Static plots
│ └── *.gif # Animated visualizations
├── docs/ # Documentation
│ ├── Final Project.pdf # Project report
│ └── Module 1 Final Project.nb # Mathematica notebook
├── final_project.wpr # Wing IDE workspace configuration
└── README.md # This file
This project implements numerical methods to solve the three-body problem in celestial mechanics. The code uses several numerical integration schemes:
- Explicit Euler Method: First-order explicit method
- Adams-Bashforth (2-step): Second-order multi-step method
- Runge-Kutta 4: Fourth-order explicit method
- Multiple numerical integration schemes
- 3D visualization of trajectories
- Animated GIF generation
- Support for various initial conditions (Figure 8, Dragonfly, Yin-Yang, etc.)
-
Activate the virtual environment (if using one):
.\.venv\Scripts\Activate.ps1
-
Run the simulation from the project root:
python src/main.py
Outputs (PNG images and GIF animations) will be saved to the outputs/ directory.
- Python 3.x
- numpy
- matplotlib
-
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
- Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
- Windows (Command Prompt):
.venv\Scripts\activate.bat
- macOS/Linux:
source .venv/bin/activate
- Windows (PowerShell):
-
Install dependencies:
pip install -r requirements.txt
If you prefer to install packages globally:
pip install -r requirements.txtThe script includes several pre-configured initial conditions for different periodic orbits:
- Ovals with flourishes
- Figure 8
- Dragonfly
- Yin-Yang 1a/1b
- Yarn
- Goggles
- Skinny pineapple
Uncomment the desired configuration in src/main.py to run different simulations.