Source-linked AI summary
Physically Consistent Neural Networks for building thermal modeling: theory and analysis
Loris Di Natale, Bratislav Svetozarevic, Philipp Heer, Colin N. Jones
TL;DR
Building models are needed across design, retrofitting, and control, but neural models can lack physical guarantees and generalize poorly to unseen inputs. This paper introduces PCNNs, combining a neural network with a parallel physics-inspired linear module, and formally proves physical consistency for control inputs and exogenous temperatures. In a case study, PCNNs reduced error against an RC model by more than 40% at the end of a 3-day prediction horizon while overfitting less than classical LSTMs.
Problem
Neural building models can lack physical consistency and fail to generalize to unseen inputs, limiting their reliability for control-oriented thermal modeling.
Source: §1.1 · p. 1Method
PCNNs pair a classical neural network with a parallel physics-inspired linear module for selected inputs and train their parameters end-to-end from past data.
Source: §7 · p. 13Results
More than 40% lower error than the RC model at the end of the 3-day horizon; PCNNs also matched classical LSTMs on validation data while overfitting less.
Source: §7 · p. 13Takeaways & Limitations
PCNNs offer a data-based building-modeling approach without engineering parameter design, while retaining physical consistency for the specified inputs.
Source: §7 · p. 13Physical consistency is guaranteed only for control inputs and exogenous temperatures; robustness to variation in other inputs is not guaranteed.
Source: §6.3 · p. 13
Abstract
from arXiv · showhide
Due to their high energy intensity, buildings play a major role in the current worldwide energy transition. Building models are ubiquitous since they are needed at each stage of the life of buildings, i.e. for design, retrofitting, and control operations. Classical white-box models, based on physical equations, are bound to follow the laws of physics but the specific design of their underlying structure might hinder their expressiveness and hence their accuracy. On the other hand, black-box models are better suited to capture nonlinear building dynamics and thus can often achieve better accuracy, but they require a lot of data and might not follow the laws of physics, a problem that is particularly common for neural network (NN) models. To counter this known generalization issue, physics-informed NNs have recently been introduced, where researchers introduce prior knowledge in the structure of NNs to ground them in known underlying physical laws and avoid classical NN generalization issues. In this work, we present a novel physics-informed NN architecture, dubbed Physically Consistent NN (PCNN), which only requires past operational data and no engineering overhead, including prior knowledge in a linear module running in parallel to a classical NN. We formally prove that such networks are physically consistent - by design and even on unseen data - with respect to different control inputs and temperatures outside and in neighboring zones. We demonstrate their performance on a case study, where the PCNN attains an accuracy up to 40% better than a classical physics-based resistance-capacitance model on 3-day long prediction horizons. Furthermore, despite their constrained structure, PCNNs attain similar performance to classical NNs on the validation data, overfitting the training data less and retaining high expressiveness to tackle the generalization issue.
1. Introduction
Buildings’ energy use and emissions make reducing their energy intensity important, and models support design, retrofitting, and operations. Building models must handle stochastic conditions and newer technologies, while data-driven neural models lack guarantees of physical consistency on unseen inputs.
1. Introduction
- Buildings account for 30% of global end-use energy and 28% of energy-related global GHG emissions, making lower building-sector energy intensity important.Heating alone accounts for 64% of household energy consumption in the EU.Source: §1 · p. 1
1.1. The importance of building models
- Building models support design, refurbishment, and intelligent control, but their outputs depend on stochastic weather and occupant behavior and increasingly complex technologies.Residential control-oriented models also need short-term multi-step temperature predictions, while RL training may require thousands of days of data.Source: §1.1 · p. 1
- Data-driven building models can be flexible and accurate, but require substantial past data and lack guarantees of generalization or physical consistency on unseen inputs.For control applications, this can leave neural models without guarantees that they represent heating and cooling effects correctly.Source: §1.1 · p. 1
Nomenclature
PCNNs combine a neural network with physics-based structure to model zone temperatures, formally guaranteeing consistency for control inputs and exogenous temperatures. In the case study, they reduced error against an RC model by more than 40% at the end of a 3-day horizon and showed less overfitting than classical LSTMs.
Nomenclature
- The notation distinguishes unforced dynamics, an energy accumulator, power, solar gains, zone and exogenous temperatures, scaling parameters, water flow, inputs, disturbances, and system state.Exogenous temperatures refer to outside and neighboring-zone temperatures.Source: Nomenclature · p. 2, §1.2 · p. 2
1.2. The generalization issue of neural networks
- Building thermal datasets can omit heating and cooling combinations, leaving classical neural networks prone to errors when predicting long-horizon responses to those inputs.A classical LSTM can fit training data better yet fail to capture heating and cooling effects.Source: §1.2 · p. 2
1.3. Introducing physics-based prior knowledge
- Physics-informed neural networks introduce physical knowledge through network structure or custom loss functions; PCNNs use this prior as an inductive bias.This reduces what the network must learn from data to behavior not readily characterized in advance.Source: §1.3 · p. 2, §1.4 · p. 2
1.4. Contribution
- A parallel linear module processes power inputs and heat losses separately from the neural network, encoding positive power-temperature correlation and heat loss proportional to temperature gradients.The model is trained end-to-end from past data without engineering effort to design or identify its parameters.Source: §1.4 · p. 3
- PCNNs achieved precision on par with classical LSTMs on validation data despite performing worse on training data, showing they retained expressiveness and had less tendency to overfit.Source: §1.4 · p. 4
- PCNN physical consistency is formally proven for control inputs and exogenous temperatures.The stated guarantee applies over the entire prediction horizon and to unseen inputs.Source: §1.4 · p. 4
2. Background
Building models are grouped into physics-based, black-box, and hybrid approaches, each trading physical grounding, data needs, flexibility, and complexity differently. Hybrid approaches include grey-box models and physics-informed neural networks (PiNNs), with prior building applications of PiNNs noted as exceptions.
2.1. Physics-based building models
- Physics-based models use ordinary differential equations to represent thermal dynamics, offering interpretability and generalization but requiring design knowledge and time and potentially sacrificing accuracy through simplifications.Detailed simulation tools can be accurate and physically grounded but are hard to calibrate, costly to develop, and computationally burdensome at run-time.Source: §2.1 · p. 4
2.2. Black-box building models
- Black-box models learn patterns from operational data and are flexible and easier to design, but depend on sufficiently varied historical data and lack guarantees outside training conditions.Building applications include recurrent and gated convolutional neural networks for prediction, as well as input-convex networks for control-oriented modeling.Source: §2.2 · pp. 4–5
2.3. Hybrid methods
- Hybrid methods combine physics-based knowledge with data, while excluding approaches that train a black-box model on a physics-based model to accelerate run-time inference.That alternative usage of “hybrid methods” is exemplified by.Source: §2.3 · p. 5
2.3.1. Grey-box building models
- Grey-box models fit parameters or disturbances in simplified physical equations, retaining interpretability and reducing data needs while trading off accuracy against model complexity.Low-order resistance-capacitance models are often favored because higher-order models increase complexity and can hinder generalization.Source: §2.3.1 · p. 5
2.3.2. Physics-informed neural networks
- Physics-informed neural networks incorporate prior physical knowledge into neural-network structures to address generalization, with building applications differing in whether constraints alter the architecture or the loss.Earlier control-oriented building PiNNs used constrained system matrices or a physics-inspired loss, but the cited works did not provide physical-consistency guarantees.Source: §2.3.2 · p. 5
3. Methods
The methods define physical consistency as requiring outputs to respond to inputs according to physical laws, then build a neural model that separates explicit thermal effects from unforced dynamics. The paper describes joint data-driven training and derives conditions under which PCNN predictions remain physically consistent.
3.1. Respecting the underlying physical laws
- Physical consistency means that changing an input changes the output in a way that follows the underlying physical laws, including expected responses to control and exogenous temperatures.For example, heating should raise zone temperature and cooling should lower it; higher outside or neighboring-zone temperatures and solar gains should raise it.Source: §3.1 · p. 6
3.2. Physically consistent neural networks
- PCNN predicts temperature as the sum of an unforced-dynamics state and an energy accumulator, and applies this architecture recursively over the prediction horizon.The single-neighbor formulation can be extended by adding loss terms for additional neighboring zones.Source: §3.2 · p. 6
3.2.1. Linear physics-inspired module
- The linear module adds heating or cooling power and subtracts heat losses proportional to outside- and neighboring-zone temperature gradients, with physics-inspired parameters learned alongside the neural module.The design is RC-inspired but leaves nonlinear solar and other unknown heat gains to the black-box module; the control-to-power function g can be engineered or learned subject to monotonicity and g(0)=0.Source: §3.2.1 · p. 6
3.2.2. Black-box module
- The black-box module models unforced temperature dynamics from inputs not handled by the energy accumulator, independently of control inputs and heat losses.The paper uses an encoder-LSTM-decoder, but states that other neural architectures or non-neural functions can be used without affecting physical consistency.Source: §3.2.2 · pp. 6–7
3.2.3. Training procedure
- PCNN parameters are optimized jointly from measurement data by minimizing prediction error over sequences and a predefined prediction horizon.The model uses past inputs to predict subsequent measured temperatures; the paper implements the recurrent function with RNNs and BPTT.Source: §3.2.3 · p. 7
3.3. PCNNs follow physical laws by design
- For direct power control, PCNN derivatives have the same form as in a classical RC model, and physical consistency holds under the stated parameter conditions, including d>0 for cooling.The paper says these conditions are simple to verify and could be enforced during training; consistency also holds when power inputs pass through g if it satisfies the stated conditions.Source: §3.3 · p. 8
4. Case study
The case study models a bedroom in UMAR, a NEST unit in Duebendorf, using more than three years of data. Models predict zone temperature over three days, with implementation choices informed by the building and a comparison of training and validation losses.
4. Case study
- The case study uses more than three years of data from UMAR, a residential and office unit in NEST, Duebendorf, Switzerland.UMAR is the Urban Mining and Recycling unit.Source: §4 · p. 8
4.1. UMAR
- The modeled bedroom has radiant ceiling heating and cooling, and its power use is approximated by disaggregating UMAR’s total consumption using design mass flows and valve-open times.The living room is the only neighboring zone; bathroom heat transfers are assumed negligible.Source: §4.1 · pp. 8–9
4.2. Implementation details
- Models predict bedroom temperature for three days at 15-minute steps, using solar irradiation, time information, and direct power input.The PCNN uses an encoder-LSTM-decoder, with parameters initialized using rules of thumb based on plausible temperature changes under heating and temperature gradients.Source: §4.2 · p. 9
- Table 1 compares training and validation losses for three classical LSTMs and PCNNs, with losses scaled by 10^3.The caption refers to the full table in Appendix E.Source: Table 1 · p. 9
5. Results
Across the residential case study, PCNNs improve on the RC baseline over long prediction horizons, show less overfitting than classical LSTMs, and retain physical consistency under changed control inputs.
5.1. Improving the generalization issue of NNs
- PCNN results were consistent across random seeds and the other UMAR bedroom, indicating robustness and flexibility.Source: §5.1 · p. 9
- Without the physics-inspired energy accumulator, classical LSTMs achieve lower training errors but higher validation errors than PCNNs.The authors interpret this as less overfitting while retaining enough expressiveness to perform well on new data.Source: §5.1 · p. 9
5.2. Performance analysis
- After three days, PCNN error is more than 40% lower than the RC model’s, despite slightly higher errors early in the horizon.The early-horizon difference is attributed to the PCNN warm start; the comparison uses the best-validation PCNN and a 2R1C RC baseline.Source: §5 · p. 9, Table 2 · p. 10, §5.2 · p. 10
- Across more than three years of data and varied seasons and weather, PCNN errors are less prone to extremes and mostly lower than the RC baseline.The authors note this suggests exogenous variables have limited impact on model quality.Source: §5.2 · p. 10
5.3. Empirical analysis of the physical consistency
- Under an unusually large heating input that raises temperature above 30 °C, PCNN predictions still match the ground-truth trend.This condition was unusual in practice and therefore not well covered by the training data.Source: §5.3 · p. 10
5.2. Performance analysis
- Across almost 2,000 unseen three-day sequences, only a few have substantially larger PCNN errors, while many favor PCNN over RC.The PCNN error distribution is clustered below 1 °C and almost always below 2 °C; RC errors are more spread out.Source: §5.2 · p. 10, Figure 6 · p. 11
5.3. Empirical analysis of the physical consistency
- When heating stops, both models predict temperatures falling toward uncontrolled dynamics; when heating is on, predictions diverge from that baseline.The baseline gap closes as higher inside temperatures increase heat losses to the outside and neighboring zone; the neighboring-room effect is an order of magnitude smaller.Source: §5.3 · p. 11
6. Discussion
PCNNs combine nonlinear unforced dynamics with a linear energy accumulator, and the discussion identifies uses in control and digital twins alongside limits to their guarantees and evaluation.
6.1. Contrasting PCNNs with grey-box models
- Unlike grey-box models, PCNNs use nonlinear neural networks for unforced dynamics and a linear energy accumulator for control inputs and known heat losses.All parameters are trained end-to-end over the prediction horizon, capturing dependencies between the two components.Source: §6.1 · p. 11
6.2. Potential of PCNNs
- With historical data, PCNNs could reduce digital-twin calibration effort and imitate detailed twins to accelerate inference.Source: §6.2 · pp. 11–12
- For energy-system retrofits, PCNNs could compare alternative heating capacities and help estimate energy savings against installation costs.Source: §6.2 · p. 12
- The parallel physics-informed module can be expanded for additional known processes, including a detailed solar-gains model, without changing the rest of the pipeline.The authors suggest PCNNs may extend to systems that accumulate and dissipate energy.Source: §6.2 · pp. 12–13
6.3. Limits of our application
- Physical-consistency guarantees cover control inputs and exogenous temperatures, but not changes in other inputs such as solar gains.The current PCNN also does not meet the stated solar-gain condition; the authors leave this for future work.Source: §6.3 · p. 13
- Unrealistic parameter initializations can yield solutions that do not recover physically consistent parameters, although this did not occur in the reported experiments.The authors say final values can vary with random seed and that parameter tuning and initialization warrant further investigation.Source: §6.3 · p. 13
- The accuracy comparison is against a tuned but low-complexity RC baseline, so stronger physics-based models may perform better.Source: §6.3 · p. 13
7. Conclusion
The conclusion presents PCNNs as a data-based architecture for building zone-temperature modeling that combines a physics-informed module with a neural network. In the bedroom case study, it reports physical consistency and improved validation performance, including over the RC baseline at the end of a three-day horizon.
7. Conclusion
- PCNNs place selected inputs in a physics-informed module parallel to the main neural network, incorporating prior knowledge without engineering overhead.Source: §7 · p. 13
- The authors formally prove physical consistency for control inputs and exogenous temperatures over the entire prediction horizon.They also report that grounding PCNNs in underlying physics mitigates the usual generalization issue of classical neural networks.Source: §7 · p. 13
- In the bedroom case study, PCNNs generally outperform classical LSTMs on validation data and reduce error by more than 40% versus the RC baseline after three days.PCNNs sometimes perform worse during training, while retaining better validation results.Source: §7 · p. 13
CRediT authorship contribution statement
The contribution statement assigns conceptualization, methodology, and writing roles across the listed authors, with additional responsibilities specified for each.
CRediT authorship contribution statement
- Di Natale is credited with software, validation, formal analysis, data curation, visualization, and the original draft, alongside conceptualization and methodology.Source: CRediT authorship contribution statement · p. 13
- Svetozarevic is credited with conceptualization, methodology, and review and editing; Heer with review and editing, resources, and funding acquisition.Source: CRediT authorship contribution statement · pp. 13–14
- Jones is credited with conceptualization, methodology, review and editing, and supervision.Source: CRediT authorship contribution statement · p. 14
Appendices
The appendix derives a room-temperature model from heat flows, then simplifies it into a least-squares resistance-capacitance baseline.
A.1. General RC models
- The room-temperature ODE accounts for heat flows from systems, solar irradiation, occupants, conduction, and convection across adjacent surfaces.The model groups conduction and convection into transfers to a neighboring zone and the environment, and processes solar irradiation to represent window gains.Source: §A.1 · p. 16
- Euler discretization at Δt=1 min and grouped parameters yield a discrete-time thermal model with residual heat gains represented separately.The model includes outside and neighboring-zone temperatures and scaled residual heat gains.Source: §A.1 · p. 16
A.2. Baseline RC model
- The comparison baseline discards residual heat gains because occupant information and other gains are assumed unknown.The resulting temperature-difference model groups influencing factors and unknown parameters into matrices for identification.Source: §A.2 · p. 16
- Least Squares is used to identify the baseline model’s parameters from the grouped data.Source: §A.2 · p. 16
B. Mathematical derivations
The derivations express future temperatures recursively for physics-based and PCNN models; the appendices also describe data preparation and room-level power estimates.
B.1. Physics-based predictions
- Recursive application of the RC model yields temperature predictions two steps ahead and a general formula for any future step.The RC model is physically consistent when its parameters are small and positive, as expected for the represented physical constants.Source: §B.1 · pp. 16–17
B.2. Black-box predictions
- PCNN predictions are likewise expanded recursively into a general future-temperature formula, with disturbance recursion independent of control and exogenous temperatures.The nested disturbance-network inputs are not affected by changes to control input, outside temperature, or neighboring-zone temperature.Source: §B.2 · p. 17
C.1. NEST data
- NEST sensor data are cleaned and smoothed, missing intervals under 30 minutes are interpolated, and training and testing data are averaged into 15-minute intervals.Constant sensor streaks are removed according to sensor-specific thresholds before smoothing.Source: §C.1 · p. 17
C.2. Individual room energy consumption
- For UMAR, room-level power is approximated from valve-open time and design mass flow, allocating the single global meter measurement across five rooms.The approximation makes each room’s energy consumption proportional to water flowing through its ceiling panels.Source: §C.2 · p. 17
D. Implementation details
The implementation encodes calendar periodicity, uses a three-hour warm start for three-day forecasts, and stabilizes small learned parameters.
D. Implementation details
- Month and time-of-day inputs use sine and cosine features to encode their periodicity.The daily cycle uses 96 intervals, matching 15-minute sampling.Source: D. Implementation details · p. 18
- A three-hour warm start feeds the previous 12 true temperatures back into the PCNN before it predicts a three-day horizon at 15-minute steps.Training minimizes prediction MSE using Adam; data windows span 12 hours to three days and are split across heating and cooling seasons.Source: D. Implementation details · p. 18
- Small physical parameters are reparameterized through a more stable value initialized to 1 for backpropagation.This is intended to reduce training instability that could produce physically inconsistent parameters.Source: D. Implementation details · p. 18
E.1. Robustness of PCNNs
The appendices report PCNN robustness across seeds, transfer to another bedroom, and comparison with classical LSTMs, then relate the architecture to grey-box models.
E.1. Robustness of PCNNs
- Across six random seeds, validation accuracy was similar except early in the horizon, where two models showed oscillations and higher errors.Figure 9 summarizes MAE at six prediction steps over almost 2,000 validation predictions.Source: Figure 9 · p. 18, §E.1 · p. 18
E.2. Learned parameters
- Only two of six PCNNs substantially changed parameters, by at most 10% −15%, and those models had the worst overall performance.The table compares initial and learned parameter values.Source: Table 3 · p. 18, §E.2 · p. 18
E.3. Flexibility of PCNNs
- The other UMAR bedroom reaches comparable PCNN accuracy without engineering changes, though its end-of-horizon error is 20 −40% higher.The same architecture was used with different training and validation datasets.Source: §E.3 · p. 18, Figure 10 · p. 19
E.4. Comparison to classical LSTMs
- Classical unconstrained LSTMs perform similarly to or worse than PCNNs, while the comparison indicates that PCNNs can outperform them despite their constrained structure.Training and validation losses and validation error propagation are compared; the authors suggest the linear physics-informed module supplies useful information.Source: Table 5 · p. 19, Figure 11 · p. 19, §E.4 · p. 19
F. Deriving PCNNs from classical grey-box models
- Grey-box models use a linear RC state model whose parameters can be identified from data.The state represents the system, while the inputs capture heat fluxes including heating or cooling, heat losses, and solar gains.Source: F. Deriving PCNNs from classical… · p. 19
- Adding bilinear terms can represent harder-to-model effects such as solar gains and occupants, but complicates optimization of control inputs.Source: F. Deriving PCNNs from classical… · p. 19
- PCNNs divide uncontrollable inputs into linearly acting outside and neighboring-zone temperatures and other, potentially nonlinear disturbances.The disturbance process uses an unknown residual function; controllable power inputs retain a linear structure suited to control applications.Source: F. Deriving PCNNs from classical… · p. 20