Modeling and Controlling of Temperature and Humidity in Building Heating, Ventilating, and Air Conditioning System Using Model Predictive Control

: Nowadays, by huge improvements in industrial control and the necessity of e ﬃ cient energy consumption for buildings, uniﬁed managing systems are established to monitor and control mechanical equipment and energy usage. One of the main portions of the building management system (BMS) is the cooling and heating equipment called heating and ventilation and air-conditioning (HVAC). Based on temperature slow dynamic and presented uncertainty in modeling, a model predictive control (MPC) strategy to track both temperature and humidity is proposed in this study. The this study is to provide a framework to describe temperature and humidity elements required for dynamic modeling. Following that, by utilizing a predictive approach, a control strategy is obtained, which optimizes the tracking error of two interactional channel and performs the e ﬀ ort control by minimizing the optimization index. Other articles have mostly only had control over the temperature variable, but in our article, we tried to study the equations of temperature and humidity as well as their interference and according to the ASHRAE standard, both temperature and humidity controls must be accurate. The humidity was the novelty in our article. Simulation results proved the e ﬀ ectiveness of the proposed approach compared to the conventional proportional-integral controller. Evidently, the key idea behind the control objective is providing the comfort condition while consuming the least possible energy.


Related Works
With significant increases in energy consumption in the construction sector, strategies for saving energy has become a priority in many countries. For instance, energy consumption in the global building and construction sector accounted for 36% of total energy consumption in 2017. In the United States, energy utilization accounted for 41% of energy use in 2010 [1,2]. Heating and ventilation and air conditioning (HVAC), includes technologies for creating comfortable conditions in terms of temperature and humidity which will be more appropriate for the comfort of residents [3,4]. Bundles of construction and heating systems, ventilation, and air-conditioning, consume a large share of energy consumption (approximately 50%). As a result, developing and creating effective control systems for air conditioners is one of the most important issues in this area. Conventional air-conditioning systems traditionally consider temperature and humidity as indicators of convenience in the room.
There are several conventional methods of HVAC, for example, in [5] an experimental study presented the operational characteristics of a direct expansion system. Additionally, in [6], a direct expansion-based dehumidification air-conditioning system for improving year-round indoor humidity control in hot and humid climates was studied. In [7], a model-based cascade control approach presented the control of spatial temperature in constant air volume (CAV) air conditioners to enhance the strength and accuracy of controlling the temperature of the space. This control method includes an air temperature prediction model and a PI controller. In [8], a reinforcement learning control strategy is presented using Q-learning in natural ventilation, which combines HVAC and window operations. The learning control function has been strengthened by comparing numerical simulations on the thermal construction model and comparing that with traditional horizontal controls. In [9], a method for constructing a state-space model of a building is presented, which can be used to predict indoor temperature, humidity, and thermal comfort to control the indoor environment with MPC. With the rapid development of machine learning [10,11] and data mining technology [12,13], especially deep learning [14][15][16] and reinforcement learning [8,17], the HVAC of a building structure will become smarter based on historical data such as temperature, humidity, and energy consumption.
In addition to the above mentioned, many other cases have been studied on HVAC [18][19][20][21][22][23][24][25][26][27]. In the present paper, a model predictive control (MPC) method has been used for controlling temperature and humidity which was previously only introduced for controlling temperature in [28][29][30]. Furthermore, different techniques have been employed to reduce the cost function [31][32][33][34][35]. On the one hand, creating an optimized space for a MPC design problem to simultaneously monitor temperature and humidity as two effective factors in providing comfortable atmosphere for residents is the key idea. On the other hand, given the value of energy consumption in the construction sector, especially the cooling and heating sector, which is the main factor in building energy consumption, a multi-objective optimization function is introduced in this paper to minimize the whole energy usage [36][37][38][39][40][41][42][43]. The main novelty of the present paper is in two general lines. The first line involves modeling the thermal section of the building along with the dynamical equations of moisture. In order to get the correct equation, an electric element for the thermal model is introduced first, and then a solution is proposed for modeling external disturbances such as solar radiation, entering people, etc. The second line of innovation is to present an optimization structure with a predictive viewpoint for designing a multivariate controller, considering the interference between channels [44,45].

