ngspice: espresso boiler thermostat, by gpt-6-astra
gpt-6-astra · round 1 · seed 3$0.12SVGboiler.cir
boiler.cir · 38 lines
Espresso boiler - 1200 W heater, 92 to 96 degC thermostat
*
* Lumped thermal analogue (no water draw during warm-up/idle):
*   1 V = 1 degC; 1 A = 1 W; 1 F = 1 J/K; 1 ohm = 1 K/W.
* Effective heat capacity: 2500 J/K (water plus boiler metal).
* Ambient/cold start: 20 degC. Heat loss: 2 W/K to ambient.
* Energy balance: 2500*dT/dt = heater_power - (T - 20)/0.5.
*
Vambient ambient 0 DC 20
Cthermal boiler 0 2500 IC=20
Rloss boiler ambient 0.5
*
* Ideal 1200 W heater injects heat into the thermal capacitance.
* The low-power control circuit below is not part of the thermal mass.
Bheater 0 boiler I={1200*(v(heater_on)>0.5)}
*
* Hysteretic thermostat: control voltage = 94 - boiler temperature.
* Switch ON above +2 V (T < 92), OFF below -2 V (T > 96).
* Between thresholds it retains its previous state. Starts ON when cold.
Vlogic logic 0 DC 1
Vset setpoint 0 DC 94
Sthermostat logic heater_on setpoint boiler thermostat ON
Rlogic heater_on 0 1000
.model thermostat SW(Ron=0.001 Roff=1e12 Vt=0 Vh=2)
*
.options reltol=1e-5 abstol=1e-9 vntol=1e-6 trtol=1
.control
set noaskquit
set wr_singlescale
set wr_vecnames
* 1200 seconds = first 20 minutes. UIC preserves the cold-start IC.
* Maximum step 0.05 s resolves thermostat switching to about 0.02 degC.
tran 0.1 1200 0 0.05 uic
* Two columns: time in seconds, absolute boiler temperature in degC.
wrdata boiler_temperature.txt v(boiler)
.endc
.end

Right first time again, back at 2500 J/K. Three seeds, two different boilers, one passing band.

modelopenai/gpt-6-astrataskspice-boiler-thermostat@v2date2026-09-21rounds1 of 8 allowedcost$0.1192thinkingmediumtokens18,948 in, 1,352 out, of which 494 reasoningtime44 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.

its other runs
the prompt it was given
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.
ground truth

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.