Fault Diagnosis of Distributed Energy Distribution Network Based on PSO-BP

With the increasing scale of distribution network at distribution time, its complexity grows geometrically, and its fault diagnosis becomes more and more difficult. Aiming at the slow convergence and low accuracy of traditional backpropagation neural network in dealing with single-phase ground faults, the study proposes a backpropagation neural network based on improved particle swarm optimization. The model optimizes the weights and acceleration constants of the particle swarm algorithm by introducing dynamic coefficients to enhance its global and local optimization seeking ability. It is also applied in optimizing the parameters of backpropagation neural network and constructing the routing model and ranging model for fault diagnosis about distributed energy distribution network. The simulation results revealed that the maximum absolute error of the improved method is 0.08. While the maximum absolute errors of the traditional backpropagation neural network and the particle swarm optimized backpropagation neural network were 0.65 and 0.10, respectively. The fluctuation of the relative errors of the research method was small under different ranges of measurements. At 8.0 km, the minimum relative error was 0.39% and the maximum relative error was 2.81%. The results show that the improved method proposed in the study significantly improves the accuracy and stability of fault diagnosis and localization in distribution networks and is applicable to complex distribution network environments. The method has high training efficiency and fault detection capability and provides an effective tool for distribution network fault management.


Introduction
Due to the distributed energy distribution network (DEDN) has a wide distribution of lines as well as a complex structure, the requirements for fault diagnosis (FD) are increasing.In distribution network (DN), the most common fault types include single-phase ground faults (SPGF) [1][2].Failure to accurately diagnose and localize faults in time can seriously affect power operation, which in turn affects people's normal life and hinders socio-economic development [3][4].Therefore, efficient and accurate FD methods are of great research significance for DEDN.Current FD for DEDN is commonly used in deep learning techniques as well as heuristic algorithms for detection.When faced with the issue of duplicate and incomplete fault data in DN, Tan X et al. employed rough sets and backpropagation neural networks (BPNN) to forecast and evaluate the data.In the experimental results, the prediction accuracy was around 80% for the unprocessed data.In facing the prediction of preprocessed data, its prediction accuracy was around 96% [5].For larger scale DEDN structures, Ling C et al. suggested a grid prediction model based on quantum particle swarm (PS) optimization algorithm and wavelet neural network.The model reduced the influence of parameters on the prediction results by X. Han et al.
correcting the evolutionary and aggregation factors, and achieved high prediction accuracy and good generalization ability in the experiment [6].Zhang P et al. proposed an FD method for motor drive system optimized by BPNN.To balance the algorithm search approach, the adaptive gravitational constant factor was primarily introduced by the method.In the experimental results, the method performed well in the FD of motor drive systems [7].However, there are still some limitations in the above studies, and the convergence speed of the algorithm still has room for improvement in complex DEDNs, while the fault localization accuracy needs to be further improved.The network structure and settings have a significant impact on the algorithm's performance, and it performs poorly when addressing complicated nonlinear situations.A backpropagation neural network with improved particle swarm optimization (IPSO-BPNN) is therefore proposed in the paper as an FD model of DEDN to address the issues of low fault localization accuracy and slow convergence speed.The study's originality is the use of dynamic coefficients to optimize the PSO algorithm's weights and acceleration constant (AC), and the wavelet packet transform (WPT) is employed to extract the quantity of the defect feature.The study aims to provide an efficient and accurate solution for FD and localization of DNs to enhance the operational reliability and stability of DNs.

IPSO-BPNN fault diagnosis model construction for distribution network
Identification of the fault type, fault location, and fault cause that arises in the DN are all included in the field of FD of DNs.The process includes detecting anomalies as well as localizing the fault location.The accuracy of FD depends on the effectiveness of fault routing (FRou) and the precision of fault ranging (FRan).FRou is the process of further refining on the basis of FD to determine in which specific line or branch the fault occurs.The goal is to quickly isolate the faulted portion and reduce the impact on the rest of the distribution system.The distance between the faulted point and the measurement point is determined by FRan using measurement data and algorithms.This information must be paired with the FD's findings and the particular line information that FRou has supplied [8][9].In current DN of SPGF detection studies, the BPNN algorithm is usually used for detection.The specific results of BPNN are shown in Fig. 1.

