Model Predictive Control ( MPC ) for Enhancing Building and HVAC System Energy Efficiency : Problem Formulation , Applications and Opportunities

In the last few years, the application of Model Predictive Control (MPC) for energy management in buildings has received significant attention from the research community. MPC is becoming more and more viable because of the increase in computational power of building automation systems and the availability of a significant amount of monitored building data. MPC has found successful implementation in building thermal regulation, fully exploiting the potential of building thermal mass. Moreover, MPC has been positively applied to active energy storage systems, as well as to the optimal management of on-site renewable energy sources. MPC also opens up several opportunities for enhancing energy efficiency in the operation of Heating Ventilation and Air Conditioning (HVAC) systems because of its ability to consider constraints, prediction of disturbances and multiple conflicting objectives, such as indoor thermal comfort and building energy demand. Despite the application of MPC algorithms in building control has been thoroughly investigated in various works, a unified framework that fully describes and formulates the implementation is still lacking. Firstly, this work introduces a common dictionary and taxonomy that gives a common ground to all the engineering disciplines involved in building design and control. Secondly the main scope of this paper is to define the MPC formulation framework and critically discuss the outcomes of different existing MPC algorithms for building and HVAC system management. The potential benefits of the application of MPC in improving energy efficiency in buildings were highlighted.


Introduction
In the last few years, new concepts and technologies have been conceived to face the critical issue of increasing energy sustainability in buildings.From a life cycle perspective, this can be achieved by enhancing the energy efficiency of building envelope and systems and optimising the use of on-site Renewable Energy Sources (RES), while assuring indoor thermal comfort for the occupants.In fact, residential and commercial buildings account for approximately 40% of the total primary energy in the EU and the US [1,2], and the impact of the Heating Ventilation and Air Conditioning (HVAC) systems is always significant.Considering that usually indoor thermal comfort and building energy demand are contrasting needs, optimization procedures that aim at finding a trade-off between them are one of the primary goals of engineers and researchers worldwide [3].Moreover, the increasing spread of RES and small-size poly-generation systems (potentially integrating Thermal Energy Storage (TES) systems) in buildings, is definitively changing the paradigm of energy distribution and the role of buildings in the grid [4].Buildings' occupants are becoming "prosumers" (producers and consumers at the same time), and their behavior during building operation is becoming of vital importance in enhancing energy performance.The implementation of active demand initiatives and peak-shaving strategies are expected to increase in the next future to help the integration of these distributed resources and generation systems in smart distribution grids [5,6].
In this context, the implementation of effective energy management strategies employing advanced control methods represents an attractive solution to reduce the operational energy demand of buildings and the mismatch between their energy demand and on-site generation, maximizing the exploitation of RES.Many investigations proved that more advanced control methods could ensure significant energy saving when compared to traditional control methods [7].
Advanced control strategies are mainly enabled by the hardware decreasing cost, data accessibility, and advances of ICT and Energy Management Systems (EMS), which allow the collection, storage, and analysis of a vast amount of building-related data.For this reason, if the information gathered is properly processed through data-driven procedures, it may provide crucial knowledge on the actual building performance and the influence of occupant behavior on the building energy demand [8,9].As a consequence, the analysis of this monitored data might represent a very effective opportunity to translate the extracted knowledge into ready-to-implement energy saving and active demand strategies to enhance energy efficiency in buildings and HVAC systems.Due to this fact, much effort is going to be devoted to the implementation of more sophisticated and prediction-based control techniques aimed at optimizing the energy performance of buildings.The application of model-and prediction-based control techniques capable of searching optimal trade-offs between conflicting objectives is therefore highly desirable.
Model Predictive Control (MPC) is a well-established method for constrained control and recently has been receiving extensive attention from researchers in the field of control of buildings and active components.MPC merges principles of feedback control and numerical optimization.It opens up possibilities of exploiting energy storage capabilities and optimization of RES on-site generation.MPC is able to exploit both the predictions of future disturbances (e.g., internal gains, weather, etc.) and given requirements (e.g., comfort ranges), to anticipate the energy needs of the building and optimize its thermal behavior on the basis of the defined control goals.Constraints are included directly in the optimization problem that is solved at each sampling step.Until the past decade, the MPC framework found a steep path to the practical implementation, because of its high computational demand in massive optimization problems.With the development of new processors, graphics processing units, and Cloud computing (and therefore with the exponential increase of available computational power), MPC is increasingly applied in various types of buildings and energy systems.Just in 2009, predictive optimal controllers, such as MPC, were considered marginal strategies by a review of advanced building control systems [10].However, from that date, the application of MPC in buildings received continuously increasing attention, as it can be inferred by Figure 1.
The present paper focuses on the formulation of MPC problems for the control and thermal energy management of buildings as a whole (considering the building and HVAC system dynamics).However, so far, MPC was also successfully applied to several other applications related to building controls, but those studies will not be discussed in the present work.For example, the MPC formulation can be used to control and optimize residential appliances [11][12][13], the building interaction with a smart grid or micro-grid [14][15][16][17][18][19], or an on-site renewable energy generation system.More broadly, MPC algorithms found successful application in all of those implementations that require management of energy resources for building prosumers under designated constraints and dynamic energy pricing models [20][21][22].
Energies 2018, 11, x FOR PEER REVIEW 3 of 35 More broadly, MPC algorithms found successful application in all of those implementations that require management of energy resources for building prosumers under designated constraints and dynamic energy pricing models [20][21][22].The main scope of the present paper is to lay the foundation of an imaginary bridge linking automation and control engineers with building and mechanical engineers involved in building and HVAC system design and operation.Indeed, so far, a lack of literature work providing a common dictionary and a taxonomy to enhance the relationship between those two professional categories was observed by the authors.Furthermore, even if the MPC control problem for buildings has been well-discussed in many studies found in the literature, to the best of the authors' knowledge, a unique, clear and robust framework summarizing the necessary steps to formulate the control problem does not exist.Furthermore, the authors feel that more extended discussions and schematics to represent the operation of an MPC controller in a building could be useful to clarify the central concepts of this control framework that are sometimes misinterpreted.As a matter of fact, the lack of clear direction in the literature has generated confusion in some authors, and sometimes the term "Model Predictive Control" has been improperly used (e.g., calling MPC what actually is a day-ahead optimization procedure).The present paper aims at covering this gap and clarifying the different aspects concerning MPC in buildings.
The papers included in this survey were selected with a search of the keywords "Model Predictive Control", "MPC", "Predictive Control/Controller", "Building" and "HVAC", on Scopus and Web of Science.A total of 211 papers were identified and, after screening and removal of studies that were not in line with the definitions of a Model Predictive Control strategy applied to buildings, 161 papers were included in this survey.An additional 36 documents were used for defining the overall framework and individuating possible alternative control methods of the building thermal behavior.
The paper is organized as follows: Section 2 of the present article provides a brief overview of the control methods alternative to MPC and the previous surveys that investigated the research application of MPC for building and HVAC system control.Section 3 introduces the MPC theory and application methodology.Sections 4 and 5 present the models necessary to accurately capture the building dynamics to set up a model-based predictive controller and the main features of the theoretical and experimental controlled processes respectively.Section 6 defines a clear framework for the formulation of an MPC strategy specifically for buildings and HVAC systems, highlighting the main elements required by the controller.In conclusion, Section 7 discusses pros and cons of an The main scope of the present paper is to lay the foundation of an imaginary bridge linking automation and control engineers with building and mechanical engineers involved in building and HVAC system design and operation.Indeed, so far, a lack of literature work providing a common dictionary and a taxonomy to enhance the relationship between those two professional categories was observed by the authors.Furthermore, even if the MPC control problem for buildings has been well-discussed in many studies found in the literature, to the best of the authors' knowledge, a unique, clear and robust framework summarizing the necessary steps to formulate the control problem does not exist.Furthermore, the authors feel that more extended discussions and schematics to represent the operation of an MPC controller in a building could be useful to clarify the central concepts of this control framework that are sometimes misinterpreted.As a matter of fact, the lack of clear direction in the literature has generated confusion in some authors, and sometimes the term "Model Predictive Control" has been improperly used (e.g., calling MPC what actually is a day-ahead optimization procedure).The present paper aims at covering this gap and clarifying the different aspects concerning MPC in buildings.
The papers included in this survey were selected with a search of the keywords "Model Predictive Control", "MPC", "Predictive Control/Controller", "Building" and "HVAC", on Scopus and Web of Science.A total of 211 papers were identified and, after screening and removal of studies that were not in line with the definitions of a Model Predictive Control strategy applied to buildings, 161 papers were included in this survey.An additional 36 documents were used for defining the overall framework and individuating possible alternative control methods of the building thermal behavior.
The paper is organized as follows: Section 2 of the present article provides a brief overview of the control methods alternative to MPC and the previous surveys that investigated the research application of MPC for building and HVAC system control.Section 3 introduces the MPC theory and application methodology.Sections 4 and 5 present the models necessary to accurately capture the building dynamics to set up a model-based predictive controller and the main features of the theoretical and experimental controlled processes respectively.Section 6 defines a clear framework for the formulation of an MPC strategy specifically for buildings and HVAC systems, highlighting the main elements required by the controller.In conclusion, Section 7 discusses pros and cons of an MPC implementation for building thermal regulation on the basis of the trends undertaken by current scientific studies and the authors' vision.In this section, a classification table is also provided, stating the minimum information required by future studied on MPC applied to the building sector, in order be thorough and enhance their clarity.The entire review contains many schematics that allow the MPC problem to be conceptually formulated, promoting a clearer comprehension for the readers.

Overview on Building and HVAC System Control Methods
Over the past decades, the implementation of wired and wireless sensors and embedded controllers in building systems has increased rapidly.The increase in computational power, the availability of low-cost sensors and the availability of accurate weather predictions allow the control designers to explore some possible advanced control strategies for optimizing an efficient building climate control.
The optimization of the living space climate regulation is a problem that has no unique solution since many variables can be included in the optimization process, in particular when on-site generation and energy storage are implemented in the building.In general, the goals of an intelligent management system for energy and comfort include the following:

•
Achieving a high comfort level, concerning thermal, air quality and visual comfort.

