1def u(t): # bath, °C2 return 601def u(t): # bath, °C2 return 20 + 0.5 * t1def u(t): # bath, °C2 return 100 if t < 1 else 20u 20.0 °C020406080100y 20.0 °Cu − y = 40.0 °CG(s) = 1/(15s + 1)u
0153045607590204060time (s)°CSTEP: u AND yu bathy readingT = 15 s · 63.2%0153045607590204060time (s)°CRAMP: u AND yu bathy readinglag 7.5 °C015304560759020222426time (s)°CIMPULSE: u AND yu bathy readingideal← u: 100 °C for 1 s
Lit wire with moving dashes: the bath temperature reaching the thermometerBlocks: the water bath (input) and the thermometer (plant); the test input is the code cardPlot: input u(t) and reading y(t) for the current test, computed from the modelOn the tube: blue tick = bath temperature u, red column = reading yA thermometer under test: the code card defines the test input, the water bath applies it (u), and the thermometer, a first-order system G(s) = 1/(15s + 1), answers with its reading (y). On the glass tube the blue tick is the bath temperature and the red column the reading, always chasing it. The plot below is computed from the exact solution for each test. A true impulse is infinitely tall and lasts no time at all, so it cannot be built. Any kick much shorter than the time constant behaves like one of the same area: our 1 s dip peaks at 25.2 °C against the ideal 25.3 °C.

The idea

  1. Real inputs are messy, so engineers poke a system with a few simple, agreed signals and compare the answers. The three most used are the step, the ramp and the impulse. Our test subject is a thermometer.

Step

Ramp

Impulse

Putting it together

What is happening

# step 1/9 · why
# about: Test input u(t), Water bath (input u), Thermometer (plant)

test input   a simple, standard signal u(t)
response     what the system does, y(t)

step      a sudden jump that stays
ramp      a steady climb
impulse   a very short, strong kick

Same tests for every system, so the
answers can be compared.

Builds on: Circuit analysis with the
Laplace transform; Step response of RLC
circuits; Characteristic roots and
damping; The transfer function of a
system.

The thermometer is a first-order model with an illustrative time constant of 15 s. Every curve and number in the figure is computed from its exact solution. The Python on each step is plain Python 3 with the math module. The python-control library has step_response and impulse_response functions that compute the same curves numerically.