Heat demand model for district heating simulation

Demand for affordable and sustainable energy is growing. Even though the technology of construction and insulation of buildings is continuously improving, heating is still a significant issue for large part of Europe. Building modern heating systems as well as upgrading existing ones requires incorporating new technology and smart control systems with sophisticated control algorithms. An essential part of the control systems are models that allow the simulation to verify proposed actions or use series of simulation experiments to find the optimal solution. Several simulation tools are specializing in the field of energy already, and some general tools can also be used. This article shows two methods of own prediction mechanism of the heat demand of individual consumers (buildings). Modelling of individual buildings is the basis of the simulation model of district heating which is being developed. The fundamental idea is to build a modular model for specific district heating and start from the endpoints from the individual consumption objects that will be interconnected through the distribution model with other parts of district heating system such as other consumers and producers. It is assumed that the heat demand is the most challenging part of the prediction, and therefore the accuracy and quality of these models will be the most significant to the accuracy of the entire future result.


Introduction
District heating and cooling systems (DHCS) are relatively large energy consumers, especially in countries geographically located in areas where colder periods occur when the outside temperature drops to values that are difficult for humans without heating to live in or it is not at all possible. In the context of the current situation where the requirements for energy consumption in general are rising, and with the prospect that classical resources are limited, the solution is, on the one hand, to use conventional resources as efficiently as possible, and on the other hand use more alternative resources, especially renewable. Of course, these requirements also affect DHCS by: -to use the energy produced most efficiently, i.e., to minimize its losses, -by changing the structure of the DHCS to achieve more significant use of alternative sources. This requirements dramatically affects the management of the entire DHCS, and the inclusion of these new trends leads to new approaches and the use of modern methods for creation and use of DHC control system [1].

Heat demand models
The article shows a partial output of the project, which aims, among other things, to prepare a heat flow model for district heating system. Such a model will consist of modules (sub-models) of heat sources, distribution system, and consumers. The article will deal with the preparation and verification of the consumption model.
The expected goal of such consumption model is to offer the most accurate prediction of heat demand for a given consumption object.
For optimal heat source operation, especially CHP plant, the ability to predict the heat demand is necessary. In the past many methods have been proposed for heat demand prediction (forecasting): • ARX models [2], • Box-Jenkins [3], • SARIMA [4], • Neural networks [5,6], • Machine learning [7,8], • Particle Swarm Optimization [9]. ARX, Box-Jenkins, and SARIMA belong to the class of statistical methods with the main benefit being the linearity of the model. Many researchers use neural networks for modelling the nonlinearity of heat demand temperature dependence. Another large class of methods are methods using the machine learning technique to identify patterns in the heat demand.

ARX model of the heat demand
As mentioned earlier, the ARX model is used for modelling and prediction of the heat demand. The ambient temperature is measured at the location of the producer or consumer. The ambient temperature together ( −1 ) and ( −1 ) are polynomial with respect to the backward shift operator −1 and defined by the following equations: The important characteristic of the model is its linearity in all estimated parameters. The output signal y is the heat demand, and u stands for an input signal which is ambient temperature. The output can be written The above formula provides a direct description of one-step-ahead prediction. The parameters of polynomials ( −1 ) and ( −1 ) can be chosen so that the model fits data as much as possible in the least squares sense. The polynomial ( −1 ) of na order is the complete set of estimated parameters related to the AR part of the ARX model. This part of the model captures the social behavior of the consumers. The influence of the ambient temperature is described by the parameters of the polynomial ( −1 ).
In the calibration phase, the regression vector contains the historical measurements of the ambient temperature. Once the model is calibrated, it can be used for simulation and prediction and forecasted ambient temperature provided by any meteorological model is used instead of the historical data in the regression vector.

