A stunning Python-based interactive simulation of the N-body gravitational problem, featuring real astronomical data and multiple numerical integration methods. Watch the dance of planets, trace historic space missions, and explore the cosmos! ๐
| Feature | Description |
|---|---|
| ๐ฎ Interactive 3D Visualization | Dynamic real-time animation with adjustable speed |
| ๐ Real Astronomical Data | Accurate planetary positions from NASA |
| ๐งฎ Multiple Integration Methods | Choose from Euler, RK2, RK4, or advanced symplectic methods |
| ๐ธ Historic Space Missions | Simulate Voyager trajectories |
| โก High Performance | Optimized calculations with NumPy |
Python 3.8 or higher
pip (Python package installer)- Clone the repository:
git clone https://github.com/yourusername/n-body-simulation.git
cd n-body-simulation- Install dependencies:
pip install -r requirements.txtpython src/main.pyFor production deployment, we use Gunicorn as our WSGI server:
- Make the production script executable:
chmod +x run_production.sh- Create logs directory:
mkdir logs- Run the application:
./run_production.shThe application will be available at http://localhost:8050
$\vec{a}i = G \sum{j \neq i} \frac{m_j(\vec{r}_j - \vec{r}_i)}{|\vec{r}_j - \vec{r}_i|^3}$
| Parameter | Description |
|---|---|
| ๐ฐ G | 1.4872e-34 AUยณ/(Mโยทdayยฒ) - Gravitational constant |
| โญ |
Mass in solar masses (Mโ) |
| ๐ |
Position in astronomical units (AU) |
| Method | Equation | Characteristics |
|---|---|---|
| Euler | โ
Fast computation โ Minimal memory |
|
| RK4 | โ
High accuracy โ Stable |
|
| Verlet | โ
Energy conservation โ Long-term stability |
|
| Adams-Bashforth | โ
Efficient โ High accuracy |
| Scenario | Features |
|---|---|
| ๐ Solar System | โข Complete planetary system โข Major moons and asteroids โข Accurate orbital parameters |
| ๐ธ Space Missions | โข Voyager 1 & 2 trajectories โข Historic planetary encounters โข Mission timeline recreation |
| โ๏ธ Cometary Orbits | โข Halley's Comet simulation โข Planetary perturbations โข Long-term orbital evolution |
The production server can be configured through run_production.sh:
- Port: 8050 (default)
- Workers: 4 (default)
- Timeout: 120 seconds
- Log files location:
logs/directory
This project is licensed under the GNU License - see the LICENSE file for details.
