Why does the shower go hot, then cold?

Because you react to water that left the tap seconds ago. Turn the knob too eagerly and you keep correcting a problem that's already fixed, so the temperature swings. In Laplace terms, the delay is a factor e^(−sT), and one number, your adjusting speed times the delay, predicts whether it settles.

smoothswings, then settlesnever settles (K·T ≥ π/2)K·T = 0.2: settles smoothlytarget 38 °Csolid: water at your head · dashed: where the knob is
Time until it’s right
63.7 s
Hottest it gets
38 °C
K × T
0.2

Challenge: Get to within half a degree in under 20 seconds without going over 39.5 °C.

Each second you turn the knob by this fraction of how wrong the water feels.
Seconds for a change at the valve to reach you. Long pipes mean long delays.
More settings

Play

Crank up how fast you adjust until the water starts swinging. Then lengthen the pipe instead.

Challenge: Get to within half a degree in under 20 seconds without going over 39.5 °C. The box under the picture turns green when you get it.

Stuck? Pick one of the examples from the “Try an example” menu, or press “New example.”

Understand

s+K e−sT=0s + K\,e^{-sT} = 0

You adjust the knob based on what you feel, but what you feel is delayed:

u′(t)=K (r−y(t)),y(t)=u(t−T)u'(t) = K\,\big(r - y(t)\big),\qquad y(t) = u(t - T)

In the Laplace domain, a delay of TT seconds is just a factor e−sTe^{-sT}. The whole loop becomes one equation:

s+K e−sT=0s + K\,e^{-sT} = 0

Its roots decide everything, and they depend only on the product KTKT:

  • KT≤1/e≈0.37KT \le 1/e \approx 0.37: the water warms smoothly.
  • 1/e<KT<π/21/e < KT < \pi/2: it overshoots and swings, then settles.
  • KT≥π/2≈1.57KT \ge \pi/2 \approx 1.57: it never settles. The swings grow until the knob hits full hot and full cold.

The strip above the graph shows where your KTKT lands.

Use

Every input has a unit menu, so you can type values in the units you already have. Results follow your units.

Show the work

  1. You turn the knob by how wrong it feelsu'(t) = K\,\big(r - y(t)\big)
  2. But you feel what left the valve T seconds agoy(t) = u(t - T)
  3. Laplace transform: a delay becomes a factor e^(−sT)Y(s) = e^{-sT}\,U(s),\qquad s\,U(s) = K\,\big(R(s) - Y(s)\big)
  4. The loop’s characteristic equations + 0.05\,e^{-4\,s} = 0
  5. One number decides itKT = 0.05 \times 4 = 0.2\quad(\text{smooth} \le 1/e \approx 0.37,\ \text{stable} < \pi/2 \approx 1.57)

Export

Export PDF

Set how fast you adjust and the pipe delay. Open "More settings" for the target, cold, and hot temperatures.

  • Real people aren't perfectly steady adjusters, but the pattern is the same.

For learning and estimation. Verify with applicable codes, standards, and a qualified professional before using in design, construction, or safety-critical work.

Cheat card

u′(t)=K (r−y(t)),y(t)=u(t−T)u'(t) = K\,(r - y(t)),\quad y(t) = u(t - T)
s+K e−sT=0s + K\,e^{-sT} = 0
KT≤1/e: smooth;KT<π/2: settlesKT \le 1/e:\ \text{smooth};\quad KT < \pi/2:\ \text{settles}
SymbolMeaningUnit
KKhow fast you adjust/s
TTdelay before you feel the changes
r,yr, ythe temperature you want, and what you feel°C
  • Doubling the delay has the same effect as adjusting twice as fast. Only the product K·T matters.
  • The fix for a long delay is patience. Make a change, then wait for it to arrive.
  • Thermostats, cruise control, and autopilots all face the same trade-off.

Print this card

Where it’s used

  • Mechanical
    Control engineers tune heating systems, cruise control, and autopilots around this same delay limit.
  • Physics
    Any loop that reacts to old information can oscillate, from traffic jams to supply chains.
  • Home Projects
    Hotel showers with long pipes are the classic case. Small turns and a few seconds of patience fix them.

Questions people ask

Why does the shower keep going from hot to cold?

The water you feel left the valve a few seconds ago. If you keep turning until it feels right, you've already turned too far by the time the change arrives. Then you correct back too far, and so on.

What does the Laplace transform have to do with it?

It turns the time delay into a simple factor e^(−sT) and the whole loop into one equation, s + Ke^(−sT) = 0. Solving it gives the thresholds. Above K·T = 1/e the water overshoots, and above π/2 it never settles.

How do I stop it?

Make smaller changes and wait a few seconds after each one. Lowering K is the only fix you control, since you can't shorten the pipe.