boiler.cir · 41 lines
Espresso boiler -- cold start and 92 to 96 degC hysteretic thermostat
*
* Thermal/electrical analogy (absolute Celsius temperature):
* 1 V = 1 degC, 1 A = 1 W, 1 F = 1 J/K, 1 ohm = 1 K/W.
* Single well-mixed boiler, initially at room temperature (20 degC).
* Cth = 2500 J/K represents roughly 0.5 L water plus boiler metal.
* A 1200 W heater injects heat; Rloss = 0.25 K/W gives 4 W/K
* heat loss to a fixed 20 degC room. No water draw or sensor lag.
*
* Energy balance: 2500*dT/dt = 1200*heater_on - (T-20)/0.25.
Vambient ambient 0 DC 20
Cthermal boiler 0 2500 IC=20
Rloss boiler ambient 0.25
Bheater 0 boiler I = {1200 * (V(heat_call) > 0.5)}
*
* Stateful thermostat: control = 94 - T.
* Switch closes when control > +2 (T < 92 degC), and opens
* when control < -2 (T > 96 degC); holds its state in between.
* Cold start therefore calls for heat. This is true hysteresis,
* not a memoryless comparator at the midpoint of the band.
Vlogic logic_supply 0 DC 1
Bcontrol control 0 V = {94 - V(boiler)}
Sthermostat logic_supply heat_call control 0 thermostat
Rpulldown heat_call 0 1k
.model thermostat SW(Ron=1 Roff=1e12 Vt=0 Vh=2)
*
* UIC preserves the cold-start thermal capacitor condition rather
* than starting at a DC thermal equilibrium. Limit timestep to
* 0.05 s so ideal thermostat threshold overshoot stays <0.02 degC.
.options reltol=1e-6 abstol=1e-9 vntol=1e-7
.control
save v(boiler) v(heat_call)
tran 0.1 1200 0 0.05 uic
* Output columns: time in seconds, boiler temperature in degC.
set wr_vecnames
set numdgt=9
wrdata boiler_temperature.txt v(boiler)
quit
.endc
.endRight first time, at 2500 J/K.
modelopenai/gpt-6-astrataskspice-boiler-thermostat@v2date2026-09-21rounds1 of 8 allowedcost$0.1713thinkingmediumtokens25,941 in, 1,839 out, of which 858 reasoningtime1 min 3 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.