Input layer
The BPNN network structure contains three sections in Fig. 1.The input layer (IL), which makes up the first section, is mostly in charge of receiving data from outside sources and sending it to the hidden layer (HL).The HL, which makes up the second layer, is primarily in charge of carrying out the crucial processing and computing.It nonlinearly transforms the input data through weighted summation and activation functions to extract features and patterns so as to provide more useful information for the output layer (OL).The third section is the OL, which is mainly responsible for producing the final prediction or classification results.The BPNN expression is shown in Equation (1) [10].
The -th node's input is shown in the HL by equation (1).The input of the IL's -th node is   . , is the weight that separates the IL's -th node from the HL's -th node. is the -th node of the HL's threshold value (TV).
In the HL, the output of the -th node is represented by equation (2).The HL's excitation function (EF) is denoted by ∅.
Equation ( 3) represents the input of the -th node in the OL. , is the weight between the -th node of the HL and the -th node of the OL.k a is the TV of the -th node of the OL.
The output of the -th node in the OL is represented by equation ( 4).The EF of the OL is .The output of the OL's -th node is   .An error is always produced when the neural network is operating.Equation (5) displays the expression for the total error () produced during the BPNN's operation.
In Equation ( 5),  �  denotes the actual value and   denotes the output value.Two fundamental processes make up the BP network algorithm: backpropagation of errors and forward propagation of data.To ascertain whether the error signal needs to be propagated backward, the data is first propagated forward to the end, and the output values are then compared to the predicted values.The entire iterative process continuously corrects the weights and thresholds, and the cycle continues until the model is trained to the maximum iterations when the training stops.In BPNN, the determination of the network topology is crucial.The learning samples dictate how many input and output nodes there should be.On the other hand, the nodes in the intermediate layer is typically chosen by using empirical calculations, which causes the topology to not be unique.An overly complex topology reduces the training and testing efficiency.Furthermore, a structure that is too straightforward could cause crucial information to be lost and prevent a stable convergence of the training process.Therefore, the algorithm has a high dependence on the selection of the sample set and the adjustment of the parameters [11][12].To solve the limitations of the BPNN, the study uses the PSO algorithm to improve the BPNN and enhance the selection of BPNN parameters and the training efficiency of the model.The PSO algorithm achieves optimization by simulating the behavior of the group.Each individual moves in the search space, updates its position and velocity, and continuously adjusts to find the optimal solution through communication with other particles and self-awareness.It is assumed that the number of particles  and form a population in -dimensional space, and the population is denoted by  = ( 1 ,  2 , . . .,   ) . = ( 1 ,  2 , . . .,   ) displays the particle population velocity.Equation (6) shows the modified particle population position [13].
In Equation ( 6),   denotes the optimal particle individual.  denotes the global optimum. denotes the particle inertia weights and  denotes AC.  denotes the random function in the interval [0,1].PSO frequently results in the algorithm falling into a local optimum because of its low convergence performance when searching for the best answer.The algorithm's low accuracy and slow convergence speed are still present in the late iteration.In view of the limitations of PSO, the study introduces a dynamic coefficient to optimize the weights of the algorithm.Its primary goal is to increase the algorithm's early weight coefficients in order to improve the particles' capacity for global optimization.The method's main expression is given in Equation ( 7).In the later stage, the procedure includes reduced weight coefficients to improve the particles' capacity for local optimization.
(7) In Equation (7),  represents the iterations.AC is used as an auxiliary weight coefficient in the PSO algorithm, and its optimization can strengthen the algorithm's own and the whole optimization ability.AC is often divided into two types, of which  1 is mainly for individual optimization and  2 is mainly for overall optimization.Its specific optimization is shown in Equation (8).
By processing AC, then the premature maturity of the algorithm can be suppressed.With these improvements, the flow of the IPSO-BPNN algorithm proposed in the study is shown in Fig. 2.  distributed inductance and capacitance of the line generates an inrush discharge current, which makes the zero-sequence current (ZSC) value of the transient process much larger than the steady state value [14].The transient ZSC signal will be divided into different frequency bands by wavelet decomposition.The transient energy characteristic band in the study is the frequency band having the highest energy.The energy calculation formula for each frequency band is shown in Equation ( 9) [15].
In Equation ( 9),  denotes the decomposition coefficient under the sub-band. is the decomposition layers,  is the node number, and  denotes the number of sampling points.The fault current at the system grounding point is decomposed to contain mainly fundamental and odd harmonics, and the fundamental is affected by the arcing coil compensation, and the study selects the 5thH as the characteristic quantity.Mainly because due to the small content of harmonic currents, their changes are not significantly characterized.The 5thH is calculated as shown in Equation (10). = ∑ ()  (10) In Equation (10), () denotes the magnitude of the 5thH amplitude.The study takes the average value of one IF cycle of zero-sequence (ZS) active power as the fault characteristic quantity, and its calculation formula is shown in Equation (11).
In Equation (11), () denotes the magnitude of the ZS active power signal amplitude.Fig. 3   ) 16 =0 (12) In Equation ( 12), denotes the subband coefficient.In the fault condition, the amplitude of the ZSC fundamental component and ZS reactive component in the line will be X.Han et al.
significantly larger than that of the normal line.The phase of these components will be opposite to that of the normal line.Due to these characteristics, the ZSC of the faulted line is very obvious compared with the sound line, which helps to identify the fault.The ZS reactive component and the ZS fundamental component can be obtained by collecting a cycle of fault signal and performing Fourier transform and wavelet transform.These two transform methods can effectively analyze the frequency and time-frequency characteristics of the signal and help identify and diagnose the fault.

