Experience gravitational chaos in full 3D. Interactive camera, real‑time RK4 integration, energy monitoring, and trajectory rendering. Discover figure‑8 orbits, Lagrange points, and the butterfly effect in celestial mechanics.
The three-body problem describes the motion of three point masses interacting via Newtonian gravity. Unlike the two-body problem (solvable by Keplerian orbits), the general three-body system exhibits deterministic chaos: infinitesimal differences in initial conditions lead to exponentially diverging trajectories – the "butterfly effect" in celestial mechanics. First studied by Newton, Euler, Lagrange, and later Poincaré, who discovered that the problem is non-integrable, laying the foundations of modern dynamical systems theory.
Equations of motion (Newton's law + gravitation):
\(\displaystyle \ddot{\mathbf{r}}_i = G \sum_{j \neq i} m_j \frac{\mathbf{r}_j - \mathbf{r}_i}{|\mathbf{r}_j - \mathbf{r}_i|^3 + \epsilon^2}\)
Where \(\epsilon\) = softening length prevents numerical singularities.
Our simulator uses a 4th-order Runge-Kutta (RK4) scheme, providing excellent accuracy for Hamiltonian systems. The total energy and angular momentum are monitored to assess integration quality — typical drift is below 0.5% for reasonable durations. We incorporate a softening parameter (Plummer style) to avoid close-encounter explosions and allow realistic trajectory visualization.
Why RK4? Higher-order symplectic integrators would be ideal, but for educational real-time simulation, RK4 balances performance and precision. The method evaluates accelerations four times per step, reducing error to \(O(\Delta t^4)\). With \(\Delta t = 0.012\) and speed multiplier, the system remains stable for chaotic evolutions. The gravitational constant G can be tuned, mimicking scale-free dynamics.
Run the Burrau preset, wait 20 seconds, then reset and nudge one coordinate by 0.01. The subsequent evolution diverges completely after a few orbital periods. This exemplifies Lyapunov instability and explains why long-term predictions in celestial mechanics (e.g., Solar System stability over millions of years) rely on statistical methods rather than deterministic extrapolation.
In 1887, King Oscar II of Sweden offered a prize for a solution to the stability of the Solar System. Henri Poincaré’s winning entry did not solve the three‑body problem but instead revealed that even simple gravitational systems can exhibit such sensitive dependence on initial conditions that long‑term prediction is impossible. His geometric methods gave birth to chaos theory. The simulator above allows you to recreate that unpredictability first hand.
Energy & angular momentum (conserved quantities of the exact system):
Total energy \( E = \sum_i \frac{1}{2} m_i v_i^2 - \frac{G}{2} \sum_{i \neq j} \frac{m_i m_j}{r_{ij}} \)
Our display shows relative drift; due to numerical integration, small variation is expected.