Intelligent Prediction of Transformer Loss for Low Voltage Recovery in Distribution Network with Unbalanced Load

: In order to solve the problem of low voltage caused by unbalanced load in the distribution network, a transformer loss intelligent prediction model under unbalanced load is proposed. Firstly, the mathematical model of a transformer with an unbalanced load is established. The zero-sequence impedance and neutral line current of the transformer are calculated by using the Chaos Game Optimization algorithm (CGO), and the correctness of the mathematical model is proved by using actual data. Then, the correlation among network input variables is eliminated by using Principal Component Analysis (PCA), so the number of network input variables is decreased. At the same time, Sparrow Search Algorithm (SSA) is used to optimize the initial weight and threshold of the BP network, and an accurate transformer loss prediction model based on the PCA-SSA-BP is established. Finally, compared with the transformer loss prediction model based on BP network, Genetic Algorithm optimized BP network (GA-BP), Particle Swarm optimized BP network (PSO-BP) and Sparrow Search Algorithm optimized BP network (SSA-BP), the transformer loss prediction model based on PCA-SSA-BP network has been proven to be accurate by using actual data and it is helpful for low-voltage recovery in the distribution network.


Introduction
Transformers are an important piece of equipment in the process of power transmission, transformation and distribution. The power loss of the transformer will have an impact on the operation of the distribution network. According to the power grid data, the total loss of transformer accounts for about 10% of the power generation. Therefore, it will affect the operational economy of the power grid [1]. The reason for the high loss of the transformer is the unbalanced loads in the distribution network. The loss of distribution transformers will affect the bus voltage of the distribution network. There are many reasons for low voltage in distribution networks, one of which is the high loss caused by the unbalanced load in the distribution network. In order to solve this problem, it is necessary to predict the loss of transformer intelligently. Therefore, the object of study is the transformer loss for low-voltage recovery in the distribution network. Both electric vehicles and distributed generation may aggravate the three-phase unbalance of the distribution network. On the one hand, the large-scale electric vehicles connected to the distribution network will have an impact on the three-phase unbalance of the distribution network. On the other hand, distributed photovoltaic sources may cause three-phase unbalance and increase transformer loss in the special operation [2]. In a word, the conventional power flow calculation method is not suitable for unbalanced distribution networks. Therefore, a new power flow calculation method needs to be proposed to solve the above problems.
The loss of the distribution network is composed of line loss and transformer loss. Many studies have investigated on line loss in distribution networks. In [3], a line loss calculation model is established by using the operation data and the resistance characteristics of the transformer. Thus, an accurate line loss model is established by using the regression analysis method. In [4], the relationship between the traditional loss factor and the load factor is defined, and a model for calculating power loss in any system is established assuming that transmitted energy is known. In [5], a comprehensive line loss analysis model is proposed in the distribution network, and it is verified by using actual data. In [6], a new line loss calculation model is established by using a line loss management system and integrated electricity to solve the problem of large workload and inaccurate calculation results. In [7], a line loss analysis and management model is established based on local area network. It not only reduces the input but also improves the efficiency of loss calculation on line. In [8], a new model of calculating line loss is established based on the RBF neural network in the distribution network. Three parameters of the RBF neural network are determined. The complex nonlinear relation between power loss and characteristic parameters of the distribution network is mapped by using RBF neural network. In [9], a reasonable line loss evaluation system is established, and the relationship of the timing feature to the location of a specific size picture is mapped to help us calculate the line loss in the distribution network. In [10], the concept of the "line-loss relaxation factor" is proposed, so the efficiency of the conventional algorithm is improved, and the redundancy of the conventional algorithm is reduced. Due to the current research on predicting transformer loss in the distribution network line loss is relatively less, the prediction of transformer loss under three-phase unbalanced loads is studied, and the Sparrow Search Algorithm is used to solve this problem. Sparrow Search Algorithm is a novel swarm intelligence optimization algorithm [11]. The optimized performance of the SSA algorithm is the same as the Particle Swarm Optimization algorithm, Ant Colony Algorithm, Artificial Bee Colony algorithm and other typical swarm intelligence algorithms, but it has the advantages of a simple model, less parameters and avoiding falling into local optimal solution. It has been widely used in path planning, task scheduling, image processing and other fields. It has become a new research hotspot in the field of intelligent algorithms. Principal Component Analysis is used to eliminate the correlation among input parameters. Integrated SSA and PCA, an accurate transformer loss prediction model based on the PCA-SSA-BP network, is established. The contributions of this paper are as follows: Firstly, the mathematical model of the transformer with an unbalanced load is established, and this model is solved by using Chaos Game Optimization Algorithm; Secondly, the transformer loss prediction model is established based on the PCA-SSA-BP network; Finally, comparing with the transformer loss prediction model based on BP network, GA-BP network, PSO-BP network and SSA-BP network, the transformer loss prediction model based on the PCA-SSA-BP network is accurate.

