MODELING OF DAILY TEMPERATURE MODE IN PREMISES USING A PREDICTIVE CONTROLLER

One of the main sources of power consumption worldwide is the use of power in both residential and commercial premises. Data show that nearly 40 % of total power consumption in the USA [1], and 40 % in the EU, account for the operation of residential and commercial buildings [2]. More than 66 % of current electricity consumption is utilized in residential, administrative and office buildings [3]. Depletion of natural power resources and increasing costs of their extraction and processing make most countries worldwide search for technologies, aimed at enhancing efficiency of using power, rather than on an increase in its production volume. In the countries of the European Union, approaches to reduction of power consumption and heat savings have been developed for 25 years. Over the past 15 years, demand for heat power decreased due to adoption of national laws, rules and administrative provisions that have been developed by the public authorities [2]. The project “Power strategy of Ukraine for the period to 2035” argues about a low level of power efficiency and predominance of power-consuming industries in its structure [4]. Until recently, the state and the society of Ukraine continued to operate by inertia of stereotypes about the existence of surplus of power resources. The state economic policy did not stimulate their effective use. 10. Alfaro, V. M. Simple Robust Tuning of 2DoF PID Controllers From A Performance/Robustness Trade-off Analysis [Text] / V. M. Alfaro, R. Vilanova // Asian Journal of Control. – 2012. – Vol. 15, Issue 6. – P. 1700–1713. doi: 10.1002/asjc.653 11. Kovrygo, Y. M. Method of design H∞-PID-controler for objects with delay [Text] / Y. M. Kovrygo, T. H. Bahan // Naukovi visti NTUU “KPI”. – 2013. – Issue 1. – P. 27–33. 12. Kovrygo, Y. M. Methods to ensure stability of control systems based on pi and pid controllers [Text] / Y. M. Kovrygo, T. H. Bahan, A. S. Bunke // Eastern-European Journal of Enterprise Technologies. – 2013. – Vol. 3, Issue 3 (63). – P. 58–63. – Available at: http://journals.uran.ua/eejet/article/view/14740/12518 13. Kovrygo, Y. M. Ensuring robustness in systems control of inertial heat power objects [Text] / Y. M. Kovrygo, T. H. Bahan, A. S. Bunke // Teploenergetika. – 2014. – Issue 3. – P. 9–14. 14. Kovrygo, Y. M. Designing control systems with controller based on internal model with two degrees of freedom [Text] / Y. M. Kovrygo, T. H. Bahan, A. P. Uschapovskyi // Eastern-European Journal of Enterprise Technologies. – 2014. – Vol. 4, Issue 11 (70). – P. 4–8. doi: 10.15587/1729-4061.2014.26307


Introduction
One of the main sources of power consumption worldwide is the use of power in both residential and commercial premises.Data show that nearly 40 % of total power consumption in the USA [1], and 40 % in the EU, account for the operation of residential and commercial buildings [2].More than 66 % of current electricity consumption is utilized in residential, administrative and office buildings [3].
Depletion of natural power resources and increasing costs of their extraction and processing make most countries worldwide search for technologies, aimed at enhancing efficiency of using power, rather than on an increase in its production volume.
In the countries of the European Union, approaches to reduction of power consumption and heat savings have been developed for 25 years.Over the past 15 years, demand for heat power decreased due to adoption of national laws, rules and administrative provisions that have been developed by the public authorities [2].
The project "Power strategy of Ukraine for the period to 2035" argues about a low level of power efficiency and predominance of power-consuming industries in its structure [4].
Until recently, the state and the society of Ukraine continued to operate by inertia of stereotypes about the existence of surplus of power resources.The state economic policy did not stimulate their effective use.
Housing and buildings resources are in poor condition.Low heat insulation capacity of buildings leads to significant losses of heat by consumers (in most houses, heat power losses reach 30 %) [4].
Thus, the problem of power saving cannot be solved without development of methods for power-efficient operation of buildings.
The relevance of the present work is in reducing the cost of heat supply to buildings and in an increase in the comfort of premises due to the application of the developed temperature control algorithm [5].

Literature review and problem statement
There are known algorithms, designed for the compensation of basic disturbance of temperature mode of buildings -outdoor air temperature [6].These algorithms are intended for using in central heating systems, that is why they lack specific thermal-technical characteristics of heated buildings.
Currently, the so-called weather-dependent temperature controllers are normally applied in practice [7].The task of these systems of control is to reduce heat transfer heating appliances to current heat losses of buildings.Two-position control or PI-controllers are additionally used in order to control indoor air temperature.
Control systems that implement pulse heating mode [7] are constructed by the principle of compensation of disturbance from the influence of outdoor air temperature.The period and off-duty ratio of supply of estimated water consumption are fitted so that the power of a heating system should equal heat losses of a building.
The most widely used power-saving methods include the following ones: heating and heat storage in a reservoir with water [8], decreasing the temperature in a building on days-off [9], control of heating, ventilation and air conditioning [10,11].
Control is additionally carried out with the use of controllers, for example, a classic PID-controller [12], a non-linear controller [13], a robust optimal controller [14], an optimal controller [15], and predictive control [16].Similar controllers are designed to compensate for a control error and do not consider the character of an object of control.
A special class includes controllers, based on fuzzy logic [17], control with the use of neural networks [9], and genetic and evolutionary algorithms [18].These controllers set the task to train the system to react to temperature changes in premises, using experience of an expert.In addition, to predict power consumption and to control heat supply, adaptive controllers with fuzzy logic [19], adaptive neural networks [9], and adaptive PID-controllers [17] are used.
However, despite the diversity of methods for controlling thermal objects, they failed to create a standard unified model of premises/a building, taking into account all contributing factors.To construct a model and to design a controller, a large amount of funds, resources and time are spent.
There is no clarity on which of the developed methods will be optimal for a particular building in terms of costs and saved resources.It is also important that the constructed predicting models do not take into account the number of people in the premises, working hours, and where it is possible to save thermal resources.

That goal and objectives of the study
The aim of the present research is to simulate the daily state of the premises of an office building with the use of the method of PWM predictive control [5] for temperature control in the premises.
To accomplish the set goals, the following objectives were to be solved: -to develop a computer model of premises for studying thermal processes; -to obtain original data for designing a predictive controller; -to carry out the experiment in order to design a predictive controller; -to compare obtained results with the known methods of control.

1. Preparation to modeling
In the field of heat supply, the optimization problem has its specific features: high dimensionality, integral criterion of quality and restrictions, incomplete information about parameters of thermal mode of buildings.Heat supply objects are influenced by disturbances (both internal and external).Under real conditions, it is also necessary to take into account severe restrictions on power and economic resources.That is why, effectiveness of optimal solutions, for example, as for economic criterion of minimum of thermal power, turns out to be problematic.
In accordance with general principles of controlling complex systems, solution for the global optimization problem of heat consumption requires computer modeling.
To implement modeling of heat distribution in the premises, the software ANSYS Fluent is used.This program is intended for solving linear and nonlinear, stationary and non-stationary heat transfer and heat exchange problems.
To solve the problem of control over heat supply inside the premises, it is necessary to make measurements on a real object (Fig. 1) and create a full 3D model of the required part of a building, taking into account the internal geometry of premises, rooms and partitions.
Then, using tetrahedra or hexahedra, we split the constructed geometric model into a finite number of elements, in order to simulate processes, taking place in the model, not for the whole system, but rather for each element separately.
Next, boundary conditions are assigned, taking into account all factors affecting temperature in premises: solar radiation, heating system, artificial lighting, number of people in the premises, ventilation air, and outside air temperature.(1<k<∞); ΔT i is the temperature increment at the i-th point; Q is the power of heat flow; τ k is the duration of the k-th pulse.
For thermal fields, superposition principle holds, at which a change in temperature of an object is equal to the total of changes in temperature resulting from each heat flow (if there are several of them).Consequently, any controlling effect with a constant amplitude of the input signal Q can be represented as a set of PWM functions, and the power of heat flow can be regulated by changing pulse duration.That is why, when influencing a heat flow object, which has the form of PWM function, with the help of an array of coefficients η i,j,k it is possible to calculate the temperature of an object at any point in time, multiple to τ.
Control over a thermal object is implemented as follows.At the initial moment of time, increment codes of heat flows are nulled, heat transfer coefficients for controlling the thermal field η i,j,k are calculated according to previously recorded transitional characteristics.
After running the system of programming control, there starts calculation of a predicted change in temperature of an object relatively to initial temperature T 0 for each of n points.To calculate the magnitude of controlling influence, particularly pulse duration, which over time τ will bring an object to the point, assigned by the program, it is necessary to calculate at what point will be the temperature of an object before the next time interval t=τ•r, using formula: where p , ∆ i r T is the estimated predicted change in the tem- perature of an object in the i-th point at the end of the r-th interval of time, influenced by total heat flow from all heaters, brought to the moment of time t=τ•r; Q•Δτ j,r is the increment of heat flow by the beginning of the r-th interval of time; is the increment of temperature of a sensor, caused by increment of heat flows of all p heaters, for which the time of transitional processes is over and coefficients η i,j,r do not change and are equal to is the increment of temperature of a sensor, caused by increment of heat flows of all heaters, for which the time of transition processes is not over; η i,j,m is the corresponding coefficients of heat influence transfer for controlling the thermal field at moment of time r; m, r are the numbers of time intervals.
Next, vector of estimated temperature is compared with the vector of temperature, assigned by the program.Vector of difference with the corresponding sign is calculated from formula: where { } z r T ∆ is the vector of increments of temperatures, assigned in the program.
Difference code is equal to: where { } is the vector of increments of measured temperatures.
Thus, the total vector of predicted errors of controlling influence mismatch is calculated by formula: .
For time moment k=1 and provided temperature at all points of space does not differ from T 0 , { } { }, because other components (5) are equal to zero.
For temperature at all points n of the thermal field to be equal to temperature, assigned by the program from the beginning of the r-th interval of time till its end, it is necessary to bring the heat flow, which will cause a change in temperature equal to magnitude of error at all corresponding points.
However, each point of the field is affected by all p heaters simultaneously.That is why for the i-th point of space (1<i<n), this change must satisfy equation: The number of such equations is equal to n.That is why the value of increments in heat flows for each p heater is calculated by joint solving of the system of equations: or in matrix form: where { } ∆ is the matrix column of temperature increments at the end of time interval τ, containing n elements; { • } ∆τ n Q is the matrix line of increments in heat flows at the beginning of time interval r that compensate corresponding temperature increments, containing n elements, within time τ.
Next, values of heat flow increments for each p heater are calculated by formula (9): After calculation of values of pulse durations ΔQ j , these values are substituted into system of equations (7), solution of which gives the value of increments of complete heat flow Q j of the heaters.
Under the influence of heat, brought to an object, its temperature changes by ∆ .

Z i T
After writing the temperature change code, the system starts to calculate values of controlling influence for time interval from t=τ•r to t=τ•(r+1) The calculation process is resumed once the r-th interval of time finishes.

3. 2. Obtaining transitional characteristics of influence of outdoor air and ventilation
The premises are an object, complicated in structure, with distributed parameters.The microclimate of premises must meet special requirements for temperature and air hu-midity, operation modes of ventilation and heating systems.Before construction of a predictive controller, it is necessary to determine the factors that influence temperature in the room.These factors may include: -solar radiation; -heating system; -artificial lighting; -number of people in the premises; -air ventilation system; -temperature of outdoor air.
For modeling, we will take account the factors with the greatest influence on indoor temperature, such as the heating system, ventilation, and outdoor air temperature.
Initially, in order to construct the model of premises, we will define the influence of outdoor air temperature on indoor temperature when a heater and ventilation are switched off.Fig. 4 shows dependence of temperature with initial temperature of +10 °C from outdoor temperature, while Fig. 5 shows dependence of indoor temperature with initial temperature of +15° C from outdoor temperature.5), we will calculate the reaction of the control object to changes in outdoor air temperature by a magnitude of +5 °C, +10 °C and +15 °C.For this purpose, it is necessary to perform subtraction of curve 0 °C from temperature curves +5 °C, +10 °C, +15 °C.The obtained result is shown in Fig. 6.
Obtained characteristics (Fig. 6) indicate that the influence of outdoor air temperature in the premises does not depend on current temperature and is determined only by thermo-physical properties of a control object.
After that, we obtained transitional characteristic of the control object when the ventilation was switched on with air temperature equal to 18 °C, at outdoor temperature equal to +20 °C and initial temperature +15 °C.According to superposition principle, to obtain the influence of ventilation, it is necessary to subtract influence of outdoor temperature from final result (Fig. 7).Obtained characteristics (Fig. 4-6) indicate that the impact of outdoor temperature on temperature in premises has the character of a stepwise function.That is why, in order to construct a predictive controller, it is necessary to obtain transitional curves from -10 °C to +10 °C with the step of 1 °C.These curves can be obtained by using the interpolation methods.

3. 3. Obtaining of transitional characteristics of a heater
At the next stage, it is necessary to obtain transitional characteristic of the heater.
At assigned outdoor temperatures of -10 °C, -5 °C, 0 °C, 5 °C, 10 °C, transitional characteristics of premises when a heater is on, were obtained (Fig. 8).Obtained transitional characteristics (Fig. 8) indicate that influence of the heater on indoor temperature does not depend on outdoor temperature and operating ventilation.
Thus, it is enough to obtain acceleration curves under the influence of any outdoor temperature.Due to this, the number of coefficients that are necessary to store in the memory of the temperature controller decreases.
Time, equal to t pr =480 s was selected as a prediction period.Discretisation period τ was selected equal to dead zone of the object τ d =30 s (Fig. 1).The next step was to divide the period of pulse prediction t pr into n equal intervals τ.
Then, it was necessary to obtain reactions of the control object to pulses with duration i•τ, where i∈ [1; n].
Dependence of indoor temperature increment on the time of the heater that is turned on is shown in Fig. 9.

Fig. 9. Influence of durations of a heater that is turned on on indoor temperature
Next, using formula (1) for the heater power equal to 1.75 kW at moments of time that are multiples of τ, corresponding proportionality coefficients were calculated [21,22].

Results of application of the PWM predictive controller to control indoor temperature
Administrative and office buildings are specialized objects with a non-shift working schedule.A working day, including a break for a one-shift enterprise, lasts 9 hours.For the rest of the time, as well as during weekends and on public holidays, there are no employees in the premises, and subsequently, maintaining of comfortable temperature indoors is not required.
To conduct modeling using a PWM predictive controller, we will assign the following conditions: -outdoor temperature (air temperature outside) changes from -7 °C to + 5 °C depending on the time of the day; -initial indoor air temperature is +10 °C; -daily temperature mode indoors is: from 00:00 to 08:00 +10 °C, from 09:00 to 17:00 +18 °C, from 18:00 to 00:00 +15° C; -air ventilation is turned on 24 hours a day.
To implement the proposed method of PWM-control with prediction [5,21,22], macros (udf file) was written in environment ANSYS Fluent in language C.This macro includes formula (2)-( 9), coefficients of thermal effect transfer of the heater, calculated according to formula (1), as well as transitional characteristics of outdoor temperature and a ventilation system.
For the selected point in the premises with coordinates (1.72; 0.9; 1.645) m, at assigned original and boundary conditions, we modeled maintaining the assigned temperature (Fig. 10).For a more qualitative assessment of the obtained results using a method of the PWM predictive control, it is necessary to compare this method with those most widely used: a two-position control with hysteresis of ±2 °C, a two-position control without hysteresis, and a PID-control.For this purpose, we will repeat the experiment under the same boundary conditions.Results of modeling are shown in Fig. 11-13.To calculate coefficients of the PID-controller, we used the Ziegler-Nichols method.Employing it, the follow-  On -operating time of the heater, T out -outdoor air temperature

Discussion of results of transition from a continuous control over heat supply to premises to the predictive controller
To compare effectiveness of operation of the controllers, the following criteria are used: measurement accuracyproximity of obtained result to the assigned one, total operation time of the heater and, consequently, saving of power resources.
Table 1 shows results of modeling errors.Table 1 shows that a PWM method of predictive control demonstrated the highest accuracy of control.The two-position method with hysteresis equal to ± 2 °C, which due to the thermal inertia of the heat object exceeds the assigned temperature in the premises, proved to be the most inefficient.
Resulting accuracy of the predictive controller is explained by the fact that in contrast to other considered controllers there is a model of the control object in its composition.This model is constructed based on the results of field studies.This allows us to take into account behavior of an object under the influence of disturbing factors and to predict behavior of the object with generation of more precise controlling influence to compensate for control errors.
There is a possibility to enhance control accuracy through increasing the number of intervals of predictions, decreasing a prediction period and a step of modeling.However, resources of the controller impose restrictions in the construction of the controller.A decrease in a step of modeling leads to an increase in the number of finite-difference equations, which a system must solve at assigned resources of the computer.An increase in the number of prediction intervals leads to an increase in the number of coefficients that are involved in the prediction calculation and are stored in the memory of the controller.
Table 2 shows the total time of the heater, which is turned on, within 24 hours.Results in Table 2 show that due to the proximity of the assigned value to real temperature, a two-position controller without hysteresis increased frequency and operating time of the heating element.Methods of the PID-controller and the predicting controller showed approximately the same results.
In 2017, the cost of 1 kW of electric power is UAH 1.68 or USD 0.0618 (at the exchange rate of hryvnia at UAH 27.2 per USD 1), at consumption of above 100 kW per month.Power of the heater is 1.75 kW.
Based on the total operating time of the heater, the heater power and electricity costs, the costs of heating premises for daily and monthly modes are summarized in Table 3. Results, shown in Table 3, are calculated for buildings and premises with one-shift mode of operation.

Costs of heating the premises
One of the unsolved problems is the selection of location of the temperature sensor.In this paper, modeling was performed for the temperature sensor, located at the point with coordinates (1.72; 0.9; 1.645) m.This point was located near the heater and time of transportation delay was 30 s.
Under real conditions, the specified location is easily accessible to a person who can bring distortion into operation of the controller through direct contact with the temperature sensor.
That is why there is a problem of finding a point in the premises, at which it is necessary to mount the temperature sensor without losing temperature control accuracy, with excluding any direct contact of a sensor with a person.The premises must be considered from the position of an object with distributed parameters, and temperature should be maintained in the premises as a whole, rather than at a particular point.
In the future, it is planned to conduct modeling of the thermal state of premises, taking into account personnel that is in and operating equipment.However, there is a problem of adequate modeling of human behavior as a moving heat source, because human behavior and the number of people in the room are random magnitudes.

Conclusions
1.A simulation model of premises was constructed in the ANSYS Fluent programming environment based on measurements on the real object and the method of finite elements.For this model, we applied the algorithm for controlling a temperature field using the PWM predictive control.Effectiveness of the controller is guaranteed when all disturbing factors are used in the model and at selection of prediction period, which does not exceed the time of transitional processes with discretization period, equal to time of transport delay.
2. A formalized description for the method of PWM predictive control was presented.Based on the factors, affecting indoor temperature, a mathematical model of the controller was constructed.This model allows us to apply the algorithm of temperature control to a real object and compare results with the results of modeling.The developed method was subsequently developed by including information about the heaters, for which the time of transitional processes was over.
3. We carried out modeling of operation of the predictive controller for maintaining the assigned daily temperature mode.The maximum absolute error in temperature control was 0.5 °C.The magnitude of this error is an acceptable result for unstable thermal conditions.Results of modeling revealed the possibility of increasing accuracy of control by increasing the number of prediction intervals, decreasing a prediction period and a modeling step.Results of modeling also allowed us to formulate new objectives for a temperature sensor location and to model a person's position in the premises.
4. We compared the developed method of PWM predictive control and continuous control, two-position and PID-control.Refusal from continuous control and transition to the predictive controller demonstrated a decrease in operating time of heating equipment by 2.3 times from 24 to 10.5 hours.The method of a two-position control with hysteresis equal to 2 °C is the worst of the considered controllers for maintaining assigned temperature with maximum absolute error of result of 1.2 °C.

Fig. 8 .
Fig. 8. Transitional characteristic of the control object when the heater is on

Fig. 10 .
Fig. 10.Results of the experiment applying a method of the PWM predictive control: T in -temperature at the set point inside premises, Heater On -operating time of the heater, T out -outdoor air temperature

Fig. 11 .Fig. 12 .
Fig. 11.Results of experiment using a two-position controller without hysteresis: T in -temperature at a given point inside premises, Heater On -operating time of the heater, T out -outdoor air temperature coefficients of PID-controller were obtained: Kp=35; Ki=0.01;Kd=0.

Fig. 13 .
Fig. 13.Results of experiment using a PID-controller: T in -temperature at a given point inside premises, Heater On -operating time of the heater, T out -outdoor air temperature

Table 2
Total operating time of the heater