**1. Introduction**

Electric heating is a clean, efficient, and flexible form of heating equipment. In recent years, coal-fired heating has been gradually replaced by electric heating in northern China. In order to control urban haze pollution and improve the quality of life of residents, in recent years, the relevant departments of the state have launched the policies of "electricity instead of coal" and "electricity instead of oil" [1]. These policies promote the process of clean energy gradually replacing polluting energy and greatly improve the effect of reducing pollutant emissions. With the continuous improvement of residents' requirements for indoor comfort, the scale of electric heating in winter is increasing year by year, and electric heating is used more and more frequently. Meanwhile, the daily maximum load in winter is also increasing.

Electric heating equipment can be divided into centralized (direct heating electric boiler, regenerative electric boiler, etc.) and distributed (heating cable, electric heating film, carbon crystal heating, etc.). Because electric heating in operation will not produce pollution gas and noise, it is very clean and environmentally protective. The typical characteristics of electric heating are high power, concentrated load, easy-to-produce peak load, and large peak valley difference, and thus it has a great impact on distribution lines [2]. Therefore, accurate load forecasting of electric heating load has great practical significance.

The influence of meteorological factors on short-term load forecasting cannot be ignored. The relevant literature mainly analyzes the factors such as temperature, humidity,

**Citation:** Sun, J.; Wang, J.; Sun, Y.; Xu, M.; Shi, Y.; Liu, Z.; Wen, X. Electric Heating Load Forecasting Method Based on Improved Thermal Comfort Model and LSTM. *Energies* **2021**, *14*, 4525. https://doi.org/ 10.3390/en14154525

Academic Editor: Leijiao Ge

Received: 14 July 2021 Accepted: 23 July 2021 Published: 27 July 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

wind, and precipitation. The article [3] studies the influence of meteorological time series characteristics on urban power consumption and proposes a prediction method different from traditional methods. Articles [4,5] analyzed the prediction model of meteorological sensitive load under the influence of temperature, humidity, snowfall, and other meteorological factors, and put forward the strategy of data processing.

Electric heating load is a kind of temperature control load [6]. In recent years, scholars from all over the world have carried out research work on temperature-controlled load characteristics. The authors of [7,8] predicted the dispatchable capacity and the ability to respond to grid dispatching from the perspective of temperature-controlled load providing auxiliary services for the power system. In the study of [9], the characteristic law of typical microgrid temperature-controlled load is analyzed, and a physical model and a rough scheme for optimal scheduling is established. The authors of [10,11] analyzed and modeled the typical temperature control load characteristics in the centralized area, evaluated the load more accurately in the multi-state situation, and proposed a real-time management and control scheme for the temperature control load.

Load forecasting is based on historical load and weather data in order to analyze the possible influence of historical load data on future load changes, so as to achieve accurate load forecasting in a certain period of time in the future [12]. Short-term load forecasting only forecasts the data of each period in the next few days. The classical load forecasting algorithms generally include artificial neural network (ANN) [13], support vector machine (SVM) [14], and gray neural network [15]. For the learning of time series data, the longshort term memory (LSTM) network algorithm is more mature. In the study of [16], the convergent cross mapping (CCM) method was used to study the internal relationship between power consumption and temperature, wind speed, and other factors. The LSTM neural network model was established, and the urban power consumption was predicted. The results show that the accuracy was good. In [17], different training steps of electric heating load forecasting are compared on the basis of the LSTM network. The results show that LSTM network can achieve accurate electric heating load forecasting in different time scales.

The research on the influence of absolute temperature on power load forecasting has been relatively mature. Few studies have considered the influence of users' thermal comfort temperature in different environments, taking the difference between users' thermal comfort temperature and air temperature as the input of load forecasting model.

On the basis of the analysis of electric heating load characteristics in distribution network, this paper focused on the analysis of meteorological factors and the comfort temperature of a main crowd. Firstly, the interfering factors of electric heating load were studied by gray relational analysis method. Then, the thermal comfort temperature model of residents was constructed. Finally, the historical data of electric heating load were connected with the traditional influencing factors and the difference between thermal comfort temperature and air temperature, and the electric heating load was predicted by the improved LSTM network. Meanwhile, the proposed model was compared with other models. The results showed that the prediction effect of the proposed method was better.

This paper proposes an electric heating load forecasting method based on improved human thermal comfort model and improved LSTM neural network. The main contributions of this paper are as follows:


#### **2. Thermal Comfort Model of the Human Body**

The use of electric heating devices in heating areas in China (such as eastern Inner Mongolia) has gradually become mature, and its comfort is very important to the user experience. In the use of decentralized electric heating, human thermal comfort will affect the heating time, heating temperature, and other factors, thus affecting the electric heating load data. As the most important driving force of user response, thermal comfort should be considered in load forecasting.

