This is a basic Python tool that lets you pick a object (like the ISS or a GPS satellite) and see how it orbits the Earth based on real physics.
You need these two libraries installed:
- matplotlib (for the graph)
- PySimpleGUI (for the menu)
You can install them by typing this in your terminal:
pip install matplotlib PySimpleGUI
- Run the script.
- Pick a satellite: Select one of the presets (Geostationary orbit, ISS, GPS Satellite or Starlink Satellite) or choose Custom to enter your starting altitude and velocity.
- Click "Select": The math runs in the background.
- See the orbit: A window will pop up showing the Earth (blue circle) and the path your object took.
The simulation operates on the following principles:
-
Gravitational Force: Calculated at every time step (
$dt$ ) (default value for dt is 0.005) using:$$F = \frac{G \cdot m_1 \cdot m_2}{r^2}$$ - Integration: The script updates velocity and position iteratively to account for the changing direction of gravitational pull.
- Termination: The simulation ends if the satellite completes one full orbit, crashes into Earth, or reaches the maximum simulation time.