A Byte of PhysicsLogo

Many-body systems

A many-body model stores one state record per body and derives system-level quantities by reducing across the collection. The important question is which bodies and forces belong inside the boundary.

Think like a programmer

A many-body simulation is an array update plus reductions. Keep per-body state local, then calculate total momentum, energy, or center of mass in separate pure passes so invariants remain inspectable.

Model checklist

Inputs
Array of masses, positions, velocities, and interactions.
State
One record per body.
Rule
Update each body from forces, then reduce system totals.
Output
Center of mass and conserved totals.
Check
Internal forces do not change isolated-system momentum.

Mass-weighted location

Change the right-hand mass. The center moves toward it, but always remains between the two bodies.

Left mass 1 kg at 0 m; right mass 3 kg at 8 m; center of mass 6.00 m.

One body record, two passes

Give every body an immutable record such as mass, position, velocity, force accumulator, and optional radius or identity. An update starts by zeroing fresh force accumulators, visits each unordered pair once, adds equal and opposite internal forces, then advances every body from the completed force array. Do not move body A before calculating A–B and then calculate B–A from mixed old and new states.

The centre of mass is a reduction:

\[\mathbf R_{\mathrm{cm}}=\frac{\sum_i m_i\mathbf r_i}{\sum_i m_i}, \qquad \mathbf P=\sum_i m_i\mathbf v_i.\]

It is a derived result, not another particle that receives pair forces. The same separation applies to total momentum, kinetic energy, potential energy, and angular momentum. State the system boundary before reducing: a thermostat, a wall, a rocket exhaust, or an external field can legitimately change a total.

Pairing and diagnostics

For pairwise interactions, loop over each unordered pair once. Accumulate the force on both bodies in that single visit and retain enough information to inspect the pair distance, cutoff decision, and any softening policy. The work grows with the square of body count, so record body count, pair count, step time, and the approximation used when scaling beyond a teaching-sized system.

Test an isolated two-body fixture: pair forces cancel, total momentum stays constant within tolerance, and centre of mass moves at constant velocity. A translation of every initial position should translate the centre of mass without changing relative motion. Reordering input records should not change the physical result beyond documented floating-point summation differences. Compare a fixed physical duration at smaller time steps, and distinguish a bounded physical oscillation from a growing numerical invariant residual.

For collisions, decide whether they are resolved as impulses, soft potentials, or excluded. For long-range gravity or electrostatics, document singularity handling and whether the visualizer clamps arrows independently of the solver. A blue Three.js view can help expose spatial structure, but it should consume saved solver state and expose a text fallback; it is not the evidence for conservation.

Try this experiment

Prediction: Increasing one body's mass shifts the system center without moving either input position.

Change the right mass. Then describe which additional array field you would need before calculating total momentum.

Where this model breaks

Pairwise forces can grow quadratically with body count. Numerical stability, collisions, and long-range interactions need performance limits and approximation strategies, not just a larger loop.

Summary

Keep many-body state in a clear array structure. Compute each unordered pair from one time level, derive global totals in separate reductions, and use isolated fixtures, invariant logs, and refinement before interpreting conservation.

Glossary

Self-check

  1. Which totals can be reduced across bodies?
  2. Why separate body updates from totals?
  3. What performance cost grows with pairwise forces?

Sources

Model contract

Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.

\[\text{observable output} = f(\text{inputs},\,\text{state})\]
Inputs
Quantities you set or measure, with units and useful bounds.
State
Values the program must retain to reproduce the next result.
Rule
The relationship or update that turns inputs and state into a result.
Check
A known limit, unit check, invariant, or measured result that can expose a bad model.

Implement the idea as a model

For Many-Body Systems, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Momentum and Collisions, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.

Guided experiment

Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.

Where this model breaks

This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.

Summary

Treat Many-Body Systems as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.

Glossary

  • Input: a measured value or chosen parameter supplied to a model.
  • State: the smallest set of values needed to continue or reproduce a model.
  • Validation: comparing an output with a known result, limit, invariant, or measurement.

Self-check

  1. Which values are inputs, and which values must remain state?
  2. What observable result would tell you the model is behaving as expected?
  3. Which assumption would you test first before applying the model to a real system?

Model review: turn Many-Body Systems into a test

Model a collection of bodies with shared totals such as momentum and center of mass, then define the system boundary clearly.

  1. Name the inputs and units that the momentum and collisions model needs.
  2. Separate the state you must keep from values you can calculate when needed.
  3. Write one rule that maps the current state and inputs to an observable result.
  4. Choose a limiting case, unit check, invariant, or known result before trusting an output.
  5. State one assumption you would change before using this simplified model for a real decision.

Share to: