Skip to content
SimuLabs

Engineering / Experiment reports

Inertia 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

Many people believe moving objects naturally slow down and need a continuous push to keep going. The lab must show, with a physically correct model, that an object with zero net force keeps a constant velocity, including zero, regardless of its mass.

Scientific background

Newton’s first law states that an object remains at rest or in uniform straight-line motion unless a nonzero net external force acts on it. It is the zero-force case of the second law, F_net = m·a: with F_net = 0 and a nonzero mass, a = 0.

Learning objectives

  • An object at rest stays at rest when the net force on it is zero.
  • A moving object keeps the same velocity when the net force on it is zero.
  • Mass does not change constant-velocity motion when the net force is zero.
  • Real objects slow down because of resistive forces such as friction, not because motion runs out.

Mathematical model

For a constant-mass body with constant net force, each fixed step of length dt is updated by:

a      = F_net / m
v(t+dt) = v(t) + a·dt
x(t+dt) = x(t) + v(t)·dt + ½·a·dt²
t      = steps × dt

These are the exact solutions for constant acceleration over a step, so the integrator adds no discretisation error; only floating-point rounding remains. In the Inertia Lab F_net = 0, which reduces the model to a = 0, v(t) = v₀, x(t) = x₀ + v₀·t. Time is computed from the step count rather than summed, so the clock does not drift.

Assumptions

  • One-dimensional horizontal motion; constant mass; point-mass body.
  • Zero net force: frictionless track, no air resistance, no applied force during the run.
  • Vertical forces (gravity and the normal force) balance and are not modelled.
  • The track is an inertial reference frame.

Implementation approach

  • Physics engine (packages/physics-core): pure TypeScript, SI units, no UI dependencies. advance(state, dt) implements the model above. FixedStepSimulation adds start, pause, resume, reset, manual stepping and stop conditions. The Force Lab will reuse it unchanged.
  • Fixed time step: dt = 10 ms. Each animation frame reports real elapsed time to an accumulator, and the engine takes as many whole steps as fit. A frame that arrives late is capped at 0.25 s, so a hidden tab does not trigger a burst of catch-up steps. This slows the run against the wall clock but never changes the trajectory.
  • Lab controller (apps/web/src/labs/motion, shared with the Force Lab): applies the view limits (±20 m, 30 s), locks settings during a trial, and records a graph sample every 5 steps, copied directly from the engine state.
  • Rendering: an HTML canvas redrawn every requestAnimationFrame. Metres are converted to pixels only in the renderer. React re-renders the controls, measurements and graphs at most 10 times a second, not every frame.
  • Graphs: Recharts, straight-line segments between samples (no smoothing), fixed axes, a plain-language summary for each graph, a data table, and CSV export at full precision.

Verification tests

Mapping from the specification’s test cases (Specification Update 1.1 §2) to automated tests. All passed on 2026-11-06 against model version 1.0.0.

TestRequirementChecked byResult
Av₀ = 0, F = 0: after 5 s, v = 0 and position unchangedmotion.test.ts › Test A✓ Pass
Bv₀ = 3 m/s from 0 m, F = 0: after 5 s, v = 3 m/s and x = 15 mmotion.test.ts › Test B; simulation.test.ts › every frame rate reaches x = 15 m✓ Pass
Cv₀ = −2 m/s from 0 m, F = 0: after 4 s, v = −2 m/s and x = −8 mmotion.test.ts › Test C✓ Pass
DDoubling mass with F = 0 does not change the motionmotion.test.ts › Test D (five velocities, 4 kg vs 8 kg)✓ Pass
EPausing and resuming does not change the trajectorysimulation.test.ts › Test E (paused every 37 frames, step-by-step comparison)✓ Pass
FDifferent frame rates give equivalent resultssimulation.test.ts › Test F (30 Hz, 60 Hz, 144 Hz, irregular frames: identical states at every step)✓ Pass
+Graph data equals engine statelabs/motion/controller.test.ts › chart samples are exactly the engine's states✓ Pass
+Input boundaries, invalid input, view-edge and time-limit stopsmotion.test.ts, labs/inertia/inertia-lab.test.ts✓ Pass

The engine suite also covers the six Newton’s second law cases from the master specification, since both labs share the engine. Test suites: packages/physics-core/src/motion.test.ts, packages/physics-core/src/slide.test.ts, packages/physics-core/src/simulation.test.ts, apps/web/src/labs/motion/controller.test.ts, apps/web/src/labs/inertia/inertia-lab.test.ts, apps/web/src/labs/inertia/levels.test.ts.

Known limitations

  • No friction or air resistance; a friction extension is planned as a separate, labelled experiment.
  • The view is limited to ±20 m, so fast runs end within seconds. Runs are capped at 30 s.
  • Initial position is fixed at 0 m; only velocity and mass are adjustable.
  • The cart graphic is not to scale.
  • Tests run locally; there is no continuous integration yet. Browser behaviour was checked by hand at desktop and mobile widths, not by automated end-to-end tests.

Screenshots

The Inertia Lab paused at 4 seconds: the cart at 12 metres moving right at 3 metres per second, with locked settings and live measurements beside it.
Desktop layout, paused at t = 4.00 s with v₀ = 3 m/s and m = 5 kg. The readouts show x = 12.00 m, matching x = v₀·t (simulation output).

Source code

  • Engine: packages/physics-core/src/motion.ts, simulation.ts
  • Lab definition: apps/web/src/labs/inertia/; shared lab logic: apps/web/src/labs/motion/
  • UI: apps/web/src/components/labs/motion/

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

Future improvements

  • Friction extension with a documented kinetic-friction model, kept separate from the ideal model.
  • Comparison mode: two carts with different masses on the same clock (Phase 4).
  • Save and compare trials in the notebook (Phase 5).
  • Automated end-to-end tests in a real browser, run in continuous integration.