Estimation of Total Real and Reactive Power Losses in Electrical Power Systems via Artificial Neural Network

: Total real and reactive power losses in electrical power systems are an inevitable phenomenon and occur due to several factors, such as conductor resistance, transformer impedance, line reactance, equipment losses, and phase unbalance. Minimizing them is crucial to the system’s efficiency. In this study, an artificial neural network, specifically a Multi-layer Perceptron, was employed to predict total real and reactive power losses in electrical systems. The network is composed of three layers: an input layer consisting of the variables loading factor, real and reactive power generated on the slack bus, a hidden layer, and an output layer representing the total real and reactive power losses. The training method used was backpropagation, adjusting the weights based on the desired output. The results obtained, using datasets from IEEE systems with 14, 30, and 57 buses, showed satisfactory performance, with a mean squared error of around 10 − 4 and a coefficient of determination (R 2 ) of 0.998. In validation with 20% of the data that was not part of the training, the network demonstrated effectiveness, with a mean squared error around 10 − 3 . This indicates that the network was able to accurately predict total power losses based on loads, generating estimates close to the desired values.


Introduction
During the process of delivering energy to final consumers, a substantial portion of energy is dissipated in the transmission and distribution systems, resulting in both technical and non-technical losses.Technical losses, which include inefficiencies in equipment and infrastructure, cause economic losses and environmental impacts on a national scale [1].Therefore, optimizing these losses must be addressed comprehensively and nationally, regardless of the institutional structure of the electricity sector or the ownership of concessionary companies.The volume of losses in transmission and distribution systems is significant, typically ranging between 3% and 13%, highlighting their relevance to the efficiency of the system as a whole [1].The analysis of electrical power systems often uses load flow calculation, a fundamental and widely used approach [2][3][4].Many applications, from expansion planning to network reconfiguration and storage capacity, depend on these calculations [5][6][7].The classical formulation based on Newton's method is commonly adopted due to its effectiveness in both transmission and distribution systems [8].However, a significant drawback of this method is the need to construct and factorize the Jacobian matrix at each iteration, which can be computationally expensive, especially for large-scale systems [9,10].
Continuation power flow (CPF) is an approach to determine the total losses of the electrical system for each load increment until reaching the critical point (CP).It is crucial to identify this point, as it marks the transition between the region of stability and the region of instability of the system.However, accurately obtaining this point can be challenging due to the singularity of the Jacobian matrix, requiring the use of parameterization techniques for its determination [11].These additional techniques can significantly increase the computational cost of the process.In this context, it is desirable in engineering that even well-established energy systems analysis methods are revisited and eventually improved.In recent decades, an alternative formulation based on artificial neural networks (ANN) has been widely employed [12][13][14][15][16].In [12], two artificial neural networks (ANN) were presented, the Multi-Layer Perceptron and the Radial-Based Perceptron, with the objective of estimating the magnitudes of voltages on the buses of electrical power systems, taking into account several parameters, such as the loading factor, the real and reactive power in the slack bus, and the contingent branch number.The results indicated that the Radial Base ANN was able to accurately estimate the desired output, presenting an error of around 10 −4 .In [13], promising results were obtained in which an artificial neural network (ANN) reproduced the same results with high accuracy and speed compared to traditional voltage stability calculation methods.For this, the loading parameter and the voltage stability margin index were calculated using eight different input variables and fourteen different training functions.This approach allowed us to identify which training function was most efficient and offered the best ability to predict the loading margin and voltage stability index.
In the study [14], artificial intelligence (AI) was used to identify predictive biomarkers relevant to the prognosis of diffuse large B-cell lymphoma.Two neural networks, using Multi-Layer Perceptron (MLP) and Function Network Radial Base (RBF), demonstrated an efficient methodology for identifying these biomarkers.In [15], an application of an MLP model for fast and automatic prediction of the geometry of finished products is presented.The results show that both the training and the tests carried out were highly accurate, with an accuracy rate that exceeded 92%, demonstrating the feasibility and effectiveness of the proposed method.In the study mentioned in [16], several artificial neural networks (ANNs) algorithms were proposed to estimate voltage instability in power systems.These ANN models, based on different training algorithms, were developed and subjected to a comparative analysis, aiming to accurately predict the voltage collapse phenomenon.
Existing power loss estimators have many weaknesses, such as complicated methods, many static assumptions, and dependency on the slack unit.If the existing configuration of any network is randomly changed from its base case, then these estimators may produce negligible and unacceptable errors [17].A different technique was proposed in [17] that has the ability to solve the problems mentioned in a constant and direct way.A large number of power flow solutions are used to create a large dataset for training artificial neural networks.Therefore, through some numerical experiments, this technique proves to be an effective tool for accurately and cost-effectively estimating real and reactive power losses, but with a relatively high number of iterations and CPU time.
In this context, this study proposes an alternative methodology to obtain the power curve versus total loss of real and reactive power, avoiding the complexities associated with the Jacobian matrix, in addition to identifying the maximum loading point or critical point (CP) in electrical power systems.The objective is to develop an alternative and effective tool that can quickly assist in obtaining the total power loss curve with a low number of iterations and CPU time in relation to the works presented in the literature.Continuation power flow methods consist of several nonlinear equations, and as mentioned, singularity in the Jacobian matrix at the CP of electrical systems.Additionally, these methods require many iterations and consume a significant amount of CPU time, in contrast to the use of artificial neural networks (ANNs), as proposed in this article.The following sections will present the materials and methods, systems, ANNs, a flowchart, and analyses (MSE, MAPE, and Kruskal-Wallis test) for evaluating the error between the obtained and desired vectors.Subsequently, the results of the network's training and validation performance will be discussed, along with comparisons of the applied analyses.Finally, a discussion of the obtained results and conclusions will be provided.

Materials and Methods
The system analyzed in this study corresponds to the configuration of IEEE 14, 30, and 57-bus systems, as illustrated in Figure 1a-c.The IEEE 14 system is composed of 1 slack bus, 4 generation buses, 9 load buses, and 20 transmission lines.Meanwhile, the IEEE 30 system has 1 slack bus, 5 generation buses, 24 load buses, and 41 transmission lines.Finally, the IEEE 57 system consists of 1 slack bus, 6 generation buses, 50 load buses, and 80 transmission lines.
Appl.Syst.Innov.2024, 7, x FOR PEER REVIEW 3 of 13 and analyses (MSE, MAPE, and Kruskal-Wallis test) for evaluating the error between the obtained and desired vectors.Subsequently, the results of the network's training and validation performance will be discussed, along with comparisons of the applied analyses.Finally, a discussion of the obtained results and conclusions will be provided.

Materials and Methods
The system analyzed in this study corresponds to the configuration of IEEE 14, 30, and 57-bus systems, as illustrated in Figure 1a-c.The IEEE 14 system is composed of 1 slack bus, 4 generation buses, 9 load buses, and 20 transmission lines.Meanwhile, the IEEE 30 system has 1 slack bus, 5 generation buses, 24 load buses, and 41 transmission lines.Finally, the IEEE 57 system consists of 1 slack bus, 6 generation buses, 50 load buses, and 80 transmission lines.For the IEEE 14-bus system, 213 samples were utilized, while for the IEEE 30-bus system, 184 samples were used, and for the IEEE 57-bus system, 202 samples were employed, resulting in a total of 599 samples.These samples were acquired according to the parameterization continuation power flow (PCPF) method described in [2,11] and were used for training and validation of ANN.Each sample is composed of five pieces of data: three input data for the ANN, which include the loading factor (λ) and the real and reactive powers generated at the slack bus (P g slack and Q g slack ), and two output data representing the loss total real (Pa) and reactive (Pr) power of the system.The ANN used is an MLP (Multi-Layer Perceptron) with a backpropagation learning algorithm with three layers: input with 3 neurons, hidden with 10 neurons, and 2 neurons in the output layer, as shown in Figure 2. The software used to obtain the results was Matlab ® , version 2024 [18].
Appl.Syst.Innov.2024, 7, x FOR PEER REVIEW 4 of 13 For the IEEE 14-bus system, 213 samples were utilized, while for the IEEE 30-bus system, 184 samples were used, and for the IEEE 57-bus system, 202 samples were employed, resulting in a total of 599 samples.These samples were acquired according to the parameterization continuation power flow (PCPF) method described in [2,11] and were used for training and validation of ANN.Each sample is composed of five pieces of data: three input data for the ANN, which include the loading factor (λ) and the real and reactive powers generated at the slack bus (Pg slack and Qg slack ), and two output data representing the loss total real (Pa) and reactive (Pr) power of the system.The ANN used is an MLP (Multi-Layer Perceptron) with a backpropagation learning algorithm with three layers: input with 3 neurons, hidden with 10 neurons, and 2 neurons in the output layer, as shown in Figure 2. The software used to obtain the results was Matlab ® , version 2024 [18].Continuation power flow (CPF), unlike experimental random classification, is characterized by a sequence of nonlinear equations.Its resolution is achieved by varying the load factor parameter, resulting in different values for the real (Pa) and reactive (Pr) power losses of the system in each case.For this type of dataset, MLP networks prove to be wellsuited.Figure 3 illustrates the flowchart of the MLP network used to estimate the total real (Pa) and reactive (Pr) power losses of electrical power systems.Continuation power flow (CPF), unlike experimental random classification, is characterized by a sequence of nonlinear equations.Its resolution is achieved by varying the load factor parameter, resulting in different values for the real (Pa) and reactive (Pr) power losses of the system in each case.For this type of dataset, MLP networks prove to be well-suited.Figure 3 illustrates the flowchart of the MLP network used to estimate the total real (Pa) and reactive (Pr) power losses of electrical power systems.
Appl.Syst.Innov.2024, 7, x FOR PEER REVIEW 4 of 13 For the IEEE 14-bus system, 213 samples were utilized, while for the IEEE 30-bus system, 184 samples were used, and for the IEEE 57-bus system, 202 samples were employed, resulting in a total of 599 samples.These samples were acquired according to the parameterization continuation power flow (PCPF) method described in [2,11] and were used for training and validation of ANN.Each sample is composed of five pieces of data: three input data for the ANN, which include the loading factor (λ) and the real and reactive powers generated at the slack bus (Pg slack and Qg slack ), and two output data representing the loss total real (Pa) and reactive (Pr) power of the system.The ANN used is an MLP (Multi-Layer Perceptron) with a backpropagation learning algorithm with three layers: input with 3 neurons, hidden with 10 neurons, and 2 neurons in the output layer, as shown in Figure 2. The software used to obtain the results was Matlab ® , version 2024 [18].Continuation power flow (CPF), unlike experimental random classification, is characterized by a sequence of nonlinear equations.Its resolution is achieved by varying the load factor parameter, resulting in different values for the real (Pa) and reactive (Pr) power losses of the system in each case.For this type of dataset, MLP networks prove to be wellsuited.Figure 3 illustrates the flowchart of the MLP network used to estimate the total real (Pa) and reactive (Pr) power losses of electrical power systems.The activation functions used were the hyperbolic tangent for the hidden layer (1) and linear for the output layer (2).
where, f (u) = hyperbolic tangent activation function; t = estimate of the parameter that determines the slope of the curve; u = function activation potential.
The mean square error (MSE) vector of the ANN is calculated according to Equation ( 3), where Y ob and Y des represent the obtained and desired outputs of the ANN, respectively.The more similar these outputs are to each other, the smaller the error, indicating a more accurate weight adjustment.
where, p = number of data; Y des = desired values (target via experiment); Y ob = values obtained via ANN.
As the MSE, the Mean Absolute Percentage Error (MAPE) was also applied to the performance of the models used in Equation ( 4).The Mean Absolute Percentage Error (MAPE) is one of the most commonly used Key Performance Indicators to measure forecast accuracy.The results are presented in Table 1.A test used in the literature is the Kruskal-Wallis test, which is a nonparametric version of classical one-way ANOVA, and an extension of the Wilcoxon rank sum test to two groups or more.It compares the medians of the groups of data in x to determine if the samples come from the same population (or, equivalently, from different populations with the same distribution) [18].Within this context, several papers have been published in the literature on the Kruskal-Wallis test [19,20].In Bayram and Çıtako glu, 2023, the predictive power of three different machine learning (ML)-based approaches was investigated for long-term monthly reference evapotranspiration prediction.Satisfactory results were found.Table 1 also shows the p_values corresponding to the Kruskal-Wallis test analysis.It is observed that when applied at 5%, a comparison between the obtained output (Y ob -ANN) and the desired output (Y des ) showed similar distributions.

Results
Of the 599 samples, 80% were randomly selected for training (479 samples) and 20% for validation (120 samples).Figure 4a shows the performance of the neural network during training and validation.It is evident that the best performance, measured by the mean squared error (MSE), was achieved after 14 iterations (epochs) for training, with an error of 9.68 × 10 −4 , while for validation, the error was 1.023 × 10 −3 in the 14th iteration.The total training time was 3 s for the 14 iterations, as indicated in Table 1. Figure 4b  predictive power of three different machine learning (ML)-based approaches was investigated for long-term monthly reference evapotranspiration prediction.Satisfactory results were found.Table 1 also shows the p_values corresponding to the Kruskal-Wallis test analysis.It is observed that when applied at 5%, a comparison between the obtained output (Yob-ANN) and the desired output (Ydes) showed similar distributions.

Results
Of the 599 samples, 80% were randomly selected for training (479 samples) and 20% for validation (120 samples).Figure 4a shows the performance of the neural network during training and validation.It is evident that the best performance, measured by the mean squared error (MSE), was achieved after 14 iterations (epochs) for training, with an error of 9.68 × 10 −4 , while for validation, the error was 1.023 × 10 −3 in the 14th iteration.The total training time was 3 s for the 14 iterations, as indicated in Table 1. Figure 4b   Figure 5 illustrates the correlation between the desired output (x-axis) and the obtained output (y-axis).It is observed that, for training the network in Figure 5a with 80% of the samples, that is, 479 samples, the value of the coefficient of determination (R 2 ) was 0.9994, indicating a strong correlation between the outputs obtained by the ANN and those desired by the CPF.To validate the model in Figure 5b, with 20% of the samples that were not used in training (120 samples), the R 2 value was 0.9993, demonstrating a strong correlation between the outputs (similarity between the outputs).A similar result was observed in Figure 5c for 100% of the samples (599 samples), with an R 2 of 0.9994.Based on these results, we can infer that the ANN was able to predict the total power losses (real and reactive) with a low error (MSE), both during training and, especially, during model validation, which are samples that were not part of the training.Figure 5 illustrates the correlation between the desired output (x-axis) and the obtained output (y-axis).It is observed that, for training the network in Figure 5a with 80% of the samples, that is, 479 samples, the value of the coefficient of determination (R 2 ) was 0.9994, indicating a strong correlation between the outputs obtained by the ANN and those desired by the CPF.To validate the model in Figure 5b, with 20% of the samples that were not used in training (120 samples), the R 2 value was 0.9993, demonstrating a strong correlation between the outputs (similarity between the outputs).A similar result was observed in Figure 5c for 100% of the samples (599 samples), with an R 2 of 0.9994.Based on these results, we can infer that the ANN was able to predict the total power losses (real and reactive) with a low error (MSE), both during training and, especially, during model validation, which are samples that were not part of the training.
A. Results for the IEEE 14-bus system Figure 6 shows the total real (Pa) and reactive (Pr) power losses, both desired (targets-Y des ) and obtained by the ANN (Y ob ).In Figure 6a, the results during the training phase with 80% of the samples (173) are presented, showing a high similarity between the obtained output and the desired one, and the same pattern is observed for Pr.During the validation, in which Pa and Pr losses were predicted, Figure 6b displays the results for the 40 samples (20%) that were not used in training, for both Pa and Pr.A similar behaviour is noticed between the outputs in both curves, indicating that the network managed to approximate Y ob very closely to Y des .Finally, Figure 6c shows the total losses of Pa and Pr desired (Y des ) and the outputs obtained (Y ob ) by ANN for 100% of the samples (213 samples), where a similar behaviour is also observed between the outputs on both curves.

A. Results for the IEEE 14-bus system
Figure 6 shows the total real (Pa) and reactive (Pr) power losses, both desired (targets-Ydes) and obtained by the ANN (Yob).In Figure 6a, the results during the training phase with 80% of the samples (173) are presented, showing a high similarity between the obtained output and the desired one, and the same pattern is observed for Pr.During the validation, in which Pa and Pr losses were predicted, Figure 6b displays the results for the 40 samples (20%) that were not used in training, for both Pa and Pr.A similar behaviour is noticed between the outputs in both curves, indicating that the network managed to approximate Yob very closely to Ydes.Finally, Figure 6c shows the total losses of Pa and Pr desired (Ydes) and the outputs obtained (Yob) by ANN for 100% of the samples (213 samples), where a similar behaviour is also observed between the outputs on both curves.Figure 7 shows the total real (Pa) and reactive (Pr) power loss curves, both desired and obtained, as a function of the loading factor (λ) for the IEEE 14 bus system.In the study of continuation power flow (CPF) in electrical power systems, reaching the critical  A. Results for the IEEE 14-bus system Figure 6 shows the total real (Pa) and reactive (Pr) power losses, both desired (targets-Ydes) and obtained by the ANN (Yob).In Figure 6a, the results during the training phase with 80% of the samples (173) are presented, showing a high similarity between the obtained output and the desired one, and the same pattern is observed for Pr.During the validation, in which Pa and Pr losses were predicted, Figure 6b displays the results for the 40 samples (20%) that were not used in training, for both Pa and Pr.A similar behaviour is noticed between the outputs in both curves, indicating that the network managed to approximate Yob very closely to Ydes.Finally, Figure 6c shows the total losses of Pa and Pr desired (Ydes) and the outputs obtained (Yob) by ANN for 100% of the samples (213 samples), where a similar behaviour is also observed between the outputs on both curves.Figure 7 shows the total real (Pa) and reactive (Pr) power loss curves, both desired and obtained, as a function of the loading factor (λ) for the IEEE 14 bus system.In the study of continuation power flow (CPF) in electrical power systems, reaching the critical Figure 7 shows the total real (Pa) and reactive (Pr) power loss curves, both desired and obtained, as a function of the loading factor (λ) for the IEEE 14 bus system.In the study of continuation power flow (CPF) in electrical power systems, reaching the critical point (CP) with a minimum error is extremely important, since this point defines the stability and instability of the system.In this work, the CP value for Pa obtained via ANN was (λ, Pa) = (1.7680,0.8008), while the desired value is (λ, Pa) = (1.7680,0.7855).This resulted in an error of 0.0153 for Pa in CP.As for Pr, the CP obtained value was (λ, Pr) = (1.7680,3.1245), while the desired value is (λ, Pr) = (1.7680,3.1321), with an error of 0.0076, according to