PSO model
The second approach is an iterative model whose parameters were searched by the optimization algorithm PSO. The Particle swarm algorithm (PSO) [10,11] was chosen as the numeric optimization algorithm suitable for problems without the explicit knowledge of the gradient of the function to be optimized. Traditional PSO (TPSO) should be written in this form: where: represents the particle index i = 1,2, … , NP represents the number of particles in swarm, d represents the dimension index = 1,2, … , represents the dimension of the solution space, represent the index of iteration, ( ) represents the particle position, ( ) represents particle velocity ( ) represents the particle best position, ( ) represents the swarm best position, represents the inertia component, The particle velocity is limited to where: is the maximum particle velocity.
The number of particles NP is usually set at two times more than the dimension .
The implementation of PSO algorithm approximates the heat demand as follows and under these conditions: The proposed version of the algorithm does not take into account other consumption than the heating, e.g., energy to prepare hot tap water.
The measured parameters are heat demand, outdoor temperature, and supply temperature on the primary side of the heat exchanger. Given parameters are required plus maximum indoor and secondary side supply temperature. The calculated parameters are indoor temperature and the output temperature of the heat exchanger secondary side. The algorithm is based on the balance of the temperature loss according to the outdoor temperature (8) and the indoor temperature gains (10) from secondary supply temperature. Similarly, the updated secondary side temperature (13) and heat load (14) are calculated using the difference between required and actual secondary side temperature multiplied by the difference between the primary side supply temperatures and decreased secondary side supply temperature.
Producer Heat Exchanger where: represents the decreased indoor temperature, represents the indoor temperature, represents the outdoor temperature, represents the secondary side supply temperature, ∆ represents the secondary side temperature difference, represents the required indoor temperature, represents the maximum indoor temperature, represents the secondary side supply temperature, represents the decreased secondary side supply temperature, ∆ represents the primary side temperature difference, represents the required secondary side supply temperature, represents the maximum secondary side supply temperature, represents the primary side supply temperature, represents the head load, 1 represents the indoor temperature loss coefficient, 2 represents the indoor temperature gain coefficient, 3 represents the secondary side temperature loss coefficient, 4 represents the secondary side temperature gain coefficient, 5 represents the head load coefficient.

Real data prediction results
Both models were tested for accuracy in prediction of future heat demand. The data source was selected location in the Czech Republic. This article will show the results of prediction for two selected apartment buildings -examining the January 2018. In detail, the course of two days (23rd and 24th January) will also be shown.

Conditions for the experiment
Both buildings are of the same construction, size, and they are also located close together. Even though the houses are identical, heat demand behavior is different. The total amount of heat consumed during the day is similar, but the time course differs. The main reason is that the control system of the first building, unlike that in the second building, is set for a pronounced overnight temperature setback. This intervention leads to lower heat demand at night but causes a significant jump in heat demand at the moment, when the setback mode turns into ordinary, can be seen in Figure. 4.
The source for the forecast of the ambient temperature was Yr.no (Norwegian weather forecasting).
For ARX model, the regression vector contains historical values of ambient temperature and heat demand from the previous three days with a sampling period of 15 minutes ( na,nb = 3*24*4). The regression vector was limited to historical values from the previous three days as no further improvement in prediction accuracy was achieved with the regression vector with data from longer period.
The ambient temperature during the reference period (January 2018) is shown in Figure 2. Figure 3 shows the ambient temperature in a more detailed period (The period for which the prediction was evaluated in more detail -January 23-24. 2018).   Table 1 shows the total heat consumed in the selected building during January compared to the heat obtained from the individual prediction models. In this overall view, it may seem that the results are excellent.  Table 2 shows the sum of heat demand in day period for the days analyzed in more detail in next text. The results for the whole month are however just a basic observation of the quality of the model. Also the results for the day period show quite higher error, but they are still more than good.

Experiment results
To evaluate the usefulness of the methods for the application in whole district heating simulation means to examine the compliance in a much shorter period -the model must capture the heat demand in the different periods of the single days. Such detailed view is shown in Figure 4 and 5. The images show how both models are able to predict day course of heat demand. As already mentioned, the detail view is created from January 23rd to January 25th.

Evaluation of results
The following common criteria were used to evaluate the quality of the prediction.
where: ̂ depict the predicted value, presents the measured value, and N indicates the total number of samples. ̅ is the mean value of evaluated, measured values. The normalized (percentage) mean absolute error does not go too well, but in a visual comparison of predicted and measured data (especially ARX model) the result seems fairly satisfactory.
For practical use from the heating plant point of view, it is not necessary to monitor the variance of each sample (specimen 15 min. period), but more important is, for example, the accuracy of the consumption estimation in the hour period. The course of the error in the hour period is shown in Figure 6 and 7.

Conclusion
Heat demand modeling and the ability to predict it is significant for effective planning and optimization of heat production and distribution. In production planning, it is important to realize in which time frame (resolution) it is meaningful to work. As the results presented in this article have shown, it is more difficult to predict behaviors in short periods, but with the widening of the time window the stochastic behavior is compensated, and the accuracy of the prediction increases. In this direction, further research will be undertaken -the suitable length of the time period for which the DHC model will be discretized will be sought.
This article showed two methods of heat demand prediction presented for two residential buildings. The ARX model showed better results on the presented data, but unlike the PSO model, ARX does not offer much room for modification. For example, for the consumers where the heating mode is not periodically clear to the exact time or outside temperature, the quality of the result will be significantly worse than the present courses.
For the next stages of the district heating model development, it is advisable to continue work with more models (methods) and, if appropriate, use the one with better results for a particular consumer. A suitable prediction method for each type of consumer (residential houses, schools, offices,...) will be sought and applied in other parts of the DHC model.