•
Achieving high energy efficiency and minimizing the running cost of the building.
A variety of control logic approaches for building cooling, and heating systems have been proposed and reported in the literature.The ASHRAE handbook [23,24] offers a thorough review of existing control methodologies for building energy systems.Classical control has been widely adopted in building energy systems due to its simplicity in design and low computational complexity when determining the control signals.The HVAC subsystems are controlled using Rule-Based Controllers (RBC), based on inferential logic like "if-then-else", which are each managing a specific area.For example, On/Off or bang-bang controllers are very common in old building systems without digital control, and Proportional-Integral-Derivative (PID) control loops are usually implemented in more modern buildings where heating and cooling systems are equipped with digital control and variable frequency drives (e.g., pulse-width modulation controls) [24].At the level of the whole building, there is generally no optimization, even though there are often highly sophisticated local controllers.This means that an upper layer capable of optimizing the set-point of each controller, in general, is lacking.This is due to the high complexity that would be required for each RBC controller and the fact that it is practically impossible to generalize their rules at a building level [25].
In the 1990s research started to focus on the development and application of intelligent methods to building control systems.Smart controllers could be optimally tuned for the control of different subsystems of an intelligent building using evolutionary algorithms [26].For this purpose, the learning-based approaches from Artificial Intelligence (AI) techniques offer a different approach to the energy management problem compared to conventional methods.AI based control can deal with noisy or incomplete data, and with nonlinearities in the system.After being trained, it can perform predictions at relatively high speed [27].The most common AI approach are the Artificial Neural Networks (ANNs) that have been used extensively for the building predictions and HVAC control strategies [28,29].
Fuzzy Logic Controllers (FLCs) also offer a potential solution, coupling and integrating the management of all the different criteria and components of an HVAC system.
Genetic Algorithms (GAs) are optimization tools that can be used to improve the parameters of other control techniques.The use of GAs has been extensively researched for tuning parameters of classical controllers [30] and FLCs [31].GAs were also used to identify the key thermal parameters of a zone model based on measurements [32], as well as for the optimization of ANN models [33] for the control of an HVAC system.Moreover, Gas were exploited for the broader scope of optimizing the coordination of energy demand, renewable energy generation and energy storage [34].
In the last years, an increasing number of surveys aimed at analyzing the opportunity offered by the implementation of techniques based on classical control principles were published.From these works it has emerged that Model Predictive Control (MPC) algorithms are an effective method to improve building energy efficiency.In particular, the reviews on MPC can be grouped in those focused on optimal-intelligent control methods adopted for a single HVAC component (e.g., ventilation systems [35], ground-coupled heat pumps [36], thermal storages [37], window control [38], etc.) or those that consider the control strategies for the energy management of the entire building.Surveys can be further classified into two main groups: those that consider MPC just as one among many possible control methods, and those that are entirely focused on MPC.

Previous Reviews That Consider MPC Only as One among Many Possible Control Methods
The papers [10,39] are two preliminary surveys dealing with advanced control systems for energy and comfort management in buildings.In detail, in [39] a useful framework of the early studies about the model-based supervisory control methods up to 2006 is provided.In [40,41] Demand Side Management (DSM) procedures are reviewed with the aim to clarify the possible energy management strategies based on load forecasts and predictions.In [41] MPC is considered as the most diffused and effective instrument in an energy management optimization framework, which represents the higher level of intelligent control of a building for the authors.In [3,42] an entire section is focused on MPC, and a summary of its main features and advantages for energy management is provided.The recent study [7], provides a detailed overview of the various control strategies that can be applied to a building, focusing in particular on model-based controllers, such as MPC.This remarkable paper provides a framework that highlights strengths and weakness of those strategies.

Previous Reviews That Are Entirely Focused on MPC
To the best of authors' knowledge, the work of Afram and Janabi-Sharifi [21] can be considered the most remarkable review on MPC due to the worthy scheme of MPC implementation that it offers, combined with clear classifications criteria.This review highlights all the steps necessary to correctly implement the MPC problem and to formulate the optimization problem for building energy management.This review dates back to 2013.From that time, as far as authors know, more than 100 new articles have been published about MPC algorithm for building thermal management, reflecting the increasing magnitude that this topic is getting.Hilliard et al. [22] published in 2014 an excellent review of trend and opportunities for MPC implementation in commercial buildings.After an introductory description of MPC main features, the article summarizes details of 19 scientific works using a series of tables that capture the salient points and allow for comparison.Results of this work were used by the same authors also in [43] to define which are the primary requirements of a commercial building to be controlled appropriately by MPC.Papers [20,44] are the most recent reviews on MPC applied to building and HVAC system control.They are both not general surveys, but works focused on particular aspects of building-related MPC problems.The first one [44] is focused on ANN based MPC.The second one [20] is focused on occupant behavior based MPC problems for internal temperature regulation.Eventually, [45] provided a good overview and vision of the current and future potential applications for MPC building thermal regulation.

Framework and Structure
The dynamic response of the outputs of a system is affected by controlled inputs (or manipulated variables) and uncontrolled inputs (or disturbances) [46].A dynamical model of the system can capture such dynamics.Afterward, the controller can exploit them to make predictions of the possible future response of the system as a function of future controlled and uncontrolled inputs.MPC uses these predictions to select the best sequence of future manipulated variables, according to a specific performance index.The latter is defined over a time window that starts from the current time and spans a given prediction horizon in the future.The best sequence is obtained by solving a numerical optimization problem, that also takes into account the constraints on input and output variables one must satisfy during the operation of the building.The difference between MPC and open-loop optimal control is that the former only applies the first optimal move of the sequence at the current time instant, optimizing a new sequence at the following time-step again.This way of acting and re-planning continuously over time is denoted as the "receding horizon" concept and is sketched in Figure 2. optimization problem, that also takes into account the constraints on input and output variables one must satisfy during the operation of the building.The difference between MPC and open-loop optimal control is that the former only applies the first optimal move of the sequence at the current time instant, optimizing a new sequence at the following time-step again.This way of acting and replanning continuously over time is denoted as the "receding horizon" concept and is sketched in Figure 2. We introduce the following notation to describe the receding horizon problem: • Current instant (k): the current sampling step the controller is applied.

•
Control time-step (Ts): it is the time between control updates and iterative receding horizon optimizations.The discrete variable k is generally used to refer to a specific control time-step.

•
Prediction horizon (Np) (also referred to as planning horizon): the number of control time-steps the controller looks ahead in the future to optimize the cost function under constraints.

•
Control horizon (Nc) (also referred to as execution horizon or manipulated input horizon): the number of possible different values the manipulated variables can take in the future, that relates to the dimension of the optimization vector.
A general framework of the MPC formulation is presented in Figure 3.All the aspects of the MPC framework shown in this figure are discussed further in the various sections of this paper.We introduce the following notation to describe the receding horizon problem:

•
Current instant (k): the current sampling step the controller is applied.

•
Control time-step (T s ): it is the time between control updates and iterative receding horizon optimizations.The discrete variable k is generally used to refer to a specific control time-step.

•
Prediction horizon (N p ) (also referred to as planning horizon): the number of control time-steps the controller looks ahead in the future to optimize the cost function under constraints.

•
Control horizon (N c ) (also referred to as execution horizon or manipulated input horizon): the number of possible different values the manipulated variables can take in the future, that relates to the dimension of the optimization vector.
A general framework of the MPC formulation is presented in Figure 3.All the aspects of the MPC framework shown in this figure are discussed further in the various sections of this paper.

MPC Typologies
When solving a building control problem, multiple MPC typologies can be adopted and they have to be selected according to the nature of the controlled process, in particular to the type of prediction model one has developed to describe it.Consequently, also the optimization algorithms used will differ depending on the nature of the optimization problem.
The primary goal of what we will refer to as tracking MPC is to reach and closely track an apriori defined reference trajectory of a controlled variable.Depending on the nature of the controlled system dynamics, the MPC problem can be either linear or nonlinear.The extension of MPC from linear to nonlinear problems is not a trivial matter due to additional computational complexity, the reliability of nonlinear programming solvers, and lack of general purpose nonlinear systems identification techniques [47].
When the effect of unmeasured disturbances or model mismatch is a concern, sometimes is useful to embed a model of the possible mismatch between the nominal and real system within the MPC problem formulation.Generally, with expert knowledge of the controlled process or during the model validation phase from data, it is possible to define the magnitude of the uncertainties affecting the system and their effect on the model response.An MPC is called robust MPC when the stability and the performance specifications are maintained for all possible model variations and a class of noise signals (uncertainty magnitude) within a specified range [48].In this case, the uncertainties are bounded, and the resulting control strategy always satisfies the defined constraints within the uncertainty range.An alternative solution is offered by the stochastic MPC, where a stochastic dynamical model of the process is used to predict its possible future evolution.Disturbances and constraints are included as random variables with a given probability distribution (e.g., Markov Chains).In case of continuous distributions, one allows for unbounded uncertainties and enforces constraints within a finite probability.Contrariwise, in case of discrete distributions, that is if the

MPC Typologies
When solving a building control problem, multiple MPC typologies can be adopted and they have to be selected according to the nature of the controlled process, in particular to the type of prediction model one has developed to describe it.Consequently, also the optimization algorithms used will differ depending on the nature of the optimization problem.
The primary goal of what we will refer to as tracking MPC is to reach and closely track an apriori defined reference trajectory of a controlled variable.Depending on the nature of the controlled system dynamics, the MPC problem can be either linear or nonlinear.The extension of MPC from linear to nonlinear problems is not a trivial matter due to additional computational complexity, the reliability of nonlinear programming solvers, and lack of general purpose nonlinear systems identification techniques [47].
When the effect of unmeasured disturbances or model mismatch is a concern, sometimes is useful to embed a model of the possible mismatch between the nominal and real system within the MPC problem formulation.Generally, with expert knowledge of the controlled process or during the model validation phase from data, it is possible to define the magnitude of the uncertainties affecting the system and their effect on the model response.An MPC is called robust MPC when the stability and the performance specifications are maintained for all possible model variations and a class of noise signals (uncertainty magnitude) within a specified range [48].In this case, the uncertainties are bounded, and the resulting control strategy always satisfies the defined constraints within the uncertainty range.An alternative solution is offered by the stochastic MPC, where a stochastic dynamical model of the process is used to predict its possible future evolution.Disturbances and constraints are included as random variables with a given probability distribution (e.g., Markov Chains).In case of continuous distributions, one allows for unbounded uncertainties and enforces constraints within a finite probability.Contrariwise, in case of discrete distributions, that is if the uncertainty can only take value from a limited set with a given probability, one can optimize stochastic measures (such as a trade-off of expectation and variance, or conditional value at risk) and enforce constraints either for all disturbances (worst-case) or in probability, depending on how critical are the constraints [49].A stochastic approach in MPC is often used to simulate the occupancy disturbances [50,51].
The previously described MPC strategies are designed around an objective function that penalizes the deviation of an output of the system from a reference trajectory.Generally, in a hierarchal MPC configuration, the reference trajectories for the set-points are calculated based on economic considerations (e.g., temperature desired values for optimal energy demand) by the upper supervisory optimization layer [52].At a lower level, an MPC can optimize the control sequence of the actuators, minimizing the control effort to tracking the defined trajectory.Economic MPC refers to a strategy where temperature trajectories and system set-points are optimized within the same MPC cost function.The cost function is therefore based on an economic objective rather than the magnitude of the tracking error.While this takes into consideration the building operational cost, it also implies that the cost function cannot be used as a traditional Lyapunov function to prove closed-loop stability [53].
In numerous energy management applications, the system is of a hybrid nature, in the sense that it includes both continuous dynamics (affecting real-values inputs and states) and discrete dynamics (involving finite-state machines and Boolean input and states), leading to a nonlinear model with discontinuities.In this case, the optimization most commonly can be cast as a Mixed Integer Programming (MIP) problem, and the MPC formulation is commonly referred as hybrid MPC [54].This MPC approach is frequently used when the operation of the system involves discrete states, functioning modes, open or closed, On or Off, or scheduling requirements.
The MPC problem can be formulated in an implicit or explicit formulation.While in implicit MPC the control law is defined by solving the optimization problem in real-time, in explicit MPC multi-parametric programming algorithms are run offline to recast the control law as a lookup table of linear gains [55].Explicit MPC is used in those applications of small size where the computing power is limited or a very short computational time is needed (e.g., in embedded controllers that are required to perform the online optimization).

