# The Minimum Energy Building Temperature Control

Marek Dlugosz

► To cite this version:

Marek Dlugosz. The Minimum Energy Building Temperature Control. 25th System Modeling and Optimization (CSMO), Sep 2011, Berlin, Germany. pp.471-480, 10.1007/978-3-642-36062-6_47. hal-01347569

HAL Id: hal-01347569

https://inria.hal.science/hal-01347569

Submitted on 21 Jul 2016

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>

Distributed under a Creative Commons Attribution 4.0 International License
# The Minimum Energy Building Temperature Control

Marek Długosz

AGH University of Science and Technology

Faculty of Electrical Engineering, Automatics, Computer Science and Electronics

Department of Automatics

Al. A. Mickiewicza 30, 30-059 Krakow, Poland

mdlugosz@agh.edu.pl

http://www.agh.edu.pl

**Abstract.** One of the most important factors of users comfort inside building is air temperature. From the other side one of the most biggest position in home budget is price for heat. Mutually exclusive indices are the cause that the control of temperature task using the smallest amount of energy as it is possible is very difficult. In this paper is presented simple model of temperature changes inside building base on lumped capacity method. Using this method finally obtains mathematical model of temperature changes which model is equivalent in structure to electrical RC-network. The model is composed of linear differential equations. Based on this mathematical model the simple algorithm controlling of temperature inside room is proposed. In this article are also included numerical simulations of the proposed solutions.

**Keywords:** building temperature model, control, optimization

## 1 Introduction

Problem of optimal use of the heat energy for heating residential building is still a current problem. Some of the main reasons for this are: still rising energy price (electricity, gas, coal), still rising power consumption by household or environmental pollution. The goal of this article is to present a control system which stabilises the temperature inside the building with the using minimum amount of energy.

The air temperature inside the building $T_i$ depends on many factors. Some of them like: solar radiation, wind, heating system, light, people, air ventilation are showed on figure 1. Some of these factors are unpredicted like: people inside, light, air ventilation. Some of them are periodical and can be measured or predicted, for example: solar radiation, temperature outside, wind direction and force. The physical phenomena of thermal conductivity are also very complex and described by partial differential equations which depend on time and spatial variables. For those reasons one and general thermal model of the building does not exist. On the other hand for searching optimal controls the mathematical model of the
<figure><img src="image_2.png" /><figcaption>**Fig. 1.** The temperature inside the building depends on many factors such as: heating system, external air temperature, wind, solar heat, casual heat gains, structure of the building.</figcaption></figure>

system is necessary. In the literature can be found three main methods to obtain and identify an approximated thermal model of the building.

The first method: the impulse response factor method [1, 8] is based on the response of the model if the excitation is a unit impulse. Making some additional assumptions and using the properties of Laplace transform the response of the wall to this excitation function can be expressed as time series.

The second method is the finite difference method. This is a numerical method for solving partial differential equation of the heat conduction [1, 8]. The finite difference method is based on approximation derivates by algebraic equation. The building wall is divided into a finite number of layers and temperature for each layers is computed using set of the algebraic equations.

The third method: the lumped parameter method (or other name the lumped capacitance method) base on assumptions that transfer of the heat flux between two spaces which are divided by partition (wall) can be modeled by the equivalent electrical RC circuit [4, 5, 8]. The parameters of the electrical RC circuit like resistances are interpreted as thermal resistances, capacities are interpreted as heat capacities of the modeled elements. The physical properties of the construction elements of the building are represented by resistors and capacitors. The lumped parameter method describes changes of the air temperatures or the temperatures of the construction elements in one point. Finally, the mathematical model which is obtained by using the lumped parameter method has the form of linear differential equations. This model can be easily solved by analytical or
numerical methods. In this paper, the lumped parameter method was chosen for modeling changes of the indoor air temperature of building.

The plan of the article is as follow, the first section contains short description of the lumped parameter method (LPM), next section contains description of the LQR controller. The last section presents some of experimental results. At the end of the article are contained conclusions and plans for the future works.