Motivation
The main purpose of the control problem is to provide thermal comfort while minimizing energy consumption and improve the comfort condition of an office room. Initially, an appropriate framework for the accurate modeling of a room's thermal section is presented with the consideration of effective factors such as presence of individuals and impact of solar radiation and the thermal transfer of walls. In Section two, the control structure of the MPC is described. Then, a specific structure will be presented for modeling the thermal and moisture states of the building. Afterwards, the electrical equivalent of every component is introduced and their values are determined. Constraints, and cost function are stated and all requirements for simulation work are provided. Finally, simulation results are presented using MATLAB software for proportional-integral (PI) and MPC are the main ideas of this paper. A comparison of the results and an analysis of the relationships are described in detail at the end of the Section. Finally, the paper concludes and presents suggestion as future work. One proposal is introduced to improve the findings.

Predictive Control Method
MPC is based on the iterative optimization and finite horizons of the plant model. At the time t, the current status of plant samples and a control strategy to minimize the cost (through numerical optimization algorithms) for a relatively short time horizon of the future is calculated: [t, t + T].
Only the first step of the control strategy is executed, then sampled again, and the calculations are repeated with the new current start, giving a new control and new state prediction. The MPC method is shown in Figure 1. Constraints, and cost function are stated and all requirements for simulation work are provided. Finally, simulation results are presented using MATLAB software for proportional-integral (PI) and MPC are the main ideas of this paper. A comparison of the results and an analysis of the relationships are described in detail at the end of the Section. Finally, the paper concludes and presents suggestion as future work. One proposal is introduced to improve the findings.

Predictive Control Method
MPC is based on the iterative optimization and finite horizons of the plant model. At the time t, the current status of plant samples and a control strategy to minimize the cost (through numerical optimization algorithms) for a relatively short time horizon of the future is calculated: [t, t + T]. Only the first step of the control strategy is executed, then sampled again, and the calculations are repeated with the new current start, giving a new control and new state prediction. The MPC method is shown in Figure 1. In which, future outputs are determined up to N moments later called the prediction horizon.
, depend on past inputs and outputs, and future system inputs. Future control signals are determined by a benchmark optimization that represents the distance between future outputs and future desired outputs. This criterion is generally a square function of the error between the expected future outputs and the desired future outputs. Additionally, in this square function, you can enter the control signal. If this criterion is a square function and on the other hand the system model is a linear and unconstrained model, then an explicit answer can be found for this optimization. Otherwise, a duplicate optimization method should be used. After specifying future control signals, is the only control signal to be applied to the system to control it, ( | ) u t t . In order to apply this control method, the structure shown in Figure 2 is used. In which, future outputs are determined up to N moments later called the prediction horizon. Future outputs,ŷ(t + k t), k ∈ {1, 2, . . . , N} , depend on past inputs and outputs, and future system inputs. Future control signals are determined by a benchmark optimization that represents the distance between future outputs and future desired outputs. This criterion is generally a square function of the error between the expected future outputs and the desired future outputs. Additionally, in this square function, you can enter the control signal. If this criterion is a square function and on the other hand the system model is a linear and unconstrained model, then an explicit answer can be found for this optimization. Otherwise, a duplicate optimization method should be used. After specifying future control signals, u(t + k t), k ∈ {1, 2, . . . , N} is the only control signal to be applied to the system to control it, u(t t) . In order to apply this control method, the structure shown in Figure 2 is used.
• At time t : Solve an optimal control problem over a future horizon of N steps; • Apply only the first optimal move ( ) ut , throw the rest of the sequence away; • At time 1 t + : Get new measurements and repeat the optimization.
In this method, the system model is used to predict future outputs. According to the model obtained from the system and past inputs and outputs as well as future inputs, obtained from optimization of the objective function, the output value is predicted at future moments. As we can see in Figure 2, the optimizer predicts future system inputs, taking into account the system's objective function and expected future error.

•
Objective: Make the output ( ) yt track a reference signal ( ) rt ; • Idea: Parameterize the problem using input increments as follows: (y k − r(t + k)) : Penalty on tracking error (u k ) : Penalty on actuation e f f ort • At time t: Solve an optimal control problem over a future horizon of N steps; • Apply only the first optimal move u(t), throw the rest of the sequence away; • At time t + 1: Get new measurements and repeat the optimization.
In this method, the system model is used to predict future outputs. According to the model obtained from the system and past inputs and outputs as well as future inputs, obtained from optimization of the objective function, the output value is predicted at future moments. As we can see in Figure 2, the optimizer predicts future system inputs, taking into account the system's objective function and expected future error.

