# Line Loss Prediction of Distribution Network Based on BP Neural Network

Authors: Haoran Huang
Journal: Scientific Programming
 (2022)

---

## Abstract

Distribution network line loss calculation refers to the calculation of the electrical energy loss, which is generated by all components in a distribution network system in a given period of time. Distribution network, as the end of the power network, is directly connected with users; there are many equipment on the network; the system has impedance, electric energy in the process of conversion, transmission and distribution with a lot of loss, so the calculation of distribution network line loss has very important economic significance. In addition, with the development of power network construction, the rationality of distribution network topology design and the comparison of practical effects of various measures need the guidance of line loss calculation. Line loss and line loss rate is one of the main criteria to reflect the operation of distribution system. Reducing line loss of distribution system is very important for the effective use of power and economic operation of distribution system. In order to better find the effective reduction method and lay the foundation for the scientific establishment of linear contraction targets. This study uses a line loss calculation method based on BP neural network. The method uses the super matching property of the network to map the complex nonlinear relationship between the line loss and the characteristic variables and stores the evolution of the line loss changes with the changes of the structural and operational variables of the distribution line. On the basis of analyzing the theoretical methods, management methods, and various loss reduction measures of power loss calculation, this study also analyzes the status quo and existing problems of line loss analysis and calculation and collects data from line loss calculation and theoretical line loss calculation methods. This study discusses in detail the method and idea of the application of the improved neural network in the estimation of distribution network line loss, and it is used to predict the line loss in a certain area, and the prediction result is good.


---

## Body

## 1. Introduction

Power generation and transmission systems transmit power to users through the distribution network, and the distribution network is directly connected to users at the end of the power network [1]. Due to the characteristics of low voltage grade, aging equipment, and long power supply radius of the distribution network, the line loss of the distribution network is more serious, accounting for more than 20% of the line loss of the power network at all voltage levels [2]. In recent years, as most countries in the world are in a state of insufficient energy, the contradiction between supply and demand and between the energy supply side and the energy purchase side is increasing [3], so how to prevent our country from falling into energy conflict has become a key domestic issue in recent years [4]. In the power system, line loss, as an important index to evaluate the efficiency and economy of power grid operation, has always been one of the important research and management contents of power grid companies [5]. Reasonable calculation and prediction of line loss rate is a method to effectively improve the management of power grid company, reduce power loss, and increase power grid income. Therefore, how to improve the accuracy of line loss rate prediction has very important practical significance. In recent years, many new methods for theoretical calculation of power distribution system line loss have emerged, and the calculation accuracy has been improved [6]. Add line loss calculation function and calculate line loss on time, to ensure that the system line loss can always be in the management of the management personnel. Design automatic line loss management system and improve load management device [7, 8]. The traditional manual management way already cannot adapt to the current management needs, the previous theoretical line loss is mostly artificial calculation, calculation workload is big, calculation cycle is long, and only a rough calculation for simple lines is impossible to calculate for complex circuit; limitation is very big; this requires us to use a computer for line loss calculation [9, 10]. It is very urgent to study the simple and effective computer aided distribution network line loss calculation method and implementation. This is also a more accurate calculation of the theoretical line loss and its distribution in the network and the institutionalization, standardization, and standardized line loss calculation work of the inevitable requirements.


## 2. Application of BP Neural Network Algorithm

### 2.1. Distribution Network Line Loss Calculation Scheme

Theoretically, the BP neural system can map all nonlinear relations and effectively deal with the nonlinear relations between characteristic variables and line losses [11]. For the selection of input variables and output variables of neural network, in a certain period of time, the line loss of distribution lines is related to many characteristic parameters, such as the active power supply of distribution lines, the reactive power supply, the capacity of distribution transformers, the length of distribution lines, the number of distribution transformers, and the total number of truncation of distribution lines [12]. Calculation scheme of line loss of distribution network using BP neural network is shown in Figure 1:Figure 1
Calculation scheme of line loss of distribution network using BP neural network.In this study, the relationship between the four characteristic parameters and line loss is analyzed. When applying neural network to modeling, the active power supply, reactive power supply, distribution capacity, and distribution line length are taken as the input of neural network, and the line output is taken as the output. Neural network structure is shown in Figure2:Figure 2
Neural network structure.


### 2.2. Raw Data Acquisition and Processing

The process of data sampling and sample selection is as follows.


#### 2.2.1. Attribute Selection