Indoor environment quality will directly affect the physical and mental health and work efficiency of human body. It is very important and fundamental for people in a heated area to achieve a comfortable indoor temperature. Thermal comfort is used to indicate that most people are satisfied with the objective thermal environment, both physically and psychologically. It is mainly affected by physical conditions, physiological conditions, and psychological conditions [18]. The physical conditions include the heat transfer performance and shading coefficient of the walls and windows of the building where people live, the internal disturbance of lighting and equipment, the growth rate of indoor microorganism, and so on, which are not affected by the human body's own activities. Physiological conditions include the change of perspiration rate caused by the roughness or cracking of human skin, the intensity of exercise when carrying out routine activities, and the regulation of local or overall sensation of radiation temperature. Psychological conditions refer to the deviation between the factors and psychological expectation in the thermal environment, which are closely related to subjective feeling.

At present, the thermal comfort of people's environment is usually analyzed according to the ISO 7730 thermal comfort model [19], which is proposed by the international standards organization. The calculation results are expressed by predicted mean vote (PMV), and the formula is as follows [20,21]:

$$\begin{array}{l} PMV &= \left[0.303 \times e^{-0.036M} + 0.028\right] \times \left\{(M-W) - 3.05 \times 10^{-3} \times \left(\frac{t\_{cl}}{e^{-t\_{cl}}}\right)^{4}\right.\\ &\left[5733 - 6.99 \times (M-W) - P\_a\right] - 0.42 \times \left[(M-W) - 58.15\right] \\ &- 1.7 \times 10^{-5} \times M \times (5867 - P\_a) - 0.0014 \times M \times (34 - t\_a) - \\ &3.96 \times 10^{-8} \times f\_{cl} \times \left[\left(t\_{cl} + 273\right)^{4} - \left(t\_r + 273\right)^{4}\right] - f\_{cl} \times h\_c \times \\ &\left(t\_{cl} - t\_a\right)\right] \end{array} \tag{1}$$

where *M* is metabolic rate of human body, *W*/*m*<sup>2</sup> ; *W* is the mechanical power consumed by the human body, *W*/*m*<sup>2</sup> ; *P<sup>a</sup>* is partial pressure of water vapor in ambient air around human body, Pa; *t<sup>a</sup>* is air temperature around human body, ◦C; *t<sup>r</sup>* is average radiation temperature, ◦C; *fcl* is the ratio of clothing area covered by human body to bare area; *tcl* is the temperature of outer surface for clothing, ◦C; and *h<sup>c</sup>* is the heat transfer coefficient, *W*/(*m*<sup>2</sup> ·*K*).

ISO 7730 thermal comfort model has a high accuracy in obtaining the user comfort temperature range, but it is difficult to obtain the real-time environmental data required by the model. Therefore, the ISO 7730 model can be simplified properly without affecting the accuracy. In [22], the Rohles simplified model was improved, and the results were extended to a wider range of clothing insulations. Only the indoor air temperature and relative humidity in the test environment were used as the input parameters, and therefore the thermal comfort parameters can be easily evaluated. The results show that the method is very close to ISO 7730 thermal comfort model and is easy to operate and greatly enhanced. The simplified and improved model is as follows:

$$I\_{PMV} = aT\_a + bP\_v - c \tag{2}$$

where *IPMV* is index value of PMV; *T<sup>a</sup>* is indoor temperature; *P<sup>v</sup>* is relative humidity, %; and *a*, *b*, and *c* are known parameters.

When the indoor temperature and relative humidity are on the high side or on the low side, they will interfere with people's core temperature. At present, people's heating temperature is increasing day by day, and therefore the temperature of people's thermal comfort zone will also rise as a whole, and the regulation ability of cold and heat stimulation of people who stay in the thermal comfort zone for a long time will be weakened. In the end, peoples' sensitivity and reaction time to adjust the temperature will become longer.

longer.

When the indoor temperature is not the expected thermal comfort temperature, people will adjust the temperature setting to achieve the expected value. Therefore, in order to consider the impact of users' thermal comfort temperature, we used the difference between the air temperature and human thermal comfort temperature to improve the input data of LSTM neural network prediction model. *3.1. Load Characteristics of Electric Heating*  Electric heating load is different from general electric load, and it has obvious seasonal climate characteristics. Taking the electric heating data of a certain year in eastern Inner Mongolia as an example, from the change trend of annual load curve, we found that the electric heating load in northern region is more intensive in winter (December to

When the indoor temperature and relative humidity are on the high side or on the low side, they will interfere with people's core temperature. At present, people's heating temperature is increasing day by day, and therefore the temperature of people's thermal comfort zone will also rise as a whole, and the regulation ability of cold and heat stimulation of people who stay in the thermal comfort zone for a long time will be weakened. In the end, peoples' sensitivity and reaction time to adjust the temperature will become

When the indoor temperature is not the expected thermal comfort temperature, people will adjust the temperature setting to achieve the expected value. Therefore, in order to consider the impact of users' thermal comfort temperature, we used the difference between the air temperature and human thermal comfort temperature to improve the input

#### **3. Analysis of Factors Affecting Electric Heating Load** March of the next year), in which December to January are the months with the lowest average temperature. From the daily load curve, we found that electric heating load also

*Energies* **2021**, *14*, x FOR PEER REVIEW 4 of 14

#### *3.1. Load Characteristics of Electric Heating* has obvious characteristics of daily type. From Monday to Friday, the load of office build-

data of LSTM neural network prediction model.

**3. Analysis of Factors Affecting Electric Heating Load** 

Electric heating load is different from general electric load, and it has obvious seasonal climate characteristics. Taking the electric heating data of a certain year in eastern Inner Mongolia as an example, from the change trend of annual load curve, we found that the electric heating load in northern region is more intensive in winter (December to March of the next year), in which December to January are the months with the lowest average temperature. From the daily load curve, we found that electric heating load also has obvious characteristics of daily type. From Monday to Friday, the load of office buildings is higher, while the load of weekends and holidays is lower, but the load of commercial and residential electric heating is higher, and the overall trend of daily change is not large. It can be seen from Figure 1 that the typical daily load curve of electric heating in eastern Inner Mongolia presents the characteristics of morning peak, afternoon trough, and evening peak. In terms of electricity consumption, this is mainly due to the start-up of industrial and commercial electric heating in the morning, the general rise of temperature in the afternoon, and the start-up of residential load gathering in the evening. ings is higher, while the load of weekends and holidays is lower, but the load of commercial and residential electric heating is higher, and the overall trend of daily change is not large. It can be seen from Figure 1 that the typical daily load curve of electric heating in eastern Inner Mongolia presents the characteristics of morning peak, afternoon trough, and evening peak. In terms of electricity consumption, this is mainly due to the start-up of industrial and commercial electric heating in the morning, the general rise of temperature in the afternoon, and the start-up of residential load gathering in the evening. The key areas of electric energy substitution in eastern Inner Mongolia are distributed electric heating and centralized electric heating, and electric heating accounts for more than 50% of the proportion of electric energy substitution in eastern Inner Mongolia. With the increasing application of electric heating and large-scale access to the power grid, the impact on the operation of the power system is to further narrow the gap between the winter and summer load.

**Figure 1. Figure 1.** Typical electric heating load curve of a coal to electricity area in eastern Inner Mongolia. Typical electric heating load curve of a coal to electricity area in eastern Inner Mongolia.

The key areas of electric energy substitution in eastern Inner Mongolia are distributed electric heating and centralized electric heating, and electric heating accounts for more than 50% of the proportion of electric energy substitution in eastern Inner Mongolia. With the increasing application of electric heating and large-scale access to the power grid, the impact on the operation of the power system is to further narrow the gap between the winter and summer load.

#### *3.2. Correlation Analysis of Electric Heating Load and Influencing Factors*

The idea of association analysis is to compare the similarity degree of data series, so as to clarify the association degree and regular pattern between each series. It belongs to an effective and practical method of gray system theory to analyze the correlation degree of various factors in the research object system [5,23]. In order for the variation characteristics of electric heating load in winter in eastern Inner Mongolia to be studied, the relationship between the meteorological factors such as temperature difference (the difference between human thermal comfort temperature and actual temperature), relative humidity, wind speed and snow falling, and electric heating load should be analyzed. The calculation steps of correlation analysis method are as follows:

**Step 1:** Construct electric heating load characteristic sequence and influence factor sequence. The electric heating load sequence is expressed as *X***0**, and the related influencing factor sequence is expressed as *X<sup>i</sup>* ; the complete sequence is as follows:

$$\mathbf{X\_0} = (\mathbf{x\_0}(1) \quad \mathbf{x\_0}(2) \cdots \mathbf{x\_0}(k) \cdots \mathbf{x\_0}(n)) \tag{3}$$

$$\mathbf{X}\_{i} = (\mathbf{x}\_{i}(1) \quad \mathbf{x}\_{i}(2) \cdots \mathbf{x}\_{i}(k) \cdots \mathbf{x}\_{i}(n)) \tag{4}$$

where *k* is serial number; *n* is number of samples, *k* = 1, 2, · · · , *n*; and *i* is the number of related factors, *i* = 1, 2, · · · , *m*.

**Step 2:** Obtain the correlation degree.

(a) Each sequence is dimensionless as the initial value, as shown in the following formula:

$$\mathbf{X}'\_{i} = \frac{\mathbf{X}\_{i}}{\mathbf{x}\_{i}(1)} = \left(\mathbf{x}'\_{i}(1)\mathbf{x}'\_{i}(2)\cdots\mathbf{x}'\_{i}(n)\right) \tag{5}$$

where *i* = 1, 2, · · · , *m*, and *X* 0 *i* is initial value after processing.

(b) Determine the difference between electric heating load sequence and each influencing factor **∆***<sup>i</sup>* .

∆*i*(*k*) = *x* 0 <sup>0</sup>(*k*) − *x* 0 *<sup>i</sup>*(*k*) (6)

$$
\Delta\_{\bar{i}} = \begin{pmatrix} \Delta\_{\bar{i}}(1) & \Delta\_{\bar{i}}(2) \cdots \Delta\_{\bar{i}}(k) \cdots \Delta\_{\bar{i}}(n) \end{pmatrix} \tag{7}
$$

Record the minimum value of all sequence differences as *a*, the minimum range is *b*.

$$\begin{cases} a = \min\{\Delta\_i(1), \Delta\_i(2), \dots, \Delta\_i(k), \dots, \Delta\_i(n)\} \\ b = \max\{\Delta\_i(1), \Delta\_i(2), \dots, \Delta\_i(k), \dots, \Delta\_i(n)\} \\ \vdots \\ \end{cases} \tag{8}$$

(c) Find the correlation coefficient of each sample in the sequence *γi*(*k*).

$$\gamma\_i(k) = \frac{a + \varepsilon b}{\Delta\_i(k) + \varepsilon b} \tag{9}$$

where *γi*(*k*) is the correlation coefficient between the *k*-th parameter of the *i*-th subsequence and the *k*-th parameter of the electric heating load sequence, and *ε* is the resolution coefficient, usually 0.5.

(d) Calculate the average correlation coefficient as the following:

$$\gamma\_i = \frac{1}{n} \sum\_{k=1}^n \gamma\_i(k) \tag{10}$$

where *i* = 1, 2, · · · , *m*.

**Step 3:** Analyze the correlation coefficient.

Obtain the correlation coefficient between the electric heating load data series *X***<sup>0</sup>** and each related factor series *X<sup>i</sup>* . The larger the correlation coefficient, the greater the influence of the factor series on the electric heating load data series. Therefore, the correlation coefficient between electric heating load and various factors can be calculated, as shown in Table 1.

It can be seen from the data in Table 1 that temperature difference and humidity are the most influential factors on electric heating load data, while snowfall and wind speed are relatively less influential. This is mainly because temperature difference and humidity will affect human thermal comfort to a greater extent. Although snowfall and wind speed will also affect people's psychological expectation and feeling of temperature and humidity, their influence is relatively small relative to temperature difference and humidity.


Obtain the correlation coefficient between the electric heating load data series *X0* and each related factor series *Xi* . The larger the correlation coefficient, the greater the influence of the factor series on the electric heating load data series. Therefore, the correlation coefficient between electric heating load and various factors can be calculated, as

**Table 1.** Coefficient of correlation between electric heating load and meteorological factors. 1 Table notes: In this paper and Table 1, "temperature difference" refers to the difference between human thermal comfort temperature and actual temperature.

**Table 1.** Coefficient of correlation between electric heating load and meteorological factors.

**Influence Factor Correlation Coefficient Influence Factor Correlation** 

difference 1 0.9601 Snowfall 0.8326 Humidity 0.9416 Wind speed 0.7952

**Coefficient** 

*Energies* **2021**, *14*, x FOR PEER REVIEW 6 of 14

**Step 3:** Analyze the correlation coefficient.

where *i m* =1,2, , .

shown in Table 1.

Temperature

<sup>1</sup> Table notes: In this paper and Table 1, "temperature difference" refers to the difference between human thermal comfort temperature and actual temperature. will also affect people's psychological expectation and feeling of temperature and humidity, their influence is relatively small relative to temperature difference and humidity.

After the most relevant factors of electric heating load are analyzed, in addition to the historical electric heating load data, temperature difference data and humidity also become the main source data of electric heating load prediction. After the most relevant factors of electric heating load are analyzed, in addition to the historical electric heating load data, temperature difference data and humidity also become the main source data of electric heating load prediction.

#### **4. Improved LSTM Neural Network Prediction Model 4. Improved LSTM Neural Network Prediction Model**

#### *4.1. Long Short-Term Memory Network 4.1. Long Short-Term Memory Network*

Due to the inherent time series of load data, the selected forecasting model must have a good ability to express the time series characteristics. In this paper, the long short-term memory network (LSTM) was taken as the main body and improved as the model to study its applicability for short-term load forecasting modeling of electric heating load in eastern Inner Mongolia. Due to the inherent time series of load data, the selected forecasting model must have a good ability to express the time series characteristics. In this paper, the long short-term memory network (LSTM) was taken as the main body and improved as the model to study its applicability for short-term load forecasting modeling of electric heating load in eastern Inner Mongolia.

LSTM is a kind of special recurrent neural network (RNN). It can use the information learned at the last moment to learn at the current moment and can set gradient threshold to prevent the gradient disappearing or exploding in RNN training. LSTM algorithm adds cell state C to the original RNN hidden layer to keep the long-term state, thus solving the long-term dependence problem of RNN. Therefore, LSTM is superior to other neural network models. Figure 2 is the schematic diagram of LSTM expansion structure. LSTM is a kind of special recurrent neural network (RNN). It can use the information learned at the last moment to learn at the current moment and can set gradient threshold to prevent the gradient disappearing or exploding in RNN training. LSTM algorithm adds cell state C to the original RNN hidden layer to keep the long-term state, thus solving the long-term dependence problem of RNN. Therefore, LSTM is superior to other neural network models. Figure 2 is the schematic diagram of LSTM expansion structure.

**Figure 2. Figure 2.**  Network deployment structure of LSTM. Network deployment structure of LSTM.

