Skip to content
SimuLabs

Engineering / Experiment reports

Action–Reaction Lab: engineering report

Status
Validated
Validated
Model version
1.0.0
Release
V0.1

Every result in this report is a simulation output compared against an analytical solution. None of it is a measurement from a physical instrument.

Problem statement

A common misconception is that the heavier object, or the one that “does the pushing”, exerts the bigger force, and that action and reaction cancel. The lab must show two interacting bodies with a force-pair model that is correct by construction (update 1.1 §5), and make the difference between equal forces and equal effects visible.

Scientific background

Newton’s third law: if body A exerts a force on body B, then B exerts a force on A of equal size and opposite direction, F_AB = −F_BA. The two forces act on different bodies, so they never cancel each other. With no external force, it follows that total momentum is conserved: d(p_A + p_B)/dt = F_AB + F_BA = 0.

Learning objectives

  • Forces come in pairs that act on two different objects.
  • The two forces in a pair are equal in size and opposite in direction.
  • Equal forces can still produce different accelerations when masses differ.

Mathematical model

Two carts start at rest, touching at 0 m. A massless plunger pushes them apart with a constant force pair of size F for a time T; then no force acts. Each cart’s position is its inner bumper, so the carts touch when x_A = x_B.

pair force   = F  for 0 ≤ t < T,  0 for t ≥ T
F on B by A  = +pair force
F on A by B  = 0 − pair force
each cart    = motion.ts update with its own net force
t            = steps × dt

Analytically, after the push v_A = −F·T/m_A and v_B = +F·T/m_B; each cart receives the impulse F·T in opposite directions, the total momentum stays 0, and the centre of mass stays at 0 m.

Assumptions

  • One-dimensional motion on a frictionless horizontal track; constant masses; point bodies.
  • Idealised plunger: constant force, no mass, keeps the carts in contact by extending. The extension is shown as the gap readout, ½·F·t²·(1/m_A + 1/m_B) during the push.
  • No external horizontal forces: no friction, air resistance or collisions.
  • Vertical forces balance and are not modelled. The track is an inertial reference frame.

Implementation approach

  • The third law by construction. packages/physics-core/src/interaction.ts stores one number, pairForce. Cart B receives +pairForce and cart A 0 − pairForce, so unequal forces cannot be represented, and tests check exact equality, not closeness.
  • No new integration code. advancePair calls the existing advance() (motion model 1.0.0, unchanged) on each cart.
  • Exact phase boundary. The push duration must be a whole number of 10 ms steps (the slider uses 0.05 s steps), so the force switches off on a step boundary and every step still has constant force. Other durations are rejected, not approximated.
  • Shared lifecycle. The run loop (accumulator, pause, step, stop conditions) became a generic FixedStepRunner; the one-body FixedStepSimulation and the new TwoBodySimulation are thin wrappers. The lab controller became a generic RunLabController in the same way. ADR 0006 records this.
  • Graphs sample every 5 steps, copied from the engine state. Force is drawn as a step function, because the push switches off instantly; velocity and momentum as straight segments. Axes are fixed per trial: force to F, velocity to the faster cart’s final speed, momentum to F·T.
  • Momentum is a new quantity, with its own colour and symbol p (ADR 0003).

Verification tests

Mapping from the specification’s test plan to automated tests. All passed on 2026-11-05 against interaction model 1.0.0.

CaseRequirementChecked byResult
T15 kg / 5 kg, 20 N, 0.5 s → v_A = −2, v_B = +2 m/sinteraction.test.ts › T1; action-reaction-lab.test.ts › T1 (through the lab)✓ Pass
T22 kg / 4 kg, 20 N, 0.5 s → v_A = −5, v_B = +2.5 m/sinteraction.test.ts › T2; action-reaction-lab.test.ts › T2✓ Pass
T320 kg / 2 kg, 100 N, 1 s → v_A = −5, v_B = +50 m/sinteraction.test.ts › T3 (engine). Through the lab: 20 N, 0.5 s → −0.5 and 5 m/s (100 N for 1 s leaves the view mid-push)✓ Pass
T4F = 0 → both carts stay at restinteraction.test.ts › T4✓ Pass
T5F on A === −F on B at every step; total momentum 0 (< 10⁻¹⁰)interaction.test.ts › T5 (each case); action-reaction-lab.test.ts › default trial✓ Pass
T6Push ends exactly at T; velocities constant afterwardsinteraction.test.ts › T6✓ Pass
T7Positions and velocities within 10⁻⁹ of the analytical solutioninteraction.test.ts › T7 (each case)✓ Pass
T8Swapping the masses mirrors the motioninteraction.test.ts › T8✓ Pass
T9Centre of mass stays at its startinteraction.test.ts › T9 (each case)✓ Pass
T10Invalid inputs rejected (mass ≤ 0, F < 0, NaN, T not a whole step)interaction.test.ts › T10✓ Pass
T1130/60/144 Hz identical; pause/resume; stop and resetinteraction.test.ts › T11✓ Pass
+Chart data equals engine state; edge stop; settings locked; every slider duration acceptedaction-reaction-lab.test.ts✓ Pass
+Inertia and Force Lab suites unchanged after the lifecycle refactorsimulation.test.ts, motion.test.ts, controller.test.ts, inertia-lab.test.ts, force-lab.test.ts✓ Pass

Test suites: packages/physics-core/src/interaction.test.ts, packages/physics-core/src/simulation.test.ts, apps/web/src/labs/action-reaction/action-reaction-lab.test.ts, packages/physics-core/src/slide.test.ts, apps/web/src/labs/action-reaction/levels.test.ts.

Known limitations

  • The push is a constant force, not a real spring whose force falls as it extends.
  • The view is ±10 m: a light cart with a large push can reach the edge before the push ends. Runs are capped at 20 s.
  • Both carts start at rest; moving starts are planned with comparison mode (Phase 4).
  • Collisions are not modelled; the carts only move apart.
  • Tests run locally; there is no continuous integration yet. Browser behaviour was checked by hand at desktop and mobile widths.

Screenshots

The Action–Reaction Lab paused at 0.3 seconds: two 5 kilogram carts pushed apart, with force arrows of minus and plus 20 newtons and velocities of minus and plus 1.2 metres per second.
Desktop layout, paused at t = 0.30 s during a 20 N, 0.5 s push between two 5 kg carts. The readouts show forces of −20 N and +20 N, velocities of ∓1.20 m/s (= 20·0.3/5) and a total momentum of 0.00 kg·m/s (simulation output).

Source code

  • Engine: packages/physics-core/src/interaction.ts, simulation.ts, motion.ts
  • Lab logic: apps/web/src/labs/action-reaction/; shared controller: apps/web/src/labs/motion/run-controller.ts
  • UI: apps/web/src/components/labs/action-reaction/

The repository is not public yet; these paths are relative to its root.

Future improvements

  • A spring push with a force that depends on extension (needs a new integrator and its own ADR).
  • Moving starts and comparison of trials (Phase 4).
  • Collisions, as their own module, reusing the force-pair model during contact.
  • Automated end-to-end tests in a real browser, run in continuous integration.