Skip to main content
Sandbox Physics

M078 · Every star pulls every star

N-Body Star Cluster

Release a three-dimensional cloud of gravitating particles. Change its initial speed, mass spread and force softening; follow collapse, rebound and expansion while auditing energy and momentum.

Interactive modelN-Body Star Cluster
Model timeReady\text{Ready}
Half-mass radiusReady\text{Ready}
Instantaneous virial ratioReady\text{Ready}
Total energyReady\text{Ready}
Energy error / initial binding scaleReady\text{Ready}
Total momentum magnitudeReady\text{Ready}

Physics tutorial

N-Body Star Cluster

BackgroundGravity changes the source cloud itself.

Why it mattersFollow all particles and test what the collective motion conserves.

Start with the essentials

Focus question
Does a cold cloud settle, rebound or escape?
One-sentence intuition
One instantaneous virial ratio cannot establish equilibrium.

Core mathematical model

Pair interaction

U=−∑i<jGmimjrij2+ϵ2U=-\sum_{i<j}\frac{Gm_im_j}{\sqrt{r_{ij}^2+\epsilon^2}}

Force and potential use the same softening.

Virial is a force moment

W=∑iri⋅Fi,Q=2K∣W∣W=\sum_i\mathbf r_i\cdot\mathbf F_i,\quad Q=\frac{2K}{|W|}

With softening, the virial moment differs from the potential energy.

Finite-time identity

12I¨=2K+W,I=∑imiri2\frac12\ddot I=2K+W,\quad I=\sum_i m_i r_i^2

A turning radius is not a proof of equilibrium.

Conservation audit

E=K+U,P=∑imiviE=K+U,\quad\mathbf P=\sum_i m_i\mathbf v_i

Track numerical drift independently of the apparent motion.

Common difficulties

A model boundary

Typical misconceptionA bright particle is a resolved star.

Better mental modelMarkers encode particle mass; close stellar encounters require a different model.

Run the experiment

  1. 01

    Release cold

    Play the cold-collapse preset.

    What to observe: The cloud contracts, then rebounds without an imposed restoring spring.
  2. 02

    Add speed

    Compare the warm and expanding clouds.

    What to observe: The same initial geometry produces different outcomes.
  3. 03

    Refine the force

    Halve the timestep with the same cloud seed.

    What to observe: Compare energy drift before interpreting detailed encounters.
FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy