Energy Saving Control of District Heating System Based on MATLAB

In order to oset the lag and delay in the heating process and solve the problem of excessive heating in the heating season, an energy-saving control method of district heating system based on MATLAB is proposed. Based on MATLAB/SIMULINK software, the simulation model of district heating system is established to study its dynamic characteristics. e short-term load forecasting method is introduced to guide the system to conduct centralized regulation and observe the dynamic response of indoor temperature and operating energy consumption. Compared with the constant water supply temperature and the outdoor temperature compensation method, the results show that the proposed method can reduce the indoor temperature uctuation range to 20± 1°C, and the energy saving rate of the whole heating season can reach 14.5% compared with the conventional regulation method.


Introduction
With the rapid development of the construction industry [1], the proportion of building energy consumption in the total social energy consumption has reached more than 27.45% in recent years, and the proportion of heating energy consumption in northern cities and towns is as high as 36%. However, at present, the problem of excessive heating in China's heating season is quite serious [2], resulting in the actual heating consumption of buildings in China exceeding about 35% of the average building heat demand, and the building energy consumption is 2∼4 times that of some Nordic countries at the same latitude. Jiachen et al. [3] aimed at the mismatch between heat supply and demand, in order to study the feasibility of nuclear intermittent heating, taking the 49-2 pool heating reactor as the research object, based on the MATLAB/SIMULINK software platform, the pool reactor heating system simulation model is established by using the lumped parameter method, the room heat load is calculated and modeled by using DeST software, and the model is veri ed by using the test data. However, the whole system operates under the outdoor temperature unchanged and without regulation. e dynamic response of the system under di erent regulation schemes is not explored. In order to better guide the energy-saving and e cient operation of the heating system, many scholars at home and abroad have made relevant research on heat load forecasting. Lisiqi and Jiang [4] and others proposed the method of building a prediction model for the heating load based on a BP neural network optimized by a di erential evolution algorithm. Zhang et al. [5] proposed an SVR heating load prediction model based on the genetic algorithm by analyzing the parameters that a ect the performance of the support vector regression machine. Combined with outdoor meteorological parameters and the heat demand of end users, the heat supply of the heat exchange station is regulated through heat load prediction [6,7]. In addition, there are state estimation method and time series method [8,9], which can achieve the prediction accuracy. However, the mechanism and programming are complex, and they are not widely used in the heating automatic control system. erefore, this paper uses computer simulation technology to study the dynamic characteristics of the heating system under di erent regulation schemes. By establishing the heating mathematical model and simulation model, the heating regulation is realized based on the short-term load forecasting results. Simulation results show that the proposed method reduces heating energy consumption and improves energy efficiency.

System Mathematical Model
Taking the directly connected district heating system as an example, the whole system is divided into four parts: heat source, heat network, radiator, and building area. Based on the mass and energy conservation formulas of the four parts, the mathematical models of each part are established by using the heat capacity particle system method.

Boiler Model.
Ignoring the heat dissipation from the boiler to the outside, the mathematical model is established according to the fact that the hot water storage heat contained in the boiler is equal to the net heat supplied to the boiler through fuel combustion minus the heat required for heating the makeup water and circulating water of the heat supply network, as shown in formulas (1) and (2), where the lower corner symbol "boiler" represents the boiler, makeup represents the makeup water, dw represents the heat supply network, and r represents the return water.
where C represents heat capacity, J/°C; T represents temperature,°C; u represents control parameters; Q represents design heat load, W; G fuel，max represents rated fuel consumption rate of boiler, kg/s; h fuel represents calorific value of fuel, J/kg; η represents thermal efficiency; c w represents specific heat capacity of water, J/(kg·°C); G represents flow, kg/s. rough the above formula, the boiler mathematical model can be obtained.

Heat Supply Network Model.
Assuming that the pipes and insulation materials are uniform, ignoring the heat storage in the insulation layer, a mathematical model is established according to the relationship that the heat stored in the n pipe section is equal to the transmitted heat of the upstream pipe section minus the heat dissipation loss and leakage loss of the n pipe section, as shown in formula (3), where the subscript n represents the pipe section number, leak represents the leakage loss, and soil represents the soil.
where L represents the length of the pipe section, m; K represents the heat dissipation coefficient of the pipe section, W/(m·°C). rough the above formula, the mathematical model of the heat supply network can be obtained.