During network modeling, it is necessary to input feature weights that can characterize the problem, which imposes certain requirements on the fault information on the shaping device. The number of attributes determines the success of network recognition to a large extent, so the choice of attribute number is directly related to the accuracy of calculation [13]. In addition, the selection of the number of attributes must take into account the difficulty of obtaining data, whether it is correct and perfect, and the selection of the number of attributes must consider various factors.There are many characteristic variables that affect line loss in a distribution system. According to the above, there are many characteristic quantities that satisfy the above conditions, such as the total number of distribution lines, the number of distribution changes, the length of distribution lines, distribution capacity, and the distribution of the total reactive power and total active power of the distribution cabinet.According to the strength of the correlation between the line loss and characteristic variables of the distribution system, this study chooses the total effective power of the line, the total response capacity of the line, the distribution voltage capacity, and the length of the distribution line as the input and output, that is, the line loss.


#### 2.2.2. Data Collection

Select a portion of distribution system data in a specific area and sort the data by network code number. In order to match Matlab programming calculation, it is formatted into the matrix form. The data are divided into practice samples and test samples.


#### 2.2.3. Data Processing

Before creating a network, make preparations. Since the data sizes of different samples are usually different, direct input without processing will affect convergence and processing speed. Therefore, data samples need to be standardized. Chemical processing can ensure that the data size is relatively close, avoid calculating some data with small sample size due to large size difference, and improve the accuracy of data processing [14]. The normalized calculation formula is as follows:(1)xk=xk−xminxmax−xmin,where xmax and represent the maximum and minimum input values in the input data.


### 2.3. Neural Network Building and Training

In the Matlab platform, the Matlab language is used for neural programming, and the data on the input samples have been standardized. The results after exercise were compared with actual data for easy comparison.In the modeling and training process of the nervous system, training samples are represented by variable corpus, production samples are represented byt, and untrained samples are represented by the network created by Newff. After setting the corresponding parameters, it can continue [15]. About training, this study covers two main commands. The first is the network, which is used to define the coach’s goals [16]. Teaching ends only when the error is below the target value. In general, the default root mean square error (MSE) is the main index to measure the validity of this error. The second is the network. During this period, this command is mainly used to set the maximum number of repetitions. When the number of repetitions exceeds the set limit, the exercise will automatically end.As can be seen from the training results, the training process of the network was repeated for a total of 6 times, reaching the precision set by the training network. Therefore, the network training was stopped to prevent the network from falling into an overly suitable state. At this point, the mean exponential error and repetition rate of the training samples were 0.00152 and 1.00E − 5, respectively, and the accuracy was already very high.The larger the error target is, the more iterations need to be carried out, and the two are obviously positively correlated. Curve of mean square error and iteration times is shown in Figure3:Figure 3
Curve of mean square error and iteration times.Figure4 shows that the mean square error of the training sample decreases with repetition, and the mean square error of the validation sample and test sample decreases correspondingly. However, the training performance of the nervous system is not higher with higher accuracy of training because the success rate of network generalization will be reduced, so it is necessary to avoid excessive online training.Figure 4
Sample data regression analysis.Figure5 is a linear regression analysis of the calculated loss frequency and the actual value obtained through the neural network model based on sample data. The deduction is the calculated line loss and the horizontal axis is the actual line loss. R = [−1, 1] indicates the fitness level, and the higher the R value, the better the nervous system and computational performance. Neural network sample test results are shown in Figure 5:Figure 5
Neural network sample test results.Figure5 is a sample of the nervous system. It can be seen that the calculated value of theoretical line loss in the figure is quite close to the actual value, and the error accuracy meets the requirements of actual calculation.


## 2.1. Distribution Network Line Loss Calculation Scheme

Theoretically, the BP neural system can map all nonlinear relations and effectively deal with the nonlinear relations between characteristic variables and line losses [11]. For the selection of input variables and output variables of neural network, in a certain period of time, the line loss of distribution lines is related to many characteristic parameters, such as the active power supply of distribution lines, the reactive power supply, the capacity of distribution transformers, the length of distribution lines, the number of distribution transformers, and the total number of truncation of distribution lines [12]. Calculation scheme of line loss of distribution network using BP neural network is shown in Figure 1:Figure 1
Calculation scheme of line loss of distribution network using BP neural network.In this study, the relationship between the four characteristic parameters and line loss is analyzed. When applying neural network to modeling, the active power supply, reactive power supply, distribution capacity, and distribution line length are taken as the input of neural network, and the line output is taken as the output. Neural network structure is shown in Figure2:Figure 2
Neural network structure.


## 2.2. Raw Data Acquisition and Processing

The process of data sampling and sample selection is as follows.


### 2.2.1. Attribute Selection

