Machine learning for prediction models to mitigate the voltage deviation in photovoltaic-rich distributed network

The voltage deviation is one of the most crucial power quality issues that occur in electrical power systems. Renewable energy plays a vital role in electrical distribution networks due to the high economic returns. However, the presence of photovoltaic systems changes the nature of the energy flow in the grid and causes many problems such as voltage deviation. In this work, several predictive models are examined for voltage regulation in the Jordanian Sabha distribution network equipped with photovoltaic farms. The augmented grey wolf optimizer is used to train the different predictive models. To evaluate the performance of models, a value of one for regression factor and a low value for root mean square error, mean square error, and mean absolute error are used as standards. In addition, a comparison between nineteen predictive models has been made. The results have proved the capability of linear regression and the gaussian process to restore the bus voltages in the distribution network accurately and quickly and to solve the shortening in the voltage dynamic response caused by the iterative nature of the heuristic algorithm.


INTRODUCTION
Large solar power plants in the desert are often connected to the local electric grid through lengthy high-voltage transmission lines. However, because of the nature of solar irradiation, it will influence the voltage profile along the transmission line. Yi-Bo et al. [1] examined the effect of a grid-connected photovoltaic (PV) power plant on voltage profiles. The validity of their technique was then confirmed by comparing it to power flow analysis. According to the findings, the bus voltage increases in a parabolic pattern as the PV power output increase. Tonkoski et al. [2] tested the voltage profiles in residential districts where PV systems are present. A simulation analysis was conducted to observe possible voltage raise concerns in the network with total PV penetration of 11.25% in the feeder and transformer capacity penetration of 75%. When distributed PV resources do not exceed 2.5 kW per household on a typical distribution grid, the results show that PV penetration does not negatively influence grid voltage. In [3], a particle swarm optimization (PSO) algorithm is employed for determining the best placement and sizing for various types of distributed generators (DGs), such as renewable energy sources. The IEEE 123 node distribution feeder was used as a test platform. The findings showed that integrating the properly sized DGs at the ideal locations minimizes overall energy loss in the distributed network and improves the voltage profile. In [4], the voltage regulation sensitivities of power system buses were evaluated using a reactive power voltage. The IEEE 14-bus system and the New England 39-bus system were used to test the suggested technique. As the renewable energy sources (RES) penetration level rises, the sensitivity analysis of the buses might reveal the best location for big reactive loads or devices like flexible alternating current transmission systems (FACTS).
To provide an optimal power flow based on the secure and stable operation of the distribution network, it is necessary to achieve the appropriate reactive power distribution [5], [6]. The optimal generation of reactive power is to find the suitable operating settings for the compensators such as static Var compensator (SVC), static synchronous compensator (STATCOM), and on-load tap changer transformers. The control parameters of these compensators are continuously modified to keep the voltages of the load buses at a balanced condition and within the acceptable range to improve the power quality [7], [8]. The thyristor-controlled reactor (TCR), thyristor switched capacitor, and bank capacitors (BC) are the types of SVC. In electrical power systems, they are widely used in voltage regulation, voltage balancing, and power factor correction [9], [10]. In [11], a wide range of reactive power compensation was achieved for threephase voltage unbalance mitigation in 500 km electrical power systems, using TCR and TSC. The achieved range of voltage unbalance factor (VUF) for voltage balancing was 3.33% and 12.4601% at the quick and precise response. In [12], a PSO-artificial neural network (PSO-ANN) controller was proposed to mitigate the voltage unbalance in the three-phase electrical power system. The PSO algorithm and the mathematical model were used in the steady-state condition to determine the required reactive power for voltage balancing. The ANN was trained by these data to restore the voltage balance in the online operations. The proposed technique showed its high performance and produced a very low VUF. STATCOM was introduced in [13] to mitigate the voltage sag and voltage swell and in [14], to improve the voltage profile and reduce the total harmonics distortion down to 0.92%. The simulated results showed the capability and fast response of the technique to sudden changes.
The optimization algorithms, ANNs, and predictive models play an essential role in solving many engineering problems such as voltage regulation and voltage balancing in electrical power systems, mitigation of voltage deviation, and stability improvement in electrical distribution networks. In [15], combined compensators were employed at each load and distribution line to improve the power factor and reduce the power loss of the distribution network. Three heuristic algorithms were examined PSO, parasitism predation algorithm (PPA), and tunicate swarm algorithm (TSA), and PSO showed its capability in reducing power loss in the distribution network. In [16], different loads of distribution systems were modeled and tested for the minimum power loss in the distribution network. IEEE 16-bus and 33-bus were used, and dolphin optimization algorithm (DOA) was employed for achieving optimal values of capacitors and reactive power compensation. Chaudhary and Rizwan [17] introduced three techniques, stored energy, photovoltaic power, and reactive power, to mitigate voltage deviation in the electrical distribution network under high photovoltaic penetration. The results concluded that the reactive power technique showed high response time and efficiency. Ermis et al. [18] proposed wind driven optimization (WDO) algorithm to solve the voltage deviation problem in the IEEE 9-bus power system, showing its supremacy in voltage regulation. Many algorithms are applied to improve the power dispatch on IEEE 57,118 bus systems [19]. The moth-flame optimization (MFO) and grey wolf optimizer (GWO) outperformed the other tested algorithms in power loss reduction, voltage deviation, and stability. In [6], the teaching learning based optimization (TLBO) and PSO algorithms were applied to IEEE 30 bus system. The results concluded that the line losses and voltage deviation were minimized by PSO, and the L-index function that reflects stability was reduced by TLBO. Naderi et al. [14] used PSO-fuzzy logic to improve the power flow of the IEEE 30 bus system, implementing a reactive power compensator. The proposed technique showed its capability in computed time, line losses, and voltage deviation.
In this work, an advanced GWO (AGWO) is proposed to calculate the operating settings for STATCOMs in the Jordanian Sabha Distribution Network (JSDN) required for voltage regulation at three network buses. However, there is a shortening in the dynamic response of AGWO due to its iterative nature. To overcome the delay in the dynamic response of the AGWO, machine learning is proposed to train the predictive models for real-time voltage regulation. Many predictive models are presented, and a comparison between their performances is made. This comparison is based on many training factors such as regression factor (RF), mean square error (MSE), mean absolute error (MAE), and their responses to the voltage deviation at intermediate buses of JSDN. The paper is organized as: the PV-rich distributed network is described in section 2. The proposed augmented grey wolf optimizer algorithm for learning prediction models is presented in section 3. Section 4 presents the results and discussion. Section 5 concludes this work.