Distribution Network Data Processing
The grey relational analysis is widely used in forecasting in various fields [12], so the grey relational analysis is introduced before the introduction of Principal Component Analysis [13], and the influencing factors with high correlation obtained by grey relational analysis are applied to the Principal Component Analysis to obtain the corresponding principal components. Finally, the original influencing factors obtained by grey relational analysis are replaced by the obtained principal components.
Firstly, the reference sequence and the comparison sequence are determined. The total index sequences {Z 1 , Z 2 , Z 3 , Z 4 , Z 5 , Z 6 , Z 7 , Z 8 , Z 9 , Z 10 , Z 11 } are {U A , U B , U C , I A , I B , I C , θ A , θ B , θ C , I n , T L }, respectively. The reference sequence is selected based on the correlation between the index and the predicted target. In this paper, the reference sequence is the total transformer loss Z 11 , and the reference sequence is shown in (1).  Three-phase voltage {U A , U B , U C }, three-phase current {I A , I B , I C }, three-phase power  factor angle {θ A , θ B , θ C } and neutral line current {I n } are selected as the comparison sequence  {Z 1 , Z 2 , Z 3 , Z 4 , Z 5 , Z 6 , Z 7 , Z 8 , Z 9 , Z 10 }, as shown in (2).
where n is the number of data groups. Then, the data of distribution network are simplified into dimensionless, as shown in (3). Due to the units of different parameters in the distribution network are different, it is not convenient for comparison and analysis, so the data of distribution network are dimensionless.
The sequence after processing is shown in (4).
where ρ is the discrimination coefficient, and the range of values for the discrimination coefficient is [0, 1]. In this paper, ρ = 0.5. Finally, the correlation degree is calculated, the expression is shown in (6).
where G i is the correlation between each index and the total transformer loss T L ; n is the number of data groups. By using the grey correlation analysis, the correlation degree of every factor is shown in Table 1, and it can be seen that the correlation degree between every influencing factor and the total transformer loss is greater than 0.88. The influence of three-phase voltage on the total transformer loss is the biggest among several influencing factors, followed by the three-phase power factor angle, and the influence of three-phase current on the total transformer loss is the smallest. It also provides direction for future decision-making.
In order to realize the optimization of power parameters in distribution network, the original energy data of the distribution network is written into a matrix V, as shown in (7).
Some operation data collected in distribution network are shown in Table 2.  After standardizing the original data collected in the distribution network, the partial standardized data are shown in Table 3. Then, the correlation coefficient matrix is calculated by using Principal Component Analysis, the correlation coefficient matrix is shown in Table 4. It can be seen from Table 4 that the absolute values of some correlation coefficients among the influencing factors are greater than 0.5. It shows that there is a correlation among the factors, and the accuracy of the prediction model will be affected.
Then, the Principal Component Analysis is used for the 2016 groups of data, and the variance contribution rate of principal components is shown in Table 5. It can be seen from Table 5 that the cumulative contribution rate of the seven principal components has reached 99%. It indicates that most of the original data is contained in the seven principal components. In order to retain more information, the eight components are selected as principal components, and the component matrix of the eight principal components is obtained, as shown in Table 6. By using (8), the principal component load matrix can be obtained, as shown in Table 7.
where U i is the element in the principal component load matrix, A i is the element in the component matrix and λ i is the characteristic value. Table 7 shows that the original network input is reduced from 10 factors to only 8 factors so as to improve the efficiency and accuracy of the algorithm. The eight principal components can be expressed in (9).