B. Results for the IEEE 30-bus system
Similar results are also observed for the IEEE 30 bus system.In Figure 8, the total real (Pa) and reactive (Pr) power losses desired (Ydes) are presented, as well as those obtained (Yob) via ANN, for the two phases: training (80% of samples), validation (20% of samples), and for all samples (100%).In Figure 8a, the training results (148 samples) are shown, while in Figure 8b, the validation results (36 samples) are shown.It is important to highlight that the validation samples were not used in training the network; however, even so, the ANN was able to estimate Pa and Pr values very close to those desired.Finally, in Figure 8c, the total real (Pa) and reactive (Pr) power losses desired (Ydes) and obtained (Yob) for all samples (184 samples) are shown.Figure 9 shows, on the left, the curves of real power loss (Pa) as a function of load λ, including both the desired one via CPF and that obtained via ANN.It is observed that there was a difference in the values in the region of maximum real power loss.However, at the critical point (CP), the values obtained were quite close: (λ, Pa) = (1.5335,0.8036) for Ydes and (λ, Pa) = (1.5335,0.8316) for Yob, resulting in an error of 0.0280.On the right of Figure 8, the reactive power loss curves (Pr) as a function of load λ (Ydes-desired and Yob-obtained) show similarities between both, resulting in very close CP values: (λ, Pr) = (1.5335,2.9657) for Ydes and (λ, Pr) = (1.5335,3.0070) for Yob, resulting in an error of 0.0423.These values can be seen in Table 2.

