Physically Consistent Neural Networks For Building
Physically Consistent Neural Networks For Building
Building models might hinder their expressiveness and hence their accuracy. On the other hand, black-box models are
Deep Learning 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 com-
mon 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 Consis-
tent 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 dif-
ferent control inputs and temperatures outside and in neighboring zones. We demonstrate their per-
formance 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.
Nomenclature
PCNN variables 𝑐 Heat losses to the neighboring zone scaling param-
𝐷 Unforced dynamics eter
𝐸 Energy accumulator 𝑑 Cooling effect scaling parameter
𝑃 Power 𝑚̇ Water mass flow rate in a radiator
𝑄𝑠𝑢𝑛 Solar gains 𝑢 Control inputs
𝑇 Temperature of the modeled zone 𝑥 Inputs to the black-box module
𝑇 𝑛𝑒𝑖𝑔ℎ Temperature of the neighboring zone Grey-box model variables
𝑇 𝑜𝑢𝑡 Outside temperature 𝜉 Disturbance model
𝑇𝑤 Water temperature of the heating system 𝑢 Controllable inputs
𝑎 Heating effect scaling parameter 𝑤1 , 𝑤2 Uncontrollable inputs
𝑏 Heat losses to the outside scaling parameter 𝑧 State of the system
1.2. The generalization issue of neural networks 1.3. Introducing physics-based prior knowledge
Originally spotted by Szegedy et al. [19], the general- In general, classical NNs suffer from underspecification,
ization issue of NNs led to the field of adversarial examples, as reported in a large-scale study from Google [25]. As a
where researchers aim to find input perturbations that fool countermeasure, we should find ways to include prior knowl-
NNs, showing how brittle their predictions can be [20, 21], edge, typically about the underlying laws of physics, into
even when only little noise is applied to the input. NNs to facilitate their training and improve their performance.
To circumvent this generalization issue, researchers of- This trend already began several years ago with the emer-
ten rely on better sets of data that cover the entire spectrum gence of physics-guided machine learning [26] and the cre-
of inputs and allow NNs to react to any situation. This re- ation of specific network structures that represent known phys-
quires vast amounts of resources and is only possible in fields ical systems [18, 27, 28]. In such NNs, physics can, for ex-
where a significant amount of data is available, such as for ample, be introduced directly in the structure of the network
tasks related to natural language processing [22] or images or through custom loss functions, among others [29]. In this
[23]. Additionally, to ensure some level of generalization, paper, we refer to these models as Physics-informed Neural
practitioners typically separate the data into training and val- Networks (PiNNs).
idation sets, the former being used to train the network and To the best of the authors’ knowledge, Drgoňa et al. [30]
the latter to assess its performance on unseen data to avoid were the first to use PiNNs as control-oriented building mod-
overfitting the training data [24]. However, classical NNs els, but they did not provide theoretical guarantees of their
cannot be robust to input modifications that do not exist in models following the underlying physics, except for the hard-
the entire data set. encoded dissipativity. Furthermore, the performance of their
In the case of building thermal models, even if several models, which remarkably work in the multi-zone setting,
years of data are available, one will always face an input was not benchmarked against classical methods. Concur-
coverage problem. Indeed, buildings are usually inhabited rently to our work, Gokhale et al. developed another PiNN
and operated in a typical fashion to maintain a comfortable structure for control-oriented building modeling, but they
temperature – heating when it gets cold in winter and cool- modified the loss function of their NNs and not their archi-
ing when it gets hot in summer. Most data sets are hence tecture [31], contrary to PCNNs. Finally, while not relying
inherently incomplete and we cannot hope to learn robust on PiNNs, we want to mention here the recent work of Bün-
NNs that grasp the effect of heating in summer, for exam- ning et al. on physics-inspired linear regression for buildings
ple. When predicting the evolution of the temperature over [32], which is philosophically related to the general efforts
long horizons of several days, classical NNs might there- to introduce physical priors in otherwise black-box models.
fore fail to capture the underlying physics, i.e. the impact of
heating and cooling on the temperature. This is illustrated 1.4. Contribution
in Figure 1, where one can compare the temperature pre- To tackle the aforementioned generalization issues of clas-
dictions of a classical physics-based resistance-capacitance sical NNs, we introduce a novel PiNN architecture, dubbed
(RC) model, a classical Long Short-Term Memory network PCNN, which includes existing knowledge on the physics of
(LSTM), and a Physically Consistent NN (PCNN) proposed the system at its core, with an application to building zone
in this work under different heating and cooling power in- temperature modeling. The introduction of prior knowledge
puts. Interestingly, the LSTM achieves a superior accuracy essentially works as an inductive bias, such that PCNNs do
than both other models on the training data, overfitting it, but not need to learn everything from data, but only what we
clearly fails to capture the impact of heating and cooling. cannot easily characterize a priori.
31 Classical RC model
No power
Temperature
28 Significantly heating
25 Slightly cooling
( C)
Slightly heating
22
19
31 Classical LSTM
Temperature
28
25
( C)
22
19
31 PCNN (ours)
Temperature
28
25
( C)
22
19
2
Power input
1
Power
(kW)
1
h 12h , 0h 12h , 0h 12h , 0h
a r, 0 , ar , ar , ar
2M 2 Mar 3M 3 Mar 4M 4 Mar 5M
Time
Figure 1: Temperature predictions of the RC model and the proposed PCNN detailed and analyzed in Section 5 compared to a
classical LSTM under different control inputs. The grey-shaded areas represent the span of the RC model predictions to provide a
visual comparison with both black-box methods. While the LSTM presents a lower training error than the PCNN (see Section 5),
indicating a good fit to the data, it does not capture the impact of the different heating/cooling powers applied to the system, e.g.
predicting higher temperatures when cooling is on than when heating is. The specific structure of PCNNs introduced in Section 3,
on the other hand, allows them to retain physical consistency, similarly to classical physics-based models, while improving the
prediction accuracy (see Section 5.2).
While PCNNs model unforced temperature dynamics1 to be proportional to the corresponding temperature gradi-
with classical NNs, they treat parts of the inputs separately: ents to provide physically consistent predictions. This solves
the power input to the zone and the heat losses to the envi- parts of the generalization issue of NN building models and
ronment and neighboring zones are processed in parallel by a makes PCNNs well-suited for control applications. The key
linear module inspired by classical physics-based RC mod- however is that, unlike in classical physics-based models, no
els. This module ensures the positive correlation between engineering effort is required to design and identify the pa-
power inputs and zone temperatures while forcing heat losses rameters of PCNNs: we only need access to past data, and
1 Throughout this work, unforced dynamics represent the temperature
PCNNs are then trained in an end-to-end fashion to learn all
evolution in the zone when no heating or cooling is applied and heat losses the parameters simultaneously. Furthermore, we show that
are neglected. PCNNs achieve better accuracy than a baseline RC model on
hand, an advantage of data-driven methods is their flexibil- spired from Bünning et al. [57] and simplified versions of
ity, as they can be scaled to large systems in a more straight- Maasoumy et al. [58–60] to construct the PCNNs proposed
forward manner than physics-based methods [49]. Addition- in this work.
ally, they are generally easier to transfer from one building
to another since similar model architectures can be used and 2.3.2. Physics-informed neural networks
all the parameters are learned from data. While early DL applications used classical feedforward
Very recently, as a consequence of the growing amount NNs, researchers soon realized how transferring prior knowl-
of available data, Deep Learning (DL) has started to be ap- edge to NNs could be beneficial. Among the success stories,
plied to building modeling [37]. For example, recurrent NNs one can find the CNN and RNN families, specially designed
(RNNs) were shown to provide better accuracy than feedfor- to capture spatial invariance [61] and temporal dependencies
ward NNs for the prediction of energy consumption [50]. [62] in the data, respectively.
In another study, a specific gated Convolutional NN (CNN) In recent years, a new field emerged in the Machine Learn-
was shown to outperform RNNs and the classical Seasonal ing community to tackle the generalization issue of neural
ARIMAX model on day-ahead multistep hourly predictions networks and create new NN architectures bound to follow
of the electricity consumption [14]. Due to the nonconvexity given physical laws, such as Hamiltonian NNs [28] or La-
of classical NN-based models, which makes them hard to use grangian NNs [27], later generalized by Djeumou et al. [18].
in optimization procedures, researchers also used specific In parallel, PiNN architectures flourished, pioneered by the
control-oriented models, such as Input Convex NN (ICNN), physics-guided NNs of Karpatne et al. [26, 63] and the more
to model building dynamics [51]. general physics-informed Deep Learning (DL) framework
originally proposed by Raissi et al. [64–66] . Since then, var-
2.3. Hybrid methods ious methods to include prior knowledge in NNs have been
Hybrid methods combine physics-based knowledge with proposed, several of which can be found in [29], where the
existing data to have the best of both worlds. Note that some authors tried to classify them.
researchers use the term “hybrid methods” to refer to the Methodologically, the PCNNs proposed in this work are
fact that they first build a physics-based model and then fit a close to the physics-interpretable shallow NNs, where the
black-box model to it to then accelerate the inference proce- inputs are also processed by two modules in parallel, one to
dure at run-time, such as [47, 52], which is out of the scope retain physical exactness when possible and one to capture
of this overview and hence not covered here. nonlinearities through a shallow NN [67]. Also related in
spirit to the PCNN architecture, Hu et al. introduced a spe-
2.3.1. Grey-box building models cific learning pipeline, where the output of the forward NN
In grey-box modeling, one generally starts from simpli- is fed back through a physics-inspired NN structure to recon-
fied physics-based equations and uses data-driven methods struct the input and hence ensure the forward process retains
to identify the model parameters [10, 12, 46] and/or learn an physical consistency [68].
unknown disturbance model on top of it [53]. The simpli- Finally, two recent works applied PiNNs to create control-
fied base model requires less expert knowledge and time to oriented building models [30, 31]. Drgoňa et al. replaced
be designed than pure physics-based models but still allows the state, input, disturbance, and output matrices of classical
one to retain the interpretability of physics-based models. linear models with four NNs and leveraged known physical
Furthermore, this basis includes physical knowledge in the rules to enforce constraints on them [30]. They additionally
model, so that less information has to be learned from data used the Perron-Frobenius theorem to enforce the stability
compared to pure black-box models, which in turn implies and dissipativity of the system by bounding the eigenvalues
that less historical data is required to fit such models [34]. of all the NNs. On the other hand, Gokhale et al. relied on
Typical grey-box models start with linear state-space mod- a more classical PiNN approach with the introduction of a
els and identify their parameters from data, even if some new physics-inspired loss term to guide the learning towards
nonlinearities are not well captured by this approach [49]. physically meaningful solutions without modifying the NN
Due to the difficulty of finding good parameters in general, architecture [31]. However, neither of these works provide
low complexity RC models usually perform better, with mod- physical consistency guarantees, unlike the PCNN architec-
els with one or two capacitances usually being selected [46, ture presented in this work.
54, 55]. Higher-order models furthermore entail more com-
plexity and hinder the generalization capability of grey-box
models, which also advocates in favor of low-complexity 3. Methods
frameworks [56]. As a partial solution, a feature assessment This section firstly defines a notion of physical consis-
framework to test the flexibility, scalability, and interoper- tency and then details the novel PCNN structure proposed
ability of grey-box models and select the right model char- in this work, where the effect of the control inputs and the
acteristics was proposed by Shamsi et al. [12]. In essence, heat losses to the environment and neighboring zones are
grey-box approaches hence allow for a trade-off between the separated from the unforced temperature dynamics. Finally,
accuracy and the complexity of building models [56]. we formally prove the physical consistency of PCNNs with
Due to the effectiveness of low-order RC models, we respect to control inputs and exogenous temperatures.
hence rely on linear first-order RC modeling techniques in-
3.1. Respecting the underlying physical laws Secondly, from the laws of thermodynamics, we know
Throughout this work, we define a model as being physi- that the modeled zone loses energy through heat transfers to
cally consistent with respect to a given input when any change the environment and the neighboring zone. We hence sub-
in this input leads to a change of the output that follows the tract these effects, which are proportional to the correspond-
underlying physical laws. In our case, for example, we need ing temperature gradients with the outside temperature 𝑇 𝑜𝑢𝑡 ,
models that are physically consistent with respect to control respectively the temperature in the neighboring zone 𝑇 𝑛𝑒𝑖𝑔ℎ ,
inputs to ensure that turning the heating on leads to higher scaled by parameters 𝑏, respectively 𝑐, learned from data.
zone temperatures than when heating is off, and vice versa Mathematically, in the heating case, we can hence write the
for cooling. Mathematically, we can express this require- evolution of the physics-inspired module as follows:
ment as follows for a zone with power input 𝑃 ∈ ℝ at time
step 𝑗 and temperature prediction 𝑇 ∈ ℝ at time step 𝑘: 𝐸𝑘+1 = 𝐸𝑘 + 𝑎𝑔(𝑢𝑘 ) − 𝑏(𝑇𝑘 − 𝑇𝑘𝑜𝑢𝑡 ) − 𝑐(𝑇𝑘 − 𝑇𝑘𝑛𝑒𝑖𝑔ℎ ), (6)
f
<latexit sha1_base64="FShqvcHvZf8AvXd/dWPaE1bbkG8=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mkqMeCF48t2A9oQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgobm1vbO8Xd0t7+weFR+fikreNUMWyxWMSqG1CNgktsGW4EdhOFNAoEdoLJ3dzvPKHSPJYPZpqgH9GR5CFn1FipGQ7KFbfqLkDWiZeTCuRoDMpf/WHM0gilYYJq3fPcxPgZVYYzgbNSP9WYUDahI+xZKmmE2s8Wh87IhVWGJIyVLWnIQv09kdFI62kU2M6ImrFe9ebif14vNeGtn3GZpAYlWy4KU0FMTOZfkyFXyIyYWkKZ4vZWwsZUUWZsNiUbgrf68jppX1W962qtWavUa3kcRTiDc7gED26gDvfQgBYwQHi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ms/4zJJDUq2WBSmgpiYzP4mA66QGTGxhDLF7a2EjaiizNh0SjYEb/nlVdK6qHqX1dp9rVKv5XEU4QRO4Rw8uII63EEDmsBgCM/wCm+OcF6cd+dj0Vpw8plj+APn8wcUno2i</latexit>
Figure 3: The proposed PCNN architecture used recursively at each time step. The control inputs 𝑢, transformed into power
inputs by the function 𝑔, and the losses to the environment 𝑏(𝑇 − 𝑇 𝑜𝑢𝑡 ) and neighboring zone 𝑐(𝑇 − 𝑇 𝑛𝑒𝑖𝑔ℎ ) all influence an energy
accumulator 𝐸, which accumulates or dissipates energy at each time step. Here, the separation between red and blue lines signals
a different treatment of the power inputs in the heating and cooling case, respectively, since they are scaled by different constants
𝑎 and 𝑑. The accumulated energy is then added to the unforced dynamics 𝐷, modeled by a residual NN that takes all the features
apart from 𝑢, 𝑇 𝑜𝑢𝑡 , and 𝑇 𝑛𝑒𝑖𝑔ℎ – gathered in 𝑥 – as input, to get the final zone temperature prediction 𝑇 .
𝑇𝑘+𝑖 = (1 − 𝑏 − 𝑐)𝑖 𝑇𝑘
∑
𝑖
+ (1 − 𝑏 − 𝑐)(𝑗−1) [𝑓 (𝐷𝑘+𝑖−𝑗 , 𝑥𝑘+𝑖−𝑗 ) (10)
𝑗=1
Figure 4: NEST building, Duebendorf, and the UMAR unit
𝑜𝑢𝑡 𝑛𝑒𝑖𝑔ℎ
+ 𝑎𝑔(𝑢𝑘+𝑖−𝑗 ) + 𝑏𝑇𝑘+𝑖−𝑗 + 𝑐𝑇𝑘+𝑖−𝑗 ] circled in white © Zooey Braun, Stuttgart.
them by disaggregating the total consumption of UMAR us- Seed Training loss Validation loss
ing the design mass flows and the amount of time the valves LSTMs 0 0.57 2.28
in each room are open. Apart from the temperature and 1 0.57 1.92
power consumption of the rooms, we also use data about 2 1.14 2.30
Mean 0.76 2.17
the solar irradiation and the ambient temperature on-site.
PCNNs 0 1.83 1.93
Details on the data preprocessing can be found in Appendix C. 1 1.85 1.65
Since both bathrooms are much smaller and have signifi- 2 2.06 1.75
cantly less heating/cooling power than the bedrooms and the Mean 1.91 1.78
living room, we assume that the heat transfers between the
former and the latter are negligible compared to the other Table 1
Comparison training and validation loss for three classical
heat transfers. In other words, we do not consider the bath-
LSTMs and PCNNs, scaled by 103 (full table in Appendix E).
rooms as distinct zones and only include the living room as
neighboring zone of the modeled bedroom.
Frequency Frequency
RC model
100
PCNN MAE ( C)
50 2
0
0.5-quantile
100 0.9-quantile 1
PCNN
50
0
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 00 1 2 3
Mean Absolute Error ( C) RC model MAE ( C)
(a) Distribution of the MAE of both models over the test sequences, (b) Scatter plot of the MAEs of both models on each test sequence,
with the 50% and 90% quantiles marked in red, respectively black. with the black diagonal line representing equal performance.
Figure 6: Comparison of the MAE of both the PCNN and RC model over almost 2000 predictions of three days, taken from the
unseen validation data of the PCNN.
Furthermore, looking at the three other predictions, for els, as detailed in Appendix F, written as follows:
which we do not have a ground truth anymore, both mod-
els again show similar behaviors. This is the visual conse- 𝜉𝑘+1 = 𝜉𝑘 + 𝑚(𝜉𝑘 , 𝑤2𝑘 )
quence of the physical consistency proven in Section 3.3, 𝑧𝑘+1 = 𝐴𝑧𝑘 + 𝐵𝑢 𝑔(𝑢𝑘 ) + 𝐵𝑤1 𝑤1𝑘 (17)
with the red predictions deviating from the blue ones at the
+ 𝐵𝑑 𝜉𝑘 + 𝜉𝑘+1
same point in time for both models: as soon as we stop heat-
ing the room, we get lower temperatures. Similarly, the or- where 𝑧 represents the state of the system, 𝑢 the controllable
ange predictions deviate from the uncontrolled dynamics at inputs, 𝑤1 uncontrollable ones, and 𝜉 is a disturbance model
the same points in time for both models. Finally, looking at computed as a function 𝑚 of the rest of the uncontrollable
the uncontrolled predictions, one can observe smoother pat- inputs 𝑤2 . The main structural difference between Equa-
terns for the PCNNs due to the unforced base dynamics be- tion (17) and classical grey-box formulations is the impact of
ing captured by LSTMs instead of the more aggressive linear the disturbance 𝜉, which appears both with and without a lag
regression at the core of the RC model. of one in the state update function. Traditional approaches
To get a better visualization of the behavior of both mod- generally first forget about the unknown disturbance 𝜉 to iden-
els with respect to the different control inputs, we can sub- tify 𝐴, 𝐵𝑢 , and 𝐵𝑤1 , and then fit a disturbance model to the
tract the uncontrolled predictions from the other curves. The residuals, e.g. using Gaussian Processes [72].
result is pictured in Figure 8 and allows us to assess the im- Despite the similarity with classical grey-box models,
pact of the three different control sequences on the final pre- PCNNs are fundamentally different both in terms of philos-
dictions. As expected, both models still exhibit similar be- ophy and training procedure. Firstly, the linear evolution of
haviors, with predictions diverging from the baseline as soon the state 𝑧 captures the main dynamics of grey-box mod-
as heating is turned on. On the other hand, when heating is els, including the impact of control inputs, and the nonlinear
off, the gap with the baseline gets slowly closed because of disturbance 𝜉 corrects them to match the data. On the other
the higher inside temperature leading to higher energy losses hand, in PCNNs, the main (unforced) dynamics 𝐷 are pro-
to the environment and the neighboring zone. Note that the cessed by nonlinear NNs, while the linear energy accumu-
impact of the neighboring room is hard to distinguish in that lator 𝐸 adjusts the predictions according to the controllable
plot since it is an order of magnitude smaller than the losses inputs and known disturbances, i.e. heat losses.
to the outside. Secondly, contrary to classical techniques modeling the
disturbance 𝜉 as a separate process, all the parameters of
6. Discussion PCNNs are trained simultaneously over the entire prediction
horizon – PCNNs are multi-step-ahead models – and in an
In this section, we briefly discuss the main differences
end-to-end fashion to capture dependencies between 𝐷 and
between PCNNs and classical grey-box modelsand then men-
𝐸, leveraging automatic BPTT.
tion potential applications of PCNNs, leveraging their physi-
cal consistency, and some hurdles that still need clarification. 6.2. Potential of PCNNs
As discussed, the good accuracy and physical consis-
6.1. Contrasting PCNNs with grey-box models
tency of PCNNs make them natural candidates for control-
Since PCNNs are heavily inspired from classical RC mod-
oriented zone temperature models. They could however also
els, we can derive them as a specific form of grey-box mod-
be used or integrated into Digital Twins (DTs), a fast-growing
field that suffers from two problems that PCNNs could solve.
RC model
31 No power
Temperature
28 Full power input
First half
( C)
25 Second half
22
19
PCNN
31
Temperature
28
( C)
25
22
19
2.0 Power input
1.5
Power
(kW)
1.0
0.5
0.0
ar , 0h , 12h ar , 0h , 12h ar, 0h , 12h
11 M 11 Mar 12 M 12 Mar 13 M 13 Mar
Time
Figure 7: Comparison between the RC model (top) and the PCNN (middle) given the bottom heating control sequence, over
three days. In blue, one can assess the precision of both models compared to the ground truth (dashed), where the full control
sequence was used. Then, red and orange show the result when only the first half of the control input, respectively the second
one, is used. Finally, the black uncontrolled dynamics reflect the case when no power is used, and we shaded the span of the RC
model predictions in the middle plot as reference.
Supervision . Heer P.: Writing - Review & Editing, Re- [17] L. Yu, W. Xie, D. Xie, Y. Zou, D. Zhang, Z. Sun, L. Zhang, Y. Zhang,
sources, Funding acquisition. Jones C.N.: Conceptualiza- T. Jiang, Deep Reinforcement Learning for Smart Home Energy Man-
tion, Methodology, Writing - Review & Editing, Supervi- agement, IEEE Internet of Things Journal (2019) https://doi.org/10.
1109/JIOT.2019.2957289.
sion. [18] F. Djeumou, C. Neary, E. Goubault, S. Putot, U. Topcu, Neural Net-
works with Physics-Informed Architectures and Constraints for Dy-
namical Systems Modeling, arXiv preprint arXiv:2109.06407 (2021).
References [19] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Good-
[1] International Energy Agency (IEA), Tracking Buildings 2020, fellow, R. Fergus, Intriguing properties of neural networks, arXiv
https://www.iea.org/reports/tracking-buildings-2020, Accessed: preprint arXiv:1312.6199 (2013).
2021.05.28, 2020. [20] R. R. Wiyatno, A. Xu, O. Dia, A. de Berker, Adversarial ex-
[2] European Commission (EC), Factsheet: The energy performance of amples in modern machine learning: A review, arXiv preprint
buildings directive, https://ec.europa.eu/energy/sites/ener/files/ arXiv:1911.05268 (2019).
documents/buildings_performance_factsheet.pdf, 2019. Accessed: [21] S.-M. Moosavi-Dezfooli, A. Fawzi, P. Frossard, Deepfool: a simple
06.01.2021. and accurate method to fool deep neural networks, in: Proceedings of
[3] Eurostat, statistics explained, Energy consumption in house- the IEEE conference on computer vision and pattern recognition, pp.
holds, https://ec.europa.eu/eurostat/statistics-explained/index. 2574–2582.
php?title=Energy_consumption_in_households, Accessed: 2021.05.28, [22] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal,
2020. A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al., Language mod-
[4] United Nations Framework Convention on Climate Change (UN- els are few-shot learners, arXiv preprint arXiv:2005.14165 (2020).
FCCC), Paris agreement to the united nations framework convention [23] Q. Xie, M.-T. Luong, E. Hovy, Q. V. Le, Self-training with noisy
on climate change, https://unfccc.int/process-and-meetings/ student improves imagenet classification, in: Proceedings of the
the-paris-agreement/the-paris-agreement, 2015. Accessed: IEEE/CVF Conference on Computer Vision and Pattern Recognition,
05.05.2021. pp. 10687–10698.
[5] P. Westermann, R. Evins, Surrogate modelling for sustainable build- [24] Y. Xu, R. Goodacre, On splitting training and validation set: a com-
ing design–a review, Energy and Buildings 198 (2019) 170–186, parative study of cross-validation, bootstrap and systematic sampling
https://doi.org/10.1016/j.enbuild.2019.05.057. for estimating the generalization performance of supervised learning,
[6] M. Rabani, H. B. Madessa, O. Mohseni, N. Nord, Minimizing de- Journal of Analysis and Testing 2 (2018) 249–262, https://doi.org/
livered energy and life cycle cost using Graphical script: An of- 10.1007/s41664--018--0068--2.
fice building retrofitting case, Applied Energy 268 (2020) 114929, [25] A. D’Amour, K. Heller, D. Moldovan, B. Adlam, B. Alipanahi,
https://doi.org/10.1016/j.apenergy.2020.114929. A. Beutel, C. Chen, J. Deaton, J. Eisenstein, M. D. Hoffman, et al.,
[7] B. Svetozarevic, C. Baumann, S. Muntwiler, L. Di Natale, M. N. Underspecification Presents Challenges for Credibility in Modern
Zeilinger, P. Heer, Data-driven control of room temperature and bidi- Machine Learning, arXiv preprint arXiv:2011.03395 (2020).
rectional ev charging using deep reinforcement learning: simulations [26] A. Karpatne, W. Watkins, J. Read, V. Kumar, Physics-guided neural
and experiments, Applied Energy (2021) 118127. networks (pgnn): An application in lake temperature modeling, arXiv
[8] A. Boodi, K. Beddiar, M. Benamour, Y. Amirat, M. Benbouzid, Intel- preprint arXiv:1710.11431 (2017).
ligent systems for building energy and occupant comfort optimization: [27] M. Lutter, C. Ritter, J. Peters, Deep lagrangian networks: Us-
A state of the art review and recommendations, Energies 11 (2018) ing physics as model prior for deep learning, arXiv preprint
2604, https://doi.org/10.3390/en11102604. arXiv:1907.04490 (2019).
[9] C. Fan, F. Xiao, Y. Zhao, A short-term building cooling load pre- [28] S. Greydanus, M. Dzamba, J. Yosinski, Hamiltonian neural net-
diction method using deep learning algorithms, Applied energy 195 works, Advances in Neural Information Processing Systems 32
(2017) 222–233, https://doi.org/10.1016/j.apenergy.2017.03.064. (2019) 15379–15389.
[10] M. H. Shamsi, U. Ali, E. Mangina, J. O’Donnell, A framework for [29] L. von Rueden, S. Mayer, K. Beckh, B. Georgiev, S. Giesselbach,
uncertainty quantification in building heat demand simulations using R. Heese, B. Kirsch, M. Walczak, J. Pfrommer, A. Pick, R. Ra-
reduced-order grey-box energy models, Applied Energy 275 (2020) mamurthy, J. Garcke, C. Bauckhage, J. Schuecker, Informed Ma-
115141, https://doi.org/10.1016/j.apenergy.2020.115141. chine Learning - A Taxonomy and Survey of Integrating Prior Knowl-
[11] W. Tian, Y. Heo, P. De Wilde, Z. Li, D. Yan, C. S. Park, X. Feng, edge into Learning Systems, IEEE Transactions on Knowledge and
G. Augenbroe, A review of uncertainty analysis in building energy Data Engineering (2021) 1–1, https://doi.org/10.1109/TKDE.2021.
assessment, Renewable and Sustainable Energy Reviews 93 (2018) 3079836.
285–301, https://doi.org/10.1016/j.rser.2018.05.029. [30] J. Drgoňa, A. R. Tuor, V. Chandan, D. L. Vrabie, Physics-constrained
[12] M. H. Shamsi, U. Ali, E. Mangina, J. O’Donnell, Feature assessment deep learning of multi-zone building thermal dynamics, Energy and
frameworks to evaluate reduced-order grey-box building energy mod- Buildings 243 (2021) 110992, https://doi.org/10.1016/j.enbuild.
els, Applied Energy 298 (2021) 117174, https://doi.org/10.1016/j. 2021.110992.
apenergy.2021.117174. [31] G. Gokhale, B. Claessens, C. Develder, Physics informed neural net-
[13] Z. Afroz, G. Shafiullah, T. Urmee, G. Higgins, Modeling tech- works for control oriented thermal modeling of buildings, Applied
niques used in building HVAC control systems: A review, Renewable Energy 314 (2022) 118852.
and sustainable energy reviews 83 (2018) 64–84, https://doi.org/10. [32] F. Bünning, B. Huber, A. Schalbetter, A. Aboudonia, M. H. de Badyn,
1016/j.rser.2017.10.044. P. Heer, R. S. Smith, J. Lygeros, Physics-informed linear regression
[14] M. Cai, M. Pipattanasomporn, S. Rahman, Day-ahead building-level is a competitive approach compared to Machine Learning methods in
load forecasts using deep learning vs. traditional time-series tech- building MPC, arXiv preprint arXiv:2110.15911 (2021).
niques, Applied Energy 236 (2019) 1078–1088, https://doi.org/10. [33] R. Z. Homod, Review on the HVAC system modeling types and the
1016/j.apenergy.2018.12.042. shortcomings of their application, Journal of Energy 2013 (2013) ,
[15] Z. Wang, T. Hong, Reinforcement learning for building controls: The https://doi.org/10.1155/2013/768632.
opportunities and challenges, Applied Energy 269 (2020) 115036, [34] A. Foucquier, S. Robert, F. Suard, L. Stéphan, A. Jay, State of the
https://doi.org/10.1016/j.apenergy.2020.115036. art in building modelling and energy performances prediction: A re-
[16] Z. Wan, H. Li, H. He, Residential energy management with deep view, Renewable and Sustainable Energy Reviews 23 (2013) 272–
reinforcement learning, in: 2018 International Joint Conference on 288, https://doi.org/10.1016/j.rser.2013.03.004.
Neural Networks (IJCNN), IEEE, pp. 1–7, https://doi.org/10.1109/ [35] X. Li, J. Wen, Review of building energy modeling for control and op-
IJCNN.2018.8489210.
eration, Renewable and Sustainable Energy Reviews 37 (2014) 517– J. Lygeros, Input Convex Neural Networks for Building MPC, in:
537, https://doi.org/10.1016/j.rser.2014.05.056. Proceedings of the 3rd Conference on Learning for Dynamics and
[36] C. Deb, F. Zhang, J. Yang, S. E. Lee, K. W. Shah, A review on time Control, volume 144 of Proceedings of Machine Learning Research,
series forecasting techniques for building energy consumption, Re- PMLR, 2021, pp. 251–262.
newable and Sustainable Energy Reviews 74 (2017) 902–924, https: [52] X. Li, R. Yao, Modelling heating and cooling energy demand for
//doi.org/10.1016/j.rser.2017.02.085. building stock using a hybrid approach, Energy and Buildings 235
[37] M. Bourdeau, X. qiang Zhai, E. Nefzaoui, X. Guo, P. Chatellier, Mod- (2021) 110740, https://doi.org/10.1016/j.enbuild.2021.110740.
eling and forecasting building energy consumption: A review of data- [53] F. M. Gray, M. Schmidt, A hybrid approach to thermal building mod-
driven techniques, Sustainable Cities and Society 48 (2019) 101533, elling using a combination of Gaussian processes and grey-box mod-
https://doi.org/10.1016/j.scs.2019.101533. els, Energy and Buildings 165 (2018) 56–63, https://doi.org/10.
[38] U. Ali, M. H. Shamsi, C. Hoare, E. Mangina, J. O’Donnell, Review 1016/j.enbuild.2018.01.039.
of urban building energy modeling (UBEM) approaches, methods and [54] S. F. Fux, A. Ashouri, M. J. Benz, L. Guzzella, EKF based self-
tools using qualitative and quantitative analysis, Energy and Buildings adaptive thermal model for a passive house, Energy and Buildings 68
246 (2021) 111073, https://doi.org/10.1016/j.enbuild.2021.111073. (2014) 811–817.
[39] T. Wei, S. Ren, Q. Zhu, Deep reinforcement learning for joint dat- [55] T. Berthou, P. Stabat, R. Salvazet, D. Marchio, Development and
acenter and HVAC load control in distributed mixed-use buildings, validation of a gray box model to predict thermal behavior of occupied
IEEE Transactions on Sustainable Computing (2019) , https://doi. office buildings, Energy and Buildings 74 (2014) 91–100, https://
org/10.1109/TSUSC.2019.2910533. doi.org/10.1016/j.enbuild.2014.01.038.
[40] D. B. Crawley, L. K. Lawrie, F. C. Winkelmann, W. F. Buhl, Y. J. [56] M. H. Shamsi, U. Ali, J. O’Donnell, A generalization approach for
Huang, C. O. Pedersen, R. K. Strand, R. J. Liesen, D. E. Fisher, M. J. reduced order modelling of commercial buildings, Journal of Build-
Witte, et al., EnergyPlus: creating a new-generation building energy ing Performance Simulation 12 (2019) 729–744, https://doi.org/10.
simulation program, Energy and buildings 33 (2001) 319–331, https: 1080/19401493.2019.1641554.
//doi.org/10.1016/S0378--7788(00)00114--6. [57] F. Bünning, B. Huber, A. Schalbetter, A. Aboudonia, M. H. de Badyn,
[41] M. Wetter, C. Haugstetter, Modelica versus TRNSYS–A comparison P. Heer, R. S. Smith, J. Lygeros, Physics-informed linear regression is
between an equation-based and a procedural modeling language for competitive with two Machine Learning methods in residential build-
building energy simulation, Proceedings of SimBuild 2 (2006). ing MPC, Applied Energy 310 (2022) 118491.
[42] D. Mazzeo, N. Matera, C. Cornaro, G. Oliveti, P. Romagnoni, [58] M. Maasoumy, A. Pinto, A. Sangiovanni-Vincentelli, Model-based
L. De Santoli, EnergyPlus, IDA ICE and TRNSYS predictive sim- hierarchical optimal control design for HVAC systems, in: Dynamic
ulation accuracy for building thermal behaviour evaluation by us- Systems and Control Conference, volume 54754, pp. 271–278.
ing an experimental campaign in solar test boxes with and without [59] M. Maasoumy, M. Razmara, M. Shahbakhti, A. S. Vincentelli, Han-
a PCM module, Energy and Buildings 212 (2020) 109812, https: dling model uncertainty in model predictive control for energy effi-
//doi.org/10.1016/j.enbuild.2020.109812. cient buildings, Energy and Buildings 77 (2014) 377–392.
[43] X. Ding, W. Du, A. Cerpa, OCTOPUS: Deep reinforcement learning [60] M. Maasoumy, M. Razmara, M. Shahbakhti, A. S. Vincentelli, Se-
for holistic smart building control, in: Proceedings of the 6th ACM lecting building predictive control based on model uncertainty, in:
International Conference on Systems for Energy-Efficient Buildings, 2014 American Control Conference, IEEE, pp. 404–411.
Cities, and Transportation, pp. 326–335, https://doi.org/10.1145/ [61] O. S. Kayhan, J. C. v. Gemert, On translation invariance in cnns: Con-
3360322.3360857. volutional layers can exploit absolute spatial location, in: Proceedings
[44] Z. Zhang, A. Chong, Y. Pan, C. Zhang, K. P. Lam, Whole building en- of the IEEE/CVF Conference on Computer Vision and Pattern Recog-
ergy model for HVAC optimal control: A practical framework based nition, pp. 14274–14285.
on deep reinforcement learning, Energy and Buildings 199 (2019) [62] Y. Yu, X. Si, C. Hu, J. Zhang, A review of recurrent neural networks:
472–490, https://doi.org/10.1016/j.enbuild.2019.07.029. LSTM cells and network architectures, Neural computation 31 (2019)
[45] A. Chakrabarty, E. Maddalena, H. Qiao, C. Laughman, Scalable 1235–1270, https://doi.org/10.1162/neco_a_01199.
Bayesian Optimization for Model Calibration: Case Study on Cou- [63] A. Karpatne, G. Atluri, J. H. Faghmous, M. Steinbach, A. Banerjee,
pled Building and HVAC Dynamics, Energy and Buildings (2021) A. Ganguly, S. Shekhar, N. Samatova, V. Kumar, Theory-guided data
111460, https://doi.org/10.1016/j.enbuild.2021.111460. science: A new paradigm for scientific discovery from data, IEEE
[46] H. Harb, N. Boyanov, L. Hernandez, R. Streblow, D. Müller, Devel- Transactions on knowledge and data engineering 29 (2017) 2318–
opment and validation of grey-box models for forecasting the thermal 2331, https://doi.org/10.1109/TKDE.2017.2720168.
response of occupied buildings, Energy and Buildings 117 (2016) [64] M. Raissi, P. Perdikaris, G. E. Karniadakis, Physics informed deep
199–207, https://doi.org/10.1016/j.enbuild.2016.02.021. learning (part I): Data-driven solutions of nonlinear partial differential
[47] F. Ascione, N. Bianco, C. De Stasio, G. M. Mauro, G. P. Vanoli, Arti- equations, arXiv preprint arXiv:1711.10561 (2017).
ficial neural networks to predict energy performance and retrofit sce- [65] M. Raissi, P. Perdikaris, G. E. Karniadakis, Physics informed deep
narios for any member of a building category: A novel approach, En- learning (part II): Data-driven solutions of nonlinear partial differen-
ergy 118 (2017) 999–1017, https://doi.org/10.1016/j.energy.2016. tial equations, arXiv preprint arXiv:1711.10561 (2017).
10.126. [66] Y. Yang, P. Perdikaris, Physics-informed deep generative models,
[48] C. Zhang, J. Li, Y. Zhao, T. Li, Q. Chen, X. Zhang, W. Qiu, Prob- arXiv preprint arXiv:1812.03511 (2018).
lem of data imbalance in building energy load prediction: Concept, [67] J. Yuan, Y. Weng, Physics Interpretable Shallow-Deep Neural Net-
influence, and solution, Applied Energy 297 (2021) 117139, https: works for Physical System Identification with Unobservability (2021).
//doi.org/10.1016/j.apenergy.2021.117139. [68] X. Hu, H. Hu, S. Verma, Z.-L. Zhang, Physics-guided deep neural net-
[49] S. Royer, S. Thil, T. Talbert, Towards a generic procedure for works for power flow analysis, IEEE Transactions on Power Systems
modeling buildings and their thermal zones, in: 2016 IEEE 16th 36 (2020) 2082–2092, https://doi.org/10.1109/TPWRS.2020.3029557.
International Conference on Environment and Electrical Engineer- [69] P. J. Werbos, Backpropagation through time: what it does and how to
ing (EEEIC), IEEE, pp. 1–6, https://doi.org/10.1109/EEEIC.2016. do it, Proceedings of the IEEE 78 (1990) 1550–1560.
7555567. [70] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan,
[50] A. Rahman, A. D. Smith, Predicting heating demand and siz- T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison,
ing a stratified thermal storage tank using deep learning algorithms, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy,
Applied Energy 228 (2018) 108–121, https://doi.org/10.1016/j. B. Steiner, L. Fang, J. Bai, S. Chintala, PyTorch: An Imperative
apenergy.2018.06.064. Style, High-Performance Deep Learning Library, in: H. Wallach,
[51] F. Bünning, A. Schalbetter, A. Aboudonia, M. H. de Badyn, P. Heer, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, R. Garnett
(Eds.), Advances in Neural Information Processing Systems 32, Cur- of the walls adjacent to the outside, respectively the neigh-
ran Associates, Inc., 2019, pp. 8024–8035. boring zone, and 𝑇 𝑜𝑢𝑡 and 𝑇 𝑛𝑒𝑖𝑔ℎ the temperature outside,
[71] Empa, NEST, https://www.empa.ch/web/nest/overview, 2021. Ac- respectively in the neighboring zone. We then group all the
cessed: 04.10.2021.
[72] L. Hewing, J. Kabzan, M. N. Zeilinger, Cautious model predictive other heat gains in 𝑄𝑟𝑒𝑠𝑡 , scaled by a parameter 𝜂 and dis-
control using gaussian process regression, IEEE Transactions on Con- cretize this ODE with the Euler forward method and the time
trol Systems Technology 28 (2019) 2736–2743, https://doi.org/10. step Δ𝑡 = 1 min, yielding:
1109/TCST.2019.2949757.
[73] D. Sturzenegger, D. Gyalistras, M. Morari, R. S. Smith, Model pre- 1 𝜖 𝜂
dictive climate control of a swiss office building: Implementation,
𝑇𝑘+1 = 𝑇𝑘 + Δ𝑡 ∗ [ 𝑄ℎ𝑒𝑎𝑡 + 𝑄𝑖𝑟𝑟 + 𝑄𝑟𝑒𝑠𝑡
𝐶 𝑘 𝐶 𝑘 𝐶 𝑘
results, and cost–benefit analysis, IEEE Transactions on Control 1
Systems Technology 24 (2015) 1–12, https://doi.org/10.1109/TCST. − (𝑇 − 𝑇𝑘𝑜𝑢𝑡 ) (21)
2015.2415411. 𝐶𝑅𝑜𝑢𝑡 𝑘
1
− (𝑇 − 𝑇𝑘𝑛𝑒𝑖𝑔ℎ )]
𝐶𝑅𝑛𝑒𝑖𝑔ℎ 𝑘
Appendices Grouping the constants together and defining new parame-
A. RC building model ters 𝑎, 𝑏, 𝑐, 𝑒1 and 𝑒2 , we can reformulate it as follows:
A.1. General RC models 𝑇𝑘+1 = 𝑇𝑘 + 𝑎𝑄ℎ𝑒𝑎𝑡
𝑘 − 𝑏(𝑇𝑘 − 𝑇𝑘𝑜𝑢𝑡 )
In general, we can describe the thermal dynamics of a
room with the following ordinary differential equation (ODE): − 𝑐(𝑇𝑘 − 𝑇𝑘𝑛𝑒𝑖𝑔ℎ ) + 𝑒1 𝑄𝑖𝑟𝑟 𝑟𝑒𝑠𝑡
𝑘 + 𝑒 2 𝑄𝑘 (22)
Applying this transformation recursively yields the follow- and we can write temperature predictions from the model as
ing two-steps-ahead temperature predictions: follows:
+ (1 − 𝑏 − 𝑐)[𝑎𝑄ℎ𝑒𝑎𝑡
𝑘 + 𝑏𝑇𝑘𝑜𝑢𝑡 𝑇𝑘+𝑖 = (1 − 𝑏 − 𝑐)𝑖 𝑇𝑘
+ 𝑐𝑇𝑘𝑛𝑒𝑖𝑔ℎ + 𝑒𝑄𝑖𝑟𝑟𝑘 ] ∑
𝑖
D. Implementation details
0.9
The month and time of day variables are represented by
Absolute Error ( C)
sine and cosine functions to introduce periodicity, so that the 0.8
last month has a value close to the first month of the year for 0.7
example. Mathematically, two variables are created: 0.6
𝑚 𝑚
𝑡𝑠𝑖𝑛
𝑚 = sin ( 12 2𝜋), 𝑡𝑐𝑜𝑠
𝑚 = cos ( 12 2𝜋), (34) 0.5
where the months 𝑚 are labeled linearly and in order from 0.4
1 to 12. The same processing is done for the time step in 0.3
during the day, replacing the factor 12 in Equation (34) by 1h 6h 12h 24h 48h 72h
96, the number of 15 min interval in one day. Hour ahead
We let the initial hidden and cell state of the LSTM be Figure 9: MAE of six PCNNs with different random seeds at
learned during training and additionally give the model a six chosen prediction steps in grey and the average in green,
warm start of 3 h, i.e. the PCNN first predicts the last 12 where the statistics were computed from almost 2000 predic-
time steps in the past, where we feed the true temperatures tions from the validation set.
back to the network to initialize all the internal states, be-
fore predicting the temperature over the given horizon. We
train the PCNN to minimize the Mean Square Error (MSE) Starting Learned
of the predictions over a horizon of 3 days with 15-minute Parameter value value
time steps, and use the Adam optimizer with a decreasing 𝑎 2 2.01
learning rate of 0.001
√ at epoch ℎ. We create sequences of 𝑏 1.5 1.50
ℎ 𝑐 1.5 1.51
data using sliding windows of minimum 12 h – and maxi- 𝑑 2 1.97
mum 3 days – with a stride of 1 h. We then separate both the
heating and cooling season in training and validation data Table 3
with an 80-20% split to ensure a fair partition of heating and Comparison between the initial and learned values of the PCNN
parameters, in degrees Celsius. For 𝑎 and 𝑑, it represents how
cooling cases in the training and validation sets. Finally, the
many degrees are gained in 𝟦 𝗁 when heating/cooling at full
data is normalized between 0.1 and 0.9. power, while for 𝑏 and 𝑐 it represents how many degrees are lost
Since 𝑎, 𝑏, 𝑐, and 𝑑 are very small values that could be through heat transfer in 𝟨 𝗁 when the exogenous temperature
unstable during training – hence leading to physically incon- is 𝟤𝟧 °C lower.
sistent parameters –, we rewrite:
𝑠 = 𝑠0 𝑠,
̃ ∀𝑠 ∈ {𝑎, 𝑏, 𝑐, 𝑑} Seed Training loss Validation loss
0 1.82 2.42
where 𝑠0 is the initial value of the parameter. We initialize 1 1.66 2.44
𝑠̃ = 1 and let the backpropagation algorithm modify this 2 1.58 2.52
much more stable value instead. 3 1.66 2.54
4 1.66 2.39
E. Additional results Mean 1.68 2.46
One can verify that Equations (9) and (39) are equivalent,
with:
𝜉=𝐷 𝑧=𝑇
[ ]
𝑛𝑒𝑖𝑔ℎ 𝑇
𝑤1 = 𝑇 𝑜𝑢𝑡 𝑇 𝑤2 = 𝑥
𝐴=1−𝑏−𝑐 𝐵𝑢 = 𝑎
[ ]
𝐵𝑤1 = −𝑏 −𝑐 𝐵𝑑 = −𝑏 − 𝑐