Optimal control of secondary side supply water temperature for substation in district heating systems

. Low temperature is the most significant feature of the future district heating system- the 4 th generation district heating (4GDH). However, a widely used control strategy for supply water temperature in substation is weather- compensated control. It is a feedforward control without any dynamic information about buildings, which can lead to higher or lower supply water temperature. This paper presents model predictive controller (MPC) applied to the supply water temperature control for substations in district heating systems. MPC is an advanced control technique, which can make full use of dynamic information of buildings to determine the optimal supply water temperature of substations. In this paper, a multiple inputs and single output dynamic model was identified by subspace methods. Two different MPC controllers were designed in Simulink. The MPC controller 1 focused on keeping indoor air temperature at reference values. The MPC controller 2 focused on both keeping indoor air temperature at reference values and tracking the minimum supply water temperature in order to find the temperature potential for the future DH systems. Both of the MPC controllers proved to have a better tracking effect for indoor air temperature and lower average supply temperatures compared to weather- compensated. The MPC controller 2 could further lower supply water temperature compared to the MPC controller 1 by tracking minimum supply water temperature in its objective function. The average supply water temperatures for the weather- compensated, the MPC controller1, and the MPC controller 2 were 52°C, 51°C and 50°C, respectively. The results showed that MPC has a great potential in the area of supply water temperature control of the district heating systems.


Introduction
In many countries around the world, the ability to heat and supply hot water to buildings is essential. District heating (DH) uses local fuel or heat resources, which would otherwise be wasted, to satisfy local customer heat demands [1]. By utilizing DH, a great improvement in energy efficiency can be achieved in the heating market. One of the most important conditions for running a DH system with high efficiency is low distribution temperatures [2]. A decrease in distribution temperatures will be essential for DH systems to play a crucial role in future sustainable energy systems [3]. In addition, low temperature is the most significant feature of the future DH -the 4 th generation district heating (4GDH). The revolutionary temperature level (50-55/25°C) will improve the efficiency of heat source, thermal storage, and distribution system, meanwhile, bring huge potential to renewable energies [4].
A consumer substation, which acts as an interface between heat sources and heat customers, is a very import part in a DH system. However, a widely used control strategy for supply water temperature of substation is the weather-compensated control (WCC). The WCC, as a feedforward control, does not contain any information about the building dynamics (such as indoor air temperature). Since it only utilizes current values of outdoor air temperature. Heat demand of a building, however, is a dynamic process. It is not only influenced by current outdoor weather conditions (outdoor air temperature, solar gains, and wind velocity), but also affected by its historical heat demands due to building thermal inertia [5,6]. The supply water temperatures provided by WCC can lead to underheating or overheating of the building easily due to lacking of dynamics in the control [7]. Higher supply water temperature is a very common phenomenon in DH system due to WCC.
Model (based) predictive control (MPC) is an advanced method of process control originated in late 1970s and early 1980s in the process industries (oil refineries, chemical plants, etc.). The main advantage of MPC is the fact that it uses the current system measurements, the current dynamic state of the process, the MPC models, and the process output targets and limits to calculate future changes for the output variables. These changes are calculated to hold the output variables close to targets while satisfying constraints. The MPC typically sends out only the first change in each manipulated variable to be implemented, and repeats the calculation when the next change is required [8].
The aim of this study is to design two different MPC controllers in a substation instead of WCC to get the optimal supply water temperature with satisfied indoor air temperature. The MPC controller 1 is to keep indoor air temperature at reference values. The MPC controller 2 is not only to keep indoor air temperature at reference values, but also to track the minimum supply water temperature in order to find the temperature potential for the future DH systems. The MPC controllers are designed in Simulink and will utilize the dynamic information of buildings to achieve two different objectives. The measured indoor air temperature is the feedback for the two closed control loops. The supply water temperature is the output of two MPC controllers.

Methodology
Model predictive control makes full use of a dynamic model to obtain the control signal by minimizing an objective function while satisfying constraints.
The MPC strategy comprises three basic steps-At each time step, compute control by optimizing an openloop objective function for the prediction horizon; Apply only the first value of the computed control sequence in system; At the next time step, get the system state and recompute [8]. For this study, MPC controller is applied in the control of supply water temperature with satisfied indoor air temperature. The three basic steps are as following-At the current point in time, a sequence of optimal supply water temperatures are formulated for the next several hours, based on the weather conditions; Apply only the first optimal supply water temperature in system; At the next time step, get the system state by the feedback of indoor air temperature measurement and recompute the optimize problem. The MPC scheme for this study can be shown in Fig. 1. As Fig. 1 shows, there are three basic elements to design a MPC controller-a dynamic model, an objective function and constraints for input or output variables. The dynamic model will be obtained by system identification method according to collected data. The objective function and constraints are formulated according to different MPC strategies. The three basic elements in this study are discussed in detail in following sections.

Collect data
In this study, the heat customer was a space heating system in one room of an apartment and it was simulated in Modelica® language [9] as shown in Fig. 2. The components of the model were mainly from Modelica standard library [9], AixLib library [10] and Buildings library [11]. The building model was a high order model, which included all individual elements of envelopes and their spatial context. It could be used for in-depth analyses of building thermal behaviours. The radiator model is presented in Fig. 3 (a). The calculation methods of convective and radiative heat transfer were described in [12,13], The calculation of water pressure loss was illustrated in [14]. The simulation result for the heat demand of this reference apartment was 121 kW·h/(m 2 ·year), which was close to 156 kW·h/(m 2 ·year) from a similar research [15]. The maximum heat load at the design outdoor air temperature of this reference apartment was 36 kW/m 2 . The heat demands of space heating mainly depend on indoor air temperature, outdoor air temperature, solar radiation, and wind velocity [1]. The supply water temperature of the substation as a control variable has a direct impact on heat supply for the heat customer. The goal of DH is to keep the indoor air temperature at a comfortable value. The outdoor air temperature, solar radiation, wind velocity, the supply water temperature, and the indoor air temperature were collected from the simulation results of the Modelica model. The WCC was applied in the Modelica model to get the supply water temperature based on outdoor air temperature. The sample time was set as 1.0 hour and sample size was 1600 hours (about 66 days).

Dynamic model identification
The Modelica model in this study consisted of weather block, space heating system block and building envelope block. These blocks were further divided into several more specialized blocks as shown in Fig. 3, such as radiator system, building walls, etc. This space heating model had a very complicated structure. Subspace identification was used to identify this dynamic model which should be able to capture the process dynamic. The inputs of the dynamic model were the outdoor air temperature, solar radiation, wind velocity, and the supply water temperature. The output of the dynamic model was the indoor air temperature. This dynamic model was a multiple inputs and single output model. It can be written as a discrete time state space model as following.
Where u(t) ϵ R 4 was a four-dimensional input vector at time instant t, y(t) ϵ R 1 was a one-dimensional output vector. The vectors e(t) ϵ R n and w(t) ϵ R l were process and measurement noise signals respectively. They were assumed as zero in this study. The objective of subspace algorithm is to determine the system order n and find the matrices A, B, C, and D.

Objective function and constraints
The objective function describes a combination of performance targets. Different cost weights for the different targets can be used to specify a preference for one closed-loop behaviour over another [16]. In this study, two different MPC controllers were developed. The objective function of MPC controller 1 is to keep indoor air temperature at reference values. The objective function of MPC controller 2 is not only to keep indoor air temperature at reference values, but also to track the minimum supply water temperature.
The standard objective function is the sum of four terms in the form of quadratic function, each focusing on a particular aspect of controller performance, as follows: Where, z k is the quadratic programming (QP) decision. J y (z k ) is output reference tracking, the controller keeps selected plant outputs at or near specified reference values. J u (z k ) is manipulated variable (MV) tracking, the controller keeps selected manipulated variables at or near specified target values. J Δu (z k ) is manipulated variable move suppression, the controller uses this performance for manipulated variable move suppression when the case prefers small MV adjustments (moves). J ε (z k ) is constraint violation, the controller uses this performance when constraint violations is unavoidable in practice cases [17].