## 2 Thermal modeling methodologies

The most suitable form of the mathematical model of dynamic system for searching of optimal control solutions, is form of the linear differential equations.

$$ \dot{x}(t) = Ax(t) + Bu(t) + Zz(t) \quad (1) $$

$$ y(t) = Cx(t) \quad (2) $$

where $A_{n \times n}$ – state space matrix, $B_{n \times r}$ – control matrix, $Z_{n \times k}$ – noise matrix, $C_{m \times n}$ – output matrix, $x(t) \in X = \mathbb{R}^n$ – state space vector, $z(t) \in Z = \mathbb{R}^k$ – noise vector, $u(t) \in U = \mathbb{R}^r$ – control vector, $y(t) \in Y = \mathbb{R}^m$ – output vector. In all simulations the noise matrix $Z$ was assumed to zero.

### 2.1 LPM

The assumptions of the lumped parameters method is that the temperature of the solid is spatially uniform at any instant during the transport of the heat process [6]. The result of this assumption is that the heat flow between two spaces which are separated by partition can be replaced by an equivalent RC electrical circuit [4, 5, 8]. The lumped parameter method describes changes of the temperature in one point so it is only an approximation of the real temperature. These simplifications allow us use the linear differential equations instead of more complicated partial differential equations. The lumped parameters method can be used for materials for which the conductivity in the middle is larger than the conductivity on the material surface [2, 6].

As was said, the heat flow between two spaces which are separated by the partition can be replaced by the electrical circuit and figure 2 shows this. The meaning parameters are: the $R_{out}$ and $R_{int}$ thermal resistances of area outer and inner, $C_{total}$ thermal capacity of the partition. The equation of the heat conduction based on the first-order model is:

$$ C_{total} \frac{dT}{dt} = \frac{(T_o - T)}{R_{out}} + \frac{(T_i - T)}{R_{in}} + q \quad (3) $$

where $q$ represents the other heat sources, $T$ is uniform material temperature, $T_o$ is outer air temperature and $T_i$ is inner air temperature. The wall on figure 2 consists one of the uniform material but in the real wall may be build more than one of layers of the uniform materials. In this case, we can extend the model by adding the next equations for each uniform layer [5, 8]. Also, if is needed the
<figure><img src="image_3.png" /><figcaption>Fig. 2. Representation of the lumped parameter construction element</figcaption></figure>

more accurate mathematical model we may add the next equations to the model [3, 5]. All these operations finally increase total number of the equations and order of the model.

## 2.2 The simple thermal model of building

The state equations from (4) to (9) describe the thermal behaviour of more complex space [4]. The space inside which temperature is modeled contains two external walls, two partitions, floor and ceiling. In this case changes of the temperature of the indoor air depend on much more factors.

$$C_1 \dot{T}_1 = U_1(T_i - T_1) + U_2(T_0 - T_1) \quad (4)$$

$$C_2 \dot{T}_2 = U_3(T_i - T_2) + U_4(T_0 - T_2) \quad (5)$$

$$C_3 \dot{T}_3 = U_5(T_i - T_3) + U_6(T_{z1} - T_3) + Q_s \quad (6)$$

$$C_4 \dot{T}_4 = U_6(T_i - T_4) + U_5(T_{z2} - T_4) \quad (7)$$

$$C_5 \dot{T}_5 = U_7(T_i - T_5) + U_7(T_{z3} - T_5) \quad (8)$$

$$C_6 \dot{T}_i = U_1(T_i - T_i) + U_3(T_2 - T_i) + U_5(T_3 - T_i) + U_6(T_4 - T_i) + U_7(T_5 - T_i) + U_8(T_o - T_i) + Q_p + Q_g \quad (9)$$