B. Results for the IEEE 30-bus system
Similar results are also observed for the IEEE 30 bus system.In Figure 8, the total real (Pa) and reactive (Pr) power losses desired (Y des ) are presented, as well as those obtained (Y ob ) via ANN, for the two phases: training (80% of samples), validation (20% of samples), and for all samples (100%).In Figure 8a, the training results (148 samples) are shown, while in Figure 8b, the validation results (36 samples) are shown.It is important to highlight that the validation samples were not used in training the network; however, even so, the ANN was able to estimate Pa and Pr values very close to those desired.Finally, in Figure 8c, the total real (Pa) and reactive (Pr) power losses desired (Y des ) and obtained (Y ob ) for all samples (184 samples) are shown.Figure 9 shows, on the left, the curves of real power loss (Pa) as a function of load λ, including both the desired one via CPF and that obtained via ANN.It is observed that there was a difference in the values in the region of maximum real power loss.However, at the critical point (CP), the values obtained were quite close: (λ, Pa) = (1.5335,0.8036) for Y des and (λ, Pa) = (1.5335,0.8316) for Y ob , resulting in an error of 0.0280.On the right of Figure 8, the reactive power loss curves (Pr) as a function of load λ (Y des -desired and Y ob -obtained) show similarities between both, resulting in very close CP values: (λ, Pr) = (1.5335,2.9657) for Y des and (λ, Pr) = (1.5335,3.0070) for Y ob , resulting in an error of 0.0423.These values can be seen in Table 2.     10a shows training with 80% of the samples (158 samples).Validation is demonstrated in Figure 10b, with 20% of the samples (44 samples) that were not used in training, providing estimated Pa and Pr data.Finally, Figure 10c shows the results for all samples (202 samples).

C. Results for the IEEE 57-bus system
Figure 11 shows the total real and reactive power losses (Pa and Pr) in relation to the increase in load (λ).The similarity of the values obtained via ANN is noticeable when compared to the desired outputs.This is due to the high correlation between the outputs, highlighting the robustness of the ANN developed for this application.10a shows training with 80% of the samples (158 samples).Validation is demonstrated in Figure 10b, with 20% of the samples (44 samples) that were not used in training, providing estimated Pa and Pr data.Finally, Figure 10c shows the results for all samples (202 samples).
Figure 11 shows the total real and reactive power losses (Pa and Pr) in relation to the increase in load (λ).The similarity of the values obtained via ANN is noticeable when compared to the desired outputs.This is due to the high correlation between the outputs, highlighting the robustness of the ANN developed for this application.

Discussion
The values corresponding to CP (critical point) for each system studied and the error between the obtained value in relation to the desired are detailed in Table 2. Tables 3-5 display the values of the weights of the connections between the input and hidden layers, between the hidden layer and the output layer, as well as the corresponding bias values of the hidden and output layers, for the neural network with the configuration [2,3,10].Figures 6b, 8b, and 10b depict the validation phase of the model via ANN.During the validation phase, the network literally calculated the values of total real and reactive power losses based on the training it received.In other words, during the validation phase, only the input data to the network (loading factor, real and reactive power at the reference bus) are presented, and based on its training (with all weights W adjusted), the network is able to infer the system's loss value (real and reactive) for a given load.To demonstrate that the results are similar to the desired losses, the desired output was also Figure 11 shows the total real and reactive power losses (Pa and Pr) in relation to the increase in load (λ).The similarity of the values obtained via ANN is noticeable when compared to the desired outputs.This is due to the high correlation between the outputs, highlighting the robustness of the ANN developed for this application.

