I build HeatAlgo, browser software that calculates the heat loss of a house room by room to EN 12831-1, the European standard, and lays underfloor heating loops on the floor plan. Heat loss is the number that decides how big a heat pump should be. Get it wrong by 40% and the pump short-cycles all winter, or the house is cold in January.
When I added AI, the obvious design was "upload the plan, ask the model for the heat loss". I did not ship that. This post is about the line I drew instead, and why I think it generalises to any domain where a wrong number costs money.
The rule: the model proposes, the engine computes
There are two kinds of work in a heat loss calculation.
- Reading the building. Which rooms are there, how big are they, which walls face outside, where are the windows, what is the wall made of. This lives in PDFs, scans, photos of hand-drawn plans and energy certificates. It is messy, visual and full of ambiguity. Language and vision models are good at it.
- Calculating. Transmission loss through every wall, window, floor and roof, ventilation loss, thermal bridges, temperature correction factors for unheated neighbours, ground loss to EN ISO 13370. This is a published method with formula numbers. There is exactly one right answer for a given set of inputs.
So the split is: the model may only produce inputs, as proposals a person can see and change. Every output comes from ordinary code that implements the standard formula by formula. The model never returns a kW figure that ends up in a result.
What "deterministic engine" means in practice
- The formulas are code, mapped to clauses. The heat loss engine is plain Python. A formula index maps every section and formula number of EN 12831-1 to the function that implements it (transmission, ground loss, ventilation, temperature adjustment factors). If you cannot point to the clause, the code does not go in.
- Tables are pinned to the source text. Values transcribed from the standards (EN 12831-1 annex values, EN 1264 for underfloor heating) are checked by tests against the published text, so a typo in a table fails the build instead of shipping.
- Two implementations, one golden file. The underfloor hydraulics run in the browser (TypeScript, for instant feedback while you draw loops) and on the server (Python, for the report). Both are pinned to the same golden JSON of inputs and expected outputs, so they cannot drift apart.
- Same inputs, same result, every time. No temperature, no sampling, no "regenerate". A report printed today and re-printed next month gives the same number unless an input changed.
What the model does
The model's job is to turn a floor plan into a structured, editable building: rooms with names and areas, walls with orientation and adjacency, windows and doors, a storey. A few things made this work better than I expected:
- Schema first. The model fills a typed structure, not prose. Anything that does not validate is rejected before a person sees it.
- Everything is a proposal. Each value the model proposes is shown as a value the user confirms or edits, with the room highlighted on the plan. The read review says when a read is weak instead of pretending it is sure.
- Model-agnostic plumbing. The model behind each AI surface is configuration, not code. When a better vision model ships, switching is a config change, and nothing about the maths changes, because the maths never depended on it.
Why not let the model do the maths?
I tested it. Language models are surprisingly good at producing a plausible heat loss. That is the problem: plausible is not checkable. Three things made it a non-starter:
- It is not reproducible. Ask twice, get two numbers. An installer who quotes from the first and a homeowner who checks with the second now have an argument nobody can settle.
- It is not explainable. In HeatAlgo every figure opens to show where it comes from: this wall, this U-value, this temperature difference. A model's number has no such trail, and "the AI said so" is not something you can put in front of an installer.
- Errors look like answers. A wrong room area from the plan reader is visible: the user sees 14 m² where the plan says 18 m² and fixes it. A wrong formula inside a model's reasoning is invisible.
The split also makes the AI's mistakes cheap. A misread room is one edit. A miscalculated house is a wrong heat pump.
The trade-offs
This design is not free.
- More UI. Because every input is visible and editable, the app needs screens for things a "magic answer" product would hide. That is real work and some people find it slower at first.
- The engine is only as good as the method. HeatAlgo calculates to EN 12831-1 with its Annex B default values. That is not the same as a national method like DIN/TS 12831-1 in Germany or ISSO 51 in the Netherlands, and the product says so in plain words where a buyer would ask. A deterministic engine makes the scope honest; it does not make it wider.
- Reading is still the hard part. Most of my AI effort goes into the plan read: scanned plans, hand drawings, plans with three storeys on one page. The engine has been the stable part.
What I would tell anyone building "AI for engineering"
- Put a hard line between proposing inputs and computing outputs, and make the line visible in the UI.
- Treat model output as untrusted user input: validate it against a schema, show it, let a person own it.
- Keep the domain code boring, tested against the source, and independent of which model you run.
- When the model gets better, you should be able to swap it in an afternoon without touching a single formula.
If you want to see the split in practice, the heat loss calculator runs the engine without sign-up. I am happy to answer questions about the architecture in the comments.