In Figure 2, the input of LSTM consists of three parts: the input value at the current time *x<sup>t</sup>* , the output value at the previous time *ht*−**1**, and the cell state at the previous time *ct*−**1**. The output of LSTM consists of the output unit state *c<sup>t</sup>* and the output value of hidden layer *h<sup>t</sup>* .

Compared with RNN, LSTM redesigns the internal memory unit while maintaining its basic structure. The architecture diagram of each unit of LSTM is shown in Figure 3. The key of every LSTM cell is the control of cell state *c*. There are three control gates in the unit state, which are forgetting gate *f t* , input gate *i<sup>t</sup>* , and output gate *o<sup>t</sup>* . Through these gates, information can be filtered or added to achieve a new unit state.

According to Figure 3, from left to right, it can be seen that the unit state of the previous time *ct*−**<sup>1</sup>** and the output value of the hidden layer of the previous time *ht*−**<sup>1</sup>** together memorize the historical information of the sequence data. Step-by-step analysis of LSTM architecture can be divided into three parts.

**Figure 3.** Network deployment structure of LSTM. **Figure 3.** Network deployment structure of LSTM.

hidden layer *ht* .

According to Figure 3, from left to right, it can be seen that the unit state of the previous time *t -1 c* and the output value of the hidden layer of the previous time *ht-1* together memorize the historical information of the sequence data. Step-by-step analysis of The first step is to filter the information selectively. The forgetting gate removes the information in the last unit according to *ht*−**<sup>1</sup>** and *x<sup>t</sup>* , that is, it removes the useless part of the information learned at the last moment. The forgetting gate is as follows:

In Figure 2, the input of LSTM consists of three parts: the input value at the current time *<sup>t</sup> x* , the output value at the previous time *ht-1* , and the cell state at the previous time *t -1 c* . The output of LSTM consists of the output unit state *<sup>t</sup> c* and the output value of

Compared with RNN, LSTM redesigns the internal memory unit while maintaining its basic structure. The architecture diagram of each unit of LSTM is shown in Figure 3. The key of every LSTM cell is the control of cell state *c* . There are three control gates in the unit state, which are forgetting gate *tf* , input gate *<sup>t</sup> i* , and output gate *<sup>t</sup> o* . Through

these gates, information can be filtered or added to achieve a new unit state.

$$f\_t = \sigma\left(w\_{\mathcal{f}} \cdot [h\_{t-1}, x\_t] + b\_f\right) \tag{11}$$

information in the last unit according to *ht-1* and *<sup>t</sup> x* , that is, it removes the useless part of the information learned at the last moment. The forgetting gate is as follows: where *σ*(·) is Sigmoid activation function, *w<sup>f</sup>* is the weight of forgetting gate, and *b<sup>f</sup>* is the bias of forgetting gate.

= + σ ( ) [ ,] *t f t-1 t f f whx b* (11) where σ ( ) is Sigmoid activation function, *w <sup>f</sup>* is the weight of forgetting gate, and The second step is to generate new information that needs to be updated. This part is combined by input gate *i<sup>t</sup>* and candidate value *C*e*<sup>t</sup>* . *ht*−**<sup>1</sup>** and *x<sup>t</sup>* use sigmoid function to obtain the data that need to be input into the cell state (i.e., input gate) and create a new candidate state through *tanh* layer. The formula is as follows:

$$\dot{\mathbf{u}}\_{\mathbf{t}} = \sigma(\mathbf{w}\_{\mathbf{t}} \cdot [\mathbf{h}\_{\mathbf{t}-\mathbf{1}}, \mathbf{x}\_{\mathbf{t}}] + \mathbf{b}\_{\mathbf{t}}) \tag{12}$$

$$\widetilde{\mathcal{C}}\_t = \tanh(w\_{\mathfrak{C}} \cdot [h\_{t-1}, \mathfrak{x}\_t] + \mathfrak{b}\_{\mathfrak{c}}) \tag{13}$$

tion to obtain the data that need to be input into the cell state (i.e., input gate) and create a new candidate state through *tanh* layer. The formula is as follows: = + σ ( ) [ ,] *t i t-1 t i i wh x b* (12) where *i<sup>t</sup>* is information to memorize, that is, input gate; *C*e*<sup>t</sup>* is the candidate value to update the original cell state; *w<sup>i</sup>* and *w<sup>c</sup>* represent the weight of input gate and candidate value, respectively; and *b<sup>i</sup>* and *b<sup>c</sup>* represent the bias of input gate and candidate value, respectively.

*C wh x b t c t-1 t c* = + tanh [ , ] ( ) (13) where *<sup>t</sup> i* is information to memorize, that is, input gate; *Ct* is the candidate value to The third step is to generate new cell state *c<sup>t</sup>* and hidden layer outputs *h<sup>t</sup>* . By multiplying the input gate *i<sup>t</sup>* and the candidate value *C*e*<sup>t</sup>* and adding them to the forgetting gate *f t* , one can obtain the updated cell state value *c<sup>t</sup>* , as shown in the following formula:

