boiler.cir · 37 lines
* Espresso machine boiler -- electrical analogue
* node T = boiler temperature in degrees C (1 V == 1 degC)
* Vamb = ambient reference (20 degC)
* Cth = lumped thermal mass (J/degC -> F)
* Rth = heat-loss path to ambient (degC/W -> ohm)
* Gheat = heater: 1200 W switched by the thermostat
* Ssw = thermostat with 4 degC hysteresis (on < 92, off > 96)
.param Tamb = 20
.param Pheat = 1200
.param Cth = 2500
.param Rth = 0.75
* ambient thermal reference
Vamb amb 0 dc {Tamb}
* boiler thermal mass, cold start at ambient
Cboiler T 0 {Cth} ic={Tamb}
* heat loss from boiler to ambient
Rloss T amb {Rth}
* thermostat: logic high -- switch -- control node 'gate'
Vlogic hi 0 dc 1
Rgate gate 0 1k
* control voltage = Tamb - T ; on when > Vt+Vh (-72 => T<92), off when < Vt-Vh (-76 => T>96)
Ssw hi gate amb T thermo
.model thermo SW(Ron=1 Roff=1G Vt=-74 Vh=2)
* voltage-controlled current source: 1200 A into node T when gate = 1 V
Gheat 0 T gate 0 {Pheat}
* --- simulation / output ---
.control
tran 0.1 1200 uic
wrdata boiler_temp.txt v(T)
.endc
.endRight first time, 2500 J/K, for eight tenths of a cent.
modeldeepseek/deepseek-v4.1-flashtaskspice-boiler-thermostat@v2date2026-09-21rounds1 of 8 allowedcost$0.0080thinkingmediumtokens118,866 in, 8,703 out, of which 6,708 reasoningtime1 min 34 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.
