Click to place in a circular orbit · drag to launch · drag a body to move it
Physics
Scenarios
right-drag pan · wheel zoom · Space pause Del remove · F follow · C circularise · R reset
System
Bodies0
Total mass0
Kinetic energy0
Potential energy0
Total energy0
Energy drift0
Momentum |p|0
Angular momentum0
Step size–
Sim time0 s
Collisions · escaped0 · 0
Position
Speed
Kinetic energy
Orbiting
Semi-major axis
Eccentricity
Periapsis · apoapsis
Period
Escape speed here
How the simulation works
Gravity
Every body pulls on every other with Newton's law, a = G·m·r / (|r|² + ε²)3/2. The softening length ε stops forces from blowing up during very close passes. Set it to 0 for pure point masses. Forces are computed for all pairs (O(n²)) and applied symmetrically, so total momentum is conserved.
Integration
Velocity Verlet (kick–drift–kick) is the default. It is symplectic, so the energy error oscillates but does not grow over long runs, which is what keeps orbits stable for many periods. RK4 is more accurate per step but slowly drifts. Explicit Euler is there to show what goes wrong: it adds energy every step, and orbits spiral outwards. Watch Energy drift in the System panel as you switch between them.
Time step
The step is adapted to the tightest encounter: h = η·min √(r³ / G(m₁+m₂)) with η = 0.03, between 0.0002 and 0.02 s. Each frame runs enough steps to cover the requested time, within a fixed amount of work per frame. If a big system can't keep up, the panel says so rather than silently taking larger, less accurate steps.
Collisions
Merge is a perfectly inelastic collision: mass, momentum and centre of mass are conserved, volumes add, and kinetic energy is lost (it would become heat). A star that grows past 1.5 M collapses into a black hole. Bounce is an elastic collision along the line of centres. Asteroid–asteroid contacts are ignored, because the drawn radii are exaggerated.
Orbital elements
For the selected body, the inspector shows the Keplerian orbit around whichever body pulls on it hardest: semi-major axis, eccentricity, periapsis and apoapsis, period and local escape speed. This is a two-body approximation. With several massive bodies nearby, the real path will differ from the drawn ellipse.
Units and limits
Units are arbitrary (distance u, time s, mass m, G = 1 by default), chosen to make systems watchable, not to match the real Solar System. The simulation is 2D and Newtonian, with no relativity. Long-term predictions are only as good as the integrator and step size; chaotic systems such as close three-body encounters diverge quickly whatever the method.