Radiator Model.
Ignoring the heat storage of the radiator pipe wall and the axial heat storage of the fluid, a mathematical model is established according to the fact that the heat supplied by the heating pipe network to the radiator minus the heat supplied by the radiator to the room is equal to the net heat obtained by the hot water in the radiator, as shown in formula (4) [10], where the lower corner mark heat represents the radiator.
where q represents heat dissipation, W. rough the above formula, the mathematical model of the radiator model can be obtained.

Enclosure Structure
Model. e engineering physical model simulated in this paper is four residential buildings with a total heating area of 74880 m 2 . When modeling the building envelope, the air in each building is first regarded as a temperature node, then the ground, roof, and wall are divided, respectively, and the dynamic balance formulas of different material layers and corresponding simulation modules are established. Finally, the heat loss calculation formula (5) of the building envelope is obtained by comprehensively considering the heat loss of the building's outdoor heat dissipation and cold air infiltration, in which the lower corner zone represents the simulation area, wall, roof floor represents an exterior wall, roof, and ground, respectively, in represents indoor air, out or 0 represents outdoor air, glass represents glass, and solar represents solar radiation.
where A represents area, m 2 ; h represents convective heat transfer coefficient, W/(m 2 ·°C); ρ represents density, kg/m 3 ; n k represents ventilation times, times/h; V represents volume, m 3 . rough the above formula, the envelope model can be obtained.

Indoor Temperature Model.
According to the formula that the heat provided by the radiator plus the solar radiation heat obtained through the outer window minus the heat consumption of the enclosure structure equals the indoor air heat storage, the indoor temperature mathematical model is established, as shown in formula (6), where the lower corner z represents the simulation area.
According to the calculation result of formula (6), the indoor temperature change can be obtained.

Simulation Model Establishment
2.5.1. eoretical Basis. MATLAB is a simulation software integrating numerical processing, mathematical modeling, dynamic simulation, and signal processing [11,12]. MATLAB has launched the dynamic system modeling and simulation software package "SIMULINK" for interactive operation.
e emergence of the SIMULINK software package greatly facilitates the modeling and simulation of dynamic systems and frees researchers from the complicated coding work. Using the unique modular operation of SIMULINK, the dynamic system is modeled, and users can more intuitively conduct system modeling and simulation.
SIMULINK is widely used not only in the modular modeling and simulation environment but also as a powerful simulation tool with universal applicability. It can be used to simulate and realize linear and nonlinear, continuous and discrete, or mixed dynamic systems. It is very suitable for process control simulation. e SIMULINK module library is divided into 16 submodule libraries according to functions: common simulation module library, continuous system module library, nonlinear system module library, discrete system module library, logic operation and bit operation module library, mathematical operation module library, signal attribute module library, simulation receiving module library, simulation input source module library, user-defined function module library, etc. ese existing module libraries provide users with rich modeling resources, save a lot of repeated programming time, and devote more energy to model building and simulation debugging, which improves work efficiency.
According to the mathematical models of the district heating system established in 1.1∼1.4, the forms of mathematical equations between some nodes are the same, which provides great convenience for the establishment of simulation models. It only needs to establish models for mathematical equations of the same form, which will greatly reduce the workload of establishing simulation models. e main task of this section is to establish a "general simulation module" through SIMULINK.

Establish Simulation Model of District Heating System.
e simulation modules corresponding to the above mathematical models are established in the MATLAB/ SIMULINK software environment, and the modules are combined and connected based on the actual engineering physical model to obtain the simulation model of the whole district heating system, as shown in Figure 1.

Unadjusted Model.
In order to better compare the energy consumption of the direct connected heating system in the process of system operation guidance by the conventional regulation method and the regulation based on the prediction method, the heating system simulation model under the constant flow and constant water supply temperature operation scheme is first established; that is, the parameters u b and u dw controlling the gas consumption and the relative flow are fixed values. On this basis, the energy consumption of the following two regulation scheme models is compared.

