Simulation link copied
Gravity Pulse

Interactive N-Body Gravitational Dynamics

Interactive Gravity Simulator

An interactive gravity sandbox for exploring orbital motion, gravitational attraction, and simplified collisions between massive bodies.

Dimensionless Simulation Units • Velocity Verlet Solver
SCENARIOS:
SPAWNING TOOLBELT SLINGSHOT
MASS (u): 80
💡 How to Launch: Click & drag on empty canvas to aim velocity vector, then release to launch into orbit!

⚡ Explore Gravity: Interactive Experiments

Select an orbital mechanics experiment to load directly into the live simulator.

☀️ Orbital Speed

Stable Solar System

Orbital motion occurs because gravity continuously accelerates planets inward toward the central body while their tangential velocity carries them forward.

Try this: Adjust the G constant slider or spawn a rogue planet across the ecliptic plane to observe how the inner orbits respond.
💫 Barycenter

Binary Star System

Two massive bodies orbit a shared center of mass (barycenter) rather than one remaining stationary, demonstrating mutual gravitational attraction.

Try this: Add a third body into the circumbinary space or spawn an asteroid between the stars to observe gravitational slingshots.
♾️ Choreography

Figure-8 Three-Body

Under carefully calculated initial conditions (Chenciner & Montgomery, 2000), three equal masses can trace an identical planar figure-eight path indefinitely.

Try this: Launch a tiny asteroid probe into the crossing point to see how minor perturbations rapidly destabilize chaotic orbits.
🕳️ Inelastic Mergers

High-Mass Debris Swarm

A stylized high-mass body anchors an orbital swarm of debris particles. Bodies that make geometric contact undergo momentum-conserving mergers.

Try this: Increase Time Warp to watch the inner debris rapidly collide and coalesce into the central body, conserving total momentum.
🌀 Equilibrium

Lagrange Equilibrium (L4/L5)

Demonstrates stable gravitational equilibrium points 60° ahead (L4) and 60° behind (L5) a secondary body orbiting a massive primary star.

Try this: Toggle Gravity Vectors to visualize how the combined gravitational forces of the two massive bodies shepherd the Trojan clusters.

01. How Gravity Creates Orbits: Continuous Free Fall

Understanding the geometry of orbital motion through vectors and momentum.

An orbit is not a state of zero gravity. Instead, an orbit is continuous free fall. As an object travels through space, gravity constantly pulls it inward toward another mass. At the same time, the object’s forward tangential velocity carries it forward.

If the sideways speed is calibrated correctly, the falling trajectory bends at the exact rate the surface of the primary body curves away underneath it. The body continues to fall indefinitely without ever hitting the ground.

Connecting Vectors in Gravity Pulse:
  • • Velocity Vectors (Cyan): Point in the direction the body is currently traveling. The arrow length indicates instantaneous speed.
  • • Gravity Vectors (Purple): Point directly along the line of net gravitational acceleration toward neighboring masses.
  • • Ghost Trails: Reveal the curved historical path created by the continuous perpendicular acceleration.
The Three Orbital Regimes
1. Sub-Orbital (v < v_orbit):

Sideways speed is insufficient to overcome inward gravitational pull; the body spirals inward and merges with the primary.

2. Bound Orbit (v_orbit ≤ v < v_escape):

The body enters a stable, recurring elliptical trajectory with the primary mass at one focus.

3. Escape Trajectory (v ≥ v_escape):

Kinetic energy exceeds gravitational potential energy; the path opens into an unbound parabolic or hyperbolic trajectory into deep space.

02. Newton's Law of Universal Gravitation

Theoretical physics equation vs. simulation implementation

In physical reality, the gravitational attraction between two masses is governed by Newton's inverse-square law:

F = G · (m₁ · m₂) / r²

Where G is the gravitational constant, m₁, m₂ are the interacting masses, and r is the distance between their centers.

Plummer Softening in Gravity Pulse: In computer simulations, when two point masses pass extremely close to one another (r → 0), the force approaches infinity, causing catastrophic numerical instability. Gravity Pulse applies a softening factor (ε = 8.0 u):
a_i = G · m_j · r_ij / (|r_ij|² + ε²)^(3/2)

03. Orbital & Escape Velocity Relationships

