# Model Predictive Control-based Thermal Comfort and Energy Optimization

Abhinandana Boodi, Karim Beddiar, Yassine Amirat, Mohamed Benbouzid

► To cite this version:

Abhinandana Boodi, Karim Beddiar, Yassine Amirat, Mohamed Benbouzid. Model Predictive Control-based Thermal Comfort and Energy Optimization. IECON 2019 - 45th Annual Conference of the IEEE Industrial Electronics Society, Oct 2019, Lisbon, Portugal. pp.5801-5806, 10.1109/IECON.2019.8927227. hal-02973110

HAL Id: hal-02973110

https://hal.science/hal-02973110

Submitted on 28 Oct 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# Model Predictive Control-based Thermal Comfort and Energy Optimization

Abhinandana Boodi¹,², Karim Beddiar², Yassine Amirat³, Mohamed Benbouzid¹,⁴

1 University of Brest, UMR CNRS 6027 IRDL, Brest, France

2 CESI, LINEACT, Brest, France

3 ISEN Yncréa Ouest, UMR CNRS 6027 IRDL, Brest, France

4 Shanghai Maritime University, Shanghai, China

E-mail: aboodi@cesi.fr, kbeddiar@cesi.fr, yassine.amirat@isen-ouest.yncrea.fr, mohamed.benbouzid@univ-brest.fr

***Abstract***—This paper deals with the implementation of a Model Predictive Control (MPC) system for a classroom in a container building ventilation system and the associated indoor climate through controlling the airflow rate to the zone. A dynamic thermal model for the building system is formulated using the three resistors and two capacitors (3R2C) lumped capacitance method, and linearized using the Taylor's series expansion. This model is used for the proposed MPC implementation for thermal comfort management with energy optimization. Simulation results demonstrate the significance of the MPC controller in handling the constraints, multi-objective control, and producing optimal control strategy. The energy optimization results of the MPC have shown 31% of energy consumption reduction compared to a conventional controller.

***Index Terms***—Building energy, building energy management system, Model Predictive Control (MPC), simplified model, thermal modeling

## I. INTRODUCTION

Energy consumption by the buildings has increased rapidly during last two decades. This presently constitutes more than one-third of the primary consumption in Europe. A major portion of this energy is directly used to keep thermal comfort of buildings habitants. On the other side, there are other parameters which also influence the indoor comfort such as: indoor air quality and visual comfort. Careful maintenance of these comfort parameters is crucial to keep occupants healthy and productive, and are achievable by space Heating, Ventilation and Air-conditioning (HVAC) and lighting systems [1].

It is also important to mention that although, all the new buildings are constructed as nearly zero-energy buildings, the goal to achieve considerable reduction of primary energy consumption by buildings will take much longer time because of enormous amount of inefficient existing buildings. Thus, it is important to develop of nearly zero-energy buildings and simultaneously working on retrofit of the existing ones [2]. Therefore, an efficient/intelligent building control can provide a considerable reduction of the energy demand and CO₂ emissions.

In practice, three types of controllers have been in use for building energy management control [1], [3].

* White box models: models based on fundamental laws of thermodynamics, physics, heat transfer, and engineering

methods for thermal dynamic modeling, analysis and control.

* Black box models: data driven thermal dynamic models, which are developed on data basis.

* Grey box models: combination of physics-based models (white box models) and data driven methods (black box models).

Most of the existing buildings are equipped with simple set-point temperature control building management systems, without giving importance to reducing the energy consumption, leading to waste huge amounts of energy for maintaining thermal comfort. White box models similar to the set-point temperature models, which are mostly single-objective, thus are least suitable for optimal energy control. Black box models are proving to be highly efficient, but collecting data for training these models is a difficult task. A promising solution for building energy management and comfort control is Model Predictive Control (MPC) [4]–[6], which is the combination of white box and black box model. MPC has the capabilities to handle multi-objective control, with consideration of weather parameters, occupancy schedule, dynamic pricing for thermal comfort control. It also optimizes the energy consumption while maintaining the required temperature, and able to handle the constraints on input, output, and states of the system. These features of MPC make it ideal for building energy management systems.