•
Objective: Make the output y(t) track a reference signal r(t); • Idea: Parameterize the problem using input increments as follows: • Extended system: x u (t) = u(t − 1) is as follows: Energies 2019, 12, 4805

of 24
As a result: A liner system with states x(t), x u (t), and input ∆ u (t).

Predictive Approach to Controlling Temperature and Humidity
In this section, a simple way to estimate the thermal performance of an office building is discussed. The heat storage capacity and heat transfer power are the essential thermal properties of building components. The walls, ceilings, floors, and air inside a closed space are components of the building that can save energy. The capacity of these components depends on their energy storage and specific heat capacity. Furthermore, heat is not only saved in the atmosphere, but is transmitted through various methods amongst these components. The thermal network of the building can be represented by an analog circuit, in such a way that the heat is stored by the capacitor, and the heat transfer is displayed by the resistor. A mathematical description of the thermal model for the building is useful to design a controller. The model should be simple and accurate enough.

Modeling the Temperature and Humidity of the Room
Indoor air temperature dynamics, the indoor temperature at any moment is influenced by the following factors:

1.
Heat generated by the people in the room, lighting equipment, and other devices; 2.
Heat transferred through the internal walls (the temperature of the internal walls is affected by the heat transfer between the wall and the air inside the room and the solar thermal gain); 3.
Heat exchanged between the air inside and outside the room through external walls and glass windows; 4.
Heat produced by air conditioners and natural ventilation; 5.
Heat stored in the air inside the room.
Inside room humidity dynamics, room humidity is influenced by the following factors:

1.
Moisture produced by people in the room; 2.
Moisture produced by a humidifier or air conditioner; 3.
Humidity stored in the air inside the room.
The mathematical model of temperature and humidity of the room is as follows: The temperature of the room inside the room is influenced by many factors such as heat, room volume, and heat dissipation through the walls. Additionally, another important factor in air temperature is moisture which is considered in this research.

Assumption 1.
For the simplicity of the equations, it is assumed that the distribution of temperature and humidity inside the room is uniform, because if the distribution of these variables is not uniform, all parameters would be a function of the place and will impose a lot of complexity in the control problem. Therefore, in this research, it is assumed that temperature (T) and humidity (H) is uniformly distributed in the air inside the room, and their average value is used to control of the states in the room.

Assumption 2.
The temperature of the walls between the two rooms is considered along with the same wall and the heat transfer between the wall, and the air inside the room is linearly a function of the difference in wall temperature and air inside the room. Assumption 3. The air pressure changes inside the room in the range of −10 • C to +50 • C has been neglected [46].

The Basic Concept of Heat Transfer and Thermodynamics
One of the essential properties of the material is the specific heat capacity of the c p , which is a measurable physical quantity. To change the temperature of a high-temperature material requires more energy than a substance with a lower specific heat capacity. For an object with mass M, a specific heat capacity c p and a temperature change temperature .
T and the heat flux Q is obtained from the following formula: Compared to the electrical engineering concepts in the high equation, Mc p is similar to the capacitor, .
T is similar to the electric potential (voltage) change, and Q is similar to the electric current [47]. Heat transfer occurs through three methods of conduction, convection, and radiation, as shown in Figure 3. In a particular case, there is a relationship between the emission of heat and electric charge. As electrical resistance is related to electrical conductivity, thermal resistance is also related to thermal conductivity. The thermal resistance is as follows for a wall.
heat transfer between the wall, and the air inside the room is linearly a function of the difference in wall temperature and air inside the room. Assumption 3. The air pressure changes inside the room in the range of −10 °C to +50 °C has been neglected [46].

