A Python-based solar system simulator using real NASA orbital elements, Runge-Kutta integration, and 3D visualization with Plotly.
(If you don’t have an image yet, take a screenshot of your simulation and add it to the repo!)
✅ Uses real NASA orbital elements to calculate planetary positions
✅ Implements Runge-Kutta (RK4) for accurate orbit simulation
✅ 3D visualization with Plotly
✅ Fast computation with NumPy vectorization
✅ Supports saving and loading simulations
Make sure you have Python 3.8+ installed. Then, clone this repository and install the dependencies:
git clone https://github.com/your-username/solar-system-simulation.git
cd solar-system-simulation
pip install -r requirements.txt
Run the simulation with:
python simulation.py
You'll be prompted to enter the number of simulation steps and time step:
Enter number of simulation steps (e.g., 1000): 1000
Enter time step in seconds (e.g., 86400 for 1 day): 86400
After running, a 3D visualization will appear showing the planetary orbits.
You can save a simulation and reload it later:
# Save a new simulation
python simulation.py --save simulation.npz
# Load and visualize a previous simulation
python simulation.py --load simulation.npz
Here’s an example of what the simulation generates:
Want to modify the planets or add custom objects? Edit orbital_elements.json and change the semi-major axis, eccentricity, or mass to include asteroids, moons, or exoplanets!
- 🌠 Real-time animation instead of precomputed paths
- 🚀 Custom object insertion (add spacecraft, asteroids, etc.)
- 🪐 Moon systems (simulate moons of Jupiter, Saturn, etc.)
🌌 Data Sources: NASA JPL Horizons System
📚 Algorithms: Runge-Kutta 4th Order, Keplerian orbital mechanics
This project is licensed under the MIT License.