A large amount of research studies has been demonstrated in simulation-based dynamic optimal control that is implemented for efficient building management. MPC controllers significant advantage is taking into consideration measurable disturbances (weather, occupancy, uncontrollable heating systems, etc.), and then producing the optimal control strategy, while better handling constraints impacting operating conditions [7]. MPC can be applied to specific parameter of building systems such as: building cooling systems [6], indoor air quality [8], heating systems [9], ventilation [10], and energy management [11]. The application of MPC controllers performs better than conventional controllers, reducing the significant amount of energy consumption while maintaining specified comfort [12], [13].

The objective of this paper is to design a model predictive controller as an alternative to the conventional controller, in
order to minimize energy consumption while satisfying the heating demand of the building and operational constraints. The aforementioned literature studies have explicitly discussed the implementation of MPC controllers on conventional buildings. However, in our case study, the container building is chosen. The container building of CESI, Nanterre, France is used as a living lab for building research studies.

This paper is organised as follows. Section 2 presents the container building details. Development of a lumped capacitance model for this building is detailed in section 3. Section 4 explains the implementation of MPC controller, and results are compared over conventional controller in section 5. Finally, conclusions are drawn in section 6.

## II. DYNAMIC THERMAL MODELING

The CESI smart container building is used as an institutional building and research laboratory, located in the CESI Campus of Nanterre, France. This novel building is developed under the program PIA-French Programmes d'Investissement d'Avenir. It is built using eight recycled containers, has a net floor area of 250m², and the meets the French energy standard BBC (Bâtiment à Basse Consommation) [14]. Its state-of-the-art building systems, complex heating, ventilation and air conditioning system, and multi-purpose application makes it an ideal building to study different control and energy optimization related researches for container buildings.

<figure><img src="image_2.png" /><figcaption>Fig. 1: CESI smart building, Nanterre, France</figcaption></figure>

Figure 1 shows main building of the CESI LINEACT research center, it consists 2 floors, 2 rooms per floor. The building is equipped with heating (heat pump), and ventilation system as the suppliers of heating/cooling energy. The case study room (Fig. 2) is used for multi-purpose: laboratory and classroom. The objective is to develop detailed lumped capacitance model, design MPC based on the model, and implementation. All other rooms in the building are similar to the case study room, thus the developed model can be implemented to the other rooms as well.

The heterogeneous behaviour of building parameters makes the zone as a complex thermal system, a detailed formulation of heat and mass transfer mechanisms is impractical due to the highly nonlinear behaviour of the zone parameters. A simplified lumped capacitance approach is applied using the 3R2C network for developing dynamic thermal model, where

<figure><img src="image_3.png" /><figcaption>Fig. 2: Layout of 1st floor of CESI smart building.</figcaption></figure>

the zone air is assumed to be well mixed and walls are considered to have uniform temperatures across its volume. This simplified model approach helps to develop computationally efficient and simple (low-order) model for control and prediction purposes. In this thermal network model, three R's and two C's are the composite wall resistances and capacitances, respectively. The values of R and C values are determined as detailed in [15], using high order Crank-Nicolson finite difference heat transfer model as a reference model, then determining R and C values by minimizing the errors between reference and 3R2C network model using particle swarm optimization. The simplified model considers the following parameters:

* conduction heat transfer through walls and windows,

* convection heat transfer at the surface of external and internal walls, and floors

* solar heat radiation through windows, and absorption and emission of radiation in external walls.

* radiative heat transfer between walls,

* heating/cooling energy supplied by ventilation and heat pump.

Since the building walls are constructed using different materials for different sides; north, south, east, and west, the 3R2C thermal network model is developed separately for each wall, floor, and roof. A schematic of the thermal network model is shown in Fig. 3. The same thermal network was adapted to the remaining walls.

From the aforementioned assumptions, heat and mass transfer balance formulations are given in (1),(2), and (3). The subscript j denotes the wall.

$$C_z \frac{dT_z}{dt} = \sum \frac{T_{1j} - T_z}{R_{1j}} + \frac{(T_{amb} - T_z)}{R_{win}} + \dot{Q}_{in} + \dot{Q}_{s,wi} + \dot{Q}_{heat} \quad (1)$$