The Basic Concept of Heat Transfer and Thermodynamics
One of the essential properties of the material is the specific heat capacity of the p c , which is a measurable physical quantity. To change the temperature of a high-temperature material requires more energy than a substance with a lower specific heat capacity. For an object with mass M , a specific heat capacity p c and a temperature change temperature T and the heat flux Q is obtained from the following formula: T is similar to the electric potential (voltage) change, and Q is similar to the electric current [47].
Heat transfer occurs through three methods of conduction, convection, and radiation, as shown in Figure 3. In a particular case, there is a relationship between the emission of heat and electric charge. As electrical resistance is related to electrical conductivity, thermal resistance is also related to thermal conductivity. The thermal resistance is as follows for a wall.
where cond Q is the heat transfer rate by conduction in Watt (W ), A is the surface area in 2 m , k is the thermal conductivity coefficient of the wall, L is the thickness in m , and T  is the difference between the temperature of the two sides of the hot surface wall that is given in Kelvin and is denoted as K . Similarly, for electrical conduction in the same system, electrical resistance is obtained through Ohm's law as follows.
where Q cond is the heat transfer rate by conduction in Watt (W), A is the surface area in m 2 , k is the thermal conductivity coefficient of the wall, L is the thickness in m, and ∆T is the difference between the temperature of the two sides of the hot surface wall that is given in Kelvin and is denoted as K.
Similarly, for electrical conduction in the same system, electrical resistance is obtained through Ohm's law as follows.
As shown, there is a lot of similarities between the above equations. The thermal resistance to heat transfer from a surface by convection can also be obtained according to the following formula.
Where Q is the heat transfer rate by convection in watt (W), A is the surface area in m 2 , h is the heat-transfer coefficient in W m 2 K , and ∆T is the temperature difference between the surface and the fluid in kelvin (K) [47].
The resistor capacitor (RC) model helps in understanding both the concept and the calculations of the heat transfer problem. If the wall is a composite, first the thermal resistance of the wall must be calculated. Due to the fact that the thermal resistance of conduction and convection are in series, and according to Figures 4 and 5, the thermal resistance is calculated as follows: where h 1 and h 2 are respectively the heat-transfer coefficients of the first and second environment respectively. A is the surface area, L is the thickness of the wall, and K is the thermal conductivity of the wall [47].
h is the heat-transfer coefficient in 2 W mK , and T  is the temperature difference between the surface and the fluid in kelvin ( K ) [47].
The resistor capacitor (RC) model helps in understanding both the concept and the calculations of the heat transfer problem. If the wall is a composite, first the thermal resistance of the wall must be calculated. Due to the fact that the thermal resistance of conduction and convection are in series, and according to Figures 4,5, the thermal resistance is calculated as follows: where 1 h and 2 h are respectively the heat-transfer coefficients of the first and second environment respectively. A is the surface area, L is the thickness of the wall, and K is the thermal conductivity of the wall [47].

Mathematical Description of the Thermal and Moisture Dynamics of the Building
To describe the heat transfer between rooms, the RC model is used as mentioned earlier. Additionally, for simplicity, it is assumed that the pressure across the entire building is constant and the amount of air that leaves the room is equal to the amount of air which enters. For the thermal region j , a system with N thermal region, the thermal dynamics is modeled as a fast-dynamic and slow-dynamic. In the slow-dynamic, the temperature changes slowly while in the fast-dynamic variation, the temperature changes rapidly. T is the heater temperature, which is the input of the system. 1 j C is the heat capacity of components that has fast dynamics, such as air inside the j -room, and 2 j C is the thermal capacity of the components that are slowly moving, such as walls and ceilings exposed to sunlight.

Mathematical Description of the Thermal and Moisture Dynamics of the Building
To describe the heat transfer between rooms, the RC model is used as mentioned earlier.
Additionally, for simplicity, it is assumed that the pressure across the entire building is constant and the amount of air that leaves the room is equal to the amount of air which enters. For the thermal region j, a system with N thermal region, the thermal dynamics is modeled as a fast-dynamic and slow-dynamic. In the slow-dynamic, the temperature changes slowly while in the fast-dynamic variation, the temperature changes rapidly.
Equation (9) is fast-dynamic and Equation (10) is slow-dynamic. For all m j s , j = 1, 2, · · · , N the mass of air flowing into the j-room by the heater fan and T j s is the heater temperature, which is the input of the system. C j 1 is the heat capacity of components that has fast dynamics, such as air inside the j-room, and C j 2 is the thermal capacity of the components that are slowly moving, such as walls and ceilings exposed to sunlight. T j 1 and T j 2 are representing the temperature of the components with thermal capacity C j 1 and C j 2 . The room temperature is the same as the high dynamic temperature T j = T j 1 and T oa is the outside air temperature. N j is a collection of rooms located next to the jroom. R j oa the thermal resistance between the j-room and outside temperature, c p is the specific heat capacity of the room air, R j is the thermal Energies 2019, 12, 4805 9 of 24 resistance between C j 1 and C j 2 , and R ij = R ji is the thermal resistance between room j and room i in surroundings, P j d is not measured by the heat load which is caused by the room equipment and sun's radiation. S is the average amount of daily exposure to sun for the desired surface. Given the fact that the glass is reflective and covered inside by the curtain, this parameter can be ignored. T j s is considered as an input, and T j 1 as the system state [47]. The moisture balance of the room is calculated from the following formula: where V r is the room's volume (m 3 ), ρ is the air density (kg/m 3 ), w is the humidity ratio (kg/kg), V s is the volumetric air flow (m 3 /h), ACH is the air penetration rate (1/h), . m s is the humidity production rate inside the room (kg/h), and subtitles r, o, and s represent the indoor environment, external environment, and source, respectively [48].

