🪐 Planetary Formation

About this simulation

This is a 2D model of core accretion, the leading theory for how planets are born inside a protoplanetary disc orbiting a young star. Tiny dust grains collide and stick together, gradually building kilometre-sized planetesimals that grow into protoplanets. The same process shaped our own Solar System roughly 4.6 billion years ago, and astronomers now watch it unfold directly in discs imaged by the ALMA telescope.

How it works

Key equations

sigma = pi*r^2 * (1 + v_esc^2 / v^2) — gravitational focusing cross-section, where r is body radius, v_esc its escape speed and v the relative encounter speed. Larger bodies have a much bigger effective target, so growth accelerates: dM/dt ∝ r^2 * Sigma * Omega.

Controls

Did you know?

Beyond the snowline (~3 AU in our Solar System) water freezes into ice, adding solid material so cores grow faster — which is why the giant planets Jupiter and Saturn formed in the cold outer disc.

About this simulation

This simulator runs a 2D N-body model of core accretion in a protoplanetary disc. Hundreds of point-mass dust grains start on near-circular orbits between 80 and 290 pixels from a central protostar, each nudged every frame by an inverse-square gravitational pull scaled by disc density Σ and a linear velocity-proportional gas-drag term (F = −β·v) that slowly damps orbital speed. Pairwise distance checks detect collisions: bodies meeting below the sticking-velocity threshold merge inelastically, conserving momentum and combining mass (radius scales as mass1/3, i.e. constant bulk density), while faster impacts bounce elastically off the collision normal. Bigger bodies present a larger cross-section, so runaway accretion naturally emerges as the largest planetesimals sweep up material fastest.

🔬 What it Shows

Particles are colour-coded by growth stage — red dust (<3 m₀), orange pebbles (3–8 m₀), yellow rocks (8–20 m₀), green planetesimals (20–60 m₀), and blue protoplanets (>60 m₀) — orbiting a glowing protostar inside a dashed snowline ring at ~3 AU. The live stats panel tracks body count, the largest accumulated mass, elapsed simulation time in kyr, and the running merge count as runaway accretion thins the population into fewer, larger bodies.

🎮 How to Use It

Pick a Disc Preset (Dense, Sparse, Beyond Snowline, Inner System) to load a matched set of parameters, or drag the Particle count N, Disc density Σ, Sticking velocity v_stick, and Drag coefficient β sliders yourself. Press Run to start the physics loop, adjust Speed to fast-forward, toggle Show Snowline for the reference ring, and hit Reset to reseed a fresh disc.

💡 Did You Know?

Beyond the real Solar System's snowline (~3 AU), water and other volatiles freeze into ice, roughly doubling the solid material available for cores to sweep up. That extra icy mass is why Jupiter and Saturn's cores could grow large enough, fast enough, to capture their thick hydrogen-helium envelopes before the gas disc dispersed — while the inner, ice-free terrestrial planets stayed comparatively small and rocky.

Frequently asked questions

How does gravity work in this simulation, and what role does disc density Σ play?

Every particle feels an inverse-square pull toward the central protostar, computed as grav = density × 800 / distance², so the disc density slider Σ directly scales the strength of gravity felt by every body. Σ also sets each particle's initial near-circular orbital speed at spawn time (speed = √(density × 20 / r)), so a denser disc both starts particles moving faster and pulls them inward more strongly during the run.

What decides whether two colliding bodies stick together or bounce apart?

When two bodies' radii overlap, the simulator compares their relative speed to the Sticking velocity v_stick slider. Below that threshold they merge inelastically — a new body forms at their mass-weighted average position and velocity, conserving total momentum — and the merge counter increments. At or above the threshold they instead undergo a standard elastic collision, exchanging velocity along the line connecting their centres without combining mass.

Why does a body's radius grow as the cube root of its mass?

Merged bodies get a new radius from r = 2.5 × mass^(1/3), which is the geometric relationship between radius and mass for an object of constant bulk density (volume, and hence mass, scales with the cube of radius). This keeps larger, merged planetesimals visually proportionate rather than ballooning linearly with every collision, matching how real solid bodies of similar composition scale in size as they accumulate mass.

What happens to particles that spiral into the star or get flung out of the disc?

After each physics step, any body within 30 pixels of the protostar (fallen in) or beyond 340 pixels (ejected past the disc's outer edge) is removed from the simulation. This keeps the particle count from drifting unboundedly and approximates real mass loss to accretion onto the star or dynamical ejection from the system.

What does the dashed snowline ring represent, and does it change the physics?

The ring drawn at radius 200 px is a purely visual marker labelled "Snowline ~3AU," toggled on or off with the Show Snowline button — it does not itself alter gravity, drag, or sticking calculations for any particle. The physical idea it represents is captured instead by the separate Beyond Snowline preset, which loads a higher sticking velocity and disc density approximating the extra icy solid material available past the real ice line.