The parameters are: $T_1$ and $T_2$ – temperature of the building structure, $T_3$ and $T_4$ – temperature of the floor and ceiling, $T_5$ – temperature of the partitions, $T_o$ – outdoor air temperature and $T_i$ – indoor air temperature. The figure 3 shows electrical circuit RC which is equivalent with the building thermal model. The electrical parameters of this circuit correspond with physical parameters of the building. The resistances are equivalent to overall thermal transmittance and capacities are equivalent to thermal capacity. As is shown on the figure 3 electrical circuit has the form of the RC ladder network. The analytical solutions of the
<figure><img src="image_4.png" /><figcaption>**Fig. 3.** The equivalent electrical circuit RC for the building thermal model given by equations number from (4) to (9)</figcaption></figure>

model's equations can be easily found and analysed and this is big advantage of this type of the model.

In next simulations values of the parameters of the building like $C_i$ and $R_i$ are the same as those adopted in the article [4].

## 3 Temperature control in the building

The typical idealised behaviour of indoor air temperature is shown on figure 4. As we can see the three different phases can be highlighted. The first phase, when indoor air temperature should reach the reference value in given time. The second phase when the air temperature should be stabilised on the specified level. The third phase when the air temperature do not need to be stabilised or controlled. This is idealised behaviour of indoor air temperature but generally all more complicated schemas of the temperature changes can be described by using those three phases.

Only in the first and second phases is required active control of indoor air temperature. The main goal of the control system is to control indoor temperature in the first and second phases but in the first phase, time of control is also limited. In this paper is proposed to use two different controllers. The finite-horizon *LQR* controller which works in the first phase and the infinite-horizon *LQR* controller which works in the second phase. The next two subsections are described shortly those controllers and are present their advantages and disadvantages.
<figure><img src="image_5.png" /><figcaption>Fig. 4. Typical idealised changes of indoor air temperature.</figcaption></figure>

## 3.1 The finite-horizon LQR controller

The finite-horizon LQR controller minimizes the cost function (10) [7]:

$$J(\mathbf{x}, \mathbf{u}) = \frac{1}{2} \int_{0}^{t_k} (\mathbf{x}(t)^T \mathbf{W} \mathbf{x}(t) + \mathbf{u}(t)^T \mathbf{R} \mathbf{u}(t)) \, dt + \frac{1}{2} \mathbf{x}(t_k)^T \mathbf{F} \mathbf{x}(t_k). \quad (10)$$

The matrices $\mathbf{W}$, $\mathbf{F}$, $\mathbf{R}$ are weight matrices and that matrices must be nonnegative and symmetric and $\mathbf{W} = \mathbf{W}^T \ge 0$, $\mathbf{F} = \mathbf{F}^T \ge 0$, $\mathbf{R} = \mathbf{R}^T > 0$, the pair of matrices $(\mathbf{A}, \mathbf{B})$ is stabilisable, the pair of matrices $(\mathbf{W}, \mathbf{A})$ is detectable, $t_k$ is the control time. The control law is given by equation (11) [7]:

$$\mathbf{u}(t) = -\mathbf{R}^{-1}\mathbf{B}^T\mathbf{K}(t)\mathbf{x}(t) \quad (11)$$

where matrix $\mathbf{K}$ is unique, symmetric and nonnegative solution of Riccati differential equation (12) [7]:

$$\dot{\mathbf{K}}(t) = \mathbf{K}(t)\mathbf{B}\mathbf{R}^{-1}\mathbf{B}^T\mathbf{K}(t) - \mathbf{A}^T\mathbf{K}(t) - \mathbf{K}(t)\mathbf{A} - \mathbf{W}. \quad (12)$$

The controller (11) is nonstationary because the values of matrix $\mathbf{K}$ depend on time.

**Simulation** The fig. 5 shows the result of simulation of the control system with the finite-horizon LQR controller. The control task was to increase the temperature value from 15 to 20 degrees in a finite time (75 minutes). The first graph shows the change of the indoor air temperature $T_i$ (9), the second graph shows the change of the control signal $\mathbf{u}(t)$ (11).

