Setting up orbits

While the LEO targeting software can compute you orbits, it won't visualize them for you on screen, so one of the first things you may want to do is pick a plot tool (such as for instance gnuplot) to get graphical output. Also, LEO targeting is programmed by a config file, so you're going to need a text editor.

Also, it is assumed that you have some basic familiarity with orbital mechanics and the 2-body problem and know the meaning of e.g. orbital elements. These tutorials are an introduction to numerical orbital mechanics specifically, not to orbital mechanics in general.

Layout of the config file

The config file is divided into two modes - input and output - and various blocks. Each mode and block is initiated by a keyword. Inside each block, pairs of key/value pass variables. Create the following file as test.cfg:

units SI
gravity_model spherical
earth_model spherical

lat 0.0
lon 0.0
alt 300000
heading 38
vup 0.0
vtot 7729.0


file test_orbit.dat
x longitude
y latitude


The first part is marked as the input mode. the first block contains general simulation configuration, among other things the unit system is set to 'SI' (i.e. we want to input and output in meters) and the gravity model and Earth shape model are set to spherical (i.e. we don't request realistic gravity and Earth shape at this point).

The next block selects the initial position of the spacecraft at zero latitude and longitude and an altitude of 300 km. The spacecraft heads out to 38 degrees, i.e. crosses the equator at an angle of 52 degrees and we expect it to reach to 52 deg latitude. There is zero vertical speed set, and the horizontal speed gets the craft into a nearly perfect circular orbit.

The output branch determines that data of longitude vs. latitude (i.e. the groundtrack) should be written to the file test_orbit.dat.

This, in a nutshell, is how the config file works.

Looking at the orbit

Run the tool from a commandline via

./leo_targeting test.cfg

You'll see a short log

Reading test.cfg for configuration.
Using SI units.
Plot written to test_orbit.dat!

and when you plot the file (below the xmgrace software was used) that was created, you should see the groundtrack:

Groundtrack of the test orbit specified above.

As expected, the orbit runs out to 52 degrees, and you can see that due to Earth's rotation, it does not close but gets displaced by a fixed amount every revolution.

Getting details

We can get more details on the orbit by writing out the orbital elements. Add to the output section of the file the following block:

orbital final

This instructs the software to do additonal output to the console. Now, re-run the program. As a reward, we get to see a longer output which lists all the orbital elements in the final state:

Radius [km]:             6667.93
Alt. above surface [km]: 296.934
Apoapsis [km]:           299.996
Periapsis [km]:          296.926
Speed [m/s]:             7732.55
Longitude [deg]:         141.196
Latitude [deg]:          6.84188
Semi-major axis [km]:    6669.46
Eccentricity:            0.000230152
Inclination [deg]:       52
Asc. node lon. [deg]:    360
Arg. of periapsis [deg]: 177.13
True anomaly [deg]:      354.175

As expected, we see a very low eccentricity and an inclination of exactly 52 degrees.

Continue with The Molniya orbit.

Back to main index     Back to science     Back to LEO targeting

Created by Thorsten Renk 2017 - see the disclaimer, privacy statement and contact information.