Real World Maths Busters

The Maths Behind Everyday Life

The story, the formula and a worked example — see exactly where this maths shows up in the world around you.

Back to all stories
Technology 4 min read

Smart Thermostat PID Loop

How your thermostat learns to stop overshooting.

If the room is 18°C and the target is 22°C, the error is 4°C. The proportional term reacts to this gap, the integral corrects persistent drift, and the derivative dampens overshoot.

PID formula

The control output combines three terms.

u(t)=Kpe(t)+Ki∫e(t) dt+Kddedtu(t) = K_p e(t) + K_i \int e(t)\,dt + K_d \frac{de}{dt}

Simple proportional only

  1. 1

    Step

    Error = 4°C, Kp = 25

  2. 2

    Step

    Output = 25 × 4 = 100% heating power

Answer

Full blast until the gap closes

The formula behind it

Derivative

dydx=lim⁡h→0f(x+h)−f(x)h\frac{dy}{dx} = \lim_{h\to 0}\frac{f(x+h)-f(x)}{h}
See the full formula, variables and more examples

The takeaway

PID control is the invisible maths keeping your home comfortable.

Back to all stories