Outdoor Temperature Compensation Regulation Model.
Adjusting the water supply temperature at the heat source according to the outdoor air temperature is a commonly used heating control method at the heat source of the district heating system. e quality regulation method of changing the flow in stages is adopted [13]. e circulating water flow is divided into two stages: 100% and 80% based on the outdoor temperature of −5°C. e corresponding relationship between the supply and return water temperature and the outdoor temperature conditions is shown in Figure 2.

Regulation Model Based on Load Forecasting.
is section mainly introduces the comprehensive outdoor temperature t w,i,e , which combines the average temperature in the next four hours, the first 24 hours, and the first 25 to 48 hours, and obtains the linear relationship between the building heat load and the comprehensive outdoor temperature based on the least square method [14]. e results obtained by data mining are used to advance the adjustment operation parameters, in order to obtain a simple and easyto-operate operation adjustment scheme suitable for the practical application of the project. Finally, the expression of comprehensive outdoor temperature and predicted heating load is obtained as follows: where t w,i−n is the average temperature corresponding to the three time periods, and Q i is the predicted load. In the operation regulation, the design heating load Q ' can be Mathematical Problems in Engineering 3 obtained by substituting the indoor heating design temperature into formula (7). e ratio of predicted load to design load is the relative heating load ratio Q, which meets the following formula: Finally, a modified comprehensive quality regulation method [15] is selected; that is, when the heat load is large, it is quantity regulation, and when the heat load is small, it is quality regulation. Combined with the above formula and regulation strategy, the operation regulation curve of the heat supply network can be obtained, as shown in Figure 3.
In the process of regulation, if the calculated load ratio is used to predict the heating parameters in the next four hours, the regulation action can be made in advance, so as to offset the mismatch between supply and demand caused by the large lag and delay of the system.

Simulation Results and Analysis
In the simulation test, the constant flow variable water supply scheme that maintains the same water flow and changes the water supply temperature is taken as scheme I, the outdoor temperature compensation scheme that installs outdoor temperature compensator on the heating system is taken as scheme II, and the scheme based on load forecasting is taken as scheme III for comparison test. Run the simulation modules under each regulation scheme, and observe the indoor temperature fluctuations. e comparison results are shown in Figure 4.
Observation of Figure 4 shows that on the premise that the load forecasting module makes the guiding adjustment action to the heating system in advance, the fluctuation range of the indoor temperature response curve is reduced to 20 ± 1°C. Compared with the conventional adjustment method, the up and down floating value from the indoor design temperature is reduced by 1.5°C, which greatly improves the control effect.
Assuming that the hydraulic condition is balanced, it shows that the heating load prediction model established by   using the improved mass flow regulation method has an ideal effect on the control of the district heating system. In order to further explore the energy conservation of this scheme, the boiler fuel consumption calculation module and the pipe network circulating water pump energy consumption calculation module are established to observe the changes in energy consumption during operation, as shown in Figure 5.
It can be seen from the comparison of gas and power consumption statistics of boilers and water pumps in the whole heating season that the total gas consumption of boilers and power consumption of water pumps in scheme III vary greatly. e total energy consumption of the three schemes in the heating season is calculated and converted into standard coal for comparison. e results are shown in Table 1.  According to the calculation results, the total energy consumption of load forecasting-based regulation is 1230.75 t standard coal, which is 29.5% compared with scheme I and 14.5% compared with scheme II.

Conclusion
rough the above theoretical research and experimental demonstration, it can be seen that the implementation process of the heat supply load forecasting method based on the data mining mechanism introduced in this paper is simple. e simulation results show that the model can achieve the ideal regulation effect. Based on the simulation model of the heating system established in this paper, it can be seen that the energysaving rate of the load forecasting regulation method adopted in this paper can reach 29.5%. At the same time, the fluctuation range of indoor temperature response curve is reduced to 20 ± 1°C, which is 1.5°C lower than that of conventional regulation. erefore, the proposed method realizes the energysaving control of district heating system.

Data Availability
e raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

Conflicts of Interest
e authors declare that they have no conflicts of interest regarding this work.