# Tutorial: Basic Orbiting (Math)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 This page needs more links to other articles to help integrate it into the Kerbal Space Program Wiki
KSP apparently greatly increases the understanding of orbital mechanics

In the basic orbiting tutorial, you were introduced to the concept of orbiting, and basic orbit stabilization, as well as an orbital table to help you along. Now, what if you want an orbit that isn't on that table? What if you want to have an orbit with a specific period? That's where these formulae come in.

## Orbital Speed

The relation between orbital speed and acceleration is given by the formula:

${\displaystyle a={\frac {v^{2}}{r}},}$

where a is the acceleration due to gravity, v is the horizontal speed, and r is the radius of orbit.

Of course, gravity varies depending on your distance from the planet, so we also need the following formula to determine a based on your altitude:

${\displaystyle a=g\left({\frac {R}{R+h}}\right)^{2},}$

where g is the acceleration due to gravity at sea level (9.807 m/s2), R is the radius of Kerbin (600 km), and h is the altitude of your orbit.

Note: Since the radius of your orbit r is equal to the radius of Kerbin R plus your altitude h, we can substitute R + h for r.

Now we have two expressions for a, so we set them on opposite sides of an equation and simplify:

{\displaystyle {\begin{aligned}g\left({\frac {R}{(R+h)}}\right)^{2}&={\frac {v^{2}}{r}}\\g\left({\frac {R}{(R+h)}}\right)^{2}&={\frac {v^{2}}{R+h}}\\g{\frac {R^{2}}{(R+h)^{2}}}&={\frac {v^{2}}{R+h}}\\g{\frac {R^{2}}{R+h}}&=v^{2}\\v^{2}&=g{\frac {R^{2}}{R+h}}\\v&={\sqrt {g{\frac {R^{2}}{R+h}}}}\\v&=R{\sqrt {\frac {g}{R+h}}}\\\end{aligned}}}

Finally, substituting known values for g and R,

${\displaystyle v=600\ 000\ \mathrm {m} {\sqrt {\frac {9.807\ \mathrm {m} /\mathrm {s} ^{2}}{600\ 000\ \mathrm {m} +h}}}}$

## Orbital Period

From the basic mechanics formula:

${\displaystyle d=vt}$

We know v from the above, and d is simply the circumference of a circle with a radius equal to your orbital altitude plus the radius of Kerbin:

${\displaystyle t=2\pi {\frac {600\ 000\ \mathrm {m} +h}{v}}}$

## Orbital Equations

For this section it is assumed that the craft in question is orbiting a particular body and is a lot smaller than the body that it is orbiting. Other then in the general orbital equation and the energy equation, the orbits are assumed to be bounded orbits completely within the body's sphere of influence and no others. This section also assumes that classical physics applies in the game. All distances and radii are from the center of the body being orbited and the sea level radius of the body needs to be added to the altitude given in game to recover the values here. The section uses the standard gravitational parameter ${\displaystyle \mu =GM}$ which ${\displaystyle G}$ is Newton's Gravitational Constant and ${\displaystyle M}$ is the mass of the body that is being orbited. From here on out ${\displaystyle m}$ will refer to the mass of the craft.

When the craft is orbiting a body, the distance between the craft and the body is given by the equation

${\displaystyle r(\phi )={\frac {l^{2}}{\mu m^{2}}}{\frac {1}{1+\epsilon cos\phi }}}$

where ${\displaystyle l}$ is the angular momentum of the craft, ${\displaystyle \epsilon }$ is the eccentricity of the orbit, and ${\displaystyle \phi }$ is an angle parameter for the orbit. ${\displaystyle \phi }$ runs from ${\displaystyle 0\deg }$ to ${\displaystyle 360\deg }$, ${\displaystyle l=m\cdot r\cdot v}$ at apoapsis or periapsis, and ${\displaystyle \epsilon \geq 0}$. When ${\displaystyle \epsilon <1}$ the orbit is bounded and is an ellipse and when ${\displaystyle \epsilon \geq 1}$ the orbit is unbounded. At ${\displaystyle \phi =0\deg }$the craft is at the periapsis and at ${\displaystyle \phi =180\deg }$ the craft is at the apoapsis. At periapsis,

${\displaystyle r_{p}={\frac {l^{2}}{\mu m^{2}}}{\frac {1}{1+\epsilon }}}$

and at apoapsis,

${\displaystyle r_{a}={\frac {l^{2}}{\mu m^{2}}}{\frac {1}{1-\epsilon }}}$.

The semimajor axis is

${\displaystyle a={\frac {l^{2}}{\mu m^{2}}}{\frac {1}{1-\epsilon ^{2}}}}$