Study of Physical Equations for Temperature and Humidity Governing the Room
According to Figure 6, the thermal dynamics of this room, as stated above, is written in the following form [49]: The state variable is used to control the humidity where * w e is the pressure equilibrium pressure in millibars, T is the dry bubble temperature in degrees Celsius, and P is the absolute pressure in millibar. A.L. Buck stated that the maximum pressure error is less than 0.2% at temperatures of −10 to + 50 °C. The vector [TT sw T nw T ew T ww T r ] is the state variables for temperature control, and Q is the temperature control input. In the following, the moisture dynamics of this room is written: The state variable is used to control the humidity w r and control input w s . In order to model the interference between humidity and temperature, the exponential equation of A.L. Buck [50] is used according to the following equation: e * w = 1.0007 + 3.46 × 10 −6 P (6.1121)e 17.502T 240.97+T (23) where e * w is the pressure equilibrium pressure in millibars, T is the dry bubble temperature in degrees Celsius, and P is the absolute pressure in millibar. A.L. Buck stated that the maximum pressure error is less than 0.2% at temperatures of −10 to + 50 • C. Now assuming that the pressure inside the room is constant, the effect of temperature changes on the equilibrium vapor pressure as follows: On the other hand, relative humidity can be calculated in this way [51][52][53]: where e w is the available water vapor pressure and e * w is the saturation water vapor pressure. As a result, we will have:

The Predictive Horizon, Horizons of Control and Constraints
The predictive horizon refers to the time when the system output is calculated by the MPC, while the control horizon indicates the length of time the control signal is calculated. The sampling time is the time during which the control signal remains unchanged. Typically, for processes in HVAC systems, the prediction horizon is between 30 and 60 min, the control horizon is 15 and 30 min, and the sampling time is between 5 and 10 min.
The control horizon is generally smaller or equal to the predictive horizon. The chosen horizon depends on the controlled process and its dynamics. For example, in many internal applications, the sampling time is 1 h due to slow process temperature variations. Using a smaller prediction horizon or faster sampling time can lead to problems in controlling performance due to the existence of delay in the temperature process. Using a longer horizon's prediction can result in an increase in computational time. In certain applications, the time horizon of the variable is also used. The constraints on input and output are considered as follows.
• State space prediction model: • Constraints to enforce: u min ≤ u(t) ≤ u max y min ≤ y(t) ≤ y max • Constrained optimal control problem (quadratic performance index): Constraints is considered for optimization as follow:

Cost Function
The cost function is based on the behavior of the system, and if the optimal cost can be explained by a Lyapunov function, it will contribute in stabilizing the system. For slow-moving systems (i.e., temperature processes), stability is not an issue, and one can choose any form of cost function. The multifunctional cost function describes performance, such as minimizing the energy usage of the HVAC system and maximizing the convenience of residents.
Maximizing comfort condition and minimizing energy consumption are two goals that imply to use weight matrices in the cost function. In the second-rate function, weighted matrices communicate between error detection and control efforts. The following or a combination of the following cost functions are widely used to control HVAC systems by MPC.
Weighting Matrix Since the occupancy of the environment is different throughout the day, as well as changes in the climate, these factors together represent the uncertain factors that the controller must control.
Where G is the weighting matrix of states and Z is the weighting matrix of inputs. Basically, if Z ≥ G, then the control effort will be more important than tracking. In other words, the designer allows the controller to ignore a lot of tracking errors in gaining less control effort. Weighting matrixes are considered for optimization as follow: Furthermore, considering that the MPC optimizes the cost function in each step with respect to the abovementioned constraints during the prediction horizon, YALMIP, which is a MATLAB-based modeling language toolbox for enforcing optimization, is used. The selection of the forecast horizon and the timing of sampling will affect the accuracy, cost of calculation, and response time of the MPC. Hierarchical and cascade controls are designed to handle both changes quickly and to overcome turbulence. Slow dynamics are monitored using a monitor level controller that uses a long-time horizon, such as a sample of 24 h and a slow sampling time is used as a sample of 1 h. Fast variable disturbances are controlled by local level controllers that use a short-time horizon as an example in the range of 30 to 60 min and from fast sampling as a sample of 5 to 10 min. In this section, results of simulation for the proposed controller related to office room with the thermal and moisture characteristics is presented using MATLAB software. To this end, firstly the convergent-integral controller is considered as a common controller in the industry. Afterwards, by using the MPC provided to simultaneously control the temperature and humidity the results are compared.

