Neural Network Based Central Heating System Load Prediction and Constrained Control

A neural network (NN) based heating system load prediction and control scheme are proposed. Different from traditional physical principle based load calculation method, a multilayer NN is incorporated with selected input features and trained to predict the heating load as well as the desired supply water temperature in heating supply loop. In this manner, a complicated load calculation model can be replaced by simple but efficient data-driven scheme and the response time to outdoor temperature variation can be enhanced. Moreover, in order to handle the input and output constraints in valve opening degree control task to achieve desired supply water temperature, Barrier Lyapunov candidate function and axillary system technique are involved. An additional NN is employed to approximate the system transfer function with reliable accuracy. The stability of the system is guaranteed through rigorous mathematical analysis. The excellent performance of the novelly proposed control over traditional PID is demonstrated via extensive simulation study. A quantitative case study is also conducted to verify the flexibility and validity of proposed load prediction strategy.


Introduction
Nowadays, heating service is essential and significant to the wellness of human's daily life as well as the economy development.Attributing to the improvement of technology, central heating system has been widely studied and applied to modern municipal service industry.For example, in Finland, approximately 80% heating service is provided by central heating system, which contributes a lot to the energy conservation and environment protection.In this system, sensors measure the outdoor temperature and other information to guide the adjustment of opening valve degree in primary pipe network which in turn controls the water temperature in secondary pipe network to serve the users.
In practical operation, it is usually very complicated to build physical model for heating load calculation which leads to a lagged response for the outdoor temperature variation.In this regard, a data-driven method for the load prediction is able to facilitate the adjustment of heating control scheme.In literature, there are some researches that take advantage of the historical data to achieve nonlinear heating consumption of load prediction [1].An artificial neural network based heating system mathematical model is investigated to estimate the heating energy consumption for Canadian residence in [2].The input features' saliency to the heating load is researched in [3].The result shows that outdoor temperature is the key factor that affects the load of a heating system.This research paves the way for the input feature selection of training models.In [4], Support Vector Machine (SVM) is incorporated into the building energy consumption prediction using the instances of four commercial buildings in Singapore.The input features are selected as average month outdoor temperature, relative humidity, sunshine duration, and the prediction error being guaranteed below 4%.Apart from these works, some novel methods are also reported for the prediction such as [5] which applies Finite Impulse Response (FIR) method for critical point temperature prediction and [6] which adopts data-mining methods to predict heating steam.However, as far as the authors' knowledge, there is still no research that has been done on the short-term heating load prediction for performance upgrade of heating system to achieve fast response against temperature variation.Thus, in this paper, we propose an NN based predictor to supervise the control system operation with reliable accuracy.Automatic control has been widely applied in central heating system.An optimal control strategy is proposed in [7] by building indirectly connected district heating system model.Reference [8] introduces a reginal automatic control scheme by setting temperature monitor and valve at the user side to improve the heating quality.As for the proposed heating architecture, the aforementioned load prediction module is regarded as a supervisor to control system by advising the control objective which concretely is the desired supply water temperature in the secondary pipe network.With this desired temperature trajectory, an intelligent control method is proposed with another NN to approximate the unknown nonlinear transfer model between supply water temperature and the valve opening degree in primary pipe network.But in implementation, in order to achieve accurate temperature control and at the same time consider the opening degree limitation of the valve, the output tracking error as well as the input control effort should be constrained.It brings additional challenge for the control design.Some researches have been done for the input constraint problem [9][10][11].In [12,13], an auxiliary system is novelly introduced to handle the constraint effect in a class of uncertain multiple-input multiple-output nonlinear system.In [14], a constrainedinput system is tackled in combination with the optimal control to ensure a good tradeoff between control performance and energy consumption.For output constraints, artificial potential field [15], prescribed performance control [16,17], model predictive control [18], and reference governor [19] are some of the existing strategies to handle this problem.In [20,21], Barrier Lyapunov Function (BLF) is introduced which needs less initial conditions and does not require explicit system solution.Based on these literature reports, in this paper, the input and output constraint problem is tentatively merged with rigorous mathematical stability analysis to ensure accurate heating temperature control and limited valve opening degree.Block diagram of the overall proposed central heating system is presented in Figure 1.
The contributions of this paper are threefold: (i) NN based heating load prediction module is developed containing components such as data preprocessing, input variable selection, and NN architecture establishment.It plays a role of supervisor in the whole system to ensure fast response to the outdoor temperature variation.
(ii) Intelligent adaptive control is proposed in combination with additionally involved auxiliary subsystem and symmetric BLF to cope with coupled input saturation and output tracking error constraints simultaneously for accurate and efficient control.
(iii) A function approximator is incorporated into the control loop in order to handle the unknown nonlinear system parameters on NN basis.Validation of the proposed heating system is demonstrated through case study.
The organization of this paper is as follows.Section 2 describes the specifics of NN based heating load prediction.Section 3 presents the development of adaptive control system with multiple constraints.Numerical simulation on the proposed central heating framework is conducted to demonstrate the effectiveness in Section 4. Section 5 gives some concluding remarks.The main denotations that will be used in this paper are summarized in the Nomenclature section.

