Three Body Problem Simulator

Simulate three gravitational bodies in a two-dimensional plane with editable masses, velocity vectors, trails, and stable or chaotic presets.

E 0.00
R 0.00
COM 0.00, 0.00
Utilities Studio

Want this utility on your website?

Customize colors and dark mode for WordPress, Notion or your own site.

Frequently Asked Questions

What is the three-body problem?

The three-body problem asks how three masses move when each body gravitationally attracts the other two. Unlike the two-body problem, there is no general closed-form equation that solves every possible configuration, so most practical cases are explored with numerical integration.

Why are three-body orbits unstable?

Many three-body systems are sensitive to initial conditions. A tiny change in velocity, position, or mass changes the timing of close encounters, and those encounters can exchange energy dramatically. The result is a system that may remain bounded for a while and then suddenly eject one body.

What does the figure-eight preset show?

The figure-eight preset is a famous periodic solution for three equal masses. Each body follows the same path with a phase offset, demonstrating that the three-body problem can contain elegant stable islands inside a much larger chaotic landscape.

Is this a physically exact astronomy simulator?

This tool uses a softened Newtonian model and a symplectic-style velocity Verlet step so the motion feels faithful and stable for learning. It is designed for interactive exploration rather than high-precision ephemeris prediction.

How should I interpret total energy?

Negative total energy usually indicates a bound system, while energy closer to zero can make escape easier. In a numerical simulation, large energy drift also warns that the time step or encounter geometry is stressing the integrator.

# Interactive Three-Body Problem Simulator for Orbital Chaos

The three-body problem is one of the clearest demonstrations that simple laws can produce complicated motion. Newtonian gravity gives a compact force rule, but the moment a third massive body joins the system, each orbit continuously reshapes the other two. This simulator lets you experiment with that instability directly: choose a known configuration, adjust masses and velocity vectors, and watch whether the bodies form a repeating orbit, a rotating triangle, or a chaotic scattering event.

# What the Presets Demonstrate

Preset Physical idea What to look for
Figure eightA periodic equal-mass solution where all three bodies share the same loop.The orbit remains organized only when symmetry and velocity balance are carefully preserved.
Lagrange triangleThree bodies occupy an equilateral triangle that rotates around the center of mass.Mass balance and tangential velocity keep the triangle from collapsing inward.
SlingshotA close encounter transfers energy between bodies.One body can gain speed while another becomes more tightly bound, revealing why chaotic ejections occur.

# Why Small Changes Matter

In a two-body orbit, the center of mass and orbital ellipse provide a stable geometric picture. In a three-body system, close passes act like gravitational negotiations: a body can borrow orbital energy, change direction sharply, or convert an orderly loop into a scattering event. That sensitivity is why real astrophysical systems such as triple stars, planet-moon encounters, and early solar-system planetesimals often require numerical integration rather than a single neat formula.

# How to Use the Diagnostics

  • Total energy helps you judge whether the system is bound and whether the numerical integration is staying stable.
  • Separation range shows the closest and farthest pair distances, making near-collisions and ejections easy to spot.
  • Center of mass should remain relatively steady when the initial momentum is balanced; drift suggests an intentionally asymmetric setup or a changed velocity vector.
  • Trail length reveals long-term structure: short trails emphasize the current interaction, while long trails expose repeating loops and slow orbital precession.

# Numerical Model Used in the Tool

The simulator uses Newtonian inverse-square attraction with a small softening term that prevents visual blow-ups during extremely close passes. Motion is advanced with a velocity Verlet style step, a common choice for orbital demonstrations because it handles energy behavior better than a simple Euler update. The result is a responsive educational model that makes the qualitative behavior of the three-body problem visible without pretending to replace professional celestial mechanics software.

Bibliographic References