PV-RICH DISTRIBUTED NETWORK
The JSDN equipped by the PV farm at Badiah station is considered in this work as a real case study to mitigate the voltage deviation at intermediate buses: 2, 3, and 4, at Saliheah load, Sabha load-one, and  Figure 1.

AGWO FOR PREDICTION MODELS LEARNING
In this work, a meta-heuristic algorithm called AGWO is used to prepare the data set for training the predictive models for voltage regulation in JSDN. The AGWO is a tempt of searching, besieging, and hunting the grey wolves [20]. It is well suited to applications with a small number of search units, such as the electric power system. In [20], a comparison between the AGWO algorithm and others were made, as shown in Table 1, based on the number of functions for which the method yielded the best result. The AGWO outperformed the other algorithms, as seen in the table. Also, in this work, the AGWO was run up to 100 iterations to get the best voltage regulation based on the minimum objective function, as shown in Figure 2. The minimum objective function was obtained with minimal iterations, demonstrating the algorithm's efficiency. The supremacy of AGWO manifested in how to determine fitness value, agent position update, and the parameter equation. The first and the second-best fitness values are stored with their respective positions α and β. The agent position update is based on the average positions of α and β. The parameter equation is calculated from the relation: where rand is a random number between 0 and 1, is the iteration number. In this work, fitness is developed and used by AGWO. It is given: where Vref rated voltage at 1 p.u.; Vb=2, 3,4 are the bus voltage at buses: 2, 3, and 4 of JSDN.

Prediction models
Predictive modeling is a mathematical method that tries to predict future results through statistical theorems by analyzing patterns that can probably forecast the results. Linear regression is a classifier approach that uses a regression function to perform [21]. The desired predicted value is calculated based on independent variables. It is usually used to predict how variables are connected. In linear regression (LR), the prediction of a dependent variable (Y) is based on the value of an independent variable (x). A linear relationship between x-input and Y-output is established due to this regression technique. The following equation illustrates the generic formula for LR models: where β(1, 2,… n) is a deviation factor, ε is an error factor. Regression analysis is used to determine the independent values of the regression coefficients β against the training data set. To forecast the value of Y for a given value of x, the trained model should match the best line by determining the optimum β values. By achieving the best-fit regression line, the model aims to predict the Y value so that the error difference between the predicted and true value is as little as feasible. As a result, updating β values is required to minimize the following function: where function (E) is the root mean square error (RMSE) between the predicted and true values. Machine learning methods for creating prediction models from data include classification and regression trees. The models are created by recursively splitting the data space and fitting a simple prediction model to each partition. As a result, the partitioning can be graphically shown as a decision tree. For dependent variables with a finite number of unsorted values, classification trees are used, with prediction error evaluated in terms of classification cost. Regression trees are used to model changes in the dependent variable having continuous or ordered discrete values, with prediction error defined as the squared difference between observed and forecasted values. In [22], the author examines recent advances and provides a quick overview of the basic concepts underlying some of the most popular regression tree algorithms. On the other hand, another researcher uses regression trees to analyze data in several fields. Such as in [23], which shows an investigation of the impact of high-speed rail on tourist choices using a regression tree approach, forecasting students' science achievement using the regression tree method in [24]. The gaussian process regression (GPR) is a stochastic process to provide predictions based on prior knowledge, and it is used in statistical methods, regression, and pattern classification [25]. A machinelearning algorithm involving a Gaussian process uses learning and measures the similarity between points. The kernel function predicts the value for an unseen point from training data. The advantage of GPR is in inserting observations and adjusting the fitting. The regression function is given: where: : the observed data points. : function output. Another machine learning methodology is the ensemble approach which integrates numerous tree models to generate an effective or optimal predictive model, allowing for better predictive performance than a single model [26]. The decision of Trees is nonparametric, at which a lot of data exists, but not enough knowledge around the data. In addition to the prediction, the decision Trees are interpretable, and after building the model, inferences can be made about our data.
Moreover, in machine learning, a support vector machine (SVM) is a supervised learning model with associated learning algorithms that analyze data to solve classification and regression problems [27]. The objective of the support vector machine algorithm is to locate a super-plane in a featured n-dimensional space that classifies the data points. In [28], Cortes and Vapnik suggested that the classification of an unknown vector x is done by first transforming the vector to the separating space and then making the function: According to the properties of the soft margin classifier method, the vector w can be written as (7): Then: where: : a bias factor.

