Greenhouse through a cold night: experiment bench
Greenhouse through a cold night
Keep seedlings between 16 and 24 °C from 18:00 to 08:00 with a heater, a thermometer and a controller, using as little energy as you can.
- 1. Ask
- 2. Hypothesise
- 3. Set up
- 4. Run
- 5. Record
- 6. Change one variable
- 7. Compare
- 8. Interpret
- 9. Limitations & save
If I change …, then … will …, because …
3 · Set up the parameters
The temperature the controller aims for.
Heater watts per degree below the target.
The most power the heater can deliver.
An open vent roughly doubles the heat lost to the night air.
Builds up heat while the house stays cold.
2 more controls appear at higher levels; until then they stay at the default value.
The seed fixes any random noise. Same parameters + same seed = exactly the same result, every time, on every computer.
6 · Change one variable
Your first run is the baseline. After it, change one thing at a time.
7 · Compare on a graph
5 · Run log
No runs yet.
Equations
Lumped thermal model: C·dT/dt = Q_heater + Q_sun − UA·(T − T_out), C = 0.6 MJ/K, so τ = C/UA = 100 min.
PI control: Q = clamp(Kp·e + Ki·∫e dt, 0, Q_max), e = setpoint − reading.
Assumptions (always true in this model)
- One well-mixed air volume (a single temperature).
- Heat capacity and loss coefficient are illustrative values for a ~10 m² glass greenhouse, not measurements.
- Outdoor temperature follows a smooth daily curve (11 °C at 15:00, 1 °C at 03:00).
- PI controller with conditional-integration anti-windup; heater power is continuous between 0 and its rating.
Text description of what the chart shows
A line chart over the 14 hours from 18:00 to 08:00. The outside temperature falls to about 1 °C at 03:00. The inside temperature starts at 20 °C and falls toward the target, where the controller holds it; opening the vent from 22:00 makes it dip. Heater power rises as the night gets colder.
Did the result support your hypothesis? Use the numbers from the comparison table and link them to an equation.
Which assumptions could change your answer in the real world? For example: No humidity, wind, cloud or plant transpiration; a real greenhouse has temperature gradients and drafts.
Export and save
Exports use the ticked runs (or every run if none are ticked). Your draft saves automatically in this browser only. The Journal is private to you.
Valid parameter ranges
| Parameter | Range | Default |
|---|---|---|
| Target temperature | 10 to 24 °C | 18 |
| Proportional gain Kp | 0 to 3000 W/°C | 400 |
| Heater rating | 500 to 4000 W | 3000 |
| Vent left open (from 22:00) | 0 to 8 h | 3 |
| Integral gain Ki | 0 to 3000 W/(°C·h) | 0 |
| Thermometer noise σ | 0 to 1.5 °C | 0.4 |
| Moving-average window | 1 to 10 samples | 1 |
Independent reference checks
Heater off all night
Q = Kp·e + Ki·∫e = 0 for Kp = Ki = 0, so no energy is used and the heater never switches.
Undersized heater pinned at full power
Equilibrium T_out + (500 W + sun)/UA stays below 23.8 °C, so Kp·e > 500 W all night: E = 500 W × 14 h = 7 kWh (hand calculation).
Checked automatically on every change to the code. Educational model, not engineering-grade.
Where this model stops being right
- No humidity, wind, cloud or plant transpiration; a real greenhouse has temperature gradients and drafts.