A mechanical clock is a constant-torque motor plus an oscillator, joined by an escapement that lets the motor give the oscillator a small push once per beat. See what sets the daily rate, and why a good clock wants a steady amplitude.
The science (equations, sources, honest simplifications)
Two halves of every mechanical timekeeper. A mainspring or falling weight supplies an almost constant torque Mw through a gear train. That alone would just run down in a second. The oscillator (pendulum or balance wheel with hairspring) is what keeps time, because its period depends on its own mass, length and stiffness and (almost) not on how hard it is pushed. The escapement couples them: it releases the train one tooth per half-swing and in return hands the oscillator a small impulse that replaces the energy lost to friction and air.
pendulum: I th'' = - m g L sin th - c th' - tau_C sgn(th') + tau_esc
T = 2 pi sqrt(L/g) / AGM(1, cos(th0/2))
= T0 (1 + th0^2/16 + 11 th0^4/3072 + ...) (circular error)
balance: I th'' = - kappa th (1 + eps th^2) - c th' - tau_C sgn(th') + tau_esc
T = 2 pi sqrt(I/kappa) dT/T = - (3/8) eps A^2 (isochronism defect)
Q = omega0 I / c energy lost per beat = pi E / Q + 2 tau_C A
Energy balance per beat. The escapement gives Eimp = eta Mw dw, where dw is how far the escape wheel turns while its tooth slides on the impulse face and eta the efficiency of that sliding contact. A fraction of it is spent unlocking (the draw and friction of releasing the locked tooth). The amplitude settles where gain = loss. With viscous loss only, E = Q Eimp/pi, i.e. amplitude grows as the square root of the drive torque (Experiment 2). Add Coulomb pivot friction and the steady amplitude falls.
Isochronism. A circular-arc pendulum swings slower when it swings wider: the first correction to the small-angle period is theta02/16, about 14.8 s/day for a 3 degree amplitude, which the sim reproduces (Experiment 1 recovers the exact elliptic-integral period, computed by the arithmetic-geometric mean, to better than 0.1 % up to 150 degrees). A clock therefore wants a steady amplitude. An anchor with recoil pushes the escape wheel backwards on the locking face and the pendulum feels a restoring torque rho Mw outside the impulse arc; the model shows that this makes the rate depend on the driving torque. The Graham deadbeat has concentric locking faces (no recoil) and only a small friction torque there. A balance wheel with a flat hairspring is isochronous in the small-oscillation limit; real watches differ through hairspring end curves (modelled by eps), the escapement's own phase of impulse, and pivot friction.
Temperature. A rod expands, L → L(1 + alpha dT), so the daily rate is -43200 alpha dT s/day (brass 19e-6 /K: -0.82 s/day/K; Invar 1.5e-6 /K: -0.06). For a balance the hairspring modulus E changes with temperature at e = (1/E)dE/dT, and the balance's radius with alpha, giving T ∝ sqrt(I/kappa), dT/T = -(e + alpha) dT / 2 and a rate of 43200 (e + alpha) dT s/day: plain steel (e about -2.4e-4 /K) loses about 10 s/day per kelvin, which is why watchmakers use Elinvar-type or oxide-coated silicon springs (Guillaume's Nobel-prize work, 1920). Values here are typical, not for a particular alloy.
The lever escapement. Geometry follows the usual Swiss lever: 15-tooth club-tooth escape wheel, pallets spanning 2.5 teeth (60 degrees) with the fork pivot on the tangent lines (so the wheel centre, fork pivot and balance staff are in line), a balance lift angle of 50 degrees, a fork lift of about 6 degrees, 8 beats per second (28 800 vph). One tooth escapes twice, so the wheel advances 12 degrees per beat of which only about 3.4 degrees is impulse; the rest is the drop (lost). The pendulum clock uses a 30-tooth wheel, pallets spanning 7.5 teeth, 6 degrees per beat and 3 degrees of impulse.
Simplifications (please read). Escapement contact is reduced to constant torques over fixed angular windows (unlock resistance, constant impulse torque, lock friction); real faces have a force profile, shake, the safety action and the shock of the drop, which are not modelled. The pendulum is an ideal simple pendulum (a bob on a massless rod) with the anchor on the same arbor; no suspension-spring or rod flexure, no air-buoyancy or barometric effects, no thermal lag. Balance poise and positional errors are reduced to a pivot-friction change (vertical positions have higher friction in the model, which changes the amplitude and hence the rate). Mainspring torque is held constant (set it with the drive slider to see run-down). Gear-train meshes are drawn but not simulated for friction. Rates are measured from the simulated period over the last 8-10 oscillations.
Checks built into this page. (1) Free pendulum period vs the exact AGM value, 7 amplitudes (Experiment 1). (2) Steady amplitude vs the closed-form energy balance (Experiment 2, viscous loss only). (3) Temperature slope vs the closed-form formula (Experiment 4). (4) Free-swing energy conservation to 1e-12 relative.
Sources and background: Huygens, Horologium Oscillatorium (1673); Graham (1715, deadbeat); Mudge (1755, detached lever); Airy (1827, on the effect of escapement on isochronism); Rawlings, The Science of Clocks and Watches (1948); Daniels, Watchmaking (1981); Matthys, Accurate Clock Pendulums (2004); Guillaume (1920). Generic parts: no brand or calibre is copied.