The finite-horizon LQR controller is complicated in practical applications. First of all this is the nonstationary controller because the gain matrix $\mathbf{K}(t)$ is dependent on time. In order to compute matrix $\mathbf{K}(t)$ the Riccati differential equation (12) must be solved. The same result, raise the value of indoor temperature from one level to other level in finite time, can be obtained using the infinite-horizon LQR controller with appropriate choice of the weight matrices, $\mathbf{W}$ and $\mathbf{K}$.
<figure><img src="image_6.png" /><figcaption>Fig. 5. (a): Changes of the indoor air temperature $T_i$ (9) and (b): the control signal $u(t) = Q_p(t)$ (11).</figcaption></figure>

## 3.2 The infinite-horizon LQR controller

The infinite-horizon LQR controller minimizes a cost function (13) [7]:

$$J(\mathbf{x}, \mathbf{u}) = \int_{0}^{\infty} (\mathbf{x}(t)^{\mathrm{T}} \mathbf{W} \mathbf{x}(t) + \mathbf{u}(t)^{\mathrm{T}} \mathbf{R} \mathbf{u}(t)) \mathrm{d}t \quad (13)$$

where $\mathbf{W} = \mathbf{W}^T \ge 0$, $\mathbf{R} = \mathbf{R}^T > 0$, the pair of matrices $(\mathbf{A}, \mathbf{B})$ is stabilisable, the pair of matrices $(\mathbf{W}, \mathbf{A})$ is detectable. The cost function (13) contains two parts: a part which is joined with state space vector $\mathbf{x}(t)$ and part which is joined with the control vector $\mathbf{u}(t)$. The matrices $\mathbf{W}$ and $\mathbf{R}$ are called the weight matrices and appropriate selection of their values determines which part of cost function is better stabilised. The infinite-horizon LQR controller is proportional controller and the control law is given by equation (14) [7]:

$$\mathbf{u}(t) = -\mathbf{R}^{-1}\mathbf{B}^{\mathrm{T}}\mathbf{K}\mathbf{x}(t) \quad (14)$$

where $\mathbf{K}$ is unique, symmetric, nonnegative solution of algebraic Riccati equation:

$$\mathbf{K}\mathbf{B}\mathbf{R}^{-1}\mathbf{B}^{\mathrm{T}}\mathbf{K} - \mathbf{A}^{\mathrm{T}}\mathbf{K} - \mathbf{K}\mathbf{A} - \mathbf{W} = 0. \quad (15)$$

**Simulation** The fig. 6 shows the result of simulation of the control system with the infinite-horizon LQR controller. The control task was to increase the temperature value from 15 to 20 degrees in a finite time (1 hour). The first plot of figure 6 shows the change of the indoor temperature $T_i$ (9), the second graph shows the change of the feedback control signal $\mathbf{u}(t)$ (11).■

The infinite-horizon LQR controller is easier in practical applications because the values of matrix $\mathbf{K}$ are constant and it is a stationary proportional controller. By changing values of the matrices $\mathbf{W}$ and $\mathbf{R}$ is possible to modify in wide range of how the controller works e.g. approximate time after which the desired value of controlled variable will be achieved.
<figure><img src="image_7.png" /><figcaption>**Fig. 6.** (a): Changes of the inside temperature $T_i$ (9) and (b): the control signal $u(t) = Q_p(t)$ (11).</figcaption></figure>

## 4 The complex control system

The goal is to build a control system which works properly in phase I and phase II, see fig. 4. The control system will be implemented in a computer so this gives ability to build more complex control system. The infinite-horizon *LQR* controller will be used because, as was said earlier, this kind of controller is easy to use in practical applications. The figure 7 shows the block diagram of proposed control system. The *LQR* controller number 1 works during phase I

<figure><img src="image_8.png" /><figcaption>**Fig. 7.** Scheme of the proposed complex control system</figcaption></figure>

and the *LQR* controller number 2 works during phase II. The difference between the two *LQR* controllers is in their values of weight matrices *W* and *R*. The controller number 1 should achieve desired temperature in finite time of control. The controller number 2 should stabilise temperature on desired level but time of control is unknown. The block with title "Switching algorithm" on figure 4 contains an algorithm which decide which of controllers should work currently.