Heating Load Prediction via Neural Networks
2.1.System Architecture and Mathematical Model.In this paper, an indirectly connected central heating system is considered due to its high efficiency and energy conservation properties.The overall architecture of this system can be described in Figure 2. Heat exchanger is the bridge that connects primary and secondary network.These two loops transfer heat through heat exchanger.This process is subject to heat balance principle.Since the secondary network is directly connected to the users and influences the heating quality, in this work, we focus on the analysis of this loop.To qualitatively analyze the heat supply system, the following mathematical model is considered [22]: where  1 denotes design space-heating load of the building,  2 is heat from the radiator, and  3 represents the heat supplied to the users by heat supply loop. V ,   , ,   ,  2 ,   denote the heating index, building volume, scalar parameter, heat radiating area of the radiator, design flow of secondary network, and water specific heat capacity, respectively. equals 0 for hot water floor radiation heating.  and   are indoor and outdoor temperature. 2 and  ℎ2 denote supply and return water temperature in secondary network.
According to the heat balance principle, the three heat loads  1 ,  2 ,  3 are supposed to be equalled as shown in (1).
Assumption 1. Secondary network is usually subject to 3-5% heat loss.For simplicity purpose, the loss is ignored in this work.
In this section, the daily real-time heating load and desired secondary network supply water temperature  2 are going to be predicted through artificial neural networks with historical information.

NN Based Heating
Load and  2 Prediction.To achieve the prediction, a thorough and precise data base is required to be built.Thus, various sensors are employed to collect the real-time operating system states and other related parameters such as hourly based supply water temperature, indoor/outdoor temperature, and other meteorological parameters.These parameters can act as training samples for the prediction task.

Selection of Input and Output
Variables.In practical engineering, the selection of input variables is significant for the performance of predictor.During this task, the variables' relationship with heating load is investigated and the ones with strong impact to the target load are chosen as input variables.There are plenty of factors that affect the load.The most straightforward one is outdoor meteorological condition.Moreover, the inherent properties of the building such as types, heat characteristics of building envelope, and utility conditions will also influence the indoor temperatures.Nevertheless, it is usually difficult to collect historical data on all these aspects.Furthermore, too many input variables will contribute to a complicated prediction model and retard the training period.The nonindependent input variables can also degrade the prediction accuracy.Therefore, a comprehensive consideration should be conducted before decision of input variables.
Through analysis, the input variables can be categorized into (i) heating system: supply water temperature, return water temperature, water supply flow; (ii) outdoor meteorological parameters: outdoor temperature, outdoor wind speed, air pressure, weather condition, relative humidity, and solar irradiation intensity; (iii) time information: workday or not, daytime, or night.Among them, water supply flow, supply temperature, and return temperature can be collected through heat exchange station record.Meteorological parameters can be collected from meteorological station.By investigating the data source and conducting trial and error experiments, a four-dimension input variables are determined, that is, time (  ), outdoor temperature (  ), solar irradiation intensity (  ), and the supply water temperature in previous day ( 2 ).
In this paper, a temperature control based heating system is considered.Concretely, the supply water temperature in secondary network  2 is decided as the output.The heating load can be further calculated with predicted  2 using (1)-(4).