Calculation of Zero-Sequence Impedance of Transformer Modeling of Transformers under Unbalanced Loads
At present, there are some methods to calculate the zero-sequence impedance of a transformer [14]. The mathematical model of the distribution transformer is shown in (10).
E A , E B and E C are the equivalent three-phase voltage sources of the transformer; U A , U B and U C are the voltage obtained from the load side of the transformer; I A , I B and I C are the current obtained from the load side of the transformer; Z T is the short-circuit impedance of the transformer.
The short-circuit impedance of transformer can be calculated by using (11) and (12).
where ∆P k is the short circuit loss of the transformer, ∆U * t is the impedance voltage percentage of the transformer, U n is the rated voltage of the transformer and S n is the rated capacity of the transformer.
So the short-circuit impedance of transformer can be calculated by using (13).
Energies 2023, 16, 4432 7 of 19 Z n is the zero-sequence impedance in the equivalent circuit of the distribution transformer, and the expression is shown in (14).
I n is the current flowing through the neutral line in the equivalent circuit of the distribution transformer, and the expression is shown in (15).
The above complex equation is represented by real part and imaginary part. According to the active power P and reactive power Q at the load side of the transformer, the following power factor angles can be obtained by using (16).
Let α be the angle between the voltage of measurement point in each phase and the equivalent voltage source, and θ is the power factor angle, then β can be obtained by using (17).
Then, the expression of neutral point current I n is shown in (18).
Therefore, the expression of neutral point voltage U n is shown in (19). · U n = (R n I nr − X n I ni ) + j(R n I ni + X n I nr ).
The three-phase impedance voltage in the transformer is expressed in (20).
. (20) Therefore, the complex equation is expanded into real part and imaginary part equations, as shown in (21) and (22).
In the above equations, E A , E B , E C , R n , X n , α A , α B and α C are unknown, assuming that E A = E B = E C = e, so there are six variables. Finally, the equations are shown in (23).
Due to the above equations being nonlinear equations, it is very difficult to use the direct solution method. Most of the numerical methods depend on the initial point, and sometimes the results are not very ideal. As a new meta heuristic algorithm, the Chaos Game Optimization algorithm is suitable for solving constrained nonlinear equations [15]. The algorithm can provide very competitive results. It is better than other meta heuristics in most cases. In this paper, the solution of the nonlinear equations is transformed into the optimization of the objective function, and the Chaos Game Optimization algorithm is used to solve the optimal solution of the objective function.
Then the solution of the original nonlinear equations is transformed into a set of numbers u = (u 1 , u 2 , u 3 , u 4 , u 5 , u 6 ), so that the objective function can obtain the minimum value.

Calculation of Zero-Sequence Impedance of Transformer
Firstly, the range of each variable is constrained, and the constraint range for each variable is shown in Table 8. The Chaos Game Optimization algorithm is used to solve the zero-sequence impedance of the transformer, and the zero-sequence impedance obtained by the Chaos Game Optimization algorithm is compared with the measured data to observe the error of the CGO algorithm. The specific steps for solving this optimization problem by using the CGO algorithm are as follows: 1.
Let the maximum number of iteration be 100, and the initial number of qualified points be 25. For each candidate solution X i , it is composed of some decision variables x i,j , it represents the position of these qualified seeds in the Sierpinski triangle. The Sierpinski triangle needs to be used as the search space for the candidate solution.
The mathematical model is shown in (25).
where n is the number of qualified seeds in the search space, and d is the dimension of these seeds.

2.
The initial position of qualified seeds is determined by (26) and the corresponding fitness is calculated. For these seeds, the initial position is determined randomly in the search space, and the expression is shown in (26). The global optimal eligibility point and global optimal value GB are determined.

4.
For each eligible point X i in the search space, the average value MG i is determined.