**Simulation** The fig. 8 shows the simulation result of the control system whose block diagram is presented on figure 7. The control task was to increase the
temperature value from 15 to 20 degrees in a finite time and next stabilise this temperature on desired level. The figure 8(a) shows the changes of the indoor temperature $T_i$ (9), the figure 8(b) shows the change of the control signal $u(t)$ (11). At the beginning, the LQR controller number 1 is working, after some time when desired the indoor temperature $T_i$ is reached, the LQR controller number 2 starts to work. The moment of switched between the controller number 1 and the controller number 2 can be observed on figure 8(b) as a step change of the value of control signal $u(t)$.

<figure><img src="image_9.png" /><figcaption>**Fig. 8.** Changes of the inside temperature (left plot) and the control signal $u(t) = Q_p(t)$ (right plot).</figcaption></figure>

The fig. 9 shows a comparison of the control signals for the single LQR controller (dotted line) and the control system which contains the two LQR controllers (solid line). The control system which includes two LQR controllers uses less energy to stabilise the temperature than the system with one LQR controller and the area between two curves corresponds to the amount of saved energy. ■

# 5 Conclusions

This paper is presented the control system which contains two infinite-horizon *LQR* controllers. The infinite-horizon *LQR* controllers were chosen because: the control system is closed-loop system with negative feedback, simple structure of the infinite-horizon *LQR* controller (proportional controller) and modifying the weight matrices *W* and *R* can change the nature of the work control system. Also, some disadvantages of the infinite-horizon *LQR* controller are existing like: the *LQR* controller is a proportional controller so always is a deviation between desired value and real value of controlled signal, the *LQR* controller for proper work needs to know values of all coordinates of the state vector $\boldsymbol{x}(t)$ and in some cases reconstruction of the non-measurable coordinates of the state variables is
<figure><img src="image_10.png" /><figcaption>**Fig. 9.** Comparison of the controls signals $u(t) = Q_p(t)$ for the single LQR controller (dotted line) and the control system which contains the two LQR controllers (solid line).</figcaption></figure>

needed. As shown by results of the simulations there is possibility to control indoor air temperature efficiently and using less energy. The LQR controller minimises the cost function which also takes into account the energy consumption of the control signal. Recent times, can be observed the growing popularity of wireless home automation devices. The future work will be concentrated on practical implementation of the proposed solutions in devices which work in ZWave and ZigBee standard.

Work is financed by NCN-National Science Centre founds for 2011-2013 as a research project. Contract number N N514 644440.

## References

1. J. Clarke. *Energy simulation in building design*. Butterworth-Heinemann, 2001.

2. J. A. Crabb, N. Murdoch, and J. M. Penman. A simplified thermal response model. *Building Services Engineering Research and Technology*, 8(1):13–19, 1987.

3. K. Deng, P. Barooah, P. G. Mehta, and S. P. Meyn. Building thermal model reduction via aggregation of states. In *Proceedings of the 2010 American Control Conference, ACC 2010*, pages 5118–5123, 2010.

4. M. Gouda, S. Danaher, and C. Underwood. Low-order model for the simulation of a building and its heating system. *Building Services Engineering Research and Technology*, 21(3):199–208, 2000.

5. M. M. Gouda, S. Danaher, and C. P. Underwood. Building thermal model reduction using nonlinear constrained optimization. *Building and Environment*, 37(12):1255–1265, 2002.

6. F. P. Incropera, D. P. DeWitt, T. L. Bergman, and A. S. Lavine. *Fundamentals of Heat and Mass Transfer*. John Wiley & Sons, September 2006.

7. W. Mitkowski. *Stabilizacja Systemów Dynamicznych*. WNT Warszawa, 1991.

8. C. Underwood and F. Yik. *Modelling methods for energy in buildings*. Blackwell Science, 2004.