**1. Introduction**

Advanced control methods for energy managemen<sup>t</sup> in buildings are required if the goal is obtaining an optimized operational performance [1]. Model predictive control (MPC) represents one of the most investigated controls in academic literature [2,3] given its ability to easily merge the principles of feedback control and numerical optimization [4]. The basic concept of MPC is to use a dynamic model to forecast a system behavior and to optimize the actuations in order to operate under the best sequence of decisions [5]. A key feature of MPCs consists in selecting future control actions, taking into account both predictions of future disturbances and system constraints [4], while the goal is pursued.

In buildings, MPCs can be applied for many purposes: (i) to exploit the energy storage capability in high-massive buildings, (ii) to maximize the use of renewable energy sources (RES), or (iii) to implement demand side managemen<sup>t</sup> (DSM) such as demand response (DR). However, in order to be truly e ffective, an MPC must be based on a reliable model of the system under study [6].

Buildings are complex systems consisting of smaller systems which interact with the occupants [7]. In order to accurately predict their thermal dynamics, di fferent aspects need to be considered. The IEA (International Energy Agency) EBC (Energy and Buildings Communities) annex 53 [8] defined six main factors that determine the energy consumption in buildings: (a) climate, (b) envelope, (c) systems and equipment, (d) operation and maintenance, (e) user behavior, and (f) indoor environmental quality. As highlighted by Geraldi and Ghisi [9], the six factors can be grouped into two categories: the first three factors, (a), (b), and (c), account for the building dimension, while the remaining, (d), (e), and (f), are related to the human dimension. The latter category can have a grea<sup>t</sup> impact on the assessment of the energy demand of buildings [10]. However, it is not always easy to predict users' behavior [7]; thus, a certain level of uncertainty is always present in building models which are not able to exactly predict the occupancy profiles.

In general, for short-time predictions, three categories of building energy modeling and forecasting are available: physical-based, data-driven, and hybrid models [11].

Physical-based systems are white box models [12] that need a detailed description of the building's physical and thermal properties in order to describe the building's dynamics with mathematical equations. Typically, they solve energy conservation equations based on heat transfer phenomena. No training data are required, and the parameters of the model are usually obtained from design plans, manufacture catalogues, or on-site measurements [11]. Most of the popular software, such as Energy Plus [13], TRNSYS [14], DOE-2 [15], or ESP-r [16], is based on a physical-based approach [17].

On the other hand, data-driven (or black box) models do not require a physical knowledge of the system, but they need a large amount of training data to be collected over an exhaustive period [11], i.e., both the data and the considered period should be statistically representative of the system operation. Statistical models have been directly applied in order to capture the correlation between building energy consumption and available measurement data [12]. The most common black box models are [18] support vector machines (SVM) [19], statistical regression (e.g., linear auto regressive models with exogenous inputs, ARX [20]), and artificial neural networks (ANNs) [21]. Unlike white box models, in which all the model parameters have a physical meaning, the parameters involved in a black box model cannot be interpreted in such terms.

A compromise between the two approaches is represented by hybrid (or grey box) models. Grey box models are a combination of physical-based and data-driven prediction models; thereby, some internal parameters and equations are physically interpretable, while others are estimated with a data-driven approach. Grey box models are widespread in building energy modeling [22], although they require both the system structure and training data.

Many works are available in the literature concerning the performance evaluation of the di fferent hybrid and data-driven building models to be used in an MPC. Hietaharju et al. [23] introduced a generalizable grey box model based on heat transfer laws to predict temperature inside buildings. Testing the model structure on five buildings, of which real data were available, they found an average modeling error constantly below 5% during the 28-h prediction horizon. Ferracuti et al. [24] compared the performance of three di fferent data-driven models for short-term thermal prediction in a real building: a lumped element grey box model, an ARX, and a nonlinear ARX. This work demonstrates that all the data-driven models investigated can be used to predict the short-term flexibility of the building for DR applications. In fact, for a prediction horizon of one hour, all the models showed a maximum root mean square error, *RMSE*, less than 0.5 ◦C in the tested period (among the grey box models, the third order one showed the best performance). Relying on a real neighborhood, Walker et al. [25] tested the use of machine learning algorithms (boosted-tree, random forest, SVM-linear, quadratic, cubic, and fine-Gaussian, as well as ANNs) to predict the electricity demand at individual and aggregated building levels, using data from 47 commercial buildings. Their results showed that boosted-tree, random forest, and ANN provided the best performance in predicting the hourly energy demand when computational time and error accuracy were compared. Touretzky and Patil [26] developed an ARX model to forecast the building power demand, also adopting physics-based

modeling approaches for building energy management. They investigated different configurations of options for inputs and outputs in relation to the available measurements, highlighting the importance of an appropriate selection of exogenous inputs in order to capture the effect of common demand managemen<sup>t</sup> practices. In order to evaluate the user behavior impact on overheating in a domestic environment, Baborska–Narozny and Grudzinska [27] developed a grey box model to simulate different scenarios in relation to fabric, occupant ventilation, and shading practices. The results showed that overheating could be entirely avoided if blinds were deployed to prevent excessive solar heat gains and mechanical extract ventilation was installed in the building.

Besides the above, other studies focus on the energy performance improvement that is obtained when a predictive control is used in a building with respect to a classic ruled-based control. Drgo ˇna et al. [28], for example, obtained energy use savings equal to 53.5% and a thermal comfort improvement of 36.9% for an office building in Belgium when a white box MPC based on first-principle physical equations was adopted. Moreover, Ferreira et al. [29] found similar energy savings (greater than 50%) when an MPC was adopted in the building sector. In this case, they proposed a discrete MPC that used radial-basis-function ANNs as predictive models and demonstrated the feasibility of the model with experimental results obtained in a building of the University of Algarve. Joe and Karava [30] introduced a smart operation strategy based on an MPC in order to optimize the performance of hydronic radiant floor systems in office buildings. They obtained a 34% cost saving compared to the baseline feedback control during the cooling season and a 16% energy use reduction during the heating season.

However, all the mentioned works focus either on evaluating the best model configuration to be adopted in an MPC (e.g., parameters identification, selection of inputs and outputs) or on the energy benefits that can be obtained through the adoption of such controls in buildings.

The purpose of this work is to combine these two types of analysis when the energy flexibility provided by the thermostatically controlled load can be also exploited. The two opposite modeling approaches (physical-based and data-driven) to predict the building energy demand are compared from two different points of view: (i) the capability of the models to reproduce the building energy behavior of a reference case and (ii) the practical implementation of a simple MPC designed to minimize the energy supply cost. In particular, the relationship between the model structure and its effectiveness in predicting the energy flexibility behavior will be explored.

With a dynamic cost tariff and the possibility of activating the building energy's flexibility [31] by allowing the indoor temperature to vary in a wider comfort range, the MPC can apply load shifting strategies to reach the goal. For the physical-based model, a lumped-capacitance model based on thermal–electrical analogy was used, while an ANN was chosen as data-driven model. The reference building, from which training data were extrapolated and in which the MPC was tested, was designed in a TRNSYS [14] simulation environment. The goal was to highlight the advantages and disadvantages of the two approaches when they were implemented in an MPC.

After this introductive section, Section 2 describes the methodology used to design the two models and the optimization process carried out by the MPC in the two cases. The case study is reported in Section 3, while the results of the study are provided in Section 4. The conclusions of the paper can be found in Section 5.
