# Tutorial: Basic Orbiting (Math) 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:

$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:

$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:

{\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,

$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:

$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:

$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 $\mu =GM$ which $G$ is Newton's Gravitational Constant and $M$ is the mass of the body that is being orbited. From here on out $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

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

$r_{p}={\frac {l^{2}}{\mu m^{2}}}{\frac {1}{1+\epsilon }}$ and at apoapsis,

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

The semimajor axis is

$a={\frac {l^{2}}{\mu m^{2}}}{\frac {1}{1-\epsilon ^{2}}}$ and the semiminor axis is

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

$\epsilon ={\frac {\sqrt {a^{2}-b^{2}}}{a}}$ Given the results for $r_{p}$ and $r_{a}$ above,

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

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

$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

$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

$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

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

Let $r_{c,1}$ and $r_{o,1}$ be the two apsides of a given orbit and let a craft execute a burn imparting a specific $\Delta v$ all at the single point in time the craft is at $r_{c,1}$ . For this problem $\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 $r_{c,2}$ and $r_{o,2}$ with $r_{c,2}=r_{c,1}$ .

The speed of the craft before the burn is

$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

$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

$\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

$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}}}$ 