2 minute read Introductory

From the archive (2024). Corrected in October 2026; see the note at the end.

Summer research 2024: the three-body problem · Part 1 of 11

A weekly research log from my summer project at the University of Edinburgh, supervised by Prof. Jenni Smillie.

Symplectic Integrators →

What happens when three bodies move under each other’s gravity? In this first post I build a simple simulation and look at the results.

How the simulation works

The gravitational force on body 1 due to body 2 is

\[\mathbf{F}_{12} = -\frac{G m_1 m_2 (\mathbf{r}_1 - \mathbf{r}_2)}{|\mathbf{r}_1 - \mathbf{r}_2|^3},\]

and the total force on each body is the sum of the contributions from the other two.

To advance the positions and velocities in time with a step \(\Delta t\), I use the velocity Verlet scheme:

  1. Update the positions using the current force \(\mathbf{F}_i\): \(\mathbf{x}_{i+1} = \mathbf{x}_i + \mathbf{v}_i\, \Delta t + \frac{\mathbf{F}_i}{2m}\, \Delta t^2 .\)
  2. Compute the new forces \(\mathbf{F}_{i+1}\) at the new positions.
  3. Update the velocities using the average of the old and new forces: \(\mathbf{v}_{i+1} = \mathbf{v}_i + \frac{\mathbf{F}_i + \mathbf{F}_{i+1}}{2m}\, \Delta t .\)

Repeating this over many steps and animating the positions gives the results below.

Results

Watching the bodies swing around each other is mesmerising. Here is an example:

Whenever two bodies pass very close to each other, the force between them becomes very large and they can be flung off at high speed. Spacecraft exploit the same effect to gain speed, in a gravity assist.

Figure-eight orbits

Most three-body motions are chaotic and follow no discernible pattern. Remarkably, though, there is a periodic figure-eight orbit, in which three equal masses chase each other around a single figure-eight-shaped curve. It was found numerically by Cris Moore in 1993, and its existence was proved by Alain Chenciner and Richard Montgomery in 2000 (the proof is the subject of part 9).

Progress

I also tried the fourth-order Runge–Kutta method (RK4), but RK4 is not a symplectic integrator: over long simulations its energy error drifts steadily. For long-time orbital integration, symplectic methods such as Verlet are the better choice, which is the subject of the next post.

Changes on 25 October 2026

What was wrong. Nothing in the method, but the velocity Verlet update used \(\mathbf{F}_1\) and \(\mathbf{F}_2\) for the forces at two successive times, which reads like the forces on bodies 1 and 2, and \(t\) for the time step.

What changed. The update is written with \(\mathbf{F}_i\), \(\mathbf{F}_{i+1}\) and \(\Delta t\), and the wording is tightened.