An isolated collision should preserve total momentum. That makes a conservation law a direct software test for a collision function, but only after the selected system boundary and every external impulse are named. A body hitting a wall can legitimately change the particle subsystem's momentum; include the wall in the system or record its impulse before calling it a failure.
Think like a programmer
Calculate total momentum before and after each update from the authoritative body state, then compare with the signed external impulse into the selected system. Return a structured residual with units, time interval, body ids, boundary/contact events, tolerance policy, and update/integrator version. This is stronger than checking whether an animation looks like a bounce, and it generalizes from two one-dimensional bodies to multi-body vector systems.
Model checklist
Inputs
Selected body set/system boundary, masses and velocity vectors before/after, external impulses over the interval, time/contact event records, unit convention, absolute/relative tolerance, and collision/update policy.
State
Per-body momentum, total initial/final momentum, signed external impulse ledger, residual/cumulative residual, and fixture metadata.
Rule
Sum mass times velocity for all included bodies; add declared impulse into that system; subtract expected final momentum from actual final momentum componentwise or in a declared norm.
Isolated elastic and inelastic fixtures preserve total momentum; a wall impulse explains particle-subsystem change; including wall plus particles restores closed-system ledger; body-array order does not alter total; zero external impulse expects unchanged total within scale-aware tolerance; invalid/non-finite mass or velocity input is rejected.
For a closed one-dimensional fixture, a direct assertion can compare before and after totals. In a general solver, expected final momentum includes external impulse and a tolerance with both an absolute floor and a scale-aware term. Store component residuals for vector models; a small norm can hide a sign error that cancels in another component.
Momentum is independent of kinetic energy. A perfectly inelastic update can preserve total momentum while lowering translational kinetic energy. This makes paired tests useful: momentum checks system/boundary bookkeeping; kinetic energy checks the extra elastic claim or named loss transfer.
Try this experiment
Prediction: The momentum readings stay equal for an isolated pair when either input changes, while a wall impulse changes the particles-only total by a recorded amount.
Change mass and velocity in the elastic fixture. Check before/after total momentum and kinetic energy separately. Then add a declared external impulse and verify the ledger residual rather than zero raw change. Reverse body-storage order and confirm the total is unchanged. State whether the wall belongs inside or outside your selected system boundary.
Where this model breaks
A tolerance hides only small numerical representation differences. It must not hide a missing external impulse, wrong unit conversion, a collision formula outside its assumptions, asynchronous pair updates, or a changing-mass model. Momentum conservation also needs a frame and system choice; relativity, fields, radiation, and distributed contact can require momentum stores beyond simple point-body velocities.
Summary
Express conservation laws as ledger assertions. Declare the system boundary, external impulse, vector/scalar convention, and scale-aware tolerance so a failure points to an implementation bug, omitted interaction, or incorrect system definition.
Glossary
Test oracle: known property used to judge a result.
Tolerance: maximum accepted numerical difference.
External impulse: momentum transferred across the system boundary.
Momentum residual: actual minus ledger-expected momentum change.
System boundary: explicit choice of bodies and fields included in a conservation account.
Self-check
What values are compared in this test?
Why use a tolerance?
How does a wall interaction change the particles-only expected momentum?
What can legitimately break a selected-system momentum invariant?
Sources
OpenStax, University Physics Volume 1, momentum conservation chapter.
J. B. Marion and S. T. Thornton, Classical Dynamics of Particles and Systems.
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.
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 Momentum Conservation Tests, 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 Momentum Conservation Tests 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
Which values are inputs, and which values must remain state?
What observable result would tell you the model is behaving as expected?
Which assumption would you test first before applying the model to a real system?
Model review: turn Momentum Conservation Tests into a test
Turn total momentum into a deterministic test that catches collision-model and numerical-update errors.
Name the inputs and units that the momentum and collisions model needs.
Separate the state you must keep from values you can calculate when needed.
Write one rule that maps the current state and inputs to an observable result.
Choose a limiting case, unit check, invariant, or known result before trusting an output.
State one assumption you would change before using this simplified model for a real decision.