Output reference tracking
For this dynamic model, there was only one output, indoor air temperature. The reference trajectory r(k+i) were the setting values of indoor air temperature. J y (z k ) was written in the form of quadratic function as following.
Where, p was the predictive horizon. w i y was the tuning cost weight for difference between system output y(k+i/k) and reference r(k+i/k) at ith prediction horizon step. s y was scale factor for indoor air temperature.

Manipulated variable tracking
The inputs for this dynamic system were supply water temperature, the outdoor air temperature, solar radiation and wind velocity, wherein supply water temperature was MV, the weather parameters were measured disturbance variables. The MV, supply water temperature was decided by different MPC strategies. J u (z k ) can be used to track the minimum supply water temperature. It was written in the form of quadratic function as following.
Where, p was the predictive horizon. w i u was the tuning cost weight for difference between MV u(k+i/k) and MV target u target (k+i/k) at ith prediction horizon step. s u was scale factor for supply water temperature.

Manipulated variable move suppression
The MV or control variable, supply water temperature can only be changed between u min and u max . The change rate also had constraints, between Δu min and Δu max . MV move suppression J Δu (z k ) was written in the form of quadratic function as following.
Where, p was the predictive horizon. w i Δu was the tuning weight for change rate of control variable u(k+i/k) at time instant i. s u was scale factor for supply water temperature.

Constraint violation
Hard constraints are constraints that the QP solution must satisfy. However, it is not always possible to satisfy all constraints for a system especially when a hard MV bonds with a hard MV increment constraint. In order to solve this problem, a standard relaxation procedure, the socalled soft-constraints is required [18,19]. This is achieved by adding a slack variable to the optimization problem which allows constraints to be violated. At the same time, slack variables are heavily penalized in the objective function, which can prevent constraints from being violated unless absolutely necessary. In this study, the MV had the hard bonds (u min and u max ) with a hard MV increment constraint (Δu min and Δu max ), which maybe lead to QP infeasibility. Therefore, both MV and MV increment constraints were softened by a slack variable . Constraint violation was measured as the following equation.

MPC controller design
For a given discrete time dynamic model as presented in section 2.1.2.
MPC controller is used to find the control sequence over the prediction horizon by minimizing an objective function with constraints. The objective function and constraints for two MPC controller is described in following sections.

MPC strategy 1-keep indoor air temperature at reference values
For this strategy, it focused on keeping indoor air temperature at reference values over entire prediction horizon. The supply water temperature should be optimized by this goal rather than tracking its minimum values. Thus, the cost weight w i u for MV tracking performance was set as 0. The objective function for this strategy was written as flowing.
Where, constraints u min and u max were the minimum and maximum values of supply water temperature, they were 35 ℃ and 75 ℃ in this study. Δu min and Δu max were the minimum and maximum values for change rate of supply water temperature. They were assumed as -10 ℃/h and 10 ℃/h, respectively. Slack variable was assumed as 0.2, meaning small constraints violation allowed. The reference trajectory r(k+i/k) was assumed as a constant value at each prediction horizon step. It was 20 ℃ which was the recommended value of category Ⅱ in Norwegian standard NS-EN 15251 [20].
Scale factors are used to avoid poor performance when certain variables have much larger or smaller magnitudes than others. Since the small range variables are very small compared to other variables. If same cost weights both used for small range and large range variables, MPC controller does not pay much attention to regulate the small range variables because the associated penalty is so small compared to other variables in the objective function [17]. In this study, the span for the supply water temperature was 40 K (from 35℃ to 75℃). However, the variation of the indoor air temperature was only about 1.0 K (from 19.8 ℃ to 20.8 ℃) according to the collected data. In order to avoid poor performance, scale factor s u for supply water temperature was set as 40, Scale factor s y for indoor air temperature was set as 1.0.
, , and ρ ε were set as constant values over the entire prediction horizon. For this strategy, it focused on keeping indoor air temperature at its setpoint (20 ℃) without large constraint violations. Thus, was set as 1.0, was set as 0.5, and ρ ε was set as 10. The objective function can be rewritten into a matrix form, as flows: Here, and ∆ are weight matrices for output error and change rate of MV, respectively. is QP decision, ] .

