This simulator integrates a linearised tidal-torque model, dω/dt = −k·(ω − n), where ω is the moon's spin rate, n is a fixed orbital mean motion (n = 1), and k encodes the tidal Love number k₂ over the dissipation quality factor Q. Each tick nudges ω toward n in proportion to their difference, so spin decays exponentially into synchronous rotation without overshoot — flagged "tidally locked" once |ω−n|/n falls under 2%. Alongside it the simulator draws the Roche radius, R·(2M_planet/M_moon)^(1/3), and warns when the orbit sits inside it, since tidal stress there overwhelms the moon's self-gravity and would tear it apart.
A moon orbiting a planet while a tidal bulge is dragged toward the planet by gravity, gradually slowing the moon's spin from its initial rate down to match its orbital period — with a dashed Roche-limit circle marking where tidal disruption would take over.
Pick a preset (Moon, Pluto-Charon, Hot Jupiter, Mercury) or drag the mass ratio, orbital distance, initial spin and k₂/Q sliders yourself, then press Run and watch the spin-rate history chart decay toward the green synchronous line while the bulge settles into shape.
The relaxation law dω/dt = −k·(ω−n) means ω only ever approaches n asymptotically and never reaches it exactly — which is why the simulator (and real tidal-evolution models) declare a body "locked" once it gets within a small tolerance rather than waiting for an exact match.
The simulator integrates a simple linear relaxation law, dω/dt = −k·(ω − n), where ω is the moon's spin rate, n is its fixed orbital mean motion (set to 1.0), and k is the tidal dissipation constant set by the k₂/Q slider. Each animation tick advances ω toward n in proportion to how far it already is from n, so the spin rate decays exponentially toward synchronous rotation rather than overshooting or oscillating.
On every frame the code checks |ω − n| / n < 0.02, i.e. whether the spin rate is within 2% of the orbital mean motion. Once that threshold is crossed the canvas displays the on-screen banner "TIDALLY LOCKED". The underlying relaxation equation never lets ω reach n exactly, so 2% is used as a practical stand-in for true synchronous rotation.
The Roche radius is computed as R = 1.5 · planetRadius · (2 · massRatio)^(1/3), a simplified version of the rigid-body Roche limit formula d = R·(2M_planet/M_moon)^(1/3), and drawn as a dashed red circle around the planet. If the current orbital distance places the moon's orbit inside that circle, the canvas prints an "INSIDE ROCHE LIMIT" warning, since tidal stress there would exceed the moon's self-gravity.
Each preset sets four parameters at once: the planet-to-moon mass ratio, the orbital distance in Roche-radius units, the initial spin rate as a multiple of the orbital rate, and the tidal dissipation constant k₂/Q. Mercury uses an extreme mass ratio (6,000,000) and a low k₂/Q (0.003) to illustrate a very slow, weakly-dissipating spin-down, while Hot Jupiter combines a close orbit (3 Roche radii) with strong dissipation (0.08) to show near-instant locking.
The drawn moon is an ellipse whose elongation is scaled by lockFrac, a value derived from how close the current spin rate is to the orbital rate — the same |ω − n| quantity used for the lock check. As ω relaxes toward n the ellipse's eccentricity is recomputed each frame, so the tidal bulge visibly settles into its final, more symmetric shape as synchronous rotation is approached, and the orange spin-indicator line rotates more slowly relative to the bulge.