Discussion
The values corresponding to CP (critical point) for each system studied and the error between the obtained value in relation to the desired are detailed in Table 2. Tables 3-5 display the values of the weights of the connections between the input and hidden layers, between the hidden layer and the output layer, as well as the corresponding bias values of the hidden and output layers, for the neural network with the configuration [2,3,10].Figures 6b, 8b, and 10b depict the validation phase of the model via ANN.During the validation phase, the network literally calculated the values of total real and reactive power losses based on the training it received.In other words, during the validation phase, only the input data to the network (loading factor, real and reactive power at the reference bus) are presented, and based on its training (with all weights W adjusted), the network is able to infer the system's loss value (real and reactive) for a given load.To demonstrate that the results are similar to the desired losses, the desired output was also

Discussion
The values corresponding to CP (critical point) for each system studied and the error between the obtained value in relation to the desired are detailed in Table 2. Tables 3-5 display the values of the weights of the connections between the input and hidden layers, between the hidden layer and the output layer, as well as the corresponding bias values of the hidden and output layers, for the neural network with the configuration [2,3,10].Figures 6b, 8b and 10b depict the validation phase of the model via ANN.During the validation phase, the network literally calculated the values of total real and reactive power losses based on the training it received.In other words, during the validation phase, only the input data to the network (loading factor, real and reactive power at the reference bus) are presented, and based on its training (with all weights W adjusted), the network is able to infer the system's loss value (real and reactive) for a given load.To demonstrate that the results are similar to the desired losses, the desired output was also plotted on the graph, solely for comparison purposes, and the similarity between them (Y des and Y ob ) can be observed.

Conclusions
In this study, an approach using MLP-type artificial neural networks was proposed to estimate total real and reactive power losses in electrical power systems.These estimates were made as a function of the load factor (λ) and the real and reactive powers generated in the slack bus (P g slack and Q gslack ).During network training, good performance was achieved, with a mean squared error (MSE) of 9.6832 × 10 −4 in the fourteenth iteration, a training time of 3 s, and a correlation (R 2 ) of 0.99.In the validation phase, where samples that were not used in training were estimated, an approximation was observed between the obtained outputs (Y ob ) and the desired outputs (Y des ), with an error of around 1.0233 × 10 −3 and R 2 equal to 0.99.This highlights a strong correlation between the outputs, demonstrating that the network has the capacity to act as an estimator of total power losses.Additionally, the Pa and Pr curves as a function of λ were obtained for the three systems studied, identifying the critical points with low error in relation to the desired outputs.

Figure 2 .
Figure 2. ANN used in this work.

Figure 3 .
Figure 3. Flowchart depicting the MLP utilized in this study.

Figure 2 .
Figure 2. ANN used in this work.

Figure 2 .
Figure 2. ANN used in this work.

Figure 3 .
Figure 3. Flowchart depicting the MLP utilized in this study.Figure 3. Flowchart depicting the MLP utilized in this study.

Figure 3 .
Figure 3. Flowchart depicting the MLP utilized in this study.Figure 3. Flowchart depicting the MLP utilized in this study.
displays the error histogram, represented by the difference between the desired output and the obtained output (|Y des − Y ob |) relative to zero error.It is notable that the error remained around zero for the analyzed data.Appl.Syst.Innov.2024, 7, x FOR PEER REVIEW 6 of 13 displays the error histogram, represented by the difference between the desired output and the obtained output (|Ydes − Yob|) relative to zero error.It is notable that the error remained around zero for the analyzed data.

Figure 6 .
Figure 6.Pa (Ydes e Yob) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 14-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

Figure 6 .
Figure 6.Pa (Ydes e Yob) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 14-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

Figure 6 .
Figure 6.Pa (Y des and Y ob ) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 14-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

Figure 8 .
Figure 8. Pa (Ydes e Yob) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 30-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

Figure 10
Figure 10 illustrates the results (Pa on the left and Pr on the right) obtained by the artificial neural network (ANN) during network training and validation.Figure10ashows training with 80% of the samples (158 samples).Validation is demonstrated in Figure10b, with 20% of the samples (44 samples) that were not used in training, providing estimated Pa and Pr data.Finally, Figure10cshows the results for all samples (202 samples).Figure11shows the total real and reactive power losses (Pa and Pr) in relation to the increase in load (λ).The similarity of the values obtained via ANN is noticeable when compared to the desired outputs.This is due to the high correlation between the outputs, highlighting the robustness of the ANN developed for this application.