During network modeling, it is necessary to input feature weights that can characterize the problem, which imposes certain requirements on the fault information on the shaping device. The number of attributes determines the success of network recognition to a large extent, so the choice of attribute number is directly related to the accuracy of calculation [13]. In addition, the selection of the number of attributes must take into account the difficulty of obtaining data, whether it is correct and perfect, and the selection of the number of attributes must consider various factors.There are many characteristic variables that affect line loss in a distribution system. According to the above, there are many characteristic quantities that satisfy the above conditions, such as the total number of distribution lines, the number of distribution changes, the length of distribution lines, distribution capacity, and the distribution of the total reactive power and total active power of the distribution cabinet.According to the strength of the correlation between the line loss and characteristic variables of the distribution system, this study chooses the total effective power of the line, the total response capacity of the line, the distribution voltage capacity, and the length of the distribution line as the input and output, that is, the line loss.


### 2.2.2. Data Collection

Select a portion of distribution system data in a specific area and sort the data by network code number. In order to match Matlab programming calculation, it is formatted into the matrix form. The data are divided into practice samples and test samples.


### 2.2.3. Data Processing

Before creating a network, make preparations. Since the data sizes of different samples are usually different, direct input without processing will affect convergence and processing speed. Therefore, data samples need to be standardized. Chemical processing can ensure that the data size is relatively close, avoid calculating some data with small sample size due to large size difference, and improve the accuracy of data processing [14]. The normalized calculation formula is as follows:(1)xk=xk−xminxmax−xmin,where xmax and represent the maximum and minimum input values in the input data.


## 2.2.1. Attribute Selection

During network modeling, it is necessary to input feature weights that can characterize the problem, which imposes certain requirements on the fault information on the shaping device. The number of attributes determines the success of network recognition to a large extent, so the choice of attribute number is directly related to the accuracy of calculation [13]. In addition, the selection of the number of attributes must take into account the difficulty of obtaining data, whether it is correct and perfect, and the selection of the number of attributes must consider various factors.There are many characteristic variables that affect line loss in a distribution system. According to the above, there are many characteristic quantities that satisfy the above conditions, such as the total number of distribution lines, the number of distribution changes, the length of distribution lines, distribution capacity, and the distribution of the total reactive power and total active power of the distribution cabinet.According to the strength of the correlation between the line loss and characteristic variables of the distribution system, this study chooses the total effective power of the line, the total response capacity of the line, the distribution voltage capacity, and the length of the distribution line as the input and output, that is, the line loss.


## 2.2.2. Data Collection

Select a portion of distribution system data in a specific area and sort the data by network code number. In order to match Matlab programming calculation, it is formatted into the matrix form. The data are divided into practice samples and test samples.


## 2.2.3. Data Processing

Before creating a network, make preparations. Since the data sizes of different samples are usually different, direct input without processing will affect convergence and processing speed. Therefore, data samples need to be standardized. Chemical processing can ensure that the data size is relatively close, avoid calculating some data with small sample size due to large size difference, and improve the accuracy of data processing [14]. The normalized calculation formula is as follows:(1)xk=xk−xminxmax−xmin,where xmax and represent the maximum and minimum input values in the input data.


## 2.3. Neural Network Building and Training

In the Matlab platform, the Matlab language is used for neural programming, and the data on the input samples have been standardized. The results after exercise were compared with actual data for easy comparison.In the modeling and training process of the nervous system, training samples are represented by variable corpus, production samples are represented byt, and untrained samples are represented by the network created by Newff. After setting the corresponding parameters, it can continue [15]. About training, this study covers two main commands. The first is the network, which is used to define the coach’s goals [16]. Teaching ends only when the error is below the target value. In general, the default root mean square error (MSE) is the main index to measure the validity of this error. The second is the network. During this period, this command is mainly used to set the maximum number of repetitions. When the number of repetitions exceeds the set limit, the exercise will automatically end.As can be seen from the training results, the training process of the network was repeated for a total of 6 times, reaching the precision set by the training network. Therefore, the network training was stopped to prevent the network from falling into an overly suitable state. At this point, the mean exponential error and repetition rate of the training samples were 0.00152 and 1.00E − 5, respectively, and the accuracy was already very high.The larger the error target is, the more iterations need to be carried out, and the two are obviously positively correlated. Curve of mean square error and iteration times is shown in Figure3:Figure 3
Curve of mean square error and iteration times.Figure4 shows that the mean square error of the training sample decreases with repetition, and the mean square error of the validation sample and test sample decreases correspondingly. However, the training performance of the nervous system is not higher with higher accuracy of training because the success rate of network generalization will be reduced, so it is necessary to avoid excessive online training.Figure 4
Sample data regression analysis.Figure5 is a linear regression analysis of the calculated loss frequency and the actual value obtained through the neural network model based on sample data. The deduction is the calculated line loss and the horizontal axis is the actual line loss. R = [−1, 1] indicates the fitness level, and the higher the R value, the better the nervous system and computational performance. Neural network sample test results are shown in Figure 5:Figure 5
Neural network sample test results.Figure5 is a sample of the nervous system. It can be seen that the calculated value of theoretical line loss in the figure is quite close to the actual value, and the error accuracy meets the requirements of actual calculation.


