Click to place gravitational sources and watch the grid warp like a spacetime rubber sheet. Observe test particles tracing orbits and build an intuitive grasp of general relativity.
The simulator primarily uses Newton's Law of Universal Gravitation to calculate the force between two masses. This force is always attractive and depends on the product of the masses and the inverse square of the distance between them.
$$F = G \frac{m_1 m_2}{r^2}$$F is the gravitational force. G is the gravitational constant. m₁ and m₂ are the masses (e.g., the central star and a planet). r is the distance between their centers.
For orbital motion, this central force is balanced by the required centripetal force for circular motion. This gives us the equation for orbital velocity.
$$v = \sqrt{\frac{GM}{r}}$$v is the orbital speed. M is the central mass. r is the orbital radius. This shows why increasing the central mass (with the slider) requires a higher speed for a stable orbit at the same distance.
Satellite Orbit Planning: Every communications or GPS satellite must be placed in a precise orbit. Engineers use these exact equations to calculate the required launch velocity and orbital altitude, ensuring the satellite doesn't drift away or fall back to Earth.
Space Mission Trajectories: Missions like the Voyager probes or the Parker Solar Probe use "gravity assists." They carefully aim their trajectory to "slingshot" around a planet, using its gravity well to gain speed without using fuel, a direct application of orbital mechanics.
Understanding Black Holes: A black hole is an infinitely deep gravity well. The concepts here—like the escape velocity becoming greater than the speed of light at the event horizon—are extreme versions of the physics you're simulating.
CAE & Astrophysics Simulations: In Computer-Aided Engineering, sophisticated versions of this simulator are used to model galaxy formations, predict asteroid paths, and plan complex multi-planet space missions, testing millions of orbital scenarios before launch.
First, understand that this simulator is a 2D analogy. Actual spacetime curvature occurs in four dimensions (3D space + time), and this "rubber sheet" image is merely an aid for understanding. Crucially, particles don't "fall" in a "downward" direction relative to the sheet; the essence is that they move as a result of traveling through the distorted geometry itself.
Next, the setting of the "softening" parameter. Setting this to small values like 0.1 or 0.01 makes it easy for particles to collide violently with the gravity source, causing the calculation to diverge. In practice, you adjust it according to the scale of your simulation. For example, in galaxy collision simulations, the distances between stars are vast, so a relatively large softening value is used to stabilize the calculation. Conversely, for precise calculations of small systems, you use a smaller value, but you must correspondingly reduce the timestep (the increment of time). The erratic orbits you see in this simulator when you increase the "particle's initial velocity" occur because the timestep is fixed, which is another point to watch for in practical applications.
Finally, the characteristics of "Verlet integration". While this method has good energy conservation properties, it does not calculate velocity directly (it's derived from the difference in positions). Therefore, if you later need to add velocity-dependent forces (like air resistance), some extra consideration is needed. This simulator uses it simply because it deals with pure gravity, but keep this in mind when applying it elsewhere.
Place a 10 solar mass neutron star at canvas center with sl-mass=10 and sl-g=1.0. Set grid resolution to 32 divisions. A test particle released 50 pixels away experiences geodesic acceleration toward the mass well. With tog-trail enabled, the particle traces a spiraling infall path over ~15 seconds before crossing the event horizon approximation. Increasing sl-g to 2.5 steepens the metric curvature, reducing orbital decay time to ~6 seconds and demonstrating how gravitational strength scales nonlinearly with source mass.