$$\mathbf{c}\_{t} = f \cdot \mathbf{c}\_{t-1} + i\_{t} \cdot \mathbf{k}\_{t} \tag{14}$$

date value, respectively; and *<sup>i</sup> b* and *<sup>c</sup> b* represent the bias of input gate and candidate value, respectively. The new cell state *c<sup>t</sup>* is processed by a *tanh* function, and then multiplied by the output gate *o<sup>t</sup>* to obtain the output value of the hidden layer *h<sup>t</sup>* :

$$\mathfrak{o}\_{\mathfrak{t}} = \sigma(\mathfrak{w}\_{\mathfrak{o}} \cdot [\mathfrak{h}\_{\mathfrak{t}-\mathbf{1}}, \mathfrak{x}\_{\mathfrak{t}}] + \mathfrak{b}\_{\mathfrak{o}}) \tag{15}$$

$$h\_{\mathbf{f}} = o\_{\mathbf{f}} \cdot \tanh(\mathbf{c\_{f}}) \tag{16}$$

where *w<sup>o</sup>* is the weight of output gate, and *b<sup>o</sup>* is the bias of output gate.

Through the analysis of LSTM structure system, we can see that using LSTM to replace neurons in RNN to build load forecasting model can solve the problem of longterm dependence and we can learn the hidden historical operation law in power load forecasting.

#### *4.2. Improved LSTM with Attention Mechanism 4.2. Improved LSTM with Attention Mechanism*  For different times, the brain will focus on the areas that need to be focused on and

*Energies* **2021**, *14*, x FOR PEER REVIEW 8 of 14

output gate *<sup>t</sup> o* to obtain the output value of the hidden layer *<sup>t</sup> h* :

tiplying the input gate *<sup>t</sup> i* and the candidate value *Ct*

mula:

ing.

For different times, the brain will focus on the areas that need to be focused on and reduce or ignore the attention to other areas. This kind of attention allocation mechanism can help people to obtain important and detailed information and reduce the influence of other irrelevant information. reduce or ignore the attention to other areas. This kind of attention allocation mechanism can help people to obtain important and detailed information and reduce the influence of other irrelevant information. Attention mechanism refers to the idea of human brain attention resource allocation

The third step is to generate new cell state *<sup>t</sup> c* and hidden layer outputs *ht* . By mul-

gate *tf* , one can obtain the updated cell state value *<sup>t</sup> c* , as shown in the following for-

The new cell state *<sup>t</sup> c* is processed by a *tanh* function, and then multiplied by the

= +

Through the analysis of LSTM structure system, we can see that using LSTM to replace neurons in RNN to build load forecasting model can solve the problem of long-term dependence and we can learn the hidden historical operation law in power load forecast-

σ

where *wo* is the weight of output gate, and *<sup>o</sup> b* is the bias of output gate.

and adding them to the forgetting

*ct t-1 t t* = + *f c ik* (14)

( ) [ ,] *t o t -1 t o o wh x b* (15)

*ho c tt t* = tanh ( ) (16)

Attention mechanism refers to the idea of human brain attention resource allocation [24]. By assigning different probabilities to generate different attention distribution coefficients, the model can better learn the information in the input sequence and improve the accuracy of the model. [24]. By assigning different probabilities to generate different attention distribution coefficients, the model can better learn the information in the input sequence and improve the accuracy of the model. The attention structure is shown in Figure 4, where *xt*( [1, ]) *t n* ∈ is the input to the

The attention structure is shown in Figure 4, where *xt*(*t* ∈ [1, *n*]) is the input to the hidden layer of the LSTM model, *ht*(*t* ∈ [1, *n*]) is the hidden layer output through the LSTM corresponding to each input, *αt*(*t* ∈ [1, *n*]) is the probability distribution value of the attention mechanism output to hidden layer, and *y* is the LSTM output value with attention mechanism. hidden layer of the LSTM model, *ht*( [1, ]) *t n* ∈ is the hidden layer output through the LSTM corresponding to each input, *αt*( [1, ]) *t n* ∈ is the probability distribution value of the attention mechanism output to hidden layer, and *y* is the LSTM output value with attention mechanism.

**Figure 4.** Structure of attention mechanism. **Figure 4.** Structure of attention mechanism.

The formulas of attention weight matrix and eigenvector in attention mechanism are as follows:

$$\mathfrak{e}\_{\mathfrak{t}} = \mathfrak{u}\_{\mathfrak{s}} \tanh(\mathfrak{w}\_{\mathfrak{s}} \mathfrak{h}\_{\mathfrak{t}} + \mathfrak{b}\_{\mathfrak{s}}) \tag{17}$$

$$\mathfrak{a}\_{\mathfrak{t}} = \frac{\exp(\mathfrak{e}\_{\mathfrak{t}})}{\sum\_{\mathfrak{t}}^{\mathfrak{t}} \mathfrak{e}\_{\mathfrak{n}}} \tag{18}$$

$$\mathbf{V} = \sum\_{t=1}^{n} \mathbf{a}\_{t} \mathbf{h}\_{t} \tag{19}$$