5.
For each eligible point X i in the search space, a temporary triangle is determined by using X i , MG i and GB. 6.
For each temporary triangle, the position of four seeds is updated. In this algorithm, four methods for creating seeds are proposed to achieve optimization objectives. The first seed is located in X i , the second seed is located in GB, the third seed is located in MG i and the position of the fourth seed is generated based on a random candidate solution. The expression is shown in (27).
where α i can be determined by using (28).
The location of the seed is evaluated, and the fitness value is updated. 8.
Determine whether current iteration number has exceeded the maximum iteration number. If the maximum number of iterations has not been exceeded, return to step (3) to iterate and calculate. If the maximum number of iterations has been exceeded, the optimal location and global optimal solution will be output.
When the zero-sequence impedance of the transformer is calculated, the zero-sequence loss of the transformer can be calculated, as shown in (29). P f0 = (3I 0 ) 2 R n .
(29) The total loss of the transformer can be calculated by using the no-load loss and load loss of the transformer. The transformer model can be established by using distribution network parameters under unbalanced loads, and the zero-sequence impedance is calculated. Finally, the transformer loss is calculated. However, the computational efficiency of this method is low. Therefore, if distribution network electrical parameters can be used to predict transformer loss, it will improve computational efficiency.

Modeling of Transformer Loss Based on PCA-SSA-BP
The total loss of the transformer can be calculated by using the zero-sequence impedance of the transformer, and then the transformer loss prediction model is trained by using the data detected by the distribution network and the total loss of the transformer. Although BP neural network can be optimized by using Sparrow Search Algorithm to seek the global optimal solution if SSA-BP neural network model is used for prediction directly, there is a strong correlation among the parameters, and it will lead to low accuracy of the model. The correlation among variables can be solved effectively by using Principal Component Analysis. By using Principal Component Analysis, the data collected from the distribution network z = {U A , U B , U C , I A , I B , I C , θ A , θ B , θ C , I n } are decreased to only eight principal components y = {Y 1 , Y 2 , Y 3 , Y 4 , Y 5 , Y 6 , Y 7 , Y 8 }. In the 2016 groups of data, the 1616 groups of data are used as the training samples, the 400 groups of data are used as test data and the accuracy is evaluated with average error. The input of network optimization is shown in Figure 1. number. If the maximum number of iterations has not been exceeded, return to step (3) to iterate and calculate. If the maximum number of iterations has been exceeded, the optimal location and global optimal solution will be output.
When the zero-sequence impedance of the transformer is calculated, the zero-sequence loss of the transformer can be calculated, as shown in (29).
The total loss of the transformer can be calculated by using the no-load loss and load loss of the transformer. The transformer model can be established by using distribution network parameters under unbalanced loads, and the zero-sequence impedance is calculated. Finally, the transformer loss is calculated. However, the computational efficiency of this method is low. Therefore, if distribution network electrical parameters can be used to predict transformer loss, it will improve computational efficiency.

Modeling of Transformer Loss Based on PCA-SSA-BP
The total loss of the transformer can be calculated by using the zero-sequence impedance of the transformer, and then the transformer loss prediction model is trained by using the data detected by the distribution network and the total loss of the transformer. Although BP neural network can be optimized by using Sparrow Search Algorithm to seek the global optimal solution if SSA-BP neural network model is used for prediction directly, there is a strong correlation among the parameters, and it will lead to low accuracy of the model. The correlation among variables can be solved effectively by using Principal Component Analysis. By using Principal Component Analysis, the data collected from the distribution network z = {UA, UB, UC, IA, IB, IC, θA, θB, θC, In} are decreased to only eight principal components y = {Y1, Y2, Y3, Y4, Y5, Y6, Y7, Y8}. In the 2016 groups of data, the 1616 groups of data are used as the training samples, the 400 groups of data are used as test data and the accuracy is evaluated with average error. The input of network optimization is shown in Figure 1.  The modeling process of transformer loss prediction based on PCA-SSA-BP is shown in Figure 2.
The specific modeling process of the transformer loss prediction based on PCA-SSA-BP is described as follows: 1.
The original power data set detected in distribution network is {U A , U B , U C , I A , I B , I C , θ A , θ B , θ C , I n }; 2.
The input dimension of the transformer loss prediction model is reduced by using Principal Component Analysis, expressed as The 2016 groups of data detected in the distribution network are divided into two groups. The 1616 groups of data are used to train the transformer loss prediction model, and the 400 groups of data are used to test the established transformer loss prediction model; 4.
The initial size of sparrow population n is defined as n = 30, and the maximum number of iteration N is defined as N = 100. 5.
The topological structure of BP network and the search space dimension dim of sparrow search algorithm are determined, the input layer and hidden layer are defined as M and N, respectively, then the structure is M − N − 1, and the search dimension dim is M × N + N × 1 + N + 1;