## 3. Line Loss Prediction Simulation of Distribution Network

### 3.1. Data Processing

In order to verify the feasibility of calculating the BP distribution line losses of the BP neural system studied in this study, simulation and empirical analysis were performed based on the daily load consumption of distribution users in a region within a region for 100 consecutive days. Distribution station area structure diagram is shown in Figure6:Figure 6
Distribution station area structure diagram.Based on the above analysis, for a specific location area, the change of energy consumption of each load node in the station area is the main reason for the change of energy loss value. Therefore, the daily response force of stress nodes is applied to the nervous system, and then, the loss rate of the line is obtained with the power. On this basis, combined with LM algorithm, the neural network model for calculating the line loss is obtained.As for the sample data, they mainly contain 1 dependent variable and 16 independent variables. In short, the BP nervous system has 1 production node and 16 input nodes. The number of nodes is four, the hidden layer is one level, and the 16-4-1 network structure is defined, which is a network structure with 16 input nodes, 4 hidden level nodes, and one production node. In order to fully meet the training requirements of BP neural network, the data are processed to obtain independent variables, but there is no need to calculate the ratio of training variables.


### 3.2. Simulation Results

In six consecutive repetitions, the variance of the validation data did not decrease, but increased, exceeding the expected number of failures, so the online training ended automatically. At this point, the repetition estimation and root mean square error of training samples are very small, which are 1.08E − 7 and 7.05E − 8, respectively.In the process of repeated online training, the average error of samples decreases gradually, and the average error of test samples and confirmation samples decreases gradually, but improving generalization ability is the main purpose of online training. The goodness of fit of the sample data is very close to 1, which achieves the expected requirements. Data simulation results are shown in Table1:Table 1
Data simulation results.
Line numberCalculate line loss rate (%)Actual line loss rate (%)Absolute errorRelative error18.628.620027.187.190.01%0.71%38.448.510.07%3.02%45.865.790.07%3.11%56.036.050.02%9.24%65.455.450078.448.370.07%4.14%83.863.910.05%0.52%99.129.220.10%0.67%106.406.410.01%0.53%In this study, the daily power consumption data of users in a certain distribution area for 100 consecutive days are used for network training, and the relationship between daily energy consumption and load node line loss ratio in the distribution station area is obtained, and then, the corresponding relationship is established on this basis. Table1 shows that the absolute difference EA of all sample data is less than 1%, and the calculated results have good reliability. The relative difference is less than 5%, and the corresponding mean difference is 2.31814. Figure 7 shows a detailed fit of these test samples. Therefore, in the process of creating the online model, the representative of the sample should be considered when selecting the model, and its own structure should be considered to enrich the training sample as much as possible. Comparison diagram of sample fitting degree is shown in Figure 7.Figure 7
Comparison diagram of sample fitting degree.


## 3.1. Data Processing

In order to verify the feasibility of calculating the BP distribution line losses of the BP neural system studied in this study, simulation and empirical analysis were performed based on the daily load consumption of distribution users in a region within a region for 100 consecutive days. Distribution station area structure diagram is shown in Figure6:Figure 6
Distribution station area structure diagram.Based on the above analysis, for a specific location area, the change of energy consumption of each load node in the station area is the main reason for the change of energy loss value. Therefore, the daily response force of stress nodes is applied to the nervous system, and then, the loss rate of the line is obtained with the power. On this basis, combined with LM algorithm, the neural network model for calculating the line loss is obtained.As for the sample data, they mainly contain 1 dependent variable and 16 independent variables. In short, the BP nervous system has 1 production node and 16 input nodes. The number of nodes is four, the hidden layer is one level, and the 16-4-1 network structure is defined, which is a network structure with 16 input nodes, 4 hidden level nodes, and one production node. In order to fully meet the training requirements of BP neural network, the data are processed to obtain independent variables, but there is no need to calculate the ratio of training variables.


## 3.2. Simulation Results