Algorithm performance test for IPSO-BPNN
The study will perform simulation tests on the constructed model.The simulation experiment is realized by MATLAB software to construct a DN result model with DN line fault model.Fig. 5(a) represents the DN structure model.The experiments are set up for the DN related parameters.The frequency of each element of the DN is set to 50 Hz, and the resistance size in the line is set to 0.45 Ω/km.The inductance is set to 0.9426 mH/km, and the capacitance is set to 0.091 nF/km.In the parameters of the ZS line, the resistance size is set to 0.70 Ω/km.The inductance is set to 4.1356 mH/km, and the capacitance is set to 0.037 nF/km.The length of five lines is in an equidistant series.The first line is 10km long and its tolerance is 2km.The study begins by training the constructed algorithm.The relevant parameters need to be set first.It is also analyzed by comparing the traditional PSO algorithm, the PSO algorithm with improved inertia weights, and the PSO algorithm with improved inertia weights and learning factors.The study notates the above three methods as Method A, Method B, and Method C, respectively.Table 1 displays the three approaches' parameter configurations.
To verify the performance of the three methods, the study is tested and analyzed through four test functions.Among these, the nonlinear optimization techniques are tested using the classical mathematical function known as the Rosenbrock function.The benchmark test function that has been used to assess how well the optimization techniques work is the Rastrigin function.The Griewank function is used to test optimization algorithms to evaluate their search ability, convergence speed, and ability to handle multi-peak functions in high-dimensional spaces.Ackley function has global optimization ability in high dimensional space.Fig. 6 displays the particular test findings.The comparison between the Tai Chi Teaching Assistance System and traditional learning methods and other technology-assisted approaches provided insightful perspectives on its advantages and areas for improvement.

