boiler.cir · 31 lines
* Espresso machine boiler - lumped thermal model as an electrical analogue
* Analogy: node voltage V(T) = temperature [degC], current = heat flow [W]
* Ambient is 20 V. A capacitor on T is the thermal mass (J/K).
* A resistor T-amb is the heat loss to ambient (K/W).
* A gated current source is the heater (W); a switch gives thermostat
* hysteresis: heater ON when T < 92 C, OFF when T > 96 C.
Vamb amb 0 dc 20
Rloss T amb 0.1
Cth T 0 3000
.ic v(T)=20
* --- thermostat with hysteresis -------------------------------------
* ctrl = 100 - T. Switch closes when ctrl > Vt+Vh = 8 (T < 92 C),
* opens when ctrl < Vt-Vh = 4 (T > 96 C).
Bctrl ctrl 0 V = 100 - V(T)
Vsup sup 0 dc 1
S1 gate sup ctrl 0 SWTH
Rgate gate 0 1e6
* heater: 1200 W injected into the thermal node when gate = 1 V
Bheat 0 T I = 1200 * V(gate)
.model SWTH SW(Ron=1 Roff=1e12 Vt=6 Vh=2)
.tran 0.25 1200 uic
.control
run
wrdata boiler_temp.txt v(T)
.endc
.endround 1 of 2

Two rounds, 3000 J/K. Nothing like the 5000 it picked in September.
modeldeepseek/deepseek-v4.1-flashtaskspice-boiler-thermostat@v2date2026-09-21rounds2 of 8 allowedcost$0.0105thinkingmediumtokens180,933 in, 11,104 out, of which 8,060 reasoningtime5 min 22 s
Complete analoguedecided by a number, from the filepass
Real hysteresisdecided by a number, from the filepass
Starts colddecided by a number, from the filepass
Holds 92–96 °Cdecided by a number, from the filepass
Writes the .txtdecided by a number, from the filepass
There is no post about this one, since only some results need one, so the picture, the source and the scoring are here instead.
Model an espresso machine's boiler in ngspice as an electrical analogue (heater, thermal mass, heat loss) with a thermostat that holds it between 92 and 96 °C, and simulate the first 20 minutes from cold. In a .control block, save the boiler temperature with wrdata to a .txt file so it can be plotted.Frozen at v2. This model got this and nothing else.
The netlist itself: re-run in ngspice offline, and the temperature it writes out read back. A thermostat with a dead band is a stateful thing, so a bare comparator on one threshold is wrong however plausible the plot looks. How it is scored, and this run's files on GitHub.