MPC strategy 2-Keep indoor air temperature at reference values and track the minimum supply water temperature
For this strategy, it not only focused on keeping indoor air temperature at reference values, but also to track the  (11) subject to Where, constraints u min and u max were 35 ℃ and 75 ℃. Δu min and Δu max were -10 ℃/h and 10 ℃/h. Slack variable was 0.2. The reference trajectory r(k+i/k) was 20 ℃. Scale factor s u was 40, and scale factor s y was 1.0. Target values for supply water temperature were considered as a constant value 35 ℃, which was the minimum supply temperature according to the collected data.
For this strategy, it focused on keeping indoor air temperature at reference values and tracking the minimum supply water temperature.
was set as 1.0, was set as 1.0, was set as 0.5, and ρ ε was set as 10. The objective function can be rewritten into a matrix form, as flows: Here, , and ∆ are weight matrices for output error, difference between MV and MV targets, and change rate of MV, respectively.

Identified dynamic model
The dynamic system order n was identified as 2 by subspace algorithm. Thus, x(t) ϵ R 2 was a twodimensional state vector. The state x(t) had no physical interpretation, when identified by means of the subspace identification. The initial state x(0) was obtained by 'findstates' command in Matlab. Matrixes A, B, C and D were identified as following. The relationship between collected data and simulated data from the identified dynamic model is shown in Fig.  4. As Fig. 4 shows, the simulated data had a good fit to the collected data. Fig. 4. The relationship between collected and simulated data.
The error between collected and simulated data is shown in Fig. 5. The largest error between collected and simulated data was about 0.3 K, but most errors located from -0.1 K to 0.1 K. The mean-square error (MSE) was 0.003512.

MPC controller
The MPC controller designed in Simulink is shown in Fig.  6. The output from MPC controller was the supply water temperature, which was also an input for system model. Weather parameters were measured disturbance inputs for MPC controller and system model. The measured indoor air temperature was the feedback for MPC controller, and used to calculate the difference with the setting indoor air temperature (20℃). Prediction horizon was set as 6.0 hour, and control horizon was set as 2.0 hour.

MPC strategy 1-keep indoor air temperature at reference values
The simulated indoor air temperature controlled by the MPC controller 1 and the WCC is shown in Fig. 7. Wherein, the simulation results of the WCC were obtained from the Modelica model. Fig. 7. Indoor air temperature controlled by MPC 1 and WCC.
As Fig. 7 shows, the indoor air temperature controlled by the WCC changed drastically compared to the MPC controller 1, from 19.8℃ to 20.8℃. The difference between indoor air temperature and the reference value (20 ℃) could be up to almost 1.0 ℃. However, the indoor air temperature controlled by the MPC 1 almost kept at its reference value (20 ℃) for the entire simulation time except the initial indoor air temperature 20.3 ℃. Compared to the WCC, the MPC controller 1 had a much better tracking effect for indoor air temperature. The supply water temperature provided by the MPC controller 1 and the WCC is shown in Fig. 8. The supply water temperature optimized by the MPC controller 1 changed smoothly compared to the WCC, which was beneficial for heat supply units. Because the objective function of MPC controller 1 contained constraints for change rate of supply water temperature. The average supply water temperature provided by the WCC was about 52 ℃. The minimum and maximum supply water temperature were 38 ℃ and 70 ℃, respectively. However, the average supply water temperature optimized by the MPC controller 1 was about 51℃. The minimum and maximum supply water temperature were 41℃ and 70℃. As results show, the MPC controller 1 could lower supply water temperature to some extent with keeping indoor air temperature at 20℃.

