1. Generate a system
Each run samples three masses and an orbital configuration from the selected preset, then recenters the system so its total momentum begins near zero.
Truuts experiment
A live Newtonian gravity experiment in which three massive bodies continuously reshape one another’s orbits. Change the starting regime and watch predictable equations produce chaotic motion.
Choose an initial-condition regime or restart the system to generate a new trajectory. Every restart varies masses, positions and velocities inside the selected range.
The three-body problem asks how three masses move when every body gravitationally attracts both of the others. The equations are deterministic, but unlike the ideal two-body problem there is no single general formula that predicts every future position. The trajectory has to be integrated forward in small time steps.
This experiment starts with a binary pair and places a third body inside their shared gravitational field. Depending on the randomized masses, positions and velocities, the newcomer may enter a temporary orbit, exchange partners with one member of the binary, trigger a close encounter or gain enough energy to escape.
The same initial-condition preset can therefore produce visibly different histories. That sensitivity is the point of the simulation: simple, exact rules do not guarantee a simple or practically predictable outcome.
Each run samples three masses and an orbital configuration from the selected preset, then recenters the system so its total momentum begins near zero.
All three body pairs apply inverse-square gravitational attraction. No object follows a scripted path and no body is fixed at the center.
A leapfrog-style Velocity Verlet integrator updates velocities and positions through eight physics substeps for each 30 Hz simulation interval.
The live display compares pair distances to label formation, a surviving binary or a temporary capture while trajectory trails reveal the recent orbital history.
Every body attracts both other bodies according to their masses and the inverse square of their separation. The force is recalculated after every step.
A kick–drift–kick Velocity Verlet scheme is better suited to orbital systems than naïve Euler integration because it limits long-term numerical energy drift.
Eight substeps are evaluated for each 30 Hz simulation interval, reducing instability around fast motion and close approaches.
A small epsilon limits near-singular acceleration when two simulated point masses pass extremely close to one another.
Tiny changes in starting mass, position or velocity can change which pair survives, which object is captured and whether an escape occurs.
The overlay compares the current total kinetic and potential energy with the initial value, exposing numerical drift instead of hiding it.
The view follows the changing center and spatial extent of the system while finite trails preserve enough history to make orbital exchanges readable.
A run is regenerated after a collision threshold, extreme separation, invalid numerical state or time limit so the installation can continue autonomously.
The blue body may orbit one member of the original pair for several turns without becoming permanently bound. Watch the closest-pair phase indicator change.
A three-body encounter can eject an original partner and leave a new binary behind. Trails make the change of orbital allegiance visible.
One body can take orbital energy from the others during a close encounter and leave on a widening trajectory while the remaining pair tightens.
The model is an educational approximation, not an astronomical ephemeris. A rising drift value signals accumulated numerical error, especially during close passes.
Limits of the model: bodies are point masses rendered at an illustrative size; units are normalized; collisions, relativity, tides and external forces are omitted; softening deliberately changes the force law at very small distances. The visualization demonstrates dynamical behavior rather than reproducing a named real star system.