Sun geometry: cos z = sinφ sinδ + cosφ cosδ cosω with declination δ = 23.45° sin(2π(284+n)/365). Clear-sky beam DNI = 1353 · 0.7^(AM^0.678) (Meinel), air mass AM = 1/cos z, diffuse taken as 10 % of beam. Plane-of-array irradiance on a 35° south roof uses the incidence-angle cosine plus sky-diffuse and ground-reflected parts. Clouds multiply by 1 - 0.8 c^1.5, so the weather is a smooth monthly mean, not a random day. Output: P = kWp · G/1000 · (1 - 0.0035(Tcell - 25)) · 0.88 · 0.97 with Tcell = Ta + 0.031 G.
Real heat pumps reach a fraction of the Carnot limit: COP = η (Tsup+273.15)/(Tsup - Tout + 7) with η = 0.45 and a 7 % frosting/defrost penalty between -2 and 5 °C. Weather compensation sets the flow temperature Tsup = 26 + 0.7(Tset - Tout) (28-50 °C), so colder weather means both a bigger heat demand and a lower COP. Capacity falls about 2.7 % per kelvin below 7 °C. Hot water is made at 55 °C, which has a lower COP than space heating. A 3 kW resistive backup only starts when the house is more than 1 K below target.
One-node model: C dT/dt = Qhp + Qgain - UA (T - Tout), solved exactly over each 15-minute step as T = Teq + (T0 - Teq) e^(-Δt/τ), τ = C/UA. A large τ lets tariff shifting pre-heat the building when power is cheap and coast through the evening peak.
Vt(E) = minE' [ price(t) · grid kWh + Vt+1(E') ] with efficiency, power and 10 % reserve limits, and the day must end with at least the starting charge. It uses perfect foresight of the day, so it is an upper bound on what a real forecast-driven controller achieves.Every 15 minutes the bus must balance: PV + import + discharge = load + export + charge. Over a day, the stored-energy state is tracked separately, and Σ(PV + import) - Σ(load + export) = ΔEstored + Σ battery losses must close to rounding error. The thermal solver is also compared against a 1-minute explicit Euler integration.
Bill = import × price - export × export price + 55p/day standing charge. Payback = (PV + battery cost) / (annual bill of the same home without PV or battery - annual bill now). Tariffs are illustrative GB-style numbers, not any supplier's offer.