Data Preprocessing.
Due to measurement error, human caused error, data transmission interference, or equipment precision problem, bad data exists in historical data sequence.

Mathematical Problems in Engineering
These bad data cannot reflect the variation heating load which needs to be detected before they are imported to the network.To achieve this, data of the same category forms a matrix   , where  denotes the recording time in one day and  represents the recording date.The average value   and variance   of each row are calculated first.Then the skew ratio of each data   is obtained.Define a threshold  = 1.1.When   > , the corresponding data is judged as bad data and removed from the data set.A linear interpolation method is applied to generate new reliable data to fill the vacancy.
The data is subject to normalization after bad data detection to improve the training speed and prediction accuracy.Its objective is to fit the input and output data in the range of [−1, 1] with the following operation.
where  is the original data before normalization and  denotes the data after normalization. max and  min are the maximum and minimum data in the original data set.Equation ( 5) is utilized to transform original data into normalized data at input layer.The result from output layer will pass through (6) to obtain the normal-scale value.

Neural Network for Training.
In this paper, a three-layer neural network is proposed with input, hidden, and output layer.The number of nodes in input layer is set as 4 due to the dimension of input variables.The output layer node number is 1.Regarding the hidden layer node number, Kolmogorov Theorem [23] is employed as  = 2 + 1, where  and  denote node number of hidden and input layers.It gives 9 for the node number.Backpropagation [24] algorithm with batch training mode is applied for the training of the proposed network.

Preliminaries on NN Approximation. Radial Basis Function Neural Network (RBFNN) has been proven to have excellent function approximation and learning capabilities.
Given a continuous nonlinear function () :   →   on a compact set Ω  , it can be approximated by RBFNN in the following expression: where  ∈ Ω  ⊂   is the input vector. ∈  × denotes the adjustable weight matrix;  stands for the neuron number.() = [ 1 (), . . .,   ()]  represents the basis function vector is the center of respective field;   is the width of Gaussian function.More accurately, (7) can be rewritten as where  * denotes the ideal weight; () ∈   represents the approximation error and satisfies ‖()‖ ≤ , where  is a positive constant.The ideal weight matrix  * is defined as * is merely an "artificial" quantity for analysis purpose.
In control development, it needs to be estimated by  with designed updating law [25].Additionally, NN approximation error () indicates the minimum deviation between optimal approximation solution  * () and the unknown function ().It has been demonstrated that NN approximation can achieve any desired accuracy if the number of neurons is large enough; in other words, ‖()‖ can be arbitrarily small if  is sufficiently large [25].