Models
It is well-known that the development of an appropriate dynamic model and its identification are often the most difficult and time-consuming tasks of the control design process, in particular when applying an MPC strategy.Indeed, models are the cornerstone of MPC and, following the Camacho and Bordons [47] indications, two different essential models can be discerned within the implementation of an MPC controller for buildings and their HVAC systems:

•
The control-oriented building and its HVAC system model, which represents the thermodynamical behavior of the building, used by the MPC for the on-line optimization.

•
The disturbance models that allow the forecast of the behavior of the uncontrolled variables affecting the dynamic response of the system.
While the two aforementioned models are always required for the MPC controller implementation, a further model is necessary at the design and prototype phase:

•
The surrogate simulated building model that is a virtual, possibly high-accuracy representation of the controlled system needed to close the control loop in simulation.
A scheme of the different models entering in MPC problems for building and HVAC systems is shown in Figure 4.

Modeling the Building and the HVAC System
ASHRAE [23] categorizes modeling methods into two different categories: the forward (classical) approach and the data-driven (inverse) approach.On the one side, the forward approach (also known as white box models or engineering methods) presumes detailed knowledge of the various system processes and interactions.The main advantage of this approach is that the system does not require to be physically built to evaluate its performance.Thus, in modeling the energy behavior of a building, the forward approach is usually suitable for preliminary predictions of energy needs and design of system loads.Reduced order models, quasi-steady-state methods suggested by standards, modified bin methods and the most common detailed energy simulation tools (e.g., EnergyPlus, TRNSYS, ESP-r and DOE-2) belong to the forward approach methods [56].
On the other hand the data-driven models were further classified by ASHRAE [23] in three broad groups, highlighted in Figure 5, that have also been adopted in the following classifications [56][57][58][59][60]:

•
Calibrated simulation models: that are high fidelity response models based on physical principle to calculate thermal dynamics and energy behavior of whole building level or for sublevel components [59].The approach is the same as the one mentioned in the forward approach, but in this case the models are calibrated using real data gathered on field.

•
Black-box models (also known as empirical approach): that are developed by fitting parameters of a model to historical behavior of the system and do not require full knowledge of the system or the process.Black-box models become particularly suitable for predicting the behavior of processes where a priori deterministic knowledge of the physical relationship between input and output is not univocally defined (e.g., evolution of climatic disturbances and occupant behavior related disturbances).

•
Grey-box models: that retain the physical description of the system they represent and their parameters can be estimated using system identification methods.Grey-box models have fitting

Modeling the Building and the HVAC System
ASHRAE [23] categorizes modeling methods into two different categories: the forward (classical) approach and the data-driven (inverse) approach.On the one side, the forward approach (also known as white box models or engineering methods) presumes detailed knowledge of the various system processes and interactions.The main advantage of this approach is that the system does not require to be physically built to evaluate its performance.Thus, in modeling the energy behavior of a building, the forward approach is usually suitable for preliminary predictions of energy needs and design of system loads.Reduced order models, quasi-steady-state methods suggested by standards, modified bin methods and the most common detailed energy simulation tools (e.g., EnergyPlus, TRNSYS, ESP-r and DOE-2) belong to the forward approach methods [56].
On the other hand the data-driven models were further classified by ASHRAE [23] in three broad groups, highlighted in Figure 6, that have also been adopted in the following classifications [56][57][58][59][60]: parameters that include the dynamics of the physical system described.Semi-Deterministic Physical Modelling (DSPM) uses a Resistance-Capacitance (R-C) electrical network analogue to explain the thermodynamics of a system.Figure 6 represents an example of R-C modeling of a building.Usually, the model parameters are estimated by tuning to historical measurements, and this approach has been presented in a wide variety of papers [61][62][63][64].

Modelling the Building and the HVAC System
To correctly apply an MPC strategy it is necessary to generate a virtual image of the controlled system, called control-oriented building model, capable of describing the physics of such controlled process accurately [65].This control-oriented building model must be accurate enough to ensure satisfactory prediction capabilities and capture the fundamental engineering processes that influence the dynamics of the controlled building, but at the same time has to be simple to ensure a reasonable computational time of the optimization process [25].Since these system models, even if they are a simplification of the real physical system, are required to represent its response accurately enough for the optimization to be effective, thus in most cases they are supported by a data-driven approach.In experimental case studies, historical data of states and disturbances, measured by sensors, can be utilized for this purpose.
Inputs to the models for prediction and calibration include the most significant climatic disturbances and occupancy related disturbances, as well as controllable inputs such as the thermal

•
Calibrated simulation models: that are high fidelity response models based on physical principle to calculate thermal dynamics and energy behavior of whole building level or for sublevel components [59].The approach is the same as the one mentioned in the forward approach, but in this case the models are calibrated using real data gathered on field.

•
Black-box models (also known as empirical approach): that are developed by fitting parameters of a model to historical behavior of the system and do not require full knowledge of the system or the process.Black-box models become particularly suitable for predicting the behavior of processes where a priori deterministic knowledge of the physical relationship between input and Energies 2018, 11, 631 output is not univocally defined (e.g., evolution of climatic disturbances and occupant behavior related disturbances).

•
Grey-box models: that retain the physical description of the system they represent and their parameters can be estimated using system identification methods.Grey-box models have fitting parameters that include the dynamics of the physical system described.Semi-Deterministic Physical Modelling (DSPM) uses a Resistance-Capacitance (R-C) electrical network analogue to explain the thermodynamics of a system.Figure 5 represents an example of R-C modeling of a building.Usually, the model parameters are estimated by tuning to historical measurements, and this approach has been presented in a wide variety of papers [61][62][63][64].

Modeling the Building and the HVAC System
ASHRAE [23] categorizes modeling methods into two different categories: the forward (classical) approach and the data-driven (inverse) approach.On the one side, the forward approach (also known as white box models or engineering methods) presumes detailed knowledge of the various system processes and interactions.The main advantage of this approach is that the system does not require to be physically built to evaluate its performance.Thus, in modeling the energy behavior of a building, the forward approach is usually suitable for preliminary predictions of energy needs and design of system loads.Reduced order models, quasi-steady-state methods suggested by standards, modified bin methods and the most common detailed energy simulation tools (e.g., EnergyPlus, TRNSYS, ESP-r and DOE-2) belong to the forward approach methods [56].
On the other hand the data-driven models were further classified by ASHRAE [23] in three broad groups, highlighted in Figure 5, that have also been adopted in the following classifications [56][57][58][59][60]:

•
Calibrated simulation models: that are high fidelity response models based on physical principle to calculate thermal dynamics and energy behavior of whole building level or for sublevel components [59].The approach is the same as the one mentioned in the forward approach, but in this case the models are calibrated using real data gathered on field.

•
Black-box models (also known as empirical approach): that are developed by fitting parameters of a model to historical behavior of the system and do not require full knowledge of the system or the process.Black-box models become particularly suitable for predicting the behavior of processes where a priori deterministic knowledge of the physical relationship between input and output is not univocally defined (e.g., evolution of climatic disturbances and occupant behavior related disturbances).

•
Grey-box models: that retain the physical description of the system they represent and their parameters can be estimated using system identification methods.Grey-box models have fitting

