Orbital Resonance — Mean-Motion Lock
Preset: 3:2 t = 0.00 yr

About this simulation

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 7 July 2026

This simulator models mean-motion orbital resonance for two or three bodies on circular (e = 0) orbits around a central star. Each body's orbital period follows Kepler's third law in normalised units, T = a^1.5, so the code advances every body's mean longitude λ at rate n = 2π/T per simulated year. A conjunction is flagged whenever the wrapped phase difference between two bodies' longitudes crosses zero. For a chosen p:q ratio the code tracks the resonance angle σ = p·λ₂ − q·λ₁ (or λ₁ − 3λ₂ + 2λ₃ for the 4:2:1 Laplace preset); with no preset selected it searches integers p, q ≤ 6 for the closest rational approximation to the actual period ratio, then classifies σ's unwrapped history as librating, circulating, or quasi-librating.

What it shows

Two or three bodies orbiting a central star on circular paths, with fading conjunction lines drawn each time their longitudes align, coloured trails tracing recent motion, and a resonance-angle σ inset graph that reveals at a glance whether the system is locked or drifting.

How to use it

Pick a famous ratio from the Resonance preset dropdown (or switch to 3 bodies for the Laplace chain), drag the semi-major axis sliders to explore any ratio in Free mode, adjust Time rate, toggle conjunction lines / the σ inset / trails, then Pause or Reset as needed.

Did you know?

Pluto's 3:2 resonance with Neptune is the exact reason it never collides with Neptune despite their orbits crossing, while the Galilean moons Io, Europa and Ganymede lock into the famous 4:2:1 Laplace resonance — the same chain reproduced by this simulator's "laplace" preset.

Frequently Asked Questions

What determines whether the resonance angle librates or circulates in this simulation?

The code accumulates the resonance angle σ over up to 600 time steps, computed either from the chosen p:q preset as σ = p·λ2 − q·λ1 (or the Laplace argument λ1 − 3λ2 + 2λ3 for the 3-body case), then unwraps that history to remove ±π wrap artifacts. If the unwrapped range stays under 2.5π it is classified "Librating (locked)"; if the net span exceeds 6π and the range exceeds 4π it is "Circulating"; otherwise it shows "Quasi-libration".

How exactly are conjunctions detected and drawn?

detectConjunction() wraps the longitude difference λ2 − λ1 into [-π, π] and flags a conjunction only when its sign flips while both the previous and current wrapped values stay within 1 radian of zero, which filters out false triggers from ordinary ±π wrap-around jumps. Each detected conjunction is stored with its longitude and an age counter; the conjunction line is drawn from the inner to the outer orbit at that longitude and fades out as its age approaches 12 seconds of real time, after which it is removed.

Why does choosing a resonance preset move the semi-major axis sliders?

applyPresetAxes() inverts Kepler's third law (a = T^(2/3)) on the preset's target period ratio, normalises so the innermost axis equals 1, then rescales every axis by the current a1 slider value and writes the resulting a2 and a3 back onto their sliders. Dragging any axis slider afterward switches the preset dropdown back to "free", since the code no longer knows which target ratio you intend.

Are the orbits shown as ellipses with real eccentricity?

No. Every orbit is drawn as a perfect circle of radius state.a[i]·radius regardless of the selected preset — eccentricity is never modelled. The simulator only advances each body's mean longitude λ at Kepler's mean motion n = 2π/T along that circular path, so it demonstrates resonance locking in orbital phase rather than full two-body elliptical dynamics with a real orbit shape.

What does "Free" mode do differently from a preset like 3:2?

A preset fixes a target period ratio and derives matching semi-major axes for you automatically via applyPresetAxes(). Free mode skips that step entirely and simply uses whatever values are currently on the a1/a2/a3 sliders, letting you dial in any combination — resonant or not — and watch the resonance-angle inset and Behaviour stat report whether that particular ratio librates or circulates.