6.
Then, the fitness function is determined. In this paper, the fitness function is defined as the average value of the mean square error of the training set and the mean square error of the test set. The function is shown in (30).
where N 1 is the number of training sets, N 1 = 1616, N 2 is the number of test sets, N 2 = 400, N = N 1 + N 2 ; y train is the output value of training set, y test is the output value of test set and y is the actual value. 7.
The fitness values of the initial sparrow population are calculated and ranked, and the current corresponding best value f best and the worst value f worst are selected. 8.
The location of the discoverer, the joiner and the sparrow individuals who sense danger are updated according to steps (6) and (7). 9.
According to the iteration rules, if the current optimal value is better than the last iteration result, the update will continue, otherwise it will not be updated, and the iteration will continue. 10. Set iteration termination criteria. When the fitness value is less than the accuracy of the initial model or the number of iterations is exhausted, the iteration will be terminated, and the optimal fitness value and its corresponding global optimal position best x will be output. 11. The BP network is optimized by using the global optimal position best x , the optimal weight and threshold parameters are obtained and assigned to the BP network model, so as to realize training and simulation prediction of the network. The specific modeling process of the transformer loss prediction based on PCA-SSA-BP is described as follows:

Verification of Zero-Sequence Impedance
According to the model and operation data of the transformer provided in [16], it is used to verify the correctness of the CGO algorithm. The specific information of the transformer is shown in Table 9. The comparison results are shown in Table 10. The percentage error in Table 10 is calculated by using (31).
In addition to comparison of the zero-sequence impedance of the transformer, the three-phase voltage and neutral current of the transformer can also be compared, as shown in Tables 11 and 12.  From Tables 10-12, it can be seen that the error between calculated data and the measured data is very small. It proves the correctness of transformer calculated by the CGO algorithm.

Verification of Neutral Line Current
The operation data of a transformer for 21 days provided by a power supply company in Liaoning Province is selected. For the normal operation of the transformer, the voltage, current and power data of the transformer should be detected every 15 min. So 96 groups of transformer data can be detected in a day, and there are 2016 groups of data in 21 days. The total loss of the transformer is regarded as the decisive factor. Partial operation data of distribution transformer are shown in Table 2. The specific information of the transformer is shown in Table 13. The voltage, current and power data detected in the distribution network can be written as 2016 groups of nonlinear equations, and each nonlinear equation is equivalent to an objective function, it is solved by CGO optimization algorithm. The comparison result between the neutral line current calculated by this algorithm and the actual detected is shown in Figure 3, and the error of the calculation result is shown in Figure 4.
The operation data of a transformer for 21 days provided by a power supply company in Liaoning Province is selected. For the normal operation of the transformer, the voltage, current and power data of the transformer should be detected every 15 min. So 96 groups of transformer data can be detected in a day, and there are 2016 groups of data in 21 days. The total loss of the transformer is regarded as the decisive factor. Partial operation data of distribution transformer are shown in Table 2. The specific information of the transformer is shown in Table 13. The voltage, current and power data detected in the distribution network can be written as 2016 groups of nonlinear equations, and each nonlinear equation is equivalent to an objective function, it is solved by CGO optimization algorithm. The comparison result between the neutral line current calculated by this algorithm and the actual detected is shown in Figure 3, and the error of the calculation result is shown in Figure 4.  As can be seen from Figure 4, the maximum error of the calculation results is less than 20%, and the average error percentage of the 2016 groups of data is 7.32%. Due to the large amount of data, the data from 1 to 100 and 101 to 200 are selected to observe, as shown in As can be seen from Figure 4, the maximum error of the calculation results is less than 20%, and the average error percentage of the 2016 groups of data is 7.32%. Due to the large amount of data, the data from 1 to 100 and 101 to 200 are selected to observe, as shown in Figure 5. As can be seen from Figure 4, the maximum error of the calculation results is less than 20%, and the average error percentage of the 2016 groups of data is 7.32%. Due to the large amount of data, the data from 1 to 100 and 101 to 200 are selected to observe, as shown in Figure 5. As can be seen from Figure 5, the calculated current and the detected current have the same changes and the error is very small, it can prove the correctness of the CGO algorithm in calculating the neutral point current of the transformer.