Conceptual velocity requirements for bound orbits

For an ideal circular orbit around a dominant primary mass M at radius r, centripetal acceleration equals gravitational acceleration:

v_orbit = √(G·M / r)   |   v_escape = √(2·G·M / r)
  • • Mass Proportionality: Greater primary mass M demands a higher orbital speed to avoid falling inward.
  • • Distance Relationship: As orbital distance r increases, required circular speed drops by 1/√r.
  • • Escape Velocity Factor: Multiplying circular speed by √2 (≈ 1.414) yields escape velocity, allowing a body to permanently break free of the gravitational well.

04. How Gravity Pulse Works: Model & Limitations

A transparent engineering overview of the simulator's computational mechanics.

Newtonian Gravity Model

Calculates mutual gravitational attraction using Newton's universal force law with Plummer softening. Every pair of bodies interacts symmetrically (Newton's third law) with O(N²) computational complexity.

Velocity Verlet Integrator

Uses a symplectic Velocity Verlet multi-substep integration scheme (4 substeps per 60 Hz physics tick). Symplectic integrators preserve phase-space volume and provide superior long-term energy stability compared to standard Euler integration.

Fixed Physics Timestep

A fixed 60 Hz physics accumulator decouples physics integration from the monitor refresh rate (40 Hz, 60 Hz, 144 Hz). Simulation progression is consistent across devices and immune to tab-switch physics spikes.

Dimensionless Simulation Units

Gravity Pulse uses dimensionless simulation units (mass u, distance u, velocity u/t). The simulator demonstrates gravitational principles and orbital behavior rather than reproducing calibrated astronomical measurements.

Simplified Inelastic Mergers

Collisions are treated as perfect inelastic mergers. Mass is summed, linear momentum is strictly conserved (v_new = [m₁v₁ + m₂v₂] / [m₁ + m₂]), and radius expands under volume conservation. Fragmentation is not modeled.

Simulation Scope & Boundaries

Does not model general relativity, spacetime curvature, frame-dragging, or gravitational radiation. Designed as an interactive educational laboratory for learning orbital mechanics, not precision astronomical prediction.

? Frequently Asked Questions

Detailed answers regarding the Gravity Pulse physics engine and simulator features.

What does Gravity Pulse simulate?

Gravity Pulse simulates the mutual gravitational attraction between multiple bodies in 2D space using Newton's law of universal gravitation with gravitational softening. It allows users to experiment with planetary orbits, binary star pairs, and chaotic three-body configurations.

Is Gravity Pulse physically accurate to real astronomical systems?

Gravity Pulse is an interactive educational sandbox rather than a calibrated astronomical ephemeris. It accurately computes Newtonian gravitational forces and symplectic orbital integration, but uses dimensionless units and simplified assumptions rather than reproducing exact planetary distances or orbital periods.

What units does Gravity Pulse use?

Gravity Pulse uses transparent, dimensionless simulation units: mass units (u), distance units (u), and velocity units per tick (u/t). It does not use real-world units like solar masses, astronomical units, or km/s.

Why do planets orbit instead of falling directly into the star?

An orbit is continuous free fall. An orbiting body possesses sufficient sideways (tangential) velocity so that as gravity curves its trajectory downward, the surface curves away underneath it at the exact same rate.

What is gravitational softening?

In pure Newtonian gravity, the force approaches infinity as distance approaches zero. Gravity Pulse incorporates a softening parameter (epsilon = 8.0 units) into the denominator to prevent unrealistic numerical acceleration spikes during close flybys.

Does Gravity Pulse simulate general relativity?

No. Gravity Pulse does not model general relativity, spacetime curvature, frame dragging, or gravitational waves. The black-hole objects in the simulator are stylized, high-mass bodies operating under the same softened Newtonian gravity model.

What happens when two bodies collide in the simulator?

When two bodies make geometric contact, the simulation resolves the event as a perfect inelastic merger. Mass is summed, total linear momentum is strictly conserved to compute the new velocity, and the new radius is calculated via volume conservation. Fragmentation and explosive debris are not modeled.

Can I share my custom simulation?

Yes. Clicking the Share button encodes your simulation's celestial bodies, velocities, masses, and gravity settings into a compact URL link that can be shared and reopened on any device.