Proportional Integral Controller
Due to the presence of non-linear and non-deterministic factors, it is necessary to use an integral control to eliminate the persistent error. Despite the fact that this will reduce the margin of stability. In addition, the sampling time in the system is 45 s, while for MPC the time was increased by up to 10 min, which, due to the physical nature of temperature and humidity, is an appropriate number. On the other hand, it improves energy consumption and equipment depreciation. However, in the proportional-integral control, there is no possibility of increasing to such an extent that it creates instability. To simulate the proportional-integral controller, we created the block of Figure 7 in Simulink.

Proportional Integral Controller
Due to the presence of non-linear and non-deterministic factors, it is necessary to use an integral control to eliminate the persistent error. Despite the fact that this will reduce the margin of stability. In addition, the sampling time in the system is 45 s, while for MPC the time was increased by up to 10 min, which, due to the physical nature of temperature and humidity, is an appropriate number. On the other hand, it improves energy consumption and equipment depreciation. However, in the proportional-integral control, there is no possibility of increasing to such an extent that it creates instability. To simulate the proportional-integral controller, we created the block of Figure 7 in Simulink.

Results of Computational Experiments
The simulation was carried out with two sampling times of 1 and 45 s, and the results for the first time are presented in Figures 8-11 and the second time in Figures 12-15. As shown, in both cases, the controller provided the desired response. Permanent error for both outputs was zero. In Table 1, is provided System parameters and values.

Results of Computational Experiments
The simulation was carried out with two sampling times of 1 and 45 s, and the results for the first time are presented in Figures 8-11 and the second time in Figures 12-15. As shown, in both cases, the controller provided the desired response. Permanent error for both outputs was zero. In Table 1, is provided System parameters and values.                Figures 8,9 show the temperature and humidity trajectory tracing in the first scenario by the PI controller. Figure 10 shows control efforts that implied for tracking the desired temperature and   Figures 8,9 show the temperature and humidity trajectory tracing in the first scenario by the PI controller. Figure 10 shows control efforts that implied for tracking the desired temperature and  Figures 8 and 9 show the temperature and humidity trajectory tracing in the first scenario by the PI controller. Figure 10 shows control efforts that implied for tracking the desired temperature and humidity in the first scenario by the PI controller. Figure 11 shows states changes in the first scenario by PI. Figures 12 and 13 show temperature and humidity trajectory tracing in the first scenario by the PI controller. Figure 14 shows control efforts that implied for tracking the desired temperature and humidity in the first scenario by PI controller. Figure 15 shows states changes in the first scenario by PI.

Predictive Model Control
In this section, the results of the MPC are presented with a sampling time of 10 min. Figures 16-19 show different responses. The accuracy of the horizontal axis of these shapes indicates that responses were fast in comparison to PI. In this controller, the input was allowed to be changed every 10 min, so the volume of computation was less in comparison to the increase in the sampling rate. However, it made the output changes look more obvious than the desired amount. Due to the similar effect of interference, there were more control channels in this control. humidity in the first scenario by the PI controller. Figure 11 shows states changes in the first scenario by PI. Figures 12,13 show temperature and humidity trajectory tracing in the first scenario by the PI controller. Figure 14 shows control efforts that implied for tracking the desired temperature and humidity in the first scenario by PI controller. Figure 15 shows states changes in the first scenario by PI.

