Warm up. Switch. Hold the temperature.
A first-order thermal body with a heater and heat loss. Compare ON-OFF, hysteresis and PI, then find the limits no gain can overcome.
Give the thermostat a band
A heater can only be fully on or off. How can it maintain 60 °C when 400 W is too much and 0 W is too little?
Pin the 2 °C total-band run. Change only the band to 0, then 6 °C. Compare temperature and applied power near the end, and count relay transitions.
Preparing the physics engine…
View traces ↓Same instant, every signal
Click a trace or use the replay slider. Current temperature is cyan; the target is white dashed. Pinned signals are numbered and dashed. Scheduled events persist from their marked time, not a pulse. A PI power request may be negative; applied power cannot be.
Compare one change 0/3
Match the plant, initial state, target and event when testing a controller. Changing the plant is a separate experiment.
Whole-run observations
The ±1 °C statistic includes startup and all scheduled changes over the entire duration, evaluated at 0.1 s physics steps. Relay transitions exclude initialization and a command at the final endpoint. Energy counts heater electricity only; it is not an efficiency rating. These are finite-window observations, not a stability certificate.
Equations, assumptions and method
C·dT/dt = u − H(T − Ta) · τ = C/H · G(s) = 1/(Cs + H)
One uniform temperature, constant heat capacity and linear heat loss. G describes heater power to temperature deviation with fixed ambient and zero initial deviation. No radiation nonlinearity, heater residual heat, sensor noise, delay or active cooling. PI accepts ideal modulated power; ON-OFF uses only 0 or maximum. This is a teaching model, not equipment design advice.
RK4 at 0.1 s in a Web Worker. Controllers update every 1 s and hold output between ticks; output samples every 1 s are recorded after the controller update. PI starts with I = 0 and no bias; the current error integrates from t = 1 s. Conditional anti-windup rejects increments that worsen clipping, while permitting unwinding. Replay defaults to 30 simulated seconds per wall second and does not change physics.
Energy balance residual: J · C(T − T0) = ∫u dt − ∫H(T − Ta) dt
APMonitor — Temperature Control Lab ↗