GravitationF = GMm/r²

Orbital Mechanics Simulator

Simulate planetary orbits under gravity. Adjust mass and initial velocity to explore circular, elliptical, and escape trajectories.

Parameters
Initial Distance r
px
Velocity (× v_circular)
×

Reference speeds
v_circular20.41
v_escape28.87
v_initial20.41

r0.0 px
v0.00
KE0.00 J
PE0.00 J
E_total0.00 J
Orbit0 Circular

About Orbital Mechanics

Orbital mechanics describes the motion of objects under the influence of gravity. Newton's law of universal gravitation states that every mass attracts every other mass with a force proportional to the product of their masses and inversely proportional to the square of the distance between them.

This simulator uses normalized units (G = 1, M = 50000) for visualization. The physics is identical to real orbital mechanics — only the scale differs.

Key Variables

SymbolNameUnitDescription
GGravitational Constantm³/(kg·s²)Universal constant of gravitation
MCentral MasskgMass of the central body (e.g., star)
mOrbital MasskgMass of the orbiting body (negligible)
rOrbital RadiusmDistance from central body to orbiting body
vOrbital Speedm/sCurrent speed of the orbiting body
eEccentricityShape of orbit: 0 = circular, 0<e<1 = elliptical, e≥1 = hyperbolic
ETotal EnergyJKE + PE; negative = bound orbit, positive = escape
LAngular Momentumkg·m²/sConserved quantity: L = m r × v

Orbit Types

  • Circular orbit: v = v_c = √(GM/r). Total energy E < 0, eccentricity e = 0.
  • Elliptical orbit: v < v_esc and orbit is bound. E < 0, 0 < e < 1.
  • Parabolic escape: v = v_esc = √(2GM/r). E = 0 exactly, e = 1.
  • Hyperbolic escape: v > v_esc. E > 0, e > 1 — the body escapes to infinity.

Worked Example

For a circular orbit at distance r = 100 (normalized units) with G = 1, M = 50000:

💡Set the initial velocity to exactly the circular orbit speed to get a perfect circle. Increase it to get an ellipse. Exceed escape velocity to watch the body fly away.

Kepler's Laws

  1. First Law: Orbits are ellipses with the central body at one focus.
  2. Second Law: A line from the central body to the orbiting body sweeps equal areas in equal times (angular momentum conservation).
  3. Third Law: T² ∝ a³, where a is the semi-major axis of the orbit.

Energy Conservation

The total mechanical energy is the sum of kinetic and gravitational potential energy. For a bound orbit this is negative and remains constant.

Key Formulas

Newton's Law of Gravitation

Circular Orbit Speed

Escape Velocity

Orbital Period (Kepler's 3rd Law)

Eccentricity from Energy and Angular Momentum

FormulaDescriptionNotes
F = GMm/r²Gravitational forceInverse-square law
v_c = √(GM/r)Circular orbit speedDecreases with distance
v_esc = √(2GM/r)Escape velocityAlways √2 times circular speed
T² = 4π²a³/(GM)Kepler's 3rd lawa = semi-major axis
E = ½mv² − GMm/rTotal orbital energyNegative = bound, positive = escape
L = mr²ω = mrv⊥Angular momentumConserved in central force field
Eccentricity e = 0 gives a circle, e = 0.5 is a moderately elongated ellipse (like Mars), e = 0.967 is Halley's Comet, and e ≥ 1 means the orbit is open (parabola or hyperbola).

Frequently Asked Questions

Why does the orbit change shape when I change the initial velocity?

The shape of the orbit (its eccentricity) depends on the ratio of the initial speed to the circular orbit speed. At v_c you get a circle; below that, an inward-shifted ellipse; above that, an outward-shifted ellipse; at √2·v_c, you reach escape velocity and the orbit opens into a parabola.

Why does the orbiting body speed up near the central body?

This is Kepler's Second Law: angular momentum L = mrv is conserved. When r decreases, v must increase to keep L constant. The body converts gravitational potential energy into kinetic energy as it falls inward.

What is escape velocity?

Escape velocity is the minimum speed needed to escape the gravitational pull of the central body from a given distance: v_esc = √(2GM/r). It is always √2 ≈ 1.41 times the circular orbit speed at the same radius.

Why is total energy conserved?

Gravity is a conservative force — it does work on the orbiting body, but the work is reversible. Energy shifts between kinetic (½mv²) and potential (−GMm/r) forms, but the total E = KE + PE stays constant throughout the orbit.

What are Kepler's Laws and do they apply here?

Yes. Kepler's First Law (elliptical orbits), Second Law (equal areas in equal times), and Third Law (T² ∝ a³) all emerge naturally from Newton's inverse-square gravity law. The simulator implements this physics directly.