In six consecutive repetitions, the variance of the validation data did not decrease, but increased, exceeding the expected number of failures, so the online training ended automatically. At this point, the repetition estimation and root mean square error of training samples are very small, which are 1.08E − 7 and 7.05E − 8, respectively.In the process of repeated online training, the average error of samples decreases gradually, and the average error of test samples and confirmation samples decreases gradually, but improving generalization ability is the main purpose of online training. The goodness of fit of the sample data is very close to 1, which achieves the expected requirements. Data simulation results are shown in Table1:Table 1
Data simulation results.
Line numberCalculate line loss rate (%)Actual line loss rate (%)Absolute errorRelative error18.628.620027.187.190.01%0.71%38.448.510.07%3.02%45.865.790.07%3.11%56.036.050.02%9.24%65.455.450078.448.370.07%4.14%83.863.910.05%0.52%99.129.220.10%0.67%106.406.410.01%0.53%In this study, the daily power consumption data of users in a certain distribution area for 100 consecutive days are used for network training, and the relationship between daily energy consumption and load node line loss ratio in the distribution station area is obtained, and then, the corresponding relationship is established on this basis. Table1 shows that the absolute difference EA of all sample data is less than 1%, and the calculated results have good reliability. The relative difference is less than 5%, and the corresponding mean difference is 2.31814. Figure 7 shows a detailed fit of these test samples. Therefore, in the process of creating the online model, the representative of the sample should be considered when selecting the model, and its own structure should be considered to enrich the training sample as much as possible. Comparison diagram of sample fitting degree is shown in Figure 7.Figure 7
Comparison diagram of sample fitting degree.


## 4. Conclusion

Comprehensive and accurate theoretical calculation of line loss is very important. The clear composition of line loss and its distribution not only helps power supply companies to make plans and improve production and operating conditions but also plays an effective role in saving energy and reducing voltage [17, 18]. The lack of proper development plans over the years resulted in complex structures with many line segments and some lines with fine diameters, resulting in variables that did not meet the R << x criteria for calculating energy flow. Based on this situation, some scholars use improved algorithms after research, such as the matching energy flow method, the improved repetition method, the before and after conclusion method, and the loop resistance method [19]. However, it is difficult to collect and satisfy the data required for these algorithms. The development of science and technology promotes the generation of several new algorithms which contribute to the development of distribution system [20]. The BP network model has a wide range of applications, and three-layer neural network is the main component of this type [21]. This model allows for very complex mappings that are linear to actions. The structure of the network is relatively simple, has high availability, and can perform arbitrary nonlinear adjustment of the input and output. These advantages make the BP nervous system quickly recognized by national scholars and widely used, such as imaging, data prediction, pattern analysis, and other fields [22]. Although BP algorithm has many advantages, it inevitably has disadvantages such as slow Internet speed, easy network oscillation, and easy to fall to the lowest point of the network. Scientists in China are determined to correct the inherent defects of BP algorithm and have achieved remarkable results. Xin et al. [23] used a model-based BP neural network algorithm to change the speed of the Internet. Jiang et al. [24] used an improved algorithm that uses the concept of simulated light lines to configure online speed learning. Using this improved algorithm can significantly improve network speed. Wang et al. [25] suggested that each weight should be relative to the initial learning rate. As the network adapts strongly, the learning rate corresponding to each weight has changed to achieve optimal results. The BP network model has many advantages. Now, more and more scholars have begun to study its application in line loss calculation of distribution system and have made some achievements. This is also a new development strategy of the artificial neural network model and opens up a new theoretical method for calculating the line loss of distribution system. However, overall, the current level is still exploratory. Due to the lack of general network design methods, neural networks are limited by practical use because they rely on experimental methods used in practice [26].Therefore, this study focuses on the calculation of line loss and concrete practical calculation examples. In this study, a BP neural network model is used to calculate the line loss of the distribution system. The results show that using BP network to calculate the line loss of distribution system has the characteristics of the simple network model, fast training speed and high precision. Simulation results show that this method has great advantages in training time and calculation accuracy. It can simulate the optimal BP network type for the line loss calculation of the distribution system in a short time and has high calculation accuracy. In order to meet the needs of line loss management and analysis of distribution network, this study discusses a theoretical line loss prediction and analysis method using neural network and uses relevant algorithms and models. The prediction results also show that this arrangement of input samples may contain the main factors affecting row loss.The biggest problem of this study is that neural network has a high requirement for data. However, from the current situation, the requirement of providing a large number of real data obviously does not meet the objective conditions, which is also the main direction of future scholars.



---

*Source: 6105316-2022-04-30.xml*