trick/trick_source/trick_utils/SAIntegrator/examples/Orbit
2021-01-06 16:50:24 -06:00
..
images Improve the organization and description of the Orbit example sim for SAIntegrator, in prep for tutorial. 2021-01-06 16:50:24 -06:00
makefile Add new stand alone numerical integration library SAIntegrator #1056 #936 2020-09-27 18:36:49 -05:00
Orbit.cpp Improve the organization and description of the Orbit example sim for SAIntegrator, in prep for tutorial. 2021-01-06 16:50:24 -06:00
plot_position.py Add new stand alone numerical integration library SAIntegrator #1056 #936 2020-09-27 18:36:49 -05:00
README.md Improve the organization and description of the Orbit example sim for SAIntegrator, in prep for tutorial. 2021-01-06 16:50:24 -06:00

Orbit

The Orbit program uses the SA::EulerCromerIntegrator class to simulate the orbit of a satellite around the Earth.

The altitude of the satellite is chosen to be 408000.0 meters, the approximate altitude of the International Space Station. The initial position, and velocity of the satellite is calculated to maintain a circular orbit around the Earth. The orbital period is also calculated, to determine how long the simulation should run to complete a full orbit.

For each numerical integration time-step, the simulation program prints:

  1. time (s)
  2. 2D position vector (m)
  3. 2D velocity vector (m/s)

to stdout, in Comma Separated Values (CSV) format.

Building & Running the Simulation Program

Generate the results as follows:

$ make
$ ./Orbit > orbit.csv

Plotting the Results

The Python script, plot_position.py is provided to plot the results in orbit.csv using (Python) matplotlib.

Plot position vector for the orbit duration as follows:

$ python plot_position.py

Orbit

References:

https://en.wikipedia.org/wiki/Circular_orbit