Figure
Figure 10 illustrates the results (Pa on the left and Pr on the right) obtained by the artificial neural network (ANN) during network training and validation.Figure10ashows training with 80% of the samples (158 samples).Validation is demonstrated in Figure10b, with 20% of the samples (44 samples) that were not used in training, providing estimated Pa and Pr data.Finally, Figure10cshows the results for all samples (202 samples).Figure11shows the total real and reactive power losses (Pa and Pr) in relation to the increase in load (λ).The similarity of the values obtained via ANN is noticeable when compared to the desired outputs.This is due to the high correlation between the outputs, highlighting the robustness of the ANN developed for this application.

Figure 8 .
Figure 8. Pa (Y des and Y ob ) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 30-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

Figure 8 .
Figure 8. Pa (Ydes e Yob) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 30-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

Figure 9 .
Figure 9. Obtained curves from the IEEE 30-bus system: (a) Pa (Ydes and Yob) vs. λ, i.e., total real power loss curve (Pa) vs. loading factor (λ); (b) Pr (Ydes and Yob) vs. λ, i.e., curve total reactive power loss (Pr) vs. loading factor (λ).C. Results for the IEEE 57-bus systemFigure 10 illustrates the results (Pa on the left and Pr on the right) obtained by the artificial neural network (ANN) during network training and validation.Figure10ashows training with 80% of the samples (158 samples).Validation is demonstrated in Figure10b, with 20% of the samples (44 samples) that were not used in training, providing estimated Pa and Pr data.Finally, Figure10cshows the results for all samples (202 samples).Figure11shows the total real and reactive power losses (Pa and Pr) in relation to the increase in load (λ).The similarity of the values obtained via ANN is noticeable when compared to the desired outputs.This is due to the high correlation between the outputs, highlighting the robustness of the ANN developed for this application.

Figure
Figure 10 illustrates the results (Pa on the left and Pr on the right) obtained by the artificial neural network (ANN) during network training and validation.Figure10ashows training with 80% of the samples (158 samples).Validation is demonstrated in Figure10b, with 20% of the samples (44 samples) that were not used in training, providing estimated Pa and Pr data.Finally, Figure10cshows the results for all samples (202 samples).Figure11shows the total real and reactive power losses (Pa and Pr) in relation to the increase in load (λ).The similarity of the values obtained via ANN is noticeable when compared to the desired outputs.This is due to the high correlation between the outputs, highlighting the robustness of the ANN developed for this application.

Figure 10
Figure 10 illustrates the results (Pa on the left and Pr on the right) obtained by the artificial neural network (ANN) during network training and validation.Figure10ashows training with 80% of the samples (158 samples).Validation is demonstrated in Figure10b, with 20% of the samples (44 samples) that were not used in training, providing estimated Pa and Pr data.Finally, Figure10cshows the results for all samples (202 samples).

Figure 10 .
Figure 10.Pa (Ydes e Yob) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 57-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

Figure 10 .
Figure 10.Pa (Y des and Y ob ) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 57-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

13 Figure 10 .
Figure 10.Pa (Ydes e Yob) Pa (total real power losses) and Pr (total reactive power losses) as a function of the samples from the IEEE 57-bus system: (a) training (80% of the samples); (b) validation (20% of the samples); (c) 100% of the samples (2 network phases).

Table 1 .
Values specified and achieved in training and validation of ANN compared to desired output Y des .
* Achieved criterion.NS-not significant applied to 5%

Table 2
presented at the end of the results.

Table 2 .
Values obtained at the critical point (CP) by the CPF and ANN.

Table 3 .
Weights of the connections between the neurons of the input layer and the hidden layer (W Rm ).

Table 4 .
Weights of the connections between the neurons of the hidden layer and the output layer (W mi ).

Table 5 .
Bias of the neurons of each layer (hidden and output).