ComparisonofMachineLearningAlgorithms for thePredictionof Mechanical Stress in Three-Phase Power Transformer Winding Conductors

(is research compares four machine learning techniques: linear regression, support vector regression, random forests, and artificial neural networks, with regard to the determination of mechanical stress in power transformer winding conductors due to three-phase electrical faults. (e accuracy compared with finite element results was evaluated for each model. (e input data were the transient electrical fault currents of power system equivalents with impedances from low to high values. (e output data were the mechanical stress in the conductors located in the middle of the winding. To simplify the design, only one hyperparameter was varied on each machine learning technique. (e random forests technique had the most accurate results. (e highest errors were found for low-stress values, mainly due to the high difference between maximum and minimum stresses, which made the training of the machine learning models difficult. In the end, an accurate model that could be used in the continuous monitoring of mechanical stress was obtained.


Introduction
e determination of electromagnetic forces due to electrical faults in power transformer windings is a crucial activity developed during the design stage [1][2][3]. is problem is generally solved through numerical methods because of the transformer geometry characteristics and the partial equations involved. Nowadays, the finite element method (FEM) is the most used technique for this task in [4][5][6][7].
Internally, FEM divides the medium into triangular or rectangular elements inside which the magnetic field is considered constant [8]. e more variation the field has, the more elements are needed for better accuracy. Since the field value is unknown at the beginning, the first attempt at the disposition of elements is performed according to the geometry of the problem. After that, the elements are iteratively divided and relocated depending on the results of the simulations [9]. erefore, the whole process takes a long time to find the solution for one set of high and low voltage currents. is time consuming process is not a problem for power transformer design because the simulation is limited to a few cases corresponding to the worst case scenario. However, when conducting a continuous analysis of the effect of the forces or mechanical stress in transformer windings, such as a stress analysis [10,11], using FEM is unfeasible mainly because the results are needed almost in real-time.
An alternative path to solve this problem is the method of images since it reduces the algebraic operations needed to find the forces. e method of images for magnetic fields was presented by Hammond [12] based on the works introduced by omson and Kelvin [13]. Kulkarni and Khaparde suggested its use for the determination of the transformer reactance based on the magnetic field [14]. Minhas utilized the method of images for the determination of forces and winding vibrations in a single phase transformer [15]. In another investigation, the forces acting in the transformer terminal are calculated through the use of the method of images [16]. e method of images assumes that the permeability of the core is constant, and for each winding, the magnetic material extends towards infinite. As an advantage, this method directly gives the forces without the need to calculate the magnetic field. However, it has not been applied to three-phase transformers; hence, it is unclear how the images must be located, mainly for the windings that embrace the middle limb of the core. Another issue is the constant permeability, which does not represent the problem when the transformer phases affect each other.
In a previous work, the application of artificial neural networks (ANNs) for the determination of mechanical stress has been analysed [17]. For training the ANNs, FEM simulations were used, and a good approximation was obtained. e advantage of the method is the time reduction in getting the results. Although FEM is still necessary to get the training data, it is no longer used for the rest of the power transformer lifetime after the model is obtained. e drawback is the difficulty of training the ANNs. ey have many hyperparameters that affect the model accuracy [18]. Finding the best combination of hyperparameters could become cumbersome.
is research explores the use of four machine learning techniques for the determination of mechanical stress: linear regression (LR), support vector regression (SVR), random forests (RF), and ANN. e objective is to compare each technique's accuracy when varying only one hyperparameter, thus simplifying the model design and implementation. e worst accuracy result found when using ANNs was chosen for comparison purposes, i.e., when the electrical fault faces a high impedance [17].

Method
ere are two stages in the development of the machine learning tools: (i) Generation of data: the mechanical stress is found for different electrical currents circulating through the windings (ii) Training of the machine learning model: the pair electrical currents-mechanical stress is used to train the model

Mechanical
Stress. e first step towards finding the mechanical stress is the determination of the magnetic induction B around the winding conductor. For this, recall that the magnetic vector potential A acting in a point obeys the Poisson equation (1), where J is the current density circulating through the point and μ is the permeability of the medium. en, B can be found by equation (2).
For the solution of equation (1), the software FEMM [19], which implements FEM, was used. Table 1 presents the transformer characteristics, while Table 2 presents the geometry entered in FEMM. e electrical currents considered correspond to electromagnetic transients of electrical faults that face impedances from z � 1 + j15Ω to z � 5 + j80Ω. A total of 7839 and 795 training and validation cases were generated, respectively. ey belong to faults starting when Phase A, Phase B, and Phase C cross zero. Equation (3) shows the formulation for the low voltage winding transient current, where ω is the angular frequency of the system, t is the time, ϕ is the angle representing the fault starting point, θ is the angle between phases (120°in a three-phase balanced system), and λ � ωr/x l , where r and x l are the equivalent resistance and inductive reactance seen by the fault. e high voltage current is determined with the ratio of the respective windings.
Once B was found, the force per volume unit on the conductor was calculated by the following equation: e radial force in the middle conductors of the windings represents the highest value [17]. Moreover, this force component is the only one that could affect the conductor continuously because the winding internal structure nullifies the axial force effects. erefore, a simplified model of the winding conductor can be used to determine the stress, where the conductor is modelled as a ring with radius Rad ring and cross-sectional area S c . us, the force P normal to the section of the conductor subjected to a An additional simplification was to take the whole disk as a conductor. In that way, the FEM discretization was reduced and so was the simulation time to create the training and validation samples.

Machine Learning Models.
e design and implementation of the machine learning models were performed in the Python library scikit-learn 0.24.2. For each technique, Table 3 shows the scikit-learn libraries employed and the modified hyperparameters. Two libraries are needed in LR because the LinearRegression library can model only a straight line. With PolynomialFeatures, a higher degree polynomial, including the products of all the input variables, can be used for the model.
Previous to training, the input and output data were standardized (see equation (7)) so that all the values are in the range from zero to one.
e most suitable hyperparameter value is determined by evaluating the coefficient of determination R 2 , defined by equation (8), where y true is the true value of the output variable, y pred is the output value predicted by the model, and y true is the mean value of the output variable:

Hyperparameters for the Highest Accuracy.
For LR, the polynomial degree was varied from one to nine. Figure 1 shows the accuracy variation. e validation test had the best behaviour between degrees five and eight. e polynomial of degree five was considered for the sake of simplicity. Figure 2 shows the error for SVR, when the hyperparameter C varied from 1 to 400. e minimum error value is located at C � 250. e training error was nearly constant for high values of C, but the validation error slightly increased, which could indicate overfitting.
In RF, the number of trees was modified (see Figure 3). e error decreased until a number of 100 trees. After that, the error was constant both in the training data and in the validation test. e maximum number of trees was set at 1000 because the training time was too long after that. Moreover, no improvement was seen from 100 to 1000 trees. Hence, 100 trees were chosen for the model. Figure 4 shows the variation of the error for a different number of units in the hidden layer for ANN. Only one hidden layer was considered because that architecture has the best accuracy for the ANN-based models [17] in the mechanical stress problem. e number of units had a small effect on the training data error. However, the error decreased almost uniformly in the validation test, reaching a minimum at 1625 units. is machine learning technique accentuated the different behaviour between the training data and the validation test. It was clear that increasing the number of units in the layer did not decrease the model's error.
A comparison of the lowest error is seen in Figure 5. RF had the best behaviour, LR and SVR have similar values, and ANN has the highest error.

Error Comparison for a Transient Fault Current.
e highest error of the ANN model in the determination of the mechanical stress was found for electrical faults with the highest impedance in a previous work. In particular, the case of r � 1Ω and x l � 80Ω was seen as having the worst accuracy [17]. erefore, that case was analysed in this research for the comparison of the machine learning techniques. Figure 6 shows the mean absolute percentage error (MAPE) for the determination of stress in the low voltage winding conductors. LR and RF had the lowest MAPE, whereas it was the highest for SVR and ANN models. In general, Phase B has the highest error.
In Figure 7, the MAPE for the mechanical stress in the high voltage winding is shown. LR and RF still present the lowest error. e SVR model has the highest error in Phase B.
To clarify where the differences between the machine learning and FEM models are located, Figures 8 to 11 present the results for the worst cases of each model. All of them belong to the high voltage winding simulations. In general, there is a high difference in low values of the mechanical stress. is may be due to the lower importance that these cases have for the machine learning tool. For the practical use of the model, this behaviour is not an issue because the low mechanical stresses have little effect on the deterioration of the winding conductor.
e ANN model has a particular behaviour, as shown in Figure 11. e error prevails even when close to the steadystate of the transient. e error is high for the first cycles with high and low stresses. For practical analysis, the ANN model has the worst outcome.

Discussion
e mechanical stress and the electromagnetic forces in windings have a strong dependence on the electrical currents. For that reason, although the validity tests have cases outside those used in the training process, each machine learning Journal of Electrical and Computer Engineering       Journal of Electrical and Computer Engineering model has presented high accuracy, showing a low level of overfitting. is means that the behaviour seen by the model during training is much related to the behaviour of the validation set of data. erefore, except for the ANN model, the rest of the validation cases have given even lower errors than those of the training simulations. As is usual in machine learning models, overfitting is possible when the model is more complex, e.g., when augmenting the polynomial degree in LR or the value of hyperparameter C in SVR.
In the variation of hyperparameters, the models have a homogeneous behaviour in the validation test. When the model is simple, the error is high and lowers when the model increases its complexity. e error reaches a minimum at some value and then begins to rise, showing signs of overfitting. e exception to this behaviour is ANN, which has skipped in the flow of error when the model is more complex.
is characteristic makes it difficult to find the optimal point in the model design. e multiple relations that exist inside the ANN model, with all the weights and activation functions, might be the reason for that unusual behaviour. e RF model has the best accuracy. is result is seen in the particular case of high impedance simulation for the low voltage winding as well as in the validation test results. e chosen model has 100 trees. e second technique with the lowest error is LR, which was modelled with a five-degree polynomial. As a result, cross-terms between the six input currents are included in the internal structure of the model. is input data interconnection has allowed the model to represent the nonlinearities of the phenomenon and mainly the influence of the different input currents. It opens the possibility of  improving the predictions for other machine learning models if some combination of the winding currents is included as input data.

Conclusions
Four machine learning techniques have been compared with regard to accuracy. Only one hyperparameter has been varied for each technique so that the design process is simplified.
is study demonstrates that the appropriate machine learning technique improves the accuracy of the model. For the determination of mechanical stress in transformer windings, the random forest proved to be the best model, even for the high impedance electrical fault, which was the worst case in our previous research presented in [17].
All the models present the highest error in low values of stress. ere is a high difference in the stress values during the transient period. is affects the behaviour of the machine learning models even though the input data are standardized before the training process. Nonetheless, this is not such an issue since the mechanical stress with the highest value is the one that could cause damage to the conductor.
By finding the right machine learning technique, the utilities might have a powerful tool that allows the continuous monitoring of the mechanical stress behaviour.   Journal of Electrical and Computer Engineering us, in the future, policies of fatigue analysis to determine the deterioration of the winding conductor could be established.

Data Availability
e CSV files with the training and validation data used to support the findings of this study are available from the corresponding author upon request.