Adaptive Control with Multiple Constraints.
With the predicted supply water temperature  2 in secondary network, we intend to control the valve opening degree in primary network to ensure the supply water temperature tracking the prediction value.Herein, the prediction value  2 in the previous section acts as the desired signal denoted as  2 .The transfer function in quality adjustment is presented as follows [26].
where  1 is a scalar coefficient,  1 and  2 are inertial time constant, and  1 is the lagging time.This model describes the relationship between system input  1 , that is, opening degree of the valve in primary pipe network, and the system output  2 , that is, actual water temperature in secondary pipe network.To proceed, we transfer the above expression into time-domain formulation.
Equation ( 11) can be concisely expressed with where Without loss of generality, we make the following remarks and assumptions.
Remark 2. Although the parameters  1 ,  1 , and  2 in [26] are assumed as constants, it is obvious and straightforward that the transfer process is time-varying; that is, the aforementioned parameters are state-dependent and timevarying.Subsequently, , , and ( 2 ) should be more reasonably depicted as ( Ṫ 2 ,  2 , ), ( Ṫ 2 ,  2 , ), and ( 2 , ).Remark 3. A bounded disturbance term should be complemented in model ( 12) to consider the system noise and other disturbance.
Assumption 4.  1 is added to consider the input delay of the system.In this work, the delay is removed since we only would like to investigate the development of control to tackle multiple constraint problem.The method to cope with input delay is very trivial and many state-of-the-art works can be found [27][28][29].
Apart from the remarks and assumption above, we involve another variable  2 = Ṫ 2 .Therefore, the system model of ( 12) can be rewritten as Assumption 5.In most literatures, only one primary/ secondary pipe network is considered; in other words, the above model is an SISO system.In this research, we extend the system to an MIMO system which can generate different water temperatures in secondary pipe network to serve different operating conditions.
With Assumption 5, the input and output variables become  2 = [ 21 ,  22 ]  and  1 = [ 11 ,  12 ]  .Herein, without loss of generality, a two-dimension variable for input and output is considered.Moreover, we slightly abuse the denotation in model ( 13) by directly defining the original SISO system formulation as MIMO system without any additional denotation redefinition.
In practical implementation, the valve opening degree must have an available range such that the rate of inflow is limited under a certain threshold.With this statement, we need to consider a nonlinear input saturation for the opening degree  1 .
where  10 is the designed control law. 1 and  1 are the lower bound and upper bound for the control input.Since the minimum value of valve opening degree is the situation when it completely turns off, the lower bound  1 is set as zero.
Assumption 6.The temperature  2 in secondary pipe network can be measured and its time derivative  2 can be estimated with temperature variation between consecutive sampling intervals.Moreover, the desired tracking trajectory of the temperature  2 which is determined by the previous load prediction section and its th ( = 1, 2) order derivatives are piecewise continuous, known, and bounded.
In this tracking control, the temperature in secondary pipe network is investigated and the tracking error  2 −  2 is used for backstepping design.Besides, since we would like to more precisely control the temperature inside the target space, the output error limitation of ± lim is involved, which describes the tracking error constraints to the control system as [− lim , − lim ]  ≤  2 −  2 ≤ [ lim ,  lim ]  .For conciseness, the constraint is rewritten as −  lim ≤  2 −  2 ≤   lim .In this paper, we apply the symmetric barrier Lyapunov function (SBLF) [30] incorporated with backstepping method to tackle this output constraint problem.
Step 1. Define error variables  1 =  2 −  2 and  2 =  2 −  1 , where  1 is a stabilizing function that is to be designed.Consider the derivative of  1 .
Assumption 7. The initial condition of Choose a positive definite SBLF candidate as where The selected SBLF candidate ( 16) is positive definite and  1 continues for −  lim ≤  1 ≤   lim .The time derivative of  1 is In ( 15), the stabilizing function  1 is designed as where  1 ∈  2×2 is a symmetric positive definite design parameter matrix.With above design, ż 1 becomes The derivative of  1 gives