where *e<sup>t</sup>* is the non-normalized weight matrix, and *ws*, *bs*, and *u<sup>s</sup>* represent randomly initialized attention mechanism weight matrix, bias vector, and time series matrix, respectively.

*n*=1

To sum up, the structure of the improved LSTM electric heating load forecasting model designed in this paper is shown in Figure 5, which is mainly composed of input layer, LSTM layer, attention layer, dropout layer, and output layer. The function of dropout layer is to prevent over learning and set the discard rate, so that some neurons extracted from the model can be "discarded" (do not participate in network training).

**Figure 5.** Improved LSTM short term forecast model of electric heating load. **Figure 5.** Improved LSTM short term forecast model of electric heating load.

Considering the climate characteristics of northern China, according to the results of correlation analysis, we took the historical electric heating load data from January to March *l* , the difference between human thermal comfort temperature and air temperature *Δt* , and relative humidity *vp* as the original sample set of the prediction model. The sample data were standardized by 0-1 as the input matrix *Xs* of the model. The Considering the climate characteristics of northern China, according to the results of correlation analysis, we took the historical electric heating load data from January to March *l*, the difference between human thermal comfort temperature and air temperature **∆***t*, and relative humidity *p<sup>v</sup>* as the original sample set of the prediction model. The sample data were standardized by 0-1 as the input matrix *X<sup>s</sup>* of the model. The data of temperature and relative humidity were from the National Meteorological Data Center.

The formulas of attention weight matrix and eigenvector in attention mechanism are

1

1

To sum up, the structure of the improved LSTM electric heating load forecasting model designed in this paper is shown in Figure 5, which is mainly composed of input layer, LSTM layer, attention layer, dropout layer, and output layer. The function of dropout layer is to prevent over learning and set the discard rate, so that some neurons extracted from the model can be "discarded" (do not participate in network training).

*t*=

where *<sup>t</sup> e* is the non-normalized weight matrix, and *ws* , *<sup>s</sup> b* , and *us* represent randomly initialized attention mechanism weight matrix, bias vector, and time series matrix,

*n*

exp( ) *t n*=

*t*

*e*

*n*

*e*

=

*t*

*α*

= + tanh( ) *t s st s e u wh b* (17)

*<sup>V</sup>* <sup>=</sup>*<sup>α</sup>t t <sup>h</sup>* (19)

(18)

data of temperature and relative humidity were from the National Meteorological Data Center. The input data *Xs* of the input layer was simply extracted with feature vectors, and the neural network unit was controlled by three "gates" structures. The output data The input data *X<sup>s</sup>* of the input layer was simply extracted with feature vectors, and the neural network unit was controlled by three "gates" structures. The output data of LSTM layer was the matrix *H* = [*h*<sup>1</sup> · · · *h<sup>i</sup>* · · · *hn*], which represents the output value of electric heating load of this layer. The input of attention mechanism was the output matrix *H* of LSTM layer, and the feature vectors *V* were obtained by different attention weights.

#### **5. Case Study**

as follows:

respectively.

#### *5.1. Date Preprocessing*

The data used in this paper are the historical data of 66 days of electric heating load from January to the first week of March in 2018 in an area of eastern Inner Mongolia. At the same time, the thermal comfort of 300 individuals of different ages was investigated, and the model parameters were fitted by Equation (2), and the thermal comfort temperature of the main population was obtained. Among the 300 individuals, there were 150 men and 150 women, mainly young people aged about 20 years old and middle-aged and old people aged about 60 or 70 years old.

The thermal comfort questionnaire survey was conducted on the subjects, and the temperature and relative humidity during the survey were investigated. The model parameters of the same user under different clothing and activity intensity were obtained by fitting (see Table 2).

It can be seen from Table 2 that users had different adaptability to temperature under different clothes and different activity intensities. In order to make the model more universal, we took the average value of 23.275 ◦C as the thermal comfort temperature of the human body.


**Table 2.** Thermal comfort model parameters of users.

#### *5.2. Parameter Setting and Analysis*

The input data were divided into training set and test set. The first 90% of the input samples were taken as the training set for the data samples of model fitting; the last 10% of the input sample was taken as the test set to evaluate the accuracy of the final model, that is, the training prediction of the prediction day. We set the initial learning rate as 0.05, learning decay rate as 0.6, and data training cycle as 250. In addition, the dropout layer discard rate was set to 0.25.

The number of hidden layers of the LSTM network and the number of LSTM units in each hidden layer had an impact on the accuracy of electric heating load forecasting. Under-learning or over-learning will affect the accuracy of the model. The enumeration method was used to record the training effect of different hidden layers and different number of neurons in each layer, so as to determine the optimal network structure. Firstly, the number of hidden layers was set to 1, and different numbers of neurons were set one by one to train and record MAPE; then, we kept the optimal number of neurons in the first layer, set the number of hidden layers to 2, continued to set the number of different units one by one for training, and so on. In this paper, the maximum number of hidden layers was set to 3, and the performance of each training is shown in Table 3.


**Table 3.** Forecasting performance of different LSTM network structures.