Fault diagnosis analysis of distribution network based on IPSO-BPNN algorithm
The study assumes two DN fault states.State 1 is the route L1 ground fault, and set this time the resistance size is 10Ω, A-phase angle size is 30 °.The FP is 2km away from the bus.State 2 is to set L1 as an overhead route and a ground fault occurs.At this time, the grounding resistance is 100Ω.The A-phase phase angle is 90°, and the FP is 5km away from the bus.The results of the ZSC waveforms in the model of state 1 are shown in Fig. 8. 0 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.  Fig. 9(a)-Fig.9(e) represent the waveforms of the of DN lines L1-L5 under the condition of state II, respectively.Among them, the transient energy component of L1 is 0.3082.The transient energy component of L2 is 0.003, indicating that there may be energy fluctuations on the L1 line, which may indicate a fault or abnormality.The L2 energy fluctuation is minimized and the operation status is relatively normal.For the 5thHC, the 5thHC of L1 is 137.452,indicating that there is a high harmonic current on this line, which may affect the power quality.In terms of ZSAC, L1 has the highest ZSAC of 3.9399 kW, which is significantly higher than the other lines.This indicates the presence of significant unbalanced loads or ground faults on line L1.Absolute error (AE) and relative error (RE) are used in the study's performance evaluation to confirm the model's efficacy in FRan.Among the results of AE for different models are shown in Fig. 10.In Fig. 10, the ranging results of the BP algorithm have a large error variation, with a maximum AE of 0.65.The ranging error results of the PSO-BPNN are relatively stable, with a maximum AE of 0.10.The ranging results of the research-improved algorithm are the most stable, with a maximum error of 0.08.The outcomes display that the BPNN has poorer stability and a larger error when in FRan.Compared with the BPNN, the PSO-BPNN ranging error is significantly reduced, and its ranging accuracy and stability are improved.The IPSO-BPNN has the best performance and the smallest error in FRan, with high accuracy and stability.The study compares the RE results of different algorithms for different fault distance lengths, as shown in Table 2.
Table 2 In Table 2, the RE of the PSO-BPNN algorithm varies greatly over the range of fault distances from 3.0 km to 8.0 km.At 3.5 km, the minimum RE is 0.00%.At 6.0 km, the maximum RE is 6.29%.The REs of the IPSO-BPNN algorithm are generally lower and less variable over the same range of fault distances.At 8.0 km, the minimum RE is 0.39%.At 6.0 km, the maximum RE is 2.81%.The results display that the RE of the IPSO-BPNN is lower than that of the PSO-BPNN at different fault distances, indicating that its ranging accuracy is higher and the error is smaller.The RE of PSO-BPNN algorithm fluctuates more under different distances, showing greater instability.The RE of the IPSO-BPNN algorithm is more uniformly distributed, showing higher stability and reliability.It works well for FRan activities that call for a high degree of stability and accuracy.

Discussion
In the above experiments, the IPSO-BPNN outperforms the traditional BP algorithm and PSO-BPNN in terms of FD and ranging accuracy.The resultant data indicated that the maximum AE of the IPSO-BPNN was 0.08.While the maximum AE of the traditional BP algorithm and the PSO-BPNN algorithm were 0.65 and 0.10, respectively.Moreover, the RE of the IPSO-BPNN algorithm fluctuated less at different fault distances At 6.0 km, the maximum RE was 2.81%.At 8.0 km, the minimum RE was 0.39% and the maximum RE was 2.81%.The study presented the results from a variety of perspectives.The first aspect addressed by the study was the effectiveness of algorithm improvement.The limitations of the traditional BPNN were addressed by optimizing the parameters of the BPNN using PSO.By achieving a balance between local and global search capabilities, this enhancement increased the network's accuracy and training efficiency.Concerning the findings of the second algorithm comparison, the enhanced algorithm needed less training iterations to reach convergence, and the shorter training duration was more beneficial for real-time applications.The enhanced algorithm demonstrated enhanced accuracy in the identification and isolation of faults, thereby reducing the impact of faults on DNs and ensuring the timely restoration of service.Srinivasa Rao T C et al. used adaptive purification strategy to improve the neural network for FD of power system and also used wavelet decomposition to extract the fault signal features and obtained high prediction accuracy in experiments.This was consistent with the research strategy and both improved the model prediction accuracy [19].The third was the DEDN management aspect.The high accuracy and efficiency of the IPSO-BPNN algorithm can significantly improve the fault management process.By quickly and accurately identifying fault locations, operators can isolate and repair faults more efficiently.Zhang L et al. proposed a model for PS optimization to identify neural networks for prediction and classification of transmission line faults.The model utilized PSO to optimize the neural network parameters and improved the accuracy of the model for fault identification and classification.These studies had same conclusion [20].Consequently, the scalability of the IPSO-BPNN algorithm renders it suitable for large and intricate DN complexes.Moreover, its capacity to adapt to diverse fault conditions renders the model broadly applicable.

Conclusions
With the increasing complexity and size of power systems, the traditional BPNN faces many challenges in DN of SPGF detection, such as slow convergence and easy to fall into local optima.Therefore, improving the accuracy of FD and localization plays an important role in the development of DEDN.An IPSO-BPNN algorithm was developed to enhance the weights and AC of the PSO algorithm by introducing dynamic coefficients to enhance its global and local optimality searching ability.Based on the IPSO-BPNN algorithm, this algorithm was used to optimize the parameters of the FRou, FRan, and BPNN models.In the simulation results, the model proposed in the study showed good FD accuracy and stability, which can be applied in complex DEDN environments and provides an tool for DN fault management.Although the IPSO-BPNN algorithm shows significant advantages, the study still has shortcomings.For example, the algorithm needs to be further analyzed for its real-time and adaptability during practical application.In future research, the diagnosis of extended fault types and the impact of network topology changes on the performance of the algorithm are the focus of research.
X. Han et al.