Mathematical Problems in Engineering
Step 2. To analyze the input saturation, the following auxiliary system is introduced to the system [12].
where  ∈  2 is the state of auxiliary system.Δ 1 =  1 −  10 . 1 is a symmetric positive definite matrix.  is a small positive design parameter.For the temperature variation velocity of the system, no limitation is needed.Thus, a quadratic form Lyapunov function is selected as The time derivative of  * 2 is given by The time derivative of  2 is By substituting ż 2 into (13), we get the following expression.
Further, it yields Substituting ( 27) into (24), The desired control law is designed as follows: where  2 =   2 ∈  2×2 .To approximate the unknown terms with where Ŵ ,  *  ,   are the weights, optimal weights, and approximation error, respectively.  = [  2 ,   2 ,   1 , α  1 ]  is the input vector to the neural network.With this approximation, the control law  10 is proposed as where (  2 ) + denotes the Moore-Penrose pseudoinverse of   2 .Substituting ( 32) into (28) where and  min (•),  max (•) denote the minimum and maximum eigenvalues of •.Lyapunov function candidate  * 2 is augmented with NN deviations to ensure the convergence of the neural weights.
The updating law of the NN is designed as where Γ  > 0 and  2 > 0 ( = 1, 2) are tuning learning rate. 2 denotes the th element of  2 Incorporate the following inequalities: The derivative of V 2 yields The following inequalities hold if the output constraint is met, that is, −  lim ≤  1 ≤   lim [31].
Proof.Incorporating Lemma 8 and rigorous Lyapunov stability analysis ( 15)-( 40), the Semi-Globally Uniform Boundedness (SGUB) of  1 ,  2 , , W is proven.The tracking error is limited as | 1 | ≤   lim .Moreover, it should be noted that the above proof merely considers the result when the states of auxiliary system (22) satisfy ‖‖ ≥   which indicates the case where input saturation occurs.If there is no input saturation, that is, ‖‖ <   , the control gives  1 =  10 .Since  10 is bounded,  1 must be bounded in this situation.In this fashion, Theorem 9 still holds.The proof is completed.
Remark 10.The research in this work is motivated by intelligently controlling a city central heating system to more rapidly satisfy user's demand.But the proposed method can be tailored to other industry systems with similar formulation.

Simulation Study
In this simulation, a numerical study is conducted to demonstrate the validation of proposed load prediction and control scheme.

NN Based Heating Load Prediction.
In this study, the historical recorded data from a block exchanger station in local city is collected as the training and testing samples.The period is half month from December 5, 2014 to December 20, 2014.Among them, data from 5 to 19 December are employed as training data.Information of 20 December acts as testing samples.As mentioned in Section 2.2.1, fourdimension features are imported into the approximation network, that is, time, outdoor temperature, solar radiation intensity, and  2 in previous day. 2 in current day is regarded as ground truth to produce the prediction error for weights updating.
As for the NN architecture, a 4-9-1 layout is selected with learning rate fixed at 0.2, momentum factor 0.8, maximum training iteration 1500, and maximum square error 10 −2 .Gradient descent method with momentum [34] is employed as training function.In this manner, NN training can be guaranteed with a fast convergence speed and avoid local minima problem.
After training the network, data from 20 December is adopted to test the predictor.The testing input is plotted in Figure 3. Actually, this testing data is very challenging; an obvious temperature decreasing can be observed in Figure 3(a).In the midnight of 19 December, that is, when the time is zero, outdoor temperature is as high as −8 ∘ C.But during the morning, a sudden temperature decrease occurs at 6-8 am and the lowest temperature can be less than −18 ∘ C. At the midnight of 20 December (23)(24), the temperature is as low as −20 ∘ C.This severe temperature variation brings additional challenges to the prediction task since the input of previous day's  2 (Figure 3(c)) cannot provide an efficient hint or reference to the prediction.Robustness and generalization capability of the proposed algorithm are required to tackle this situation.The prediction results are shown in Figure 4.
Figure 4(a) reveals that the NN predicted  2 can generally follow the actual requirement with acceptable accuracy under such harsh temperature variation condition.The prediction error rate in Figure 4(b) demonstrates that the error rate can be guaranteed within 2%.It should be mentioned that although the output from proposed predictor cannot perfectly match the actual data, the accuracy is still sufficient to ensure a good heating service since there always exists allowable range or bias in practical engineering problem so that values within the range can result in acceptable performance.The load prediction is shown in Figure 4(c) with mathematical deduction using  2 as introduced in Section 2.2.1.