and the semiminor axis is

${\displaystyle b={\frac {l^{2}}{\mu m^{2}}}{\frac {1}{\sqrt {1-\epsilon ^{2}}}}}$.

${\displaystyle \epsilon ={\frac {\sqrt {a^{2}-b^{2}}}{a}}}$

Given the results for ${\displaystyle r_{p}}$ and ${\displaystyle r_{a}}$ above,

${\displaystyle l^{2}=2\mu m^{2}{\frac {r_{p}r_{a}}{r_{p}+r_{a}}}}$ and

${\displaystyle \epsilon ={\frac {r_{a}-r_{p}}{r_{p}+r_{a}}}}$ thus

${\displaystyle r(\phi )=2{\frac {r_{p}r_{a}}{r_{p}+r_{a}+(r_{a}-r_{p})cos\phi }}}$

The velocity for an object in elliptical orbit about a much larger object is

${\displaystyle v={\sqrt {\mu ({\frac {2}{r}}-{\frac {1}{a}})}}={\sqrt {\mu {\frac {r_{p}^{2}+r_{a}^{2}+(r_{a}^{2}-r_{p}^{2})cos\phi }{r_{p}r_{a}(r_{p}+r_{a})}}}}={\sqrt {2\mu {\frac {r_{p}+r_{a}-r}{r(r_{p}+r_{a})}}}}}$.

The energy for an object in orbit is

${\displaystyle E={\frac {\mu ^{2}m^{3}}{2l^{2}}}(\epsilon ^{2}-1)={\frac {\mu m(r_{p}+r_{a})}{4r_{p}r_{a}}}(\epsilon ^{2}-1)=-{\frac {\mu m}{r_{p}+r_{a}}}}$.

One should note that for bounded orbits, the energy is negative and for escape orbits, energy is non-negative.

The orbital period is

${\displaystyle \tau ={\sqrt {{\frac {4\pi ^{2}}{\mu }}a^{3}}}={\sqrt {\frac {\pi ^{2}(r_{p}+r_{a})^{3}}{2\mu }}}}$.

Let ${\displaystyle r_{c,1}}$ and ${\displaystyle r_{o,1}}$ be the two apsides of a given orbit and let a craft execute a burn imparting a specific ${\displaystyle \Delta v}$ all at the single point in time the craft is at ${\displaystyle r_{c,1}}$. For this problem ${\displaystyle \Delta v}$ can be either positive or negative. If it is positive then the thrust is to speed up the craft but if it is negative the true delta v is the opposite of that in the problem but the thrust is to slow down the craft. This problem assumes that the thrust is in the same or opposite direction of travel and is not enough to reverse the craft. The new orbit will have apsides of ${\displaystyle r_{c,2}}$ and ${\displaystyle r_{o,2}}$ with ${\displaystyle r_{c,2}=r_{c,1}}$.

The speed of the craft before the burn is

${\displaystyle v_{1}={\sqrt {2\mu {\frac {r_{c,1}+r_{o,1}-r_{c,1}}{r_{c,1}(r_{c,1}+r_{o,1})}}}}={\sqrt {2\mu {\frac {r_{o,1}}{r_{c,1}(r_{c,1}+r_{o,1})}}}}}$.

The speed of the craft after the burn is

${\displaystyle v_{2}=v_{1}+\Delta v={\sqrt {2\mu {\frac {r_{c,2}+r_{o,2}-r_{c,2}}{r_{c,2}(r_{c,2}+r_{c,2})}}}}={\sqrt {2\mu {\frac {r_{o,2}}{r_{c,1}(r_{c,1}+r_{o,2})}}}}={\sqrt {2\mu {\frac {r_{o,1}}{r_{c,1}(r_{c,1}+r_{o,1})}}}}+\Delta v}$

which yields

${\displaystyle \Delta v={\sqrt {\frac {2\mu }{r_{c,1}}}}({\sqrt {\frac {r_{o,2}}{r_{c,1}+r_{o,2}}}}-{\sqrt {\frac {r_{o,1}}{r_{c,1}+r_{o,1}}}})}$

and

${\displaystyle r_{o,2}=r_{c,1}{\frac {r_{c,1}({\sqrt {2\mu {\frac {r_{o,1}}{r_{c,1}(r_{c,1}+r_{o,1})}}}}+\Delta v)^{2}}{2\mu -r_{c,1}({\sqrt {2\mu {\frac {r_{o,1}}{r_{c,1}(r_{c,1}+r_{o,1})}}}}+\Delta v)^{2}}}=r_{c,1}{\frac {r_{c,1}v_{2}^{2}}{2\mu -r_{c,1}v_{2}^{2}}}}$