Verification of Transformer Voltage
The comparison diagram between the three-phase voltage source value calculated by the CGO algorithm and the three-phase voltage detected by the distribution network is now listed. The comparison diagram is shown in Figure 6. As can be seen from Figure 5, the calculated current and the detected current have the same changes and the error is very small, it can prove the correctness of the CGO algorithm in calculating the neutral point current of the transformer.

Verification of Transformer Voltage
The comparison diagram between the three-phase voltage source value calculated by the CGO algorithm and the three-phase voltage detected by the distribution network is now listed. The comparison diagram is shown in Figure 6. As can be seen from Figure 5, the calculated current and the detected current have the same changes and the error is very small, it can prove the correctness of the CGO algorithm in calculating the neutral point current of the transformer.

Verification of Transformer Voltage
The comparison diagram between the three-phase voltage source value calculated by the CGO algorithm and the three-phase voltage detected by the distribution network is now listed. The comparison diagram is shown in Figure 6.  There are 2016 groups of original electricity data. Due to the large amount of data, the 120 groups of voltage data are now listed. The comparison diagram is shown in Figure 7.  As can be seen from Figure 7, the changes of the three-phase voltage source of the transformer calculated by the CGO algorithm is consistent with the actual detected voltage, and the error is very small, it proves the correctness of the CGO algorithm in calculating the equivalent voltage source of the transformer.  As can be seen from Figure 7, the changes of the three-phase voltage source of the transformer calculated by the CGO algorithm is consistent with the actual detected voltage, Energies 2023, 16, 4432 16 of 19 and the error is very small, it proves the correctness of the CGO algorithm in calculating the equivalent voltage source of the transformer.

Intelligent Prediction of Transformer Loss Based on PCA-SSA-BP
In this paper, 1616 groups of data are used as training samples in the PCA-SSA-BP network, 400 groups of data are used as prediction data and the accuracy is evaluated by using the average error. To verify the effectiveness of this algorithm, this algorithm is compared with GA-BP, SSA-BP, BP and PSO-BP network prediction models. The comparison diagrams are shown in Figures 8-11 below.       Table 14.   The average error percentages of transformer loss predicted by BP, GA-BP, PSO-BP, SSA-BP and PCA-SSA-BP neural networks are shown in Table 14.  The average error percentages of transformer loss predicted by BP, GA-BP, PSO-BP, SSA-BP and PCA-SSA-BP neural networks are shown in Table 14.  Table 14, it can be seen that although the minimum error percentage of the PCA-SSA-BP model is not the smallest, the median and maximum error percentages are reduced compared to the other four algorithms. Therefore, the accuracy of the transformer loss prediction model can be improved by using PCA-SSA-BP. Compared with the transformer loss prediction model based on the BP network, the accuracy of the transformer loss prediction model based on PCA-SSA-BP has been improved by 1.12%; Compared with the transformer loss prediction model based on the GA-BP network, the accuracy of the transformer loss prediction model based on PCA-SSA-BP has been improved by 1.01%; Compared with the transformer loss prediction model based on PSO-BP network, the accuracy of transformer loss prediction model based on PCA-SSA-BP has been improved by 0.82%; Compared with the transformer loss prediction model based on SSA-BP network, the accuracy of transformer loss prediction model based on PCA-SSA-BP has been improved by 0.31%. The transformer loss prediction model based on PCA-SSA-BP is accurate by using 2016 groups of data. It is suitable for the loss estimation of power flow calculation in the distribution network.

Conclusions
An intelligent transformer loss prediction model based on PCA-SSA-BP is proposed to solve the problem of low accuracy in transformer loss calculation under three-phase unbalanced loads. The prediction model for transformer loss is optimized and an accurate transformer loss prediction model is obtained. Compared with the transformer loss prediction model based on the BP network, GA-BP network, PSO-BP network and SSA-BP network, the transformer loss prediction model based on the PCA-SSA-BP network has been proven to be accurate by using actual data. The highest improvement in prediction accuracy is 1.12%. The effectiveness and feasibility of this algorithm is verified in the transformer loss prediction with an unbalanced load.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to the need to protect the security of power data.

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