According to the results in Table 3, when the number of hidden layers was 1 and the number of neurons in each layer was 5, the minimum *eMAPE* was 4.2486%; when the number of hidden layers was 2, the number of neurons in the first layer was fixed to 5, and the number of neurons in the second layer was set to 20, and the minimum *eMAPE* was 5.0683%. When the hidden layer was 3, the first two layers were fixed with the optimal number. When the number of neurons in the third layer was 10, the minimum *eMAPE* was 5.0794%.

#### *5.3. Test Results and Analysis*

In order to verify the performance of the thermal comfort model and the improved LSTM neural network method proposed in this paper, we selected the optimal prediction model (one hidden layer, five neurons per layer). In addition, the hourly load from January to early March 2018 was used as the dataset to test the prediction performance of the model, which was compared with the other three cases.

Figure 6 shows the mean absolute percentage error (MAPE) of the prediction results of the proposed method. Figure 7 shows the comparison curve between the actual electric

heating load and the load predicted by each method. The curve LSTM-T-A represents the prediction result of the LSTM model with thermal comfort temperature and attention mechanism added, the curve LSTM-T represents the prediction result with thermal comfort temperature added only, and the curve LSTM-A represents the prediction result with attention mechanism added only. The curve LSTM represents the LSTM prediction results without thermal comfort temperature and attention mechanism. It can be seen from Figure 7 that compared with the other three methods, LSTM-T-A had little change in amplitude compared with the real value, and the curve characteristics were closest to the real value. *Energies* **2021**, *14*, x FOR PEER REVIEW 12 of 14 *Energies* **2021**, *14*, x FOR PEER REVIEW 12 of 14

**Figure 6.** MAPE of the LSTM-T-A prediction results. **Figure 6.** MAPE of the LSTM-T-A prediction results. **Figure 6.** MAPE of the LSTM-T-A prediction results.

**Figure 7.** Forecast results of electric heating load. **Figure 7.** Forecast results of electric heating load. **Figure 7.** Forecast results of electric heating load.

The MAPE (Mean Absolute Percentage Error), MAE (Mean Absolute Error), and RMSE (Root Mean Square Error) of the above four models are shown in Table 4. In addition to comparing the improved part of LSTM, the errors of SVM and ANN are also com-The MAPE (Mean Absolute Percentage Error), MAE (Mean Absolute Error), and RMSE (Root Mean Square Error) of the above four models are shown in Table 4. In addition to comparing the improved part of LSTM, the errors of SVM and ANN are also com-The MAPE (Mean Absolute Percentage Error), MAE (Mean Absolute Error), and RMSE (Root Mean Square Error) of the above four models are shown in Table 4. In addition to comparing the improved part of LSTM, the errors of SVM and ANN are also compared.

**Models** *MAPE e* **/%** *MAE e* **/MW** *RMSE e* **/MW** 

**Models** *MAPE e* **/%** *MAE e* **/MW** *RMSE e* **/MW** 

LSTM-T 9.5517 228.4801 297.6025 LSTM-A 11.3527 293.5961 358.2558 LSTM 12.7182 311.0858 399.6952 SVM 13.6543 346.7190 424.6283 ANN 14.7216 384.1764 457.4381

LSTM-T 9.5517 228.4801 297.6025 LSTM-A 11.3527 293.5961 358.2558 LSTM 12.7182 311.0858 399.6952 SVM 13.6543 346.7190 424.6283 ANN 14.7216 384.1764 457.4381

**Table 4.** Prediction performance comparison of different neural network algorithms.

**Table 4.** Prediction performance comparison of different neural network algorithms.

pared.

pared.


**Table 4.** Prediction performance comparison of different neural network algorithms.

It can be seen from Figure 7 and Table 4 that for the LSTM model, the improvement after adding human thermal comfort temperature and attention mechanism will significantly improve the prediction accuracy of electric heating load. LSTM-T-A prediction curve fitted the real value best, and the selected error index values were the smallest, which showed a better prediction effect.

#### **6. Conclusions**

According to the load of electric heating in northern China, we analyzed the load characteristics of electric heating in winter and constructed the thermal comfort temperature model of the human body. The main meteorological factors affecting electric heating load were screened out by the gray correlation analysis method. Meanwhile, the difference between thermal comfort temperature and actual temperature of main users was analyzed and considered. Attention mechanism and dropout layer were added to improve the LSTM neural network, and the optimal number of hidden layers and hidden neurons were obtained.

The actual electric heating load data were used to verify the model and were compared with several models. The results show that:


**Author Contributions:** Methodology, J.S.; investigation and data curation, J.W.; resources, Y.S. (Yonghui Sun); project administration, M.X.; supervision, Y.S. (Yong Shi); writing—original draft preparation, X.W.; writing—review and editing, Z.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported in part by State Grid Inner Mongolia East Electric Power Co., Ltd.; the project number is KH20010229.

**Informed Consent Statement:** Informed consent was obtained from all subjects involved in the study.

**Data Availability Statement:** Data are contained within the article. Data sharing is not applicable to this article.

**Conflicts of Interest:** The authors declare no conflict of interest.

## **References**

