← Space

🌑 Orbital Mechanics

About Orbital Mechanics

This simulation models gravitational motion as a true N-body problem: every massive body attracts every other through Newton's law of gravitation, with acceleration a = G·M/r². Working in astronomical units, years and solar masses sets G = 4π² from Kepler's third law. A symplectic Velocity Verlet integrator advances positions and velocities together, conserving energy over long runs so the looping orbits stay stable rather than drifting.

You choose one of three scenarios, set how many simulated years pass per real second, and toggle orbit trails, body labels, velocity vectors and the five Lagrange-point markers. Pause, reset, zoom, pan, and click a body to follow it while reading its speed and orbital radius. The same mathematics underpins real astrodynamics: planning satellite orbits, interplanetary trajectories and gravity-assist flybys that steal momentum from a planet.

Frequently Asked Questions

What does this orbital mechanics simulation show?

It shows real gravitational motion computed as an N-body problem, where every body pulls on every other. Three scenarios are available: the inner Solar System out to Jupiter, the Sun–Jupiter Lagrange points populated with Trojan asteroids, and a gravity-assist flyby of a giant planet.

What integration method does it use?

It uses Velocity Verlet, a symplectic integrator. Symplectic schemes conserve energy and angular momentum well over long timescales, so orbits do not spiral in or fly apart through accumulated numerical error, which is exactly what makes them suited to celestial mechanics.

Which units and constants are used?

Distances are in astronomical units (AU), time in years and mass in solar masses. In these units Kepler's third law gives the gravitational constant the convenient value G = 4π² ≈ 39.48, so a planet at 1 AU orbits the Sun in 1 year.

What do the on-screen controls do?

The Scenario menu switches between the Solar System, Lagrange points and gravity assist. The Speed slider sets simulated years per real second (0.1 up to 50). Checkboxes toggle orbit trails, body labels, velocity vectors and Lagrange-point markers, and Pause and Reset freeze or restart the run.

What are Lagrange points and Trojan asteroids?

Lagrange points are five positions in a two-body system where gravity and orbital motion balance. L4 and L5, sixty degrees ahead of and behind the planet, are stable, so small bodies cluster there. The simulation seeds 35 Trojan asteroids near Jupiter's L4 and L5, where they librate as in reality.

How does a gravity assist actually work?

A spacecraft passes close to a moving planet and exchanges momentum with it. In the planet's frame the probe's speed is unchanged, but because the planet is moving in the Sun's frame, the encounter adds or removes heliocentric velocity. The flyby scenario launches a probe on a transfer orbit toward Jupiter to show this.

Is the simulation physically accurate?

The physics is genuine Newtonian gravity with real relative masses and orbital radii for the Sun and planets. It is two-dimensional and uses circular starting orbits with sub-stepping for stability, so it captures the essential dynamics faithfully but is not a precision ephemeris for predicting exact positions.

Why do the orbits look slightly different each time?

In the Solar System scenario each planet starts at a random angle around its orbit for visual variety, and Trojan asteroids are scattered with small random spreads in position and speed. The underlying physics is identical; only the initial conditions differ between resets.

What does focusing on a body tell me?

Clicking a labelled body locks the camera to follow it and opens a readout of its name, speed in kilometres per second and orbital radius in AU. Speed is converted using the relation that 1 AU per year is approximately 4.74 km/s, letting you compare planets quantitatively.

Where is this kind of computation used in the real world?

Mission designers use N-body integration to plan satellite constellations, station-keeping at Lagrange points such as the James Webb telescope at L2, and interplanetary routes. Voyager 2's tour of Jupiter, Saturn, Uranus and Neptune relied on chained gravity assists from a rare alignment that recurs only about every 175 years.

🚀 Orbital Mechanics — Velocity Verlet

N-body Velocity Verlet integrator with three scenarios: inner Solar System orbits, Lagrange Points with Jupiter Trojan asteroids, and a gravity-assist flyby past a giant planet.

🔬 What It Demonstrates

Velocity Verlet integration is symplectic — it conserves energy over long timescales, making it ideal for orbital simulations. Gravity-assist transfers orbital energy between bodies.

🎮 How to Use

Switch between scenarios. Watch Trojan asteroids librate around Jupiter's L4/L5 Lagrange points. In flyby mode, observe how a spacecraft gains speed from planetary encounter.

💡 Did You Know?

Voyager 2 used four consecutive gravity assists (Jupiter, Saturn, Uranus, Neptune) — a rare planetary alignment that occurs only every 175 years. The next one is around 2152.