Predictive Model Control
In this section, the results of the MPC are presented with a sampling time of 10 min. Figures 16-19 show different responses. The accuracy of the horizontal axis of these shapes indicates that responses were fast in comparison to PI. In this controller, the input was allowed to be changed every 10 min, so the volume of computation was less in comparison to the increase in the sampling rate. However, it made the output changes look more obvious than the desired amount. Due to the similar effect of interference, there were more control channels in this control.     By comparing the results of MPC and PI, the following two findings will be extracted. Initially, by using MPC, the sampling time of the system could be reduced by about 14 times its dynamic slowness than PI. This reduces the amount of online computing, as well as the burnout rate of the operators and central processor. On the other hand, the MPC with the ability to estimate the future of the system dynamics that can result in high-precision tracking performance and lower volatility in the output. In addition, the control effort, due to its constraint as an optimization, was less than PI. It is worth mentioning that at first glance, the PI may have a better function than the interference channel, but it should be noted that this controller had a longer sampling time, hence the interference gradually in the channel, which is no longer visible in the interface of an integral part. In Table 2, the performance of PI and MPC is compared. As shown, by using the integrator and reduction of bandwidth, it is impossible to increase the sampling time to more than 60 s because of the fact that By comparing the results of MPC and PI, the following two findings will be extracted. Initially, by using MPC, the sampling time of the system could be reduced by about 14 times its dynamic slowness than PI. This reduces the amount of online computing, as well as the burnout rate of the operators and central processor. On the other hand, the MPC with the ability to estimate the future of the system dynamics that can result in high-precision tracking performance and lower volatility in the output. In addition, the control effort, due to its constraint as an optimization, was less than PI. It is worth mentioning that at first glance, the PI may have a better function than the interference channel, but it should be noted that this controller had a longer sampling time, hence the interference gradually in the channel, which is no longer visible in the interface of an integral part. In Table 2, the performance of PI and MPC is compared. As shown, by using the integrator and reduction of bandwidth, it is impossible to increase the sampling time to more than 60 s because of the fact that system will be unstable.

Conclusions
In this paper, due to the slow nature of the heat transfer and the presence of inoperative agents in the system dynamics and operators, MPC was used to control the temperature and humidity simultaneously and considered the interference between them.
The main results of the simulation and analysis are as follows: 1.
The presentation of the modeling strategy was done in a completely transparent and precise manner, and it was possible to extract it for all other buildings. Due to the presence of room humidity as another effective parameter to ensure residents' comfort, a dynamic model was presented to analyze the performance. Following that, the MPC structure was proposed to control the temperature and humidity inside the room with minimal trace error and control effort in the form of a multi-objective optimization problem; 2.
Simulation results were compared and proved that the performance of the MPC was improved. The MPC controller had a better transient response to control the temperature and relative humidity of the intake air and further increased in the presence of disturbances inside and outside the environment; 3.
During the setting of the low-flow-rate set point, the PI controller produced a slow response that required extra time to reach the setting point. For a high-flow rate set point, the PI response was high, resulting in an excessive gain from the adjustment point. In contrast, the MPC in both cases produced stable responses and reduced the time for the meeting to be faster and more efficient; 4.
The control effort employed by PI was bigger than the control effort generated by the MPC. By assessing the control signal generated by the PI and the probe control, it was observed that under low-load cooling loads, a large PI produced an oscillatory control signal that needed to be reset. In front of the MPC, a very soft control signal produced both low and high cooling conditions; 5.
The PI adjusted the region temperature individually in multiple building areas without exchanging information with neighboring controllers. However, the MPC considered the impacts of adjacent neighborhoods' interaction by providing predictions of these interaction impacts and relation to control decisions with adjacent controller. The MPC adjusted the level of comfort to the desired air-conditioning level that was appropriate for those in the areas with multiple occupations, while the PI maintained the desired thermal comfort with regard to the number of occupancies that increased in each area with failure. In order to control the temperature and humidity of the room, the MPC controller provided a much better performance over the PI; 6.
While the MPC used optimization rules at any time of the sampling, it will also be possible to increase the sampling time by up to 10 min, which will increase the lifespan of the operators and the processor. On the other hand, tracking accuracy was also higher in the MPC and was softly achieved with less control effort. The integrator correlator will require a great deal of control to achieve roughly similar tracking results; 7.
In future research, the amount of carbon dioxide produced in the room should be considered as another important factor in providing comfort condition for residents. Furthermore, future work should estimate the presence of people inside the room as a disturbance in the cost function and attempt to dispose these factors using multi-person tracking via UWB Radars.