Figure 2 .
Figure 2. Flow chart of IPSO-BPNN algorithmFirst, the algorithm determines how many nodes are in each layer of the BP network in Figure2based on pertinent parameters.It also determines how many dimensions the PS algorithm has and sets the learning factor, population size, and iterations.Secondly, it calculates the fitness value through the fitness function of PSO, and searches for the individual optimum and the global optimum of the algorithm.Then, the optimal value is constantly updated and adjusted, and when the fitness value meets the set conditions, the algorithm stops iterating, otherwise, the algorithm iterates again.The model constructed above is used for FD of DEDN, which includes FRou and FRan.

1. 2
Fault routing and fault ranging model construction based on IPSO-BPNN In the FRou problem, the fault characteristic quantities need to be extracted, which include transient energy component extraction, fifth harmonic (5thH) characteristic component extraction, and zero-sequence active component (ZSAC) characteristic extraction.When a SPGF occurs, the X.Han et al.

Figure 3 .
Figure 3. Fault line selection model based on IPSO-BPNN

Figure 4 .
Figure 4. Fault location model based on IPSO-BPNN In Fig. 4, a SPGF induces transient characteristic signals in the system, and there is some correspondence between these signals and the location of the FP.This means that by analyzing these transient signals, the location of the FP can be inferred.The traditional wavelet transform has some

Fig. 5 Figure 5 .
Figure 5. Distribution network structure model and fault line structure diagram

Figure 6 .
Figure 6.Fitness values of different test functions Fig. 6(a)-Fig.6(d) represent the adaptation results for the four functions.In Fig. 6(a), the fitness value of Method C is at [0.0001,0.001].The fitness values of Method B and Method A are in [0.001,0.01].In Fig. 6(b), the adaptation value of Method C is close to 0.00001.Both Method B and

Figure 7 .
Figure 7. Results of distribution network fault diagnosis training Fig. 7 represents the performance test of different methods in FRou training of DN.Fig. 7(a) represents the results of the training steps (TSs) for the three methods to train until the training error is satisfied.The TSs for the traditional BPNN is in the range of 18.The TSs for PSO-BPNN is around 12. The TSs for the research proposed algorithm is around 7 times.Fig. 7(b) represents the variation curves of particle fitness for the three methods.The adaptation value of the traditional algorithm is 0.0855.The PSO-BPNN particle adaptation value is 0.0814.The IPSO-BPNN particle adaptation value is 0.0800.The outcomes display the research-proposed IPSO-BPNN performs optimally, with the fastest training speed and the lowest value of the particle adaptation, and has the best performance in terms of adaptation.The comparison between the Tai Chi Teaching Assistance System and traditional learning methods and other technology-assisted approaches provided insightful perspectives on its advantages and areas for improvement.

Figure 8 . 1 Figs. 8
Figure 8. Results of zero-sequence current waveform in state 1 Figs.8(a)-Fig.8(e)represent the ZSC waveforms of DN lines L1-L5 under the condition of state one, respectively.Among them, the transient energy component of L1 is significantly higher than the other lines, which is 2.4489.This indicates that there is a large energy fluctuation on line L1, which may indicate a fault or abnormal condition of the line.The transient energy components of L2, L3, L4 and L5 are lower, which are 0.0829, 0.1207, 0.1884 and 0.314, respectively.Given the smallness of these numbers, it is likely that these lines are functioning normally and that there is little energy fluctuation on them.At 142.316, L1 has the highest 5thHC value.The 5thHCs of L2 to L5 decrease sequentially and are 25.1523, 33.275, 38.098, and 45.7912, respectively.The results indicate that there are high harmonic currents in the L1 line, which may affect the power quality.In terms of ZSAC, the ZSAC of L1 is 4.484 kW significantly higher than the other lines, which indicates the presence of significant unbalanced loads or ground faults in the L1 line.The results of the ZSC waveform in the state two model are shown in Fig. 9.

Figure 10 .
Figure 10.Absolute error results of different models

Table 1 .
Model parameter settings 8(e) represent the ZSC waveforms of DN lines L1-L5 under the condition of state one, respectively.Among them, the transient energy component of L1 is significantly higher than the other lines, which is 2.4489.