Lesson 9 of 15

Orbital Mechanics

Orbital Mechanics

Kepler and Newton gave us the laws that govern how objects orbit one another — from moons around planets to stars around black holes.

Kepler's Third Law

The orbital period TT of a body on a circular (or elliptical) orbit with semi-major axis aa around a central mass MM is:

T2=4π2a3GMT^2 = \frac{4\pi^2 a^3}{GM}

Solving for TT:

T=2πa3GMT = 2\pi \sqrt{\frac{a^3}{GM}}

For Earth orbiting the Sun (a=1.496×1011a = 1.496 \times 10^{11} m), this gives T3.156×107T \approx 3.156 \times 10^7 s — one year.

Circular Orbital Velocity

For a circular orbit, gravity provides exactly the centripetal force needed:

vc=GMrv_c = \sqrt{\frac{GM}{r}}

Earth's orbital velocity is approximately 29.8 km/s.

Orbital Energy

The total mechanical energy of a bound orbit (kinetic + potential) is:

E=GMm2aE = -\frac{GMm}{2a}

Negative energy means the orbit is bound. The more negative (smaller aa), the more tightly bound the orbit.

Your Task

Implement three functions. Use G=6.674×1011G = 6.674 \times 10^{-11} m³ kg⁻¹ s⁻², defined inside each function.

  • orbital_period_s(a_m, M_kg) — orbital period in seconds (Kepler's third law)
  • circular_velocity_m_s(M_kg, r_m) — circular orbital speed in m/s
  • orbital_energy_J(M_kg, m_kg, a_m) — total orbital energy in joules
Python runtime loading...
Loading...
Click "Run" to execute your code.