Learning the prediction models
A MATLAB-Simulink environment is used to build the model for JSDN equipped by a PV farm at Badiah station. Due to its high accuracy, a power flow analysis is performed based on the Newton-Raphson method [29]. As a first stage of the work, AGWO is applied offline to determine the optimal location for STATCOMs in the JSDN and their operating settings for voltage regulation at intermediate buses of the network. The performance of AGWO for voltage regulation is very high. Although the high capability of AGWO in the offline mode for mitigating voltage deviation at intermediate buses, the iteration process for the AGWO algorithm delays the dynamic response to the changes in the network. Therefore, as a second stage, the data set obtained by the AGWO algorithm is used to train the predictive models for voltage regulation in the online mode to overcome the delay of AGWO response and solve the voltage deviation with high performance. The predictive modes used in this work are LR, SVM, regression trees (RT), and GPR. Figure 3 shows the schematical diagram for training these models using the data set obtained by the AGWO algorithm.

RESULTS AND DISCUSSION
The outcomes of training various predictive models and the real-time performance of qualified models for online voltage regulation are discussed in this part. The first section of the discussion looks at predictive models with a regression factor close to one and a minimum value for RMSE, MSE, and MAE. The second section focuses on achieving low average voltage deviation online voltage regulation for the JSDN.

Training results in the offline mode
In . The optimal value of the regression factor is acquired if the predictive model response is very close to the ideal response. Nineteen predictive models are trained in this work. They are LR linear, LR interactions linear, LR robust linear, LR stepwise linear, Tree fine, Tree medium, Tree coarse, SVM linear, SVM quadratic, SVM cubic, SVM fine Gaussian, SVM medium Gaussian, SVM coarse Gaussian, Ensemble Boosted, Ensemble Bagged, GPR squared, GPR Matern, GPR exponential, and GPR rational. In addition, Table 1 summarizes the performance of these predictive models based on RF, RMSE, MSE, and MAE. The best outcomes can be achieved when the RF value is close to one and the RMSE, MSE, and MAE are low. Table 2 shows that the linear regression group outperformed the other groups. Furthermore, within this group, the superior performance is LR stepwise linear based on MAE. Figures 4-6 illustrate the linear regression group's high performance and harmony between the prediction model's response and the perfect one. Moreover, Table 2 proved that the next group for high performance is the GPR. Furthermore, GPR Matern has the best performance among the GPR group. Figures 13-15 summarize the high performance of the GPR group. In addition, the Tree medium and Tree coarse, as shown in Figures 7 and 8

Online mode results for voltage regulation
The training stage in the subsection above proved the capability of the two predictive models, LR and GPR, for voltage regulation at intermediate buses of the JSDN. The performances of the predictive models are calculated corresponding to RF of one and low RMSE, MSE, and MAE. Figures 16 and 17 demonstrate the voltage profile at three buses for 24 hours, with changes in load and the Badiah PV station in the JSDN, using the LR stepwise linear and GPR Matern models. The results reveal that these two trained models can accurately and quickly restore bus voltages. In addition, Figure 18 depicted the proximity of the LR stepwise linear and GPR Matern performances when the JSDN was running for 24 hours, with changes in load and the Badiah PV station.

CONCLUSION
In this work, two stages have been applied to solve the voltage deviation at intermediate buses of the JSDN. In the first stage, the AGWO algorithm is used in the offline mode to calculate the optimal location for STATCOMs in the JSDN, and their operating settings to mitigate the voltage deviation. The AGWO has high accuracy and capability in solving voltage deviation, but its shortening is in the dynamic response due to its iterative nature. Therefore, in the second stage, the dataset obtained by AGWO is used in the machine learning process of predictive models for real-time voltage regulation. A comparison between nineteen predictive models has been made. An optimal performance corresponds to the value of RF is one, and low MSE, MSE, and MAE are obtained within LR stepwise linear and GPR Matern. Moreover, the most deficient performance of the predictive models is the Tree coarse. The results have shown the capability of the trained models to restore the bus voltages accurately and quickly and to solve the shortening in the dynamic response due to the iterative nature of the heuristic algorithm.