A modular, minimalistic, and physically accurate orbital simulator.
Experience as a modern interactive web app or classic desktop Python/matplotlib animation. Powered by symplectic Velocity-Verlet integration, Flask, and vanilla JS.
- Overview
- Screenshots / GIFs
- Features
- Architecture
- Quickstart
- Editing or Adding Bodies
- What's New in 2.0
- Educational Value
- Future Work
- Known Issues
- Contributing
- License
- Credits
Orbit2.0 simulates orbital motion using energy-conserving Velocity-Verlet integration for long-term orbital stability. Built around a lightweight, performance-focused architecture designed for clarity, efficiency, and a seamless user experience while avoiding unnecessary complexity.
Experience it as:
- 🖥️ Desktop: Python + Matplotlib animation (for research, teaching, or offline demos).
- 🌐 Web: Flask backend + HTML/JS/CSS frontend (modern interactive simulation).
Both interfaces use the same NumPy-based simulation core for scientific consistency.
- Symplectic Velocity-Verlet integration (replaces semi-implicit Euler), numerically stable for long-term orbits.
- Planetary/body data stored in editable
bodies.json.
- Dynamic body selection via interactive cards.
- Real-time Canvas animation with buffering and interpolation.
- Server-Sent Events (SSE) for low-latency updates.
- Play/Pause toggle, zoom in/out, configurable trails, starry background, and auto pause on tab change.
- Modular OOP physics core (simulation.py).
- Flask backend serves snapshots to web; Matplotlib mode remains fully supported.
- Fully responsive design for desktop & mobile.
- Clean separation of code, data, and UI for maintainability.
- Open-source.
git clone https://github.com/Root3141/Orbit.git
cd Orbit
pip install -r requirements.txt
python app.py
Open http://localhost:5000 or view the live demo here↗.
python sim.py
[bodies.json]
|
+---------------------+
| simulation.py | <-- Shared OOP simulation engine (NumPy + Verlet)
+---------------------+
| |
[Matplotlib] [Flask backend/API]
|
[HTML/JS frontend]
All celestial object data lives in bodies.json.
Add, remove, or edit entries - changes are reflected instantly in both interfaces.
| Feature | v1.0 | v2.0 (Current) |
|---|---|---|
| Integration | Semi-implicit Euler | Velocity-Verlet |
| Data | Hardcoded | Editable JSON file |
| Visualization | Matplotlib only | Web + Matplotlib |
| Architecture | Flat script | Modular, shared core, clean separation |
| UI/UX | Static plots | Modern, animated, interactive web UI |
Orbit2.0 is ideal for learning:
- Visualizes Newtonian mechanics and orbital dynamics.
- Helps students experiment with orbital parameters and see real-time effects.
- Encourages hands-on learning with minimal setup.
- Modularize frontend JS/CSS for maintainability
- Expose user-configurable options (timestep, colors, trail memory)
- Expand
bodies.jsonto include moons, comets, dwarf planets - Optional: Web Workers/WebGL support for performance
- Add multi-user support
- On the deployed web version (Render), resuming a paused simulation may occasionally jump ahead instead of continuing from the pause point before proceeding smoothly. This does not occur when running locally, where it resumes as expected.
Pull requests are welcome!
For major changes, please open an issue first to discuss what you’d like to improve.
Developed by Aaryan Aaloke