Modelling the Building and the HVAC System
To correctly apply an MPC strategy it is necessary to generate a virtual image of the controlled system, called control-oriented building model, capable of describing the physics of such controlled process accurately [65].This control-oriented building model must be accurate enough to ensure satisfactory prediction capabilities and capture the fundamental engineering processes that influence the dynamics of the controlled building, but at the same time has to be simple to ensure a reasonable computational time of the optimization process [25].Since these system models, even if they are a simplification of the real physical system, are required to represent its response accurately enough for the optimization to be effective, thus in most cases they are supported by a data-driven approach.In experimental case studies, historical data of states and disturbances, measured by sensors, can be utilized for this purpose.
Inputs to the models for prediction and calibration include the most significant climatic disturbances and occupancy related disturbances, as well as controllable inputs such as the thermal energy delivered by the HVAC.Common inputs to the thermal model include outdoor temperature, solar radiation, internal gains (solar or occupancy related) and heating or cooling energy delivered by the HVAC.The measured response is generally the indoor air temperature; in some cases, mainly simulated, the measured response can also include the average walls or other building components temperature [61].While the measured indoor air temperatures typically are monitored using sensors integrated into the BAS, the temperature of the walls, floors, ceilings, and other building components generally are estimated, with no feedback from sensors.In some cases, the HVAC system states can also be considered in the model (e.g., in [66][67][68], the TES operation was optimized, by considering it as a lumped temperature node).Similarly, to the applications where the control-oriented model states relate to temperature nodes, some other authors include in this model also other variables that affect the occupants' comfort.For example, in [69-72] the internal carbon dioxide concentration level is also considered as controlled variable together with the internal temperature.In [71][72][73][74] also the light level was taken into account.The light level can be controlled using the blinds position, while the carbon dioxide concentration level was controlled by managing the air change rate.
From a thermodynamic perspective, a building can be treated as a single-zone or as a multi-zone.The number of zones coincides with the number of internal nodes that are used to model the building dynamics.From the MPC prospective and its use in the thermal regulation of indoor spaces, a multi-zone building can be modeled in its entirety in the control-oriented building model, in the attempt to find an optimal solution for the operation of the entire building.In other cases, a distributed approach is taken, where various controllers manage a separate zone.A model with reasonable prediction properties is an ultimate condition for excellent performance of the predictive controller, and extensive research has been undertaken to aid the selection of the most appropriate model for the task [61].
It is unlikely that white-box or calibrated simulation models can be utilized as a control-oriented building model, as in general they do not provide an explicit model of the building, the identification and validation of calibrated simulation models are non-trivial processes.White-box models require building blueprints, significant parameter tuning, and simulation effort.Moreover, since the complexity, non-linearity, and size of the calibrated simulation responsive models, quickly lead optimization problems exceed computation timeframes required in a practical control application.Nevertheless, many researchers have studied the implementation of optimal controllers that use those calibrated simulation models, interfaced with different optimization toolboxes [75][76][77][78].Some of these studies demonstrated how the computational time required by the optimization of a high fidelity model in TRNSYS exceeds the control sampling time [79].Moreover, high fidelity simulation models prevent the optimization solvers from exploring the sparse structure of the resulting optimization problem [80].In general, the literature offers numerous works deducing that the calibrated simulation approach is not effective for implementation in controllers [80][81][82].
In general, black-box models cannot ensure reliable prediction for operating points outside the range covered by the training data, and thus extensive and adequate data training is needed to guarantee prediction accuracy.However, state that these models are faster to develop and implement if sufficient data are available, they are often adopted as control-oriented models capable of ensuring an accurate system representation.
Grey-box modeling is proven to be an effective method to model the thermal response of a building [83].One of the critical targets in development of a grey-box model for an MPC application is identifying a suitable model is agreement with the physical response of the system and at the same time has a complexity that can embed the information contained in the data, which means that the model should neither be under-fitted nor over-fitted [84].In buildings, grey-box models commonly use the R-C network analogy with an electric circuitry to describe the thermal process dynamics of a building zone.Modular construction of the R-C circuit can be followed to describe the behavior of a multi-zone building as a combination of single zones.Toolboxes for the automatic generation of control-oriented R-C models were also recently developed [85,86].A forward selection strategy is used to find the best model by an iterative process, using the most meaningful and adequately complex model [84,87].
In most of the cases, grey-box models were formulated using a state-space representation of Linear Time Invariant (LTI) systems.A discrete state-space model is usually formulated as follows: where u(k) is the vector of manipulated inputs or controlling variables (e.g., the HVAC system control inputs), v(k) is the vector of measured disturbances affecting the system (e.g., weather), x(k) is the vector of the system states (e.g., the building temperature nodes), y(k) is the vector of the outputs, d(k) is the unmeasured random noise on the outputs, and w(k) is the unmeasured random noise on the measurement of the states.The terms A, B u , B v , C, D u , D v , and G are state matrix, manipulated input matrix, measured disturbances matrix, output matrix, direct transmission matrix for manipulated inputs, direct transmission matrix for measured disturbances, and the matrix of the unmeasured random noise on the states respectively.The parameters contained in these matrices can be estimated using system identification techniques.In building applications, similarly to other industrial processes, the output is not a function of manipulated inputs, resulting in a zero D u matrix.The outputs y(k) can be either measured (e.g., the indoor air temperature) or unmeasured (e.g., the internal wall temperature).An alternative to the output-feedback formulation discussed above is the state-feedback formulation, which assumes that all the states are measured.This formulation is frequently adopted in building applications.Some authors prefer not to include the HVAC system model in the MPC formulation and therefore solve a higher level optimization problem, which returns, for example, the building set-points to be utilized.Other authors focus on the mathematical description of the HVAC system and its energy components.This was possible either integrating it with the building model and solving a complete optimization problem, or considering separately from the building, and therefore introducing the building (or the precinct) demand as an external disturbance with a forecasted profile in the optimization problem. Figure 7 reports the fraction of papers found in the literature that use different control-oriented building models and approaches to the HVAC system modeling.
In the first case, the model takes into account the mutual interaction between building and HVAC system in the optimization of the energy problem but leads to a higher computational effort.In the second case, considering for example Air Handling Units (AHUs) and Variable Air Volume (VAV) boxes for example, the problem acquires a non-linear nature, specifically bi-linear, where one of the states (e.g., the room temperature) multiplies one of the controlled inputs (e.g., the system air flow rate) [88][89][90][91].A similar configuration can also be found in the regulation of Fan Coil Units (FCU) [92].
Energies 2018, 11, x FOR PEER REVIEW 12 of 35 Some authors prefer not to include the HVAC system model in the MPC formulation and therefore solve a higher level optimization problem, which returns, for example, the building setpoints to be utilized.Other authors focus on the mathematical description of the HVAC system and its energy components.This was possible either integrating it with the building model and solving a complete optimization problem, or considering separately from the building, and therefore introducing the building (or the precinct) demand as an external disturbance with a forecasted profile in the optimization problem. Figure 7 reports the fraction of papers found in the literature that use different control-oriented building models and approaches to the HVAC system modeling.
In the first case, the model takes into account the mutual interaction between building and HVAC system in the optimization of the energy problem but leads to a higher computational effort.In the second case, considering for example Air Handling Units (AHUs) and Variable Air Volume (VAV) boxes for example, the problem acquires a non-linear nature, specifically bi-linear, where one of the states (e.g., the room temperature) multiplies one of the controlled inputs (e.g., the system air flow rate) [88][89][90][91].A similar configuration can also be found in the regulation of Fan Coil Units (FCU) [92].Additional complexity can also derive from an intermittent nature of the energy delivery, which leads to the formulation of an optimal controller of a hybrid system, due to the combination of continuous and Boolean variables in the optimization problem [93].HVAC systems integrating RES thermal generation and energy storage can also exhibit a hybrid nature since they can operate in various defined operating modes [66,68].MPC is particularly relevant for them since renewable thermal energy resources are highly weather-dependent and energy storage allows an offset of the generation to obtain a better match with the demand.
A general framework of the alternative scenario dealing with HVAC system modeling in MPC problems is provided in Figure 8.Additional complexity can also derive from an intermittent nature of the energy delivery, which leads to the formulation of an optimal controller of a hybrid system, due to the combination of continuous and Boolean variables in the optimization problem [93].HVAC systems integrating RES thermal generation and energy storage can also exhibit a hybrid nature since they can operate in various defined operating modes [66,68].MPC is particularly relevant for them since renewable thermal energy resources are highly weather-dependent and energy storage allows an offset of the generation to obtain a better match with the demand.
A general framework of the alternative scenario dealing with HVAC system modeling in MPC problems is provided in Figure 8.

The Prediction Models of Disturbances
Disturbances can be either measured or unmeasured.The measured disturbances are generally part of the dynamic building model, and their impact on the system response is directly captured by the model.The unmeasured disturbances can have a small or significant effect on the system response, affecting the uncertainty and the accuracy of the model response.
The measured disturbances can be considered as ideal measurements or as measurements affected by uncertainty (white noise, stochastic noise, etc.).Signal processing tools generally help in discriminating the signal noise from the signal itself.
There are three main categories of measured disturbances affecting an MPC problem for HVAC system and building energy management:

•
Grid and energy distributor related disturbances (e.g., Time of Use (ToU) or real-time prices, peak load penalties).
In other cases, the building demand can be treated as a single disturbance where the climatic conditions, the occupant behavior and factors affecting the building energy demand are lumped together [94].
The most straightforward way to determine disturbances affecting a building is to utilize commonly available disturbances patterns, such as Representative Meteorological Year (RMY), Typical Meteorological Year (TMY), and International Weather for Energy Calculations (IWEC) weather files or building demand and occupation patterns (ASHRAE [23]).In this case, the disturbances can only be used when assessing seasonal macro trends, but would not be accurate enough to be utilized for the short term predictions used by optimization methods.For this reason, considering the disturbances to be equal to the ones provided in these datasets can be used to assess, at a design stage, the simulated controller performance only, but cannot be used for implementation on a real-time controller.
A more accurate representation of the disturbances affecting the building and its HVAC system can be achieved for example by analyzing historical data gathered from the BAS.In this case, the disturbances will be modeled around an existing system, and they can be used for predicting the performance of an MPC controller when compared to existing standard control logic.For the real-

The Prediction Models of Disturbances
Disturbances can be either measured or unmeasured.The measured disturbances are generally part of the dynamic building model, and their impact on the system response is directly captured by the model.The unmeasured disturbances can have a small or significant effect on the system response, affecting the uncertainty and the accuracy of the model response.
The measured disturbances can be considered as ideal measurements or as measurements affected by uncertainty (white noise, stochastic noise, etc.).Signal processing tools generally help in discriminating the signal noise from the signal itself.
There are three main categories of measured disturbances affecting an MPC problem for HVAC system and building energy management:

•
Grid and energy distributor related disturbances (e.g., Time of Use (ToU) or real-time prices, peak load penalties).
In other cases, the building demand can be treated as a single disturbance where the climatic conditions, the occupant behavior and factors affecting the building energy demand are lumped together [94].
The most straightforward way to determine disturbances affecting a building is to utilize commonly available disturbances patterns, such as Representative Meteorological Year (RMY), Typical Meteorological Year (TMY), and International Weather for Energy Calculations (IWEC) weather files or building demand and occupation patterns (ASHRAE [23]).In this case, the disturbances can only be used when assessing seasonal macro trends, but would not be accurate enough to be utilized for the short term predictions used by optimization methods.For this reason, considering the disturbances to Energies 2018, 11, 631 14 of 35 be equal to the ones provided in these datasets can be used to assess, at a design stage, the simulated controller performance only, but cannot be used for implementation on a real-time controller.
A more accurate representation of the disturbances affecting the building and its HVAC system can be achieved for example by analyzing historical data gathered from the BAS.In this case, the disturbances will be modeled around an existing system, and they can be used for predicting the performance of an MPC controller when compared to existing standard control logic.For the real-time applications, accurate short-term predictions are necessary, and two primary possible methods of forecast can be adopted:

•
Online predictions rely on the availability of an internet connection and the possibility to acquire forecasts from a third party modeling source, that can provide accurate prediction using complex models [50,57,60] (e.g., weather forecast or future energy prices).

•
Offline predictions do not need an internet connection, and they only rely on the data which has been measured on site, but they require a model that can predict the future disturbances behavior.These methods are compulsory for the forecast of occupancy related disturbances that are specific to each case study [50].The simplest method for offline predictions is based on a rule of thumb that states that "the conditions of the next hours would be only slightly different from those of the previous time period" [51,95,96].More accurate offline prediction methods are those based on statistical or machine learning models [95][96][97].
A further prediction method often used in the literature combines the predictions of both offline and online methods.Indeed, combining the predictions of external models with data gathered on-site can be useful to calibrate external forecasts-reducing the uncertainty due to discrepancies between the location of weather stations and building site-and to address the risk of sudden internet service interruptions.Furthermore, a more straightforward online forecast can be used to adjust an offline prediction.For example, in [98] minimum and maximum daily forecasted temperature were used to correct the trajectory of an offline prediction; or in [99] the Support Vector Machine (SVM) method was used to forecast day-ahead electricity tariff prices based on past spot market prices and grid load levels.
Figure 9a shows the forecasting methods used by previous scientific works and Figure 9b summarizes the scenarios concerning the type of disturbances subject to these predictions.
Energies 2018, 11, x FOR PEER REVIEW 14 of 35 time applications, accurate short-term predictions are necessary, and two primary possible methods of forecast can be adopted: • Online predictions rely on the availability of an internet connection and the possibility to acquire forecasts from a third party modeling source, that can provide accurate prediction using complex models [50,57,60] (e.g., weather forecast or future energy prices).

•
Offline predictions do not need an internet connection, and they only rely on the data which has been measured on site, but they require a model that can predict the future disturbances behavior.These methods are compulsory for the forecast of occupancy related disturbances that are specific to each case study [50].The simplest method for offline predictions is based on a rule of thumb that states that "the conditions of the next hours would be only slightly different from those of the previous time period" [51,95,96].More accurate offline prediction methods are those based on statistical or machine learning models [95][96][97].
A further prediction method often used in the literature combines the predictions of both offline and online methods.Indeed, combining the predictions of external models with data gathered onsite can be useful to calibrate external forecasts-reducing the uncertainty due to discrepancies between the location of weather stations and building site-and to address the risk of sudden internet service interruptions.Furthermore, a more straightforward online forecast can be used to adjust an offline prediction.For example, in [98] minimum and maximum daily forecasted temperature were used to correct the trajectory of an offline prediction; or in [99] the Support Vector Machine (SVM) method was used to forecast day-ahead electricity tariff prices based on past spot market prices and grid load levels.
Figure 9a shows the forecasting methods used by previous scientific works and Figure 9b summarizes the scenarios concerning the type of disturbances subject to these predictions.

The Controlled Systems
The MPC framework is suitable for the management of buildings, regardless of their typology and classification (e.g., residential, educational, commercial, institutional).Figure 10a shows that theoretical and experimental studies available in the literature cover very heterogeneous building classifications.

The Controlled Systems
The MPC framework is suitable for the management of buildings, regardless of their typology and classification (e.g., residential, educational, commercial, institutional).Figure 10a shows that theoretical and experimental studies available in the literature cover very heterogeneous building classifications.The prototyping and testing of an MPC algorithm can be achieved by implementing the controller on an experimental case study or a simulated surrogate building model.In any experimental case study, simulations (even if using simplified models) are still necessary during controller design to properly set up the controller parameters and ensure reliable performance under different boundary conditions.
When the MPC algorithm is applied experimentally, an adequate BAS and integration platform is necessary.Firstly, the correct sensors integrated into the BAS are required to monitor the variables needed for the model embedded in the MPC to estimate the response of the system, and that adequate control inputs are associated to the process components.The MPC algorithm, especially in a research study or testing phase, is not embedded in the local controller of the building, but a separate computer performs the online optimization and exchanges information with the BAS at each control time-step employing a communication protocol.The computation of the solution and therefore the communication can be either local (using a computer and a communication protocol, such as Modbus, Bacnet, Obix, etc.) or the optimization can be done off-site, where there is a remote server and the exchange of information is done over the internet.A typical schematic of a real experimental implementation of MPC is shown in Figure 11.
In most of the cases available in the literature, surrogate simulated building models have been used to test MPC performance.On the one hand, when the building is ideal or monitoring data is not available, the surrogate simulated building model follows a forward approach.This one is the typical case of the theoretical studies on the MPC performances or the evaluation of MPC at building design stage.In particular, for theoretical studies, the building can be represented by an archetype that allows to carry out simulations to obtain performance indicators on the MPC algorithm on a building category.On the other hand, when there is an existing case study building, where operative data can be gathered in the field, the surrogate simulated building model can be built using either a forward approach or a data-driven approach.This scenario occurs when it is necessary to investigate the possible benefits achievable through the MPC algorithm compared to an existing logic already implemented in the BAS.The prototyping and testing of an MPC algorithm can be achieved by implementing the controller on an experimental case study or a simulated surrogate building model.In any experimental case study, simulations (even if using simplified models) are still necessary during controller design to properly set up the controller parameters and ensure reliable performance under different boundary conditions.
When the MPC algorithm is applied experimentally, an adequate BAS and integration platform is necessary.Firstly, the correct sensors integrated into the BAS are required to monitor the variables needed for the model embedded in the MPC to estimate the response of the system, and that adequate control inputs are associated to the process components.The MPC algorithm, especially in a research study or testing phase, is not embedded in the local controller of the building, but a separate computer performs the online optimization and exchanges information with the BAS at each control time-step employing a communication protocol.The computation of the solution and therefore the communication can be either local (using a computer and a communication protocol, such as Modbus, Bacnet, Obix, etc.) or the optimization can be done off-site, where there is a remote server and the exchange of information is done over the internet.A typical schematic of a real experimental implementation of MPC is shown in Figure 11.
In most of the cases available in the literature, surrogate simulated building models have been used to test MPC performance.On the one hand, when the building is ideal or monitoring data is not available, the surrogate simulated building model follows a forward approach.This one is the typical case of the theoretical studies on the MPC performances or the evaluation of MPC at building design stage.In particular, for theoretical studies, the building can be represented by an archetype that allows to carry out simulations to obtain performance indicators on the MPC algorithm on a building category.On the other hand, when there is an existing case study building, where operative data can be gathered in the field, the surrogate simulated building model can be built using either a forward approach or a data-driven approach.This scenario occurs when it is necessary to investigate the possible benefits achievable through the MPC algorithm compared to an existing logic already implemented in the BAS.The most common issue when testing an MPC algorithm on a simulated building is that it is quite challenging to integrate an MPC controller into a building simulation software, leaving the MPC algorithm in most cases on a different external software platform.,The two platforms must be interfaced at each control time-step with each other to evaluate the performance of the controller.In this interface, the surrogate building model sends information on the current states and disturbances to the controller, which computes the optimization and responds with the set of actions that the surrogate building model has to apply at the next time-step.Sometimes, when a detailed simulated surrogate building model is not available, simulation studies can be performed utilizing the controloriented building model also as surrogate building model to test the closed-loop performance of the MPC controller and speed up the procedure.This aspect can be achieved by utilizing software that already embeds an external interface (e.g., TRNSYS-Type 155) or using packages that have been developed for time-step coupling of two platforms, such as Building Controls Virtual Test Bed (see https://simulationresearch.lbl.gov/bcvtb) or MLE+ for Matlab/Simulink interfacing with EnergyPlus (see http://www.madhurbehl.com/mleplus.html).

The Receding Finite Horizon Problem for Building Applications
The choice of horizons length is of crucial importance for a practical MPC implementation.The control horizon must be smaller or equal to the prediction horizon.Typically, the added value of having many free control moves is limited, as the accuracy of the prediction model decreases with the prediction horizon.In many research works there is no clear distinction between the two horizons, and possibly assume that they were set to equal length.The selection of time-step, control horizon, and prediction horizon is influenced by the time constants and the dynamical behavior of the controlled processes.Heat and mass transfer processes in buildings are prolonged, thus the control time-step can be relatively widened when compared to other industrial processes.Typically, because of HVAC systems have faster dynamic responses, they require smaller control time-steps (from a few seconds to a few minutes) compared to when the MPC only manages the building' dynamics (from a minute to an hour).If on the one hand short horizons reduce the computational effort of the controller, on the other hand, they can affect its reliability by neglecting the effect of a portion of the dynamics of the system.If the horizons are set too long compared to the control timestep, this could lead to much higher computational times, without a significant improvement in the The most common issue when testing an MPC algorithm on a simulated building is that it is quite challenging to integrate an MPC controller into a building simulation software, leaving the MPC algorithm in most cases on a different external software platform.,The two platforms must be interfaced at each control time-step with each other to evaluate the performance of the controller.In this interface, the surrogate building model sends information on the current states and disturbances to the controller, which computes the optimization and responds with the set of actions that the surrogate building model has to apply at the next time-step.Sometimes, when a detailed simulated surrogate building model is not available, simulation studies can be performed utilizing the control-oriented building model also as surrogate building model to test the closed-loop performance of the MPC controller and speed up the procedure.This aspect can be achieved by utilizing software that already embeds an external interface (e.g., TRNSYS-Type 155) or using packages that have been developed for time-step coupling of two platforms, such as Building Controls Virtual Test Bed (see https://simulationresearch.lbl.gov/bcvtb) or MLE+ for Matlab/Simulink interfacing with EnergyPlus (see http://www.madhurbehl.com/mleplus.html).

The Receding Finite Horizon Problem for Building Applications
The choice of horizons length is of crucial importance for a practical MPC implementation.The control horizon must be smaller or equal to the prediction horizon.Typically, the added value of having many free control moves is limited, as the accuracy of the prediction model decreases with the prediction horizon.In many research works there is no clear distinction between the two horizons, and possibly assume that they were set to equal length.The selection of time-step, control horizon, and prediction horizon is influenced by the time constants and the dynamical behavior of the controlled processes.Heat and mass transfer processes in buildings are prolonged, thus the control time-step can be relatively widened when compared to other industrial processes.Typically, because of HVAC systems have faster dynamic responses, they require smaller control time-steps (from a few seconds to a few minutes) compared to when the MPC only manages the building' dynamics (from a minute to an hour).If on the one hand short horizons reduce the computational effort of the controller, on the other hand, they can affect its reliability by neglecting the effect of a portion of the dynamics of the system.If the horizons are set too long compared to the control time-step, this could lead to much higher computational times, without a significant improvement in the controller performance.Moreover, because the optimal solution is based on disturbances forecast with inherent uncertainty, an excessive length of the horizons can affect the reliability of the forecasts and therefore the optimality of the solution found.
Referring to the applications reviewed in this paper, Figure 12 shows the frequency distribution of: (a) sampling times, (b) the prediction horizons and (c) the ratio of prediction horizon on sampling time (number of optimization steps).From the distribution of Figure 12c can be inferred how small time-steps also require short horizons, so that the number of optimization steps remains of the same order of magnitude and consequently the computational effort to solve the optimization problem.
Energies 2018, 11, x FOR PEER REVIEW 17 of 35 controller performance.Moreover, because the optimal solution is based on disturbances forecast with inherent uncertainty, an excessive length of the horizons can affect the reliability of the forecasts and therefore the optimality of the solution found.
Referring to the applications reviewed in this paper, Figure 12 shows the frequency distribution of: (a) sampling times, (b) the prediction horizons and (c) the ratio of prediction horizon on sampling time (number of optimization steps).From the distribution of Figure 12c can be inferred how small time-steps also require short horizons, so that the number of optimization steps remains of the same order of magnitude and consequently the computational effort to solve the optimization problem.

BAS and MPC Control Architecture
The control inputs calculated by the MPC, which coincides with the outputs that the controller uses to actuate the system, are used to affect the system to reach the control goals.The output of an MPC algorithm is the optimal control sequence for each control input over the controlling horizon, and at each time-step only the first element of this array is applied.The physical actuation of the control inputs is generally achieved using actuators at different levels, which can regulate the heating and cooling delivery, the fans or pumps speeds, or the dampers, valves and windows positions.
The MPC problem can be formulated contemplating different levels of controller outputs.It can control the actuators directly, or be expressed as a hierarchical controller, that provides the trajectories that lower level controllers have to follow.Generally, the scope of the MPC algorithm is to define the trajectory of the internal set-points, and how to track them is demanded to various lower level controllers.When all the controllers of the lower layer are MPC, the configuration is defined as hierarchical MPC that can be either tracking MPCs or classical controllers (e.g., RBC, PID, etc...).Hierarchical MPC is composed at least by an upper MPC layer with a more extended control timestep and horizon that decides the operation of the building processes, also addressing complex

BAS and MPC Control Architecture
The control inputs calculated by the MPC, which coincides with the outputs that the controller uses to actuate the system, are used to affect the system to reach the control goals.The output of an MPC algorithm is the optimal control sequence for each control input over the controlling horizon, and at each time-step only the first element of this array is applied.The physical actuation of the control inputs is generally achieved using actuators at different levels, which can regulate the heating and cooling delivery, the fans or pumps speeds, or the dampers, valves and windows positions.
The MPC problem can be formulated contemplating different levels of controller outputs.It can control the actuators directly, or be expressed as a hierarchical controller, that provides the trajectories that lower level controllers have to follow.Generally, the scope of the MPC algorithm is to define the trajectory of the internal set-points, and how to track them is demanded to various lower level controllers.When all the controllers of the lower layer are MPC, the configuration is Energies 2018, 11, 631 defined as hierarchical MPC that can be either tracking MPCs or classical controllers (e.g., RBC, PID, etc...).Hierarchical MPC is composed at least by an upper MPC layer with a more extended control time-step and horizon that decides the operation of the building processes, also addressing complex optimization goals.The output of this upper layer enters in a number of lower layer MPC controllers, that have a shorter control time-step and prediction horizon, and are designed to track the set-point trajectories defined by the upper control layer.Another similar architecture is represented by the cascade MPC, which presents various layers that run optimizations at the same frequency, without a higher level controller that acts as a supervisor.In the cases where the MPC also model the HVAC system, it is required to manage system set-points and schedules, as well as higher level decisions.For instance, the building and its HVAC system can be set into a specific operating mode (e.g., thermal storage charging or discharging modes, natural or mechanical ventilation modes [66,68,93,98,[100][101][102]).
A further classification of MPC architectures must be discussed.Figure 13 shows the three possible configurations of the MPC architecture and their interface to the building.The centralized MPC configuration of Figure 13a is a solution for the management of an entire building and its HVAC system, using a single MPC law.The building and its systems dynamics, their interaction and the disturbances by which they are affected are considered in a single optimization problem, which takes into consideration their constraints and mutual influences.While this configuration allows explicit modeling of the system dynamics, the computational effort can grow quite significantly with the system and process complexity.Moreover, a failure of the central MPC controller could cause severe issues with the entire building energy management, making it harder to isolate the problem.In the decentralized MPC approach, shown in Figure 12b, each component is regulated by an independent controller that does not consider events occurring to other elements of the control chain/structure.The mutual interactions among factors are regarded as unknown external perturbations to the model using this approach; the stronger the correlations of performance between these components, the more the reliability of the controller can be affected.The distributed MPC approach of Figure 13c has been considered an attractive solution for large-scale dynamically coupled building systems by many researchers [92,[103][104][105][106][107][108][109], because it incorporates positive features of both centralized and decentralized configurations, merged in a single controller.This cooperative behavior of every individual controller improves the global control performance when compared to the decentralized structure.At the same time, the computational effort is significantly reduced when compared to a centralized control method, due to the possibility of sharing the computational workload between controllers.An excellent comparison between the performance of centralized, decentralized and distributed in building energy management MPC configurations is presented in [92,104,106].
Energies 2018, 11, x FOR PEER REVIEW 18 of 35 optimization goals.The output of this upper layer enters in a number of lower layer MPC controllers, that have a shorter control time-step and prediction horizon, and are designed to track the set-point trajectories defined by the upper control layer.Another similar architecture is represented by the cascade MPC, which presents various layers that run optimizations at the same frequency, without a higher level controller that acts as a supervisor.In the cases where the MPC also model the HVAC system, it is required to manage system set-points and schedules, as well as higher level decisions.
A further classification of MPC architectures must be discussed.Figure 13 shows the three possible configurations of the MPC architecture and their interface to the building.The centralized MPC configuration of Figure 13a is a solution for the management of an entire building and its HVAC system, using a single MPC law.The building and its systems dynamics, their interaction and the disturbances by which they are affected are considered in a single optimization problem, which takes into consideration their constraints and mutual influences.While this configuration allows explicit modeling of the system dynamics, the computational effort can grow quite significantly with the system and process complexity.Moreover, a failure of the central MPC controller could cause severe issues with the entire building energy management, making it harder to isolate the problem.In the decentralized MPC approach, shown in Figure 12b, each component is regulated by an independent controller that does not consider events occurring to other elements of the control chain/structure.The mutual interactions among factors are regarded as unknown external perturbations to the model using this approach; the stronger the correlations of performance between these components, the more the reliability of the controller can be affected.The distributed MPC approach of Figure 13c has been considered an attractive solution for large-scale dynamically coupled building systems by many researchers [92,[103][104][105][106][107][108][109], because it incorporates positive features of both centralized and decentralized configurations, merged in a single controller.This cooperative behavior of every individual controller improves the global control performance when compared to the decentralized structure.At the same time, the computational effort is significantly reduced when compared to a centralized control method, due to the possibility of sharing the computational workload between controllers.An excellent comparison between the performance of centralized, decentralized and distributed in building energy management MPC configurations is presented in [92,104,106].

Constraints
One of the main advantages of utilizing MPC to control building systems is the possibility to include physical constraints into the formulation of the control problem, embedding them in the optimization algorithm.Table 1 summarizes the possible constraints features.Constraints can be formulated both as equalities or inequalities, according to how they relate to their counterpart of the real system.When the problem constraints are rigid and it is mandatory that they are satisfied, they are defined as hard constraints, while they are identified as soft constraints if they represent a flexible boundary and it is not strictly required that they are satisfied.Generally, soft constraints are formulated using a slack variable that can move the boundary of a certain amount, with an associated penalty in the cost function.The higher is the cost associated with this slack variable, and the closer the solution of the problem will be to the one where the constraints are considered to be hard.From a time perspective, constraints can be either constant or time varying limits that change according to a schedule, the occurrence of events or variations of the problem boundary conditions.
Constraints can be allocated to system states and system inputs.Constraints on systems states are generally used to handle the occupants' comfort (e.g., maximum or minimum bounds for the indoor temperature [110]), or the allowable temperature range affecting an active building component (e.g., TES tank operating range [111]).The constraints allocated to system inputs refer to physical limitations or imposed bounds on the system actuation components, or input variables.The system input constraints can include maximum and minimum limits both for the range (e.g., minimum or maximum power of a heat pump [112] or a terminal unit [104], valve/damper position limits [113]) and for the rate of change of their operation (e.g., boiler or heat pump response rate [112], valve/damper/pump/fan change rate [114]).Because of their physical meaning, constraints on actuators are typically formulated as hard constraint, while the constraints on the system states can be softened in some cases [112,115].For example, softening a constraint on an indoor temperature operation range, represents an undesirable situation that might be considered acceptable and advantageous under specific circumstances.
Additional terms that affect how the controller states behave at the end of the prediction horizon are the terminal constraint and the terminal weight.The terminal constraint imposes the desired state configuration to be attained at the end of the prediction horizon, while the terminal weight acts as an incentive (but not a necessary condition to satisfy) to the same goal.Both are often used to guarantee closed-loop stability.For example, a terminal constraint can be used to ensure that a TES tank continuously stores a minimum level of energy to satisfy the demand of the following day [116].

Control Goals and Objective Functions
The construction of the optimization function depends on the global objectives that it is desired to achieve in the controlled process.One of the primary goals is ensuring that the controller meets the constraints and operates reliably.The stability of the controller and minimization of the control effort (variation of control inputs in two subsequent time instants) are two typical objectives of the optimizations.Other key objectives could be defined by the preferences the building occupants, the requirement of stakeholders or energy managers.In the first case these requirements are mostly related to comfort factors (e.g., target tracking for indoor temperature regulation, maintaining the internal ambient temperature in bounds ensuring the thermal comfort, minimizing occupants' thermal discomfort hours), whether in the latter the drivers are mostly economic factors (e.g., reduction of overall energy demand or greenhouse gases emissions, minimization of the operational costs, maximization of RES productivity).Other factors commonly considered in the objective function are the constrained on-line system operations optimizations or the peak load shifting or shaving.The cost function has to be chosen based on the requirements of the specific application.
The MPC cost function aims at reducing a multi-objective problem into a scalar objective.This is achieved by weighting and adding the various terms in the cost function of the following exemplary form: min where x is the vector of system states, y is the vector of outputs, and u is the vector of manipulated variables or control inputs.Typically, only x or y is employed in the cost function, the first one when the control-oriented building model is formulated as state-feedback, while the second one in output-feedback formulations.The discrete index k denotes time steps along the prediction horizon.The term u(k) − u(k − 1) indicates inputs increment over the prediction horizon and is an indication of the control effort.The subscripts ref were adopted to show the reference trajectories or set-points.W x , W y , W u , and W ∆u are the weight matrices, which can vary along the prediction horizon.N p is the prediction horizon.If the prediction horizon N p is larger than the control horizon N c , then the control inputs following N c are assumed constant.The terms n indicate the norm dimensions in the cost function.The solution of the minimization of the objective function under constraints yields an optimal control sequence u*.This is a trajectory of the optimal control moves along the prediction horizon that optimizes the problem requirements according to the cost function weights and subject to the constraints defined by the user.Only the first control input u*(0) is applied to the controlled building.Afterward, the receding horizon moves one control time-step ahead and the optimization procedure is repeated.Alternative formulations of the objective function are possible according to the problem peculiarities.
When formulating an MPC algorithm, the occupant comfort is generally considered as a pre-determined set-point or set-point trajectory to track or as thermal bounds.This is the simplest way to ensure a positive thermal sensation of the occupants.This formulation avoids adding computational effort to the optimization problem due to non-linearities.Moreover, it allows simple implantation of sensors' feedback to the controller in experimental applications.The set-point trajectory can be constant in time [117] or time-varying [118][119][120].This set-point can be included in the formulation of a tracking MPC problem, entering in the objective function as a state reference x ref (k) or a system output reference y ref (k).It is also possible to include set-points as thermal bounds, and therefore as hard or soft constraints, weighted in the cost function.
In order to better assess the occupants' comfort, detailed thermal sensation indices can be introduced in the MPC formulation.For example, the Predicted Mean Vote (PMV) or the Predicted Percentage of Dissatisfied (PPD) are the most widely recognized indices to evaluate thermal comfort [121][122][123].Even if it provides a more detailed indication of the human thermal sensation than set-points or thermal bounds, the introduction of PMV in an MPC problem has significant drawbacks [124,125].Firstly, since PMV is intrinsically nonlinear, it affects the formulation of the MPC by dramatically increasing the computational effort of the optimization.In general, it is introduced as a further non-linear function in the MPC objective function.Therefore, this formulation requires the adoption of non-linear optimization methods that cannot guarantee that the optimization will reach the optimal solution.Several studies the possibilities of implementing the comfort indices evaluation into MPC formulations [77,[126][127][128][129][130][131].Some authors use a comparison between PMV and Actual Mean Vote (AMV) to merge information from occupants' feedback and data from sensors [130,132] to improve the decision of their thermal comfort.
The weighting matrix W u assigns a cost to the control inputs when comparison to references defined in the array u ref (k).In the economic MPC formulation, it can be directly related to the energy prices of the different energy sources adopted in the process.A typical example is trying to minimize the energy demand of an HVAC system.Since the model generally considers the thermal delivery to the building, it is necessary to convert this energy to the electrical demand of this equipment.This fact can be achieved either by including a constant or linear representation of the Coefficient of Performance (COP) of the studied unit in the control-oriented model or in the linear cost function [68,90,100].In other cases, where the COP is described by a more detailed non-linear function (e.g., non-linearly dependent on system states and disturbances), it can be included in the optimization problem with a non-linear cost function, similarly to the case of the PMV [133,134].The weighting matrix W ∆u assigns instead a cost to the derivative of the control inputs and therefore their rate of change, ensuring the stability of the system and avoiding excessive fluctuations that can damage the actuators.
The objective function can be expressed in the following forms: • Quadratic, also referred as "norm 2" (n = 2).Quadratic cost functions are more common in tracking MPC problems, where the distance from a reference trajectory (e.g., the internal set-point temperature [117,135]) has to be minimized and the fact that the penalty function is quadratic helps with stability and reduced computational effort of the controller (e.g., the on/off switching of the HVAC system and its components [50,100,105,106,127,[136][137][138]).

•
Linear, also referred as "norm 1" (n = 1).Linear cost functions are the most common in building energy management in problems where the costs allocated to the elements of the weighting matrices must be comparable with each other, for example when trying to minimize building operating cost or maximize RES exploitation in an economic MPC.

•
Min/Max, also referred as "norm infinite" (n = ∞).This configuration is the less frequent for building and its HVAC system control purposes.It is mainly used when the control goals focus on the peak values [108,[139][140][141][142][143][144][145], such as reducing or shifting the power peak load or minimizing the maximum daily PPD value [75].
Thermodynamical processes in buildings are generally characterized by long response times, and therefore stability is not a primary concern, allowing all the three forms of the cost function to be commonly utilized in the optimization problems [21].
Figure 14a shows the fraction of different objective function formulations in MPC applied to building and HVAC system management found in this survey; while Figure 14b  prices of the different energy sources adopted in the process.A typical example is trying to minimize the energy demand of an HVAC system.Since the model generally considers the thermal delivery to the building, it is necessary to convert this energy to the electrical demand of this equipment.This fact can be achieved either by including a constant or linear representation of the Coefficient of Performance (COP) of the studied unit in the control-oriented model or in the linear cost function [68,90,100].In other cases, where the COP is described by a more detailed non-linear function (e.g., non-linearly dependent on system states and disturbances), it can be included in the optimization problem with a non-linear cost function, similarly to the case of the PMV [133,134].The weighting matrix WΔu assigns instead a cost to the derivative of the control inputs and therefore their rate of change, ensuring the stability of the system and avoiding excessive fluctuations that can damage the actuators.
The objective function can be expressed in the following forms: • Quadratic, also referred as "norm 2" (n = 2).Quadratic cost functions are more common in tracking MPC problems, where the distance from a reference trajectory (e.g., the internal setpoint temperature [117,135]) has to be minimized and the fact that the penalty function is quadratic helps with stability and reduced computational effort of the controller (e.g., the on/off switching of the HVAC system and its components [50,100,105,106,127,[136][137][138]).• Linear, also referred as "norm 1" (n = 1).Linear cost functions are the most common in building energy management in problems where the costs allocated to the elements of the weighting matrices must be comparable with each other, for example when trying to minimize building operating cost or maximize RES exploitation in an economic MPC.

•
Min/Max, also referred as "norm infinite" (n = ∞).This configuration is the less frequent for building and its HVAC system control purposes.It is mainly used when the control goals focus on the peak values [108,[139][140][141][142][143][144][145], such as reducing or shifting the power peak load or minimizing the maximum daily PPD value [75].
Thermodynamical processes in buildings are generally characterized by long response times, and therefore stability is not a primary concern, allowing all the three forms of the cost function to be commonly utilized in the optimization problems [21].
Figure 14a shows the fraction of different objective function formulations in MPC applied to building and HVAC system management found in this survey; while Figure 14b

Optimisation Algorithms and Programming Languages
The optimization problems that the MPC has to solve highly depend on the nature of the controlled system and the objective cost function defined to assess the control goals.The nature of heat and mass transfer phenomena affecting buildings is intrinsically non-linear [146].However, those processes can be treated as a Linear Time-Invariant (LTI) system, under proper assumptions and simplifications in the control-oriented model (e.g., RC networks with fixed material features and linearized radiative heat transfer coefficient).The constrained problem that includes these LTI systems to be optimized, generally leads to a Linear Programming (LP) or a Quadratic Programming (QP) optimization problem, depending on if a linear or quadratic cost function was chosen.
Systems that contain discrete variables, such as Boolean variables (e.g., heater on/off) or defined operating modes (e.g., natural/mechanical ventilation mode or charging/discharging of a battery [67,69]), or scheduling problems (e.g., heating system operation time [147]), generally have a hybrid nature (formulated as Mixed Logical Dynamical (MLD) or Piecewise Affine (PWA) systems), and they lead to a Mixed Integer Programming (MIP) optimization problem.Also in this case, depending on the cost function, the problem can take the form of a Mixed Integer Linear Programming (MILP) or Mixed Integer Quadratic Programming (MIQP) problem, which are generally solved using an LP-or QP-based branch-and-bound algorithm.The problem complexity grows significantly with the number of discrete variables included in the optimization problem.
Another typology of non-linear systems is the bilinear system (e.g., for VAV systems or fan-coils).In this case, either non-linear optimizers or Sequential Linear Programmers (SLP) or Sequential Quadratic Programmers (SQP) can be employed to solve the problem.These approaches solve the problem by iteratively linearizing around the state trajectory computed in the previous iteration until convergence is achieved.
When the problem to be solved has a non-linear nature and a mathematical solution is not possible (e.g., the only way to find the response of the system to variable inputs is to entirely simulate the response of the model iteratively), a near-optimal solution can be found.This solution can be reached using optimization algorithms that can at least reduce the number iteration when compared to a "brute force" method, where all the possible combinations of inputs have to be iteratively simulated.This case is typical when black-box or white-box models are employed to model the response of the system.Furthermore, non-linear optimization methods are also required when the objective function handles non-linear terms, such as the PMV calculation or a non-linear COP formulation.To this purpose, the commonly used optimization methods are Genetic Algorithms (GAs) and Particle Swarm Optimization (PSO), which can reduce the number of iterations necessary to find a near-optimal solution.Due to the iterative nature of these optimization methods, the computational effort required to simulate the model becomes very significant, making the use of white box models not viable in most cases.A framework of the frequency distribution of the optimization methods used in the various MPC problems available in the scientific literature is highlighted in Figure 15.
The most commonly utilized platforms for the implementation of an MPC algorithm are Matlab, for which a number of toolboxes have been developed to make the development of an MPC controller more manageable (e.g., Matlab MPC Toolbox, MPT Toolbox, Hybrid Toolbox, Yalmip), Scilab (open-source software similar to Matlab), Python and C++.To solve the optimization problem many open-source solvers are available (e.g., GLPK), as well as faster commercial solvers (e.g., CPLEX, [148]).

Critical Discussion and Conclusions
This survey has so far aimed at providing a clear framework and a complete overview of the applications of MPC algorithms to regulate buildings and their HVAC systems.In this section the authors attempt to deliver their vision to the readers, exploring and discussing the trends emerging from the survey undertaken.Some of the studies that were not cited in the aforementioned survey  were still considered in the general statistics presented in the present work.
Quantitatively evaluate the potential benefits achievable by means a control strategy is not a simple task.Indeed, a comparable benchmark is necessary for this purpose, and this is not always readily available.When the MPC is retrofitted to an existing building, the building baseline performance before the MPC implementation could be used as a reference [195].Nevertheless, if the study is completely based on theoretical simulations, the baseline controller that defines this reference performance has to be arbitrarily set by the authors of the paper.Furthermore, in experimental implementations, different boundary conditions normally occur in different testsregarding weather conditions, occupancy patterns, etc.-and therefore it is not simple to compare consistently the performance of controllers that were acting on the same building at different times.
Figure 16a shows the average percentage of energy reduction related to an MPC implementation in the surveyed papers.These results are similar to the qualitative analysis of expected potential energy reduction outlined in 2010 by Oldewurtel et al. [72] and reported in Figure 16b.In almost all these studies the MPC algorithm outperforms the baseline controller also concerning satisfaction of the comfort requirements [151].Since in these studies different long-term comfort indicators were used [147], a detailed comparison of the results was not achievable.Furthermore, MPC controllers also led to dramatic reductions of peak loads when they were considered part of the control goals (generally around 30%) either with an explicit formulation in the objective function or with an indirect variable energy prices policy.
A further advantage of MPC is given by its ease of reconfiguration and adaptability to changes in the controlled system.For example, in building and HVAC applications the objective function may include terms describing the cost of energy.In this case, it is straightforward to update the weights to reflect fluctuations in the energy price, with no other changes to the controller.This aspect, which is also crucial for scalability of MPC technologies, is barely evaluable in terms of key performance indicators and was usually not considered in the literature papers.

Critical Discussion and Conclusions
This survey has so far aimed at providing a clear framework and a complete overview of the applications of MPC algorithms to regulate buildings and their HVAC systems.In this section the authors attempt to deliver their vision to the readers, exploring and discussing the trends emerging from the survey undertaken.Some of the studies that were not cited in the aforementioned survey  were still considered in the general statistics presented in the present work.
Quantitatively evaluate the potential benefits achievable by means a control strategy is not a simple task.Indeed, a comparable benchmark is necessary for this purpose, and this is not always readily available.When the MPC is retrofitted to an existing building, the building baseline performance before the MPC implementation could be used as a reference [195].Nevertheless, if the study is completely based on theoretical simulations, the baseline controller that defines this reference performance has to be arbitrarily set by the authors of the paper.Furthermore, in experimental implementations, different boundary conditions normally occur in different tests-regarding weather conditions, occupancy patterns, etc.-and therefore it is not simple to compare consistently the performance of controllers that were acting on the same building at different times.
Figure 16a shows the average percentage of energy reduction related to an MPC implementation in the surveyed papers.These results are similar to the qualitative analysis of expected potential energy reduction outlined in 2010 by Oldewurtel et al. [72] and reported in Figure 16b.In almost all these studies the MPC algorithm outperforms the baseline controller also concerning satisfaction of the comfort requirements [151].Since in these studies different long-term comfort indicators were used [147], a detailed comparison of the results was not achievable.Furthermore, MPC controllers also led to dramatic reductions of peak loads when they were considered part of the control goals (generally around 30%) either with an explicit formulation in the objective function or with an indirect variable energy prices policy.Authors individuated three main critical aspects in the implementation of MPC algorithms in buildings, which can significantly affect its operative performance.Firstly, the accuracy of the model, of the weather forecasting and the disturbances prediction strongly affects the performance of MPC optimization and the potential benefits achievable in terms regarding control goals satisfaction.Secondly, utilizing an MPC algorithm in the supervisory control layer requires sufficient computational power and proper system calibration to ensure bumpless integration with existing low-level controllers.The last and probably most significant issue is related to the existing great variety of building classifications and architectures.Indeed, every building is unique in terms of thermodynamic response-due to the different geometry, construction, end uses, occupancy patterns, weather location, etc.-and MPC algorithms must be customized to fit the specific building features.As an example, the control-oriented building models cannot be easily standardized to represent the whole variety of buildings, introducing a significant challenge in the controller development.
Such singularities also cause difficulties in providing a pre-defined general step-by-step guideline for the development of a building MPC control strategy.Nevertheless, the statistics undertaken in the present survey allowed the main trends to be outlined.These trends are based on the classification proposed in Table 2.A further advantage of MPC is given by its ease of reconfiguration and adaptability to changes in the controlled system.For example, in building and HVAC applications the objective function may include terms describing the cost of energy.In this case, it is straightforward to update the weights to reflect fluctuations in the energy price, with no other changes to the controller.This aspect, which is also crucial for scalability of MPC technologies, is barely evaluable in terms of key performance indicators and was usually not considered in the literature papers.
Authors individuated three main critical aspects in the implementation of MPC algorithms in buildings, which can significantly affect its operative performance.Firstly, the accuracy of the model, of the weather forecasting and the disturbances prediction strongly affects the performance of MPC optimization and the potential benefits achievable in terms regarding control goals satisfaction.Secondly, utilizing an MPC algorithm in the supervisory control layer requires sufficient computational power and proper system calibration to ensure bumpless integration with existing low-level controllers.The last and probably most significant issue is related to the existing great variety of building classifications and architectures.Indeed, every building is unique in terms of thermodynamic response-due to the different geometry, construction, end uses, occupancy patterns, weather location, etc.-and MPC algorithms must be customized to fit the specific building features.As an example, the control-oriented building models cannot be easily standardized to represent the whole variety of buildings, introducing a significant challenge in the controller development.
Such singularities also cause difficulties in providing a pre-defined general step-by-step guideline for the development of a building MPC control strategy.Nevertheless, the statistics undertaken in the present survey allowed the main trends to be outlined.These trends are based on the classification proposed in Table 2. Despite the growing diffusion of theoretical works, from Figure 10b it emerges that the number of real buildings actually implementing MPC strategies was relatively small.Up to date, the Illawarra Flame house [67][68][69] in Wollongong and 10 households in Brugg [111], the 3E Headquarters in Brussels [149] and a commercial Building in Allschwil [82,116], a building of the Czech Technical University in Prague [115,153], the UC Merced Campus [62] and the Engineers Construction Engineering Research Laboratory (CERL) in Champaign [152], and the airport of Adelaide [102,150,196] represent the most exciting examples of practical implementation of MPC algorithms in buildings.These applications cover all building classifications-residential, commercial, educational, and other respectively-and are located in various climatic locations.
In this context, a last question remains open, related to the potential future market penetration rate of MPC for building energy management.The answer to this question needs to take into account that only ten years ago MPC was almost not considered as a potential building control method.Killian and Kozek [45] compared this situation for MPC in building control systems to the one in the early 90's of MPC in the process industry.In the early 90's only very few experts in the field knew how to set up and commission an MPC control system successfully in the industrial processes.However, after a massive adoption of these controllers in the last decades, MPC proved to be one of the most widespread, reliable and best-performing methods in the processes industry [197].Nowadays, the primary barrier to a more substantial MPC adoption in the building industry is the intrinsically tricky scalability of the technology, since every building is unique, significantly increasing the controller cost.Tools that help with the design of the control-oriented model should be introduced, in order to reduce the effort and the know-how required in the controller set up.Furthermore, building archetypes coupled with proper setting guidelines should be constructed to standardize the control-oriented models partially.
This literature review showed that these algorithms lead to meaningful energy savings, which approximately are around 15-20%.These values prove that MPC implementation represents an excellent opportunity to reduce buildings carbon footprint and achieve substantial cost benefits.Furthermore, the established effectiveness whereby MPC algorithms deal with peak shifting and demand-side management allow this technology to be considered as one of the most suitable for integration of buildings in smart grids.This fact represents a crucial perspective for the energy market, which continuously requires further flexible loads to mitigate the RES supply fluctuation.
From the theoretical perspective, it is crucial to investigate better how the occupant behavior and the occupancy patterns affect the algorithm performance and how to best predict them.At the same time, it is important to study further the robust, stochastic or scenario-based formulations, which allow the uncertainty related to the forecast of disturbances in the optimization problem to be considered.Important steps in this direction were already made in [50,51,74,92,108,145].Besides, benchmarking strategies for experimental applications should be defined.Promising solutions for comparing experimental tests on the same building at different times were proposed in [111,149].
In conclusion, to accelerate the market penetration of MPC algorithms, it is necessary to explicitly identify which are the most promising building classifications and stakeholders that can take advantage of its implementation.The papers of Hilliard et al. [22,43] provided an excellent overview of the building requirements that allow MPC algorithms to be effective.The size of the building must be large enough to make an MPC algorithm a cost-effective technological solution.In large buildings, the capital investment to implement the MPC technology is relatively smaller when compared to the reduction in operating cost.The benefits are more marginal when the MPC is applied to small buildings.Moreover, possibilities of active and passive storage strategies, flexibility of the constraints and alternation between occupied and unoccupied periods were individuated as the essential requirements for a worthy building predictive control.The BAS must be at a sufficient technological level to be able to integrate an MPC controller input and output signals.In general, modern commercial, institutional and educational buildings satisfy these requirements and therefore are the most likely candidates for a straightforward practical implementation of an MPC in their supervisory building control system.
It can be misleading to consider those existing manufacturers of building automation system components are the only stakeholders that can benefit from the deployment of an MPC controller.Large organizations can be fairly conservative in the adoption of disruptive control strategies, due to the risks associated with potential failures and the sunk costs related to their existing strategies.For this reason, the authors believe that a higher adoption rate of MPC in buildings can be led by control system installers, capable of involving both BAS system manufacturers and stakeholders that would directly benefit from the MPC implementation.For example, building owners, energy managers or ESCOs (Energy Saving COmpanies) could see in MPC a real possibility to maximize both occupants' comfort and energy savings, reducing at the same time users' complaints and energy bills.Energy providers could also see the potential of MPC as an opportunity to implement demand response strategies directly.

Figure 1 .
Figure 1.Yearly frequency distribution of the scientific papers dealing with MPC formulation for buildings and HVAC systems considered in this review.

Figure 1 .
Figure 1.Yearly frequency distribution of the scientific papers dealing with MPC formulation for buildings and HVAC systems considered in this review.

Figure 2 .
Figure 2. Schematic of the principle of receding horizon.The difference between the top and the bottom figure is one time-step.

Figure 2 .
Figure 2. Schematic of the principle of receding horizon.The difference between the top and the bottom figure is one time-step.

Figure 3 .
Figure 3. Framework and critical elements of the MPC optimization problem applied to building and HVAC systems.The boxes filled in dark grey indicate factors that directly influence the optimization problem; the light grey boxes denote types of resulting optimization problems; all the other boxes list the possible forms that the MPC formulation for buildings and HVAC system can take.

Figure 3 .
Figure 3. Framework and critical elements of the MPC optimization problem applied to building and HVAC systems.The boxes filled in dark grey indicate factors that directly influence the optimization problem; the light grey boxes denote types of resulting optimization problems; all the other boxes list the possible forms that the MPC formulation for buildings and HVAC system can take.

Figure 4 .
Figure 4. Models involved in MPC problems are highlighted with grey boxes.(a) MPC formulation in absence of a real controlled system; (b) MPC formulation for real controlled system implementation.

Figure 5 .
Figure 5. Different modeling approaches according to ASHRAE classification.

Figure 4 .
Figure 4. Models involved in MPC problems are highlighted with grey boxes.(a) MPC formulation in absence of a real controlled system; (b) MPC formulation for real controlled system implementation.

Figure 6 .
Figure 6.A typical example of an R-C network for MPC applications.

Figure 5 .
Figure 5.A typical example of an R-C network for MPC applications.

Figure 4 .
Figure 4. Models involved in MPC problems are highlighted with grey boxes.(a) MPC formulation in absence of a real controlled system; (b) MPC formulation for real controlled system implementation.

Figure 5 .
Figure 5. Different modeling approaches according to ASHRAE classification.

Figure 6 .
Figure 6.Different modeling approaches according to ASHRAE classification.

Figure 7 .
Figure 7. (a) Proportion of reviewed literature papers using either white, grey or black-box models as control-oriented building models; (b) proportion of literature papers considering in the controloriented model either the building only, the HVAC only, or both.

Figure 7 .
Figure 7. (a) Proportion of reviewed literature papers using either white, grey or black-box models as control-oriented building models; (b) proportion of literature papers considering in the control-oriented model either the building only, the HVAC only, or both.

Energies 2018 , 35 Figure 8 .
Figure 8.The possible alternative scenario of HVAC system modeling in MPC problems.(a) HVAC system not considered in the MPC formulation; (b) MPC integrating both building and its HVAC system; (c) building not considered in the MPC formulation.

Figure 8 .
Figure 8.The possible alternative scenario of HVAC system modeling in MPC problems.(a) HVAC system not considered in the MPC formulation; (b) MPC integrating both building and its HVAC system; (c) building not considered in the MPC formulation.

Figure 9 .
Figure 9. (a) Proportion of literature papers using as disturbances forecast method either online predictions, offline predictions or a combination of the two; (b) number of scientific papers grouped according to the combination of forecasted disturbance variables.

Figure 9 .
Figure 9. (a) Proportion of literature papers using as disturbances forecast method either online predictions, offline predictions or a combination of the two; (b) number of scientific papers grouped according to the combination of forecasted disturbance variables.

Energies 2018 , 35 Figure 10 .
Figure 10.(a) Proportion of building typologies considered for MPC scientific literature studies; (b) proportion of simulated versus experimental cases of MPC for building and HVAC systems in the scientific literature.

Figure 10 .
Figure 10.(a) Proportion of building typologies considered for MPC scientific literature studies; (b) proportion of simulated versus experimental cases of MPC for building and HVAC systems in the scientific literature.

Energies 2018 , 35 Figure 11 .
Figure 11.Schematic of MPC implementation in a real controlled system.Dashed lines represent possible connections by the internet.

Figure 11 .
Figure 11.Schematic of MPC implementation in a real controlled system.Dashed lines represent possible connections by the internet.

Figure 12 .
Figure 12.Frequency distributions emerging from the survey of the scientific literature of MPC problems for building and HVAC system regulation: (a) sampling times; (b) prediction horizons; (c) ratio of prediction horizon on sampling time (number of optimization steps).

Figure 12 .
Figure 12.Frequency distributions emerging from the survey of the scientific literature of MPC problems for building and HVAC system regulation: (a) sampling times; (b) prediction horizons; (c) ratio of prediction horizon on sampling time (number of optimization steps).
clusters the possible factors considered as optimization goals.Energies 2018, 11, x FOR PEER REVIEW 21 of 35 clusters the possible factors considered as optimization goals.

Figure 14 .
Figure 14.(a) Proportion of different MPC objective function formulation in the scientific literature; (b) number of scientific papers grouped according to different combinations of goals considered in the MPC objective function.

Figure 14 .
Figure 14.(a) Proportion of different MPC objective function formulation in the scientific literature; (b) number of scientific papers grouped according to different combinations of goals considered in the MPC objective function.

Figure 15 .
Figure 15.Frequency distribution of the optimization methods used in the various MPC problems available in the scientific literature.

Figure 15 .
Figure 15.Frequency distribution of the optimization methods used in the various MPC problems available in the scientific literature.

Figure 16 .
Figure 16.(a) Frequency distribution of the papers about the extent of energy saving consequent to the implementation of MPC algorithms; (b) estimation of energy saving potential exploitable employing the implementation of MPC algorithms for building energy management.

Figure 16 .
Figure 16.(a) Frequency distribution of the papers about the extent of energy saving consequent to the implementation of MPC algorithms; (b) estimation of energy saving potential exploitable employing the implementation of MPC algorithms for building energy management.

Table 1 .
Constraints features in an MPC formulation.

Table 2 .
Categories used in the present survey to undertake statistical trend in MPC formulation for buildings and HVAC systems.