MPC strategy 2-Keep indoor air temperature at reference values and track the minimum supply water temperature
For this strategy, it not only focused on keeping indoor air temperature at reference values, but also to track the minimum supply water temperature. The simulated indoor air temperature controlled by the MPC controller 2 and the WCC is shown in Fig. 9.   Fig. 9. Indoor air temperature controlled by MPC 2 and WCC.
As Fig. 9 shows, the indoor air temperatures controlled by the WCC had larger fluctuations compared to the MPC controller 2. Most indoor air temperatures controlled by the WCC were higher than 20 ℃, and the average indoor temperature was 20.3 ℃, which caused higher supply water temperature and energy waste. However, the indoor air temperatures controlled by the MPC controller 2 had smaller fluctuations and most of them kept at or near 20 ℃, except those initial indoor air temperatures. The lowest indoor air temperature was 18.9 ℃, due to the initial supply water temperature was only 35 ℃. The average indoor air temperature controlled by the MPC controller 2 was 19.9 ℃, which was very close to the setting value 20.0 ℃.
The supply water temperature provided by the MPC controller 2 and the WCC is shown in Fig. 10. The supply water temperatures provided by the WCC changed drastically, and the overall supply water temperatures were higher compared to the MPC controller 2. The average supply temperature was 52 ℃. However, the supply water temperatures optimized by the MPC controller 2 changed smoothly, due to the constraints for change rate of supply water temperature. The average supply water temperature was only 50 ℃. The minimum and maximum supply water temperature was 36 ℃ and 69℃. As results show, the MPC controller 2 could minimize supply water temperature with keeping indoor air temperature at or near 20 ℃.

Discussion
In this study, two MPC controllers were designed. One focused on keeping indoor air temperature at the reference value 20℃. The other one not only focused on keeping indoor air temperature at reference values, but also to track the minimum supply water temperature in order to find the temperature potential for the future DH systems. The indoor air temperatures controlled by the MPC controller 1 and 2 are shown in Fig. 11.   Fig. 11. Indoor air temperature controlled by MPC controller 1 and MPC controller 2.
The MPC controller 1 had a much better control effect to keep indoor temperature at 20℃ compared to the MPC controller 2. The indoor air temperature controlled by the MPC controller 2, however, also could keep indoor air temperature at or near 20℃, the average value was 19.9 ℃.
The supply water temperatures optimized by the MPC controller 1 and 2 are shown in Fig. 12. The overall changing trend of supply water temperature was almost the same comparing the MPC controller 1 and 2. However, the supply water temperatures provided by the MPC controller 2 were lower than that of the MPC controller 1, which could be observed from Fig. 12. For the MPC controller 2, the average supply water temperature was about 50℃. The minimum and maximum supply water temperature was 36℃ and 69℃, respectively. For the MPC controller 1, the average supply water temperature was 51℃. The minimum and maximum supply water temperature were 41℃ and 70℃, respectively. The MPC controller 2 could further lower the supply water temperature with keeping indoor air temperature at or near 20 ℃, because the objective function of the MPC controller 2 contained tracking the minimum supply water temperature. From the above results, it could be noticed that the MPC could be designed by adjusting objective function according to different combination of performance targets. Both of the analysed MPC controllers had good tracking effect for the indoor air temperature and lower average supply water temperatures compared to the WCC.

Conclusion
This study compared two different MPC controllers in a consumer substation with the widely used WCC. The system dynamic model was developed by subspace algorithm based on the collected data. Two different MPC controllers were designed in Simulink. The MPC controller 1 focused on keeping indoor air temperature at reference values. The MPC controller 2 focused on both to keep the indoor air temperature at reference values and to track the minimum supply water temperature in order to find the temperature potential for the future DH systems.
The results showed that the MPC had a great potential in the area of supply water temperature control in district heating system. The simulation results proved both of the MPC controllers had a better tracking effect for indoor air temperature and lower average supply temperatures compared to WCC. The MPC controller 2 can further lower supply water temperature compared to the MPC controller 1 by tracking minimum supply water temperature in its objective function.
The MPC controller can make full use of dynamic information of buildings to optimize supply water temperature, and thereby minimize energy use.