eta2 · Th/(Th - Tc) = price ratio.A heat pump moves heat from cold outdoor air to the warm house with a compressor. By the first law the heat delivered is Qh = Qc + W: the heat taken from the air plus the work of the compressor. The ratio COP = Qh / W is typically 2.5 to 4.5, so one kWh of electricity gives 3 or more kWh of heat. A gas boiler cannot exceed 1 kWh of heat per kWh of fuel (about 0.89 for a condensing boiler in real use).
No machine can beat the reversible limit COPCarnot = Th / (Th - Tc), with temperatures in kelvin. Here Th = Tflow + 2 K (condenser approach) and Tc = Tout - 5 K (the evaporator must be colder than the air). Real units reach a fraction eta2 of it (default 0.5): COP = eta2 · Th/(Th - Tc) · (1 - pdefrost). At +7 C outdoors and 35 C flow this gives about 4.4, in the range of published figures.
The lift Th - Tc grows when the outdoor air is colder or the water must be hotter. At -5 C with 55 C radiators the lift is about 67 K and the COP falls to about 2.5; underfloor heating at 35 C needs only 47 K and gives about 3.3. Weather compensation lowers the flow temperature on mild days: Tflow = Tset + (Tdesign - Tset) (Q/Qdesign)1/1.3, using the radiator exponent 1.3.
Below about 5 C humid air freezes onto the evaporator. The unit must periodically reverse the cycle (or heat the coil) to melt the ice, which costs energy and interrupts heating. The model uses a penalty that peaks near +1.5 C in very humid air (up to 15 %) and vanishes in dry or warmer air; it is an average, not a cycle-by-cycle model.
One-node model: C dTi/dt = Qheat + Qgains - UA (Ti - To), solved exactly over each 5-minute step with tau = C/UA. UA (W/K) is the heat-loss coefficient: 320 uninsulated, 240 with loft insulation, 160 with wall insulation too, 85 for a full retrofit. The thermostat asks for UA(Tset - To) - gains plus a recovery term. Heat pump capacity falls with the outdoor temperature, Q = Qrated(1 + 0.025 (To - 7)); any shortfall goes to the optional 6 kW resistive backup at COP 1, or the house cools.
Running cost = electricity kWh x price + gas kWh x price. CO2 = electricity kWh x grid intensity + gas kWh x 0.184 kg/kWh. The heat pump is cheaper to run only when its COP exceeds priceelec x etaboiler / pricegas; it emits less CO2 when its COP exceeds Igrid x etaboiler / 0.184. Prices and grid intensity are illustrative round numbers, not any supplier's tariff.
Qh = Qc + W exactly and entropy generation Qh/Th - Qc/Tc ≥ 0; for eta2 = 1 it is zero (reversible).