Adaptive NN Control.
In this subsection, the performance of proposed control scheme is investigated.As aforementioned, we consider a more complicated nonlinear system model.Some of the system parameters refer to [26].Without loss of generality, we make ( 2 ,  2 , ) as a constant matrix and ( 2 ,  2 , ), ( 2 ),  as time-varying and nonlinear.The specifications of these matrices are  = diag([149.27 which depicts a temperature variation from 50/48 to 47.7/45.6 for the two subnetworks, respectively.Systematically, the predicted result  2 in previous subsection is supposed to be the reference signal  2 in the control task.But, for more efficient and concise demonstration purpose, a simplified tracking trajectory is designed instead as mentioned in afore contents.The input and output constraints are defined as  1 = 65,  1 = 0, and   lim = 0.008.It should be noted that all the simulation setting parameters above can be selected arbitrarily based on the practical implementation requirements.The values in this paper are merely a test case to verify the control performance. As for the proposed NN control settings, the coefficients  1 ,  2 ,  1 ,  21 ,  22 ,   are tuned as diag([750, 720]), diag ([30.8, 33]), diag([2, 1]), 1, 1, 0.005, respectively.The learning rate is Γ 1 = Γ 2 = 5.The number of nodes in the proposed control is eight which is obtained through trial and error in the simulation.To achieve comparative study, a PID control is implemented with properly tuned parameters   = diag([8100, 6750]),   = diag([50, 50]),    = diag([120, 90]).The simulation results are shown in Figures 5-9.
Figures 5-7 reveal that although both the proposed and PID control can achieve acceptable performance as the first two figures show, PID control will result in larger tracking errors that exceed the constraint 0.008.On the contrary, the errors with proposed control can be well limited within the constraints throughout the whole simulation process.As for the control input in Figure 8, attributing to the auxiliary system (22), the control effort is successfully guaranteed Mathematical Problems in Engineering    below the input constraint, that is, 65 without compromising the system stability and tracking performance as presented in Figure 8(a).By comparison, control input with PID control can be as high as 72 which goes beyond the constraint as shown in Figure 8(b).Moreover, if we would like to further reduce the tracking error of PID control, the parameters   ,   ,   will increase accordingly, which subsequently will cause the increase of control input.Therefore, PID control cannot achieve the control objective in the presence of multiple constraints and system nonlinearity.Figure 9 compares the temperature variation speed of the two control schemes.Both of them can ensure the boundedness of all the closed-loop signals in this case study.Moreover, system stability with proposed control is also determined by the selection of constraints.If too tight constraints are involved, the system will probably goes instable.Thus, a good tradeoff between the constraint values should be guaranteed to ensure a safe and smooth operation of the control system.Finally, it can be observed that the output constraint in this simulation is very tight (  lim = 0.008).In reality, due to the high nonlinearity of actual system, the control difficulty increases and this constraint should be looser.In that case,   the proposed control (nonlinear control in essence) will show more obvious advantage over traditional PID scheme because of the specific designed constraint-handle mechanism.

Conclusion
In this paper, an NN based central heating system has been proposed which consists of load prediction and adaptive control modules.By employing proposed data-driven prediction, the utilization of complicated physical model can be avoided and response time to temperature variation shrinks.The proposed solution is accurate and concise.With the predicted load demand, an intelligent adaptive control is proposed to handle multiple constraints on temperature control errors and valve opening degree in practical implementation.NN is applied to approximate the complicated system dynamic model which allows users to achieve accurate control without exact knowledge of the system parameters.Boundedness of all the signals in the closed loop has been guaranteed via rigorous Lyapunov verification.Finally, numerical simulation study has been conducted and feasibility of the proposed framework is demonstrated.

Figure 2 :
Figure 2: System architecture of indirectly connected district heating system.
2 record on Dec 19th

−
Predicted T g2 (a) Actual and predicted  2 on Dec 20th Heating load prediction results

Figure 5 :
Figure 5: Tracking performance for  2 with proposed control.

Figure 6 :
Figure 6: Tracking performance for  2 with PID control.
Tracking error with PID control