Part 1 of 11 of the research log of my 2024 summer project on the three-body problem, at the University of Edinburgh, supervised by Prof. Jenni Smillie.
Next: Symplectic Integrators
The project started with a direct simulation of three point masses moving under each other’s gravity.
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:
- 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 .\)
- Compute the new forces \(\mathbf{F}_{i+1}\) at the new positions.
- 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 .\)
The scheme needs one new force evaluation per step and is second-order accurate: halving \(\Delta t\) divides the error by four. I started to add the classical fourth-order Runge–Kutta method as well and then dropped it. It is more accurate per step, but it is not symplectic, so its energy error grows steadily over a long run, while Verlet’s stays bounded. Part 2 explains why.
Results
A typical run, with three equal masses starting on a line:
When two bodies pass very close to each other, the force between them becomes very large and one of them can leave at high speed. Part of this is physical: a close encounter transfers energy between the bodies, which is how a spacecraft gains speed in a gravity assist. Part of it is numerical. With a fixed time step, a very close pass is covered by only a few steps, the energy is no longer conserved, and a body can be thrown out when it should not be. The two cases can be told apart by checking the total energy during the run, which is why the later posts track the energy error.
Figure-eight orbits
Most three-body motions are chaotic. One exception is the figure-eight orbit, in which three equal masses follow each other around a single figure-eight-shaped curve. Cris Moore found it numerically in 1993, and Alain Chenciner and Richard Montgomery proved in 2000 that it exists (part 9).
In units with \(G = m = 1\), the orbit starts with the bodies at \((-1, 0)\), \((1, 0)\) and \((0, 0)\) and with velocities \((a, b)\), \((a, b)\) and \((-2a, -2b)\), where \((a, b) = (0.347111, 0.532728)\). It repeats after a period \(T \approx 6.326\).
Revised on 25 October and 11 November 2026. Nothing in the method was wrong, 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. The update is written with \(\mathbf{F}_i\), \(\mathbf{F}_{i+1}\) and \(\Delta t\). The starting values and period of the figure-eight orbit were added, with a remark on close encounters at a fixed time step.
Filed under Numerical Methods, Research, Three-Body Problem.