Reminuity  /  Celestial mechanicsLive code

Three stars, two futures

Move one starting position by 0.001 length units. Do the paths separate because gravity amplifies the change, or because the solver loses precision?

Star AStar BStar C

Change the timestep

Run a fixed-step leapfrog integrator on the figure-eight in your browser. Halve the timestep and compare how far a star ends from its starting point after one orbit.

Walk through the running code

The first half kick uses the current acceleration. Each star drifts across one timestep. The second half kick uses gravity at the new positions. The function below is the function called by Run integrator.

The research run uses adaptive eighth-order DOP853. An independent Radau collocation calculation assembles all pair forces in a different function. At every displayed instant we compare matching stars in both calculations.

For the triangle, the loosest run deviated by units somewhere along the path. Smaller step limits and tighter tolerances reduced that discrepancy. The live figure-eight experiment above changes only the timestep.

Read the published initial conditions and results. Chenciner & Montgomery’s figure-eight · Szebehely & Peters on Burrau’s triangle.