$$C_{1j} \frac{dT_{1j}}{dt} = \frac{T_{2j} - T_{1j}}{R_{1j2}} + \frac{T_{in-1j} - T_{1j}}{R_{1j3}} \quad (2)$$

$$C_{2j} \frac{dT_{2j}}{dt} = \frac{T_{u-1j} - T_{2j}}{R_{1j1}} + \frac{T_{1j} - T_{2j}}{R_{1j2}} + \dot{Q}_{s,wj} \quad (3)$$

$$\dot{Q}_{s,w} = \alpha_w A_w \dot{Q}_{red} \quad (4)$$

where, $C_z$ is zone air capacitance, $C_{1j}$ is wall heat storage capacitance inside, $C_{2j}$ is wall heat storage capacitance outside, $\dot{Q}_{in}$ is internal heat gains, $\dot{Q}_{s,wi}$ is solar radiation heat gain through windows, $\dot{Q}_{s,wj}$ is solar radiation heat gain from the walls, $\dot{Q}_{heat}$ is heating/cooling energy supplied by $\dot{Q}_{heat,pump}$
<figure><img src="image_4.png" /><figcaption>Fig. 3: Thermal dynamics of buildings (a) and equivalent 3R2C model (b) [15].</figcaption></figure>

and $\dot{Q}_{vent}$, $\dot{Q}_{heat,pump}$ is supplied energy from heat pump, $\dot{Q}_{vent}$ is supplied energy from ventilation system, $T_{amb}$ is outdoor ambient temperature,

The model has total 13 nodes: zone node and two nodes for each wall, floor and roof. Since the heat pump works autonomously, there is no control over its heat energy input to the zone and only controllable input is ventilation heat energy. This is controlled by varying its airflow. Thus, the model has only one controllable input and remaining inputs are considered as measurable disturbances (listed below).

* Ambient temperature,

* Heat energy supplied from the heat pump,

* Solar radiation gain from the walls and windows,

* Internal heat gains from the electric devices and presence of occupancy,

The above given formulations of the reduced model of the building, are represented in state-space by deriving set of first order differential equations. Moreover, the MPC controller also requires the dynamic thermal model of the system discrete time state-space representation (5) [16]–[18].

$$ 
\begin{aligned}
X(k + 1) &= AX(k) + Bu(k) + B_1d(k) \\
y(k) &= CX(k) + Du(k) + D_1d(k)
\end{aligned} 
\quad (5) $$

where:

$X$ - is the state vector: zone temperature and wall node temperatures,

$u$ - is the input vector (mass flow rate from the ventilation system),

$d$ - is the measurable disturbance vector: weather parameters, occupancy, and heat pump energy input,

$y$ - the output of the system: zone temperature $T_z$,

$A$ - state matrix, $B$ and $B_1$ - input matrices, $C$ - output matrix, and $D$ and $D_1$ - feed-through matrices.

Furthermore, in the most cases the radiative heat transfer between walls is neglected or taken as constant after linearizing it to near equilibrium point [19]. The developed model induces nonlinearities due to the radiative heat transfer (6) between the walls.

$$ \dot{Q}_{rad} = \epsilon \sigma (T_{hot}^4 - T_{cold}^4) \quad (6) $$

where,

$\epsilon$ - surface emissivity of the material,

$\sigma$ - Stefan-Boltzmann constant,

$T$ - wall surface temperatures in Kelvin degrees.

Since, the temperature difference between walls is low and the temperature relationship is in absolute temperature in (6), thus the temperature difference between walls are relatively small as compared to absolute temperature value. Hence, the radiative heat transfer coefficient is considered to be a constant value by linearizing it using the Taylor's series expansion.

The dynamic model of the building is validated against the measured values of the CESI LINEACT building. The model is validated for 6 days in February as it is one of the coldest months in Nanterre.

Figure 4 shows the temperature profile of the classroom where the system nonlinear model quite accurately follows the building thermal dynamics. On the other hand, the linearized model is also closely following the dynamics of the system, but slightly less accurately. In should be mentioned that the nonlinear model computational cost is higher than that the linearized one, while the error between the two models is low. In this case, the linearized model is considered acceptable and therefore adopted.

### III. MODEL PREDICTIVE CONTROLLER

Model Predictive Control (MPC) produces a sequence of controller variable input strategy by using a system model to optimize an objective function (minimizing energy consumption) of system model behaviour based on a quadratic performance objective, subject to equality or inequality constraints on states, inputs, and outputs over a future time horizon.

The classical objective function for the MPC has the following quadratic formulation:
<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 4: Validation of developed model against the measured room temperature.</figcaption></figure>

$$ J(t_k) = \sum_{j=N_1}^{N_p} \delta(j)[\hat{y}(t_k + j) - y^{sp}(t_k + j)]^2 + \sum_{j=1}^{N_c} \lambda(j)[u(t_k + j) - u(t_k + j - 1)]^2 \quad (7) $$

s.t.

$$ X_{t+k+1|t} = AX_{t+k|t} + Bu_{t+k|t} + B_1 d_{t+k|t} \quad (8) $$

$$ Mu \le \gamma \quad (9) $$

where, $\hat{y}$ and $y^{sp}$ are the predicted output and set-point temperatures, respectively. u is the control variable. In this model the control variable is $(\dot{m}_{fa}(t_k)c_a[T_{sp}(t_k) - 1/2(T_z(t_k) + T_0(t_k))]$, the input air flow is controlled through MPC while satisfying the constraints matrix M. However, the objective function tracks only the set-point ($y^{sp}$) temperature, which forces the building controllers to reach single set point temperature, and curtails the optimal control strategy, leading to a poor energy optimization. Hence, adding slack variables to the set-point variables gives extra freedom of controllability in the MPC. Slack variables are useful in making the output

variable to keep within a certain range by penalizing for any violation in the range [20].

The new proposed formulation is given as follows:

$$ \min \sum_{j=0}^{N_p-1} |\dot{m}_{fa}(t_j)c_a[T_{sp}(t_j) - \frac{(T_z(t_j) + T_0(t_j))}{2}| + \beta(|s_j| + |s_j|) \quad (10) $$

s.t.

$$ X_{t+j+1|t} = AX_{t+j|t} + Bu_{t+j|t} + B_1 d_{t+j|t} \quad (11) $$

$$ Mu \le \gamma \quad (12) $$

$$ T_{lb} - s_{lb,t+j|t} \le T_{z,ne,t+j|t} \le T_{ub,t+j|t} + s_{ub,t+j|t} \quad (13) $$

$$ s_{lb,t+j|t} \le s_{ub,t+j|t} \ge 0 \quad (14) $$

where, $\beta$ is penalty factor, $s$ is slack variable, $T_{lb}$ and $T_{ub}$ are lower and upper values of temperature, respectively. Similarly, the inequality constraints are applied to the input and rate of change inputs.

In order to solve the objective function (10), the state-space model needs to be represented in the predictive model form [17]:

$$ \hat{y} = Fx(k) + \phi_1 u + \phi_2 d \quad (15) $$

where,

$$ F = \begin{bmatrix} CA \\ CA^2 \\ CA^3 \\ \vdots \\ CA^{N_p} \end{bmatrix} \phi_1 = \begin{bmatrix} CB \\ CAB \\ CA^2 B \\ \vdots \\ CA^{N_p-1} B \end{bmatrix} \phi_2 = \begin{bmatrix} CB_1 & 0 & \dots & \bullet \\ CAB_1 & CB_1 & \dots & \bullet \\ CA^2 B_1 & CAB_1 & \dots & \bullet \\ \vdots & \vdots & \ddots & \vdots \\ CA^{N_p-1} B_1 & CA^{N_p-2} B_1 & \dots & CAB_1 \end{bmatrix} $$

$$ \phi_2 = \begin{bmatrix} CB_1 & 0 & \dots & \bullet \\ CAB_1 & CB_1 & \dots & \bullet \\ CA^2 B_1 & CAB_1 & \dots & \bullet \\ \vdots & \vdots & \ddots & \vdots \\ CA^{N_p-1} B_1 & CA^{N_p-2} B_1 & \dots & CAB_1 \end{bmatrix} $$

$$ \hat{y} = [\hat{y}^T(k+1) \ \hat{y}^T(k+2) \ .. \ \hat{y}^T(k+N_p)]^T $$

$$ u = [u^T(k+1) \ u^T(k+2) \ .. \ u^T(k+N_p-1)]^T $$

$$ d = [d^T(k+1) \ d^T(k+2) \ .. \ d^T(k+N_p-1)]^T $$

The matrices $F$, $\phi_1$, and $\phi_2$ are constants of the system model. Hence, these are computed only once, thus reducing the computational cost for every control time step. Therefore, the formulated objective function (10) with constraints are solved in the MPC framework. For MPC simulation, the Python programming language is used with CVXOPT [21] solvers for minimizing the cost function.
## IV. SIMULATION RESULTS

To demonstrate the optimal control strategy of the MPC for multi-objective control within given constraints, a comparison is performed between the MPC and conventional controller for building temperature control in the presence of measurable disturbances.

The simulations are carried out for 6 days (01/02/2019 to 07/02/2019) to calculate the energy consumption during heating season. The MPC implementations are performed with hourly time step for prediction horizon of one day. The lower and upper limits for zone temperature is set to 19°C and 23°C, respectively.

The conventional controller does not predict the future control strategies as compare to MPC controller, it works based on the current state of the system. On the contrary, MPC controller predicts the future control strategies, while satisfying the given constraints.

The results are shown in Fig. 5, it can be noticed that the temperature profile of MPC controller based model clearly satisfies the objective of meeting comfort criteria, while the conventional controller violates the standard indoor temperature range. The multi-objective control, and considerations of measurable disturbances of MPC has shown good control strategy, but the conventional controller without having consideration of disturbances, supplied heat energy even-though the zone temperature reached the upper limit, it shows poor performance of the conventional controller. The measurable inputs for the system are shown in Fig. 6.

From Fig. 5, it can be noticed that the energy consumption required for maintaining thermal comfort is estimated for a 6-day period. The cumulative energy for the conventional controller control is 42.23 kWh, while it is 29.55 kWh for

<figure><img src="image_7.png" /><figcaption>Fig. 5: Comparison of results of the MPC and conventional controller.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Fig. 6: Measurable disturbances of the system: solar radiation, adjacent rooms temperature, and ambient temperature.</figcaption></figure>

the MPC one, resulting in almost 31% reduction in energy consumption.

## V. CONCLUSIONS

In this study, the objective to improve the performances and energy optimization, the efficient control of model predictive control is implemented for indoor thermal comfort. The MPC has shown the ability to multi-objective control under given constraints, the average indoor temperature is always maintained within the lower and upper limits.

The energy consumption of the HVAC system for thermal comfort management during the 6 days was performed. The results indicate that the MPC system produces optimal control strategy, and offering reduced energy consumption in comparison, while the conventional controller is seen to be wasting energy and performing poorly. The presented MPC application has shown almost 31% of energy saving compared to the conventional controller.

Presented MPC is applied for single room, that will be applied for other rooms with distributive controller configuration. In the future, along with the temperature control, few other indoor comfort parameters (relative humidity, air quality, and visual comfort) will be studied.

## REFERENCES

[1] A. Boodi, K. Beddiar, M. Benamour, Y. Amirat, and M. Benbouzid, "Intelligent systems for building energy and occupant comfort optimization: A state of the art review and recommendations," *Energies*, vol. 11, no. 10, 2018.

[2] D. D'Agostino, P. Zangheri, and L. Castellazzi, "Towards Nearly Zero Energy Buildings in Europe: A Focus on Retrofit in Non-Residential Buildings," *Energies*, vol. 10, no. 1, p. 117, Jan. 2017.

[3] M. Killian and M. Kozek, "Ten questions concerning model predictive control for energy efficient buildings," *Building and Environment*, vol. 105, pp. 403-412, 2016.

[4] G. Serale, M. Fiorentini, A. Capozzoli, D. Bernardini, and A. Bemporad, "Model Predictive Control (MPC) for Enhancing Building and HVAC System Energy Efficiency: Problem Formulation, Applications and Opportunities," *Energies*, vol. 11, no. 3, p. 631, Mar. 2018.

[5] J. Cigler, S. Prívara, Z. Váňa, E. Žáčeková, and L. Ferkl, "Optimization of Predicted Mean Vote index within Model Predictive Control framework: Computationally tractable solution," *Energy and Buildings*, vol. 52, pp. 39-49, Sep. 2012.
[6] Y. Ma, F. Borrelli, B. Hencey, B. Coffey, S. Bengea, and P. Haves, "Model Predictive Control for the Operation of Building Cooling Systems," *IEEE Transactions on Control Systems Technology*, vol. 20, no. 3, pp. 796-803, May 2012.

[7] M. Castilla, J. D. Álvarez, M. Berenguel, F. Rodríguez, J. L. Guzmán, and M. Pérez, "A comparison of thermal comfort predictive control strategies," *Energy and Buildings*, vol. 43, no. 10, pp. 2737-2746, Oct. 2011.

[8] D. Kolokotsa, A. Pouliezos, G. Stavrakakis, and C. Lazos, "Predictive control techniques for energy and indoor environmental quality management in buildings," *Building and Environment*, vol. 44, no. 9, pp. 1850-1863, Sep. 2009.

[9] S. Prívara, J. Široký, L. Ferkl, and J. Cigler, "Model predictive control of a building heating system: The first experience," *Energy and Buildings*, vol. 43, no. 2-3, pp. 564-572, Feb. 2011.

[10] W. Liang, R. Quinte, X. Jia, and J.-Q. Sun, "MPC control for improving energy efficiency of a building air handler for multi-zone VAVs," *Building and Environment*, vol. 92, pp. 256-268, Oct. 2015.

[11] R. Godina, E. M. G. Rodrigues, E. Pouresmaeil, and J. P. S. Catalão, "Optimal residential model predictive control energy management performance with PV microgeneration," *Computers & Operations Research*, vol. 96, pp. 143-156, Aug. 2018.

[12] M. Maasoumy, M. Razmara, M. Shahbakhti, and A. S. Vincentelli, "Handling model uncertainty in model predictive control for energy efficient buildings," *Energy and Buildings*, vol. 77, pp. 377-392, 2014.

[13] T. Hilliard, M. Kavgic, and L. Swan, "Model predictive control for commercial buildings: Trends and opportunities," *Advances in Building Energy Research*, vol. 10, no. 2, pp. 172-190, 2016.

[14] "Bâtiments Basse Consommation, France," *Guide AITF/EDF*, 2008.

[15] A. Boodi, K. Beddiar, Y. Amirat, and M. Benbouzid, "A Numerical Approach for Buildings Reduced Thermal Model Parameters Evaluation," in *Proceedings of the 2019 SPIES, IOP Conference Series: Earth and Environmental Science*, Melbourne (Australia), April 2019, pp. 1-8.

[16] S. V. Raković and W. S. Levine, Eds., *Handbook of Model Predictive Control*, ser. Control Engineering. Birkhäuser Basel, 2019.

[17] J. Rossiter, *Model-Based Predictive Control: A Practical Approach*, 1st ed., J. Rossiter, Ed. CRC Press, Jul. 2017.

[18] C.-C. Tsui, *Robust Control System Design: Advanced State Space Techniques*, 2nd ed., ser. Control Engineering. New York: Marcel Dekker, 2004, no. 16, oCLC: ocm53390378.

[19] Z. Liao and A. Dexter, "A simplified physical model for estimating the average air temperature in multi-zone heating systems," *Building and Environment*, vol. 39, no. 9, pp. 1013-1022, Sep. 2004.

[20] L. Wang, *Model Predictive Control System Design and Implementation Using MATLAB®*, Springer Science & Business Media, 2009.

[21] L. Vandenberghe, "The CVXOPT linear and quadratic cone program solvers," *Online: http://cvxopt.org/documentation/coneprog.pdf*, 2010.