An artiﬁcial neural network based harmonic distortions estimator for grid-connected power converter-based applications

Grid-connected solar Photovoltaic (PV) systems are predicted to cause signiﬁcant harmonic distortions in today’s power networks due to the increase utilization of power conversion systems widely recognized as harmonic sources. Estimating the actual harmonic emissions of a certain harmonic source can be a challenging task, especially with multiple harmonic sources connected, changes in the system’s characteristic impedance, and the intermittent nature of renewable resources. A method based on an Artiﬁcial Neural Network (ANN) system including the location-speciﬁc data is proposed in this paper to estimate the actual harmonic distortions of a solar PV inverter. A simple power system is modelled and simulated for different cases to train the ANN system and improve its prediction performance. The method is validated in the IEEE 34-bus test feeder with established harmonic sources, and it has estimated the individual harmonic components with a maximum error of less than 10% and a maximum median of 5.4%. (cid:1) 2022 THE AUTHORS. Published by Elsevier BV on behalf of Faculty of Engineering, Ain Shams University. ThisisanopenaccessarticleundertheCCBYlicense(http://creativecommons.org/licenses/by/4.0/).


Introduction
The international upward trend in utilizing more sustainable energy systems in the power sector has mainly been driven by greenhouse gas emissions reduction schemes and growing energy consumption.A possible measure in today's power networks is the integration of more environmentally friendly technologies such as solar PVs, Wind Turbines (WTs), and Electric Vehicles (EVs), which immerge into the power grid through power electronics (PE) devices.The unpredictability of the renewable energy resources besides the switching behavior of the PE-based power conversion systems can endanger the quality of supply of the power system [1].Power harmonics, which are one of the crucial topics of the power quality problems, can lead to undesirable effects on the power system such as increased power losses, overheating and vibration of power transformers and motors, degradation of power factor, and maloperation of protection systems [2].These harmonics-related financial and technical consequences have stressed the necessity for effective measures maintaining harmonic distortions at lower possible levels and ensuring compliance with the standard limits like the IEEE Std.519.
When multiple harmonic sources are connected to a grid, harmonic distortions may violate the standard limits.Therefore, the grid operators must assign the offending harmonic source for enforcing compliance with the standard limits to improve the power quality and reduce their effects.However, the harmonic emissions of a grid-connected PE-based system can differ from the harmonic performance provided by the vendors and the assessment of the output current distortions of these power converters via conventional metering equipment cannot reflect the true harmonic emissions [3][4][5].This can be attributed to the interactions between the control circuits of the power converters, the network impedance, and background harmonics caused by other existing harmonic sources [6][7][8][9].Furthermore, the presence of capacitive elements of the passive filters at the converter level and Power Factor Correction (PFC) systems at the network level can trigger resonances amplifying the existing harmonic components in the network and influencing the harmonic performance of a gridconnected power converter, and thus misestimation of actual harmonic source contribution can occur [10,11].Besides, the intermittent nature of the renewable energy resources resulting in different https://doi.org/10.1016/j.asej.2022.1019162090-4479/Ó 2022 THE AUTHORS.Published by Elsevier BV on behalf of Faculty of Engineering, Ain Shams University.This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).operating conditions has a significant impact on the harmonic performance of such harmonic sources [12][13][14][15].
To clarify the problem, Fig. 1 depicts a power distribution network including the grid equivalent circuit, PE-based renewable power sources, PFC capacitors, and a linear load.The timevariant currents of the PE-based applications (i.e., i PV t ð Þ; i WT t ð Þ; and i EV ðtÞ) are composed of fundamental and harmonic components being injected into the power grid at the Point of Common Coupling (PCC).The power grid is usually associated with background harmonics originating from other electrically distant harmonic sources that could be amplified by resonances introduced by the PFC capacitor.Due to the interactions between the harmonic sources and the state changes at the power network level, the resulting harmonic distortions calculated only from a harmonic source output current would not accurately reflect its actual harmonic distortions.
The power systems operators and users are, therefore, required to extensively monitor the harmonic performance of each gridconnected system over different operating conditions to identify its actual contribution to the harmonics-related problems.However, the true harmonic distortions can only be obtained when the voltage at the PCC is a pure-sinusoidal, which is impractical since it requires the disconnection of all other potential nonlinear loads/harmonic sources and reducing the grid impedance to zero [4,5].
There have been several research works addressing the estimation of harmonic distortions in the literature.For instance, the classical power system analysis-based solutions such as the harmonic impedance estimation [16], active and reactive power flow of harmonics [17,18], critical impedance measurement [19], and the stochastic approach for the harmonic estimation [20][21][22][23].A number of recent publications have also made the attempt to address the harmonic distortions estimation problem as in [24][25][26][27].These methods, however, require prior knowledge about the system components for accurate harmonic models and network configurations to accurately calculate the harmonic distortions.
The development of Artificial Intelligence (AI) based systems such as ANN has motivated many researchers in the power harmonics area due to its simple implementation, learning and generalization capability, and wide applications in several engineering fields.The ANN systems were adopted in several studies dedicated to the PE harmonic performance estimation [28] and active power harmonic filters [29,30].Furthermore, an ANN system was developed to evaluate the fundamental and harmonic components deviations in a power network requiring parallel processing operation for its high computational burden [31].An intelligent harmonic estimating method based on ANN for power harmonics sources was proposed in [32].This solution is based only on distorted voltage and current measurements, and it resulted in a relatively high error for estimating high-order harmonics.A single harmonic source power system was considered with neglecting the impact of background harmonics, which can adversely affect the distortions estimated.
A Multi-Layer Perceptron (MLP) ANN system in [5], Recurrent Neural Network (RNN) system in [33], and Echo State Network (ESN) system in [34] were developed to estimate the true harmonic distortion of a nonlinear load.The proposed approach relied only on measured distorted voltage and current signals and considered several time-invariant nonlinear loads.A similar method considering multiple ANN for each harmonic component with prior knowledge of the nonlinear load specifications to estimate the harmonic distortions through equivalent coefficients was developed in [35].A method based on the Nonlinear Auto-Regressive eXogenous (NARX) neural network system was developed for the estimation of the power harmonic distortions [36].However, these proposed approaches do not capture the variations in the nonlinear load under the estimation, which can result in a different harmonic performance, and thus they can lead to inaccurate prediction of the harmonic distortions for different operating conditions in the prediction stage.
On the other hand, an approach capturing the impact of timevarying nonlinear loads on harmonic performance was proposed in [37].The work includes several nonlinear loads, but the true harmonic distortions were not considered and thus can inaccurately evaluate the nonlinear loads' contribution to the harmonic voltage distortions at the PCC.A power harmonic predicting system for solar PV systems was developed in [38].The system only predicts the Total Harmonic Distortion (THD) for various operating conditions and no attention was paid to the variations and uncertainties at the network level, which should be considered for accurate and reliable harmonic distortions estimation of a specific application.A summary of the established systems in the literature and proposed harmonic distortions estimator with requirements, features, and limitations are shown in Table 1.
To the best of the authors' knowledge, there has been no such a power harmonic distortions estimator, which considers the impacts related to the different operating conditions caused by the variations in the renewable resources, the interactions with other harmonic sources and system components, and power network impedance state changes.Therefore, this research work aims to fill the gap by developing an improved harmonic distortions estimator based on an ANN system considering the locationspecific data, which will help predict the harmonic distortions over a wide range of operating conditions.It is anticipated that the proposed system will accurately estimate the true harmonic distortions of a grid-connected power converter operating with multiple harmonic sources considering the variations in harmonic emissions due to the nature of intermittent renewable resources, effects of PFC capacitors, interactions with other harmonic sources, and the system impedance changes.The proposed system will be validated using the IEEE 34-bus test feeder with different harmonic sources obtained from a test field.
The rest of the paper is organized as follows.Section 2 describes the operation of the proposed harmonic estimating system.Section 3 is dedicated to the simple power system under the study and the solar-PV system harmonic performance with multiple harmonic sources for different operating conditions.The proposed estimator training and performance evaluations are discussed in Section 4. The validation of the proposed estimator in the IEEE 34-bus test feeder is presented in Section 5. Conclusions drawn from this work are provided in section 6.  2. Development of the improved harmonic estimating system

Operation description of the proposed estimator
The ANN systems have been widely used as an alternative modeling method for power system applications.In this paper, ANN is implemented to predict the actual injected harmonic current of a specific harmonic source without disrupting the operation of the grid, connected loads, and power sources.A single-line diagram comprising the grid equivalent circuit with background harmonics, PFC capacitors, other linear and nonlinear loads, and the ANNbased harmonic distortion estimator is shown in Fig. 2.
The distorted current of the PV inverter, i PV t ð Þ, under the estimation along with the currents of other nonlinear loads/harmonic sources and background harmonics will consequently result in a distorted grid voltage, v PCC t ð Þ, and thus the i PV t ð Þ is affected by its actual and grid supply harmonic components.The ANN-based harmonic distortions estimator is trained to capture the nonlinear characteristics of the system under the study and help model the admittance between the grid and the harmonic source.
The location-specific data such as the solar irradiance and wind speed have a significant impact on the harmonic performance of solar PV systems [12] and wind turbine power inverters [13], respectively.Therefore, when operating condition-related data is provided to the ANN-based estimator with the instantaneous distorted PCC voltage signal, an accurate estimation of the harmonic source contribution can be attained over different operating conditions.This proposed method can also be applicable for nonlinear loads when such a correlation between the operating conditions and the output harmonic distortions can be established.
The weight and threshold coefficients of the ANN are optimized with the aid of a training algorithm that compares the measured instantaneous current signal and the desired signal from the ANN to minimize the system performance error.After this online training stage, the offline ANN is fed with the solar irradiance of interest and a harmonics-free signal of the grid voltage, v g1 t ð Þ, or mathematically generated pure sinusoidal waveform to predict the output signal, i estimated t ð Þ, that attributes to the actual distorted current of the harmonic source when it is connected to a harmonics-free infinite power source with a zero impedance.

ANN architecture and training algorithm
A simple feedforward multilayer perceptron ANN system consisting of an input layer, at least a hidden layer, and an output layer is shown in Fig. 3.This structure is adopted for the harmonic distortion estimator developed in this paper due to its simple implementation and wide utilization in practical applications.The course of passing the inputs to the output through the ANN is known as feedforward propagation.Each input is fed to each neuron in the hidden layer after applying the corresponding weight, w nm , and the same process applies to the hidden output to the output layer through the related weights, v m1 .
The decision of each neuron in the hidden and output layers is governed by an activation function to determine its output.In this work, the ANN system employs the sigmoid and linear activation functions for hidden and output layers' neurons, respectively.Therefore, the neurons' outputs (h j Þ of the hidden layer and the output (y) of the output layer are subject to the following governing equations [39]: Where n is the number of the input signals x i , w ij is the weight of each connection between the input layer and the hidden layer, h j is the threshold of each hidden layer neuron.v ij is the weight of each connection between hidden and output layers, and h 1 is the threshold of the neuron in the output layer.
Generally, it is challenging to anticipate the fastest training algorithm for a given problem.This is because of various factors including the problem complexity, the data volume in the training set, the number of weights and biases of a certain structure, the performance error goal, and the task that the network is used for such as pattern recognition or function approximation [40].Although several biologically inspired optimization algorithms have been adopted in many applications to train ANN systems, the widely utilized and well-developed Levenberg-Marquardt training algorithm known for its reduced computational effort and high convergence rate is used in this work.

ANN Specifications and performance criteria
For a given number of inputs and outputs, modelling nonlinear functions using the ANN is significantly affected by the number of hidden layers and their neurons.The number of neurons has a direct effect on the convergence rate, execution time, and performance error of the ANN system [39].In the literature, the Mean Squared Error (MSE) method is commonly used to estimate the ANN performance error.
The instantaneous measured voltage and current signals are discretized based on the sampling time of the digital metering equipment or simulation environment.Therefore, since the ANN system in this work has a single output (y ¼ i desired ), the error for the training algorithm to deal with is expressed as: Where N is the number of samples in the training data.This is to achieve the best fitting with the measured signal over each epoch.
To generate the required data to train the ANN-based harmonic distortion estimator and evaluate its performance, a simple power system composed of multiple harmonic sources and different events at the power level is simulated next.

Description of the simulated power system
A single-line diagram of the three-phase system under the study is depicted in Fig. 4. The system includes a power grid mod-elled by an equivalent voltage source behind an impedance, two grid-connected solar PV systems, a wind turbine, a nonlinear load, and PFC capacitors.The system specifications are presented in the Appendix.The power system is simulated using Simulink/MATLAB to investigate with different power events the harmonic performance of the PE-based applications and their interactions with other system components.The three-phase system is assumed to be balanced and symmetrical, and, therefore, a-phase measurements of the voltage and current and their corresponding distortions are presented.

Harmonic performance of the simulated system
Since the solar PV-2 system is being under the estimation, the solar PV-1 and wind turbine systems operate in steady-state during the simulation time, a solar irradiance of 1000 W=m 2 at a constant ambient temperature of 35°C is used for the solar PV-1 system, and 12 m/sec.wind speed is used for the wind turbine system.
To investigate the effects of the potential changes at the network level and the variations in the solar irradiance on the harmonic performance of the solar PV-2 system and the PCC voltage, several events at the power network and two solar irradiance profiles are included in the simulation.At 0.5 sec.the nonlinear load increases by 50 %, the grid impedance (Z g ) experiences an increase of 30 % at 1.25 sec., and the PFC capacitor is disconnected at 1.75 sec.Two distinct solar irradiance profiles of the solar PV-2 system are also considered.Profile 1 involves a gradual decline in the solar irradiance at 1 sec., from 1000 to 800 W=m 2 , while Profile 2 has a downward trend over the simulation time starting from 1200 to 400 W=m 2 .The ambient temperature is maintained constant at 35°C for all the cases.
Additionally, taking the advantage of such a simulation tool can help determine the accurate and true harmonic distortions of a certain PE-based system under the estimation when a sinusoidal voltage is delivered at the PCC, which can only be achieved by disconnecting all other harmonic sources and reducing the grid impedance to zero, which is not possible in real power systems.The harmonic performance of the solar PV-2 system obtained from this process will be later compared with the predicted results from the ANN-based harmonic estimator.Fig. 5 depicts the solar PV-2 system connected to a pure sinusoidal power source.
The different cases considered for the simulated system are as follows.
Case 1: (Distorted PCC Voltage) This case considers the power events with all the PE-based applications connected to the grid, and the system is simulated with the solar irradiance of Profile 1 used for the PV-2 system.The results are shown in Fig. 6.
Case 2: (Distorted PCC Voltage) Like Case 1 but Profile 2 is used in this case for the solar PV-2 system.The results are presented in Fig. 7.

Case 3: (Sinusoidal PCC Voltage)
The solar PV-2 system is connected alone to the ideal power source, which is impractical in real power systems, and the solar irradiance of Profile 1 is simulated.The results are displayed in Fig. 8.

Case 4: (Sinusoidal PCC Voltage)
The solar PV-2 system is also connected alone to the ideal power source, but the solar irradiance of Profile 2 is employed in this case.The corresponding results are shown in Fig. 9.
The THDs of the PCC voltage and solar PV-2 system output current of the simple power system simulated over the simulation time are calculated using the FFT solution applied to the corresponding traces with respect to the fundamental frequency.Some observations from Fig. 6 to Fig. 9 are summarized as follows.
Generally, the harmonic sources and power events have a pronounced influence on both the grid voltage and the PV-2 current THDs and can lead to inaccurate estimation of the PV-2 inverter harmonic emissions in comparison to Case 3 and Case 4 with an ideal power source.It can be observed that the general trend of current THD of the solar PV-2 system is inversely proportional to the solar irradiance profile.For example, a decrease of 18 % in the current Fig. 6.Performance of the simple power system simulated for Case 1, including distorted grid voltage due to other harmonic sources and power events under the solar irradiance of Profile 1. Fig. 7. Performance of the simple power system simulated for Case 2, including distorted grid voltage due to other harmonic sources and power events under the solar irradiance of Profile 2. THD due to an increase of 200 W=m 2 is experienced in Case 1.This emphasizes the dependency of the THD on the operating conditions as discussed in [12].In Case 1, there is a noticeable association between the different events simulated and the voltage and current THDs.However, with the continuous variations in the solar irradiance of Profile 2, the impact of the power events can be minor on the solar PV output current THD as also discussed in [4,12].
For Case 1 and Case 2, the increase in the nonlinear load power at 0.5 sec.has significantly reduced the resultant voltage distortions at the PCC from 3.9 % to 2.6 %, and thus a 5.2 % reduction in the current distortions of the solar PV-2 system is observed.This is due to the high fundamental current component being drawn from the grid, which is inversely proportional to the THD as the common THD calculating formula in textbooks implies.Also, at 1.25 sec., the 30 % increase in the grid impedance, which is heavily inductive and increases linearly with frequency developing higher voltage drops of each harmonic component, has increased the voltage THD at the PCC from 2.6 % to 3.3 %.
For grid-connected PE-based applications, the synchronization circuit and the control system have a considerable sensitivity to a distorted grid voltage [4,6,8].Therefore, the increase in the PCC voltage distortions has consequently increased the harmonic distortions of the solar PV-2 system by 5 % in Case 1.
The PFC capacitors are usually associated with the undesirable amplification effect on the harmonic components within the resonant point, which is caused by the interaction between the inductive elements of the grid and other system components and the PFC capacitance.At 1.75 sec.the resonance is absent when the PFC capacitors are disconnected, and thus the PCC voltage THD has dropped to 3.1 % with a negligible impact on the solar PV-2 system current THD.It can be observed that the actual THD of the solar PV-2 system current when supplied with a pure sinusoidal voltage is considerably lower than that supplied with a distorted voltage at the PCC, depending on the variations in the solar irradiance.
The results of the system simulated are used next for training and evaluating the performance of the proposed ANN-based har-monic estimator.That is, since Case 2 includes a time-variant solar irradiance over the simulation time, its corresponding voltage and current along with the solar irradiance signals will be used to train the proposed harmonic distortions estimator.The results of Case 3 and Case 4 with the help of the simulation software will then be utilized as a reference to evaluate the performance of the ANNbased harmonic estimator over different solar irradiance points.
It is worth mentioning that since the ANN system performs well with signals rescaled within AE1 due to the nature of the activation functions in the neurons [39], the per unit (p.u.) voltage and current results shown in Fig. 7 are applied directly to the ANN without the need for rescaling.However, the solar irradiance is rescaled based on the rated value of 1000 W=m 2 .

ANN training stage
The ANN system shown in Fig. 3 is developed using MATLAB (R2021a) on a computer with a 64-bit Windows 10 operating system, an Intel Core TM i7 CPU 3.60 GHz, and 16 GB of RAM.The Levenberg-Marquardt backpropagation algorithm is adopted for training the system.The ANN system is trained with the simulated results of the voltage, current, and solar irradiance in Case 2 due to the continuous decay in the solar irradiance of Profile 2. To explore the performance of the proposed estimator, a defined range of the system output results is processed in the training stage.With a sampling time of 5 ls, about twenty cycles (from 0.5 to 0.8 sec. in Fig. 7) are used based on the fundamental frequency.This results in about 66 k samples each including the solar irradiances from 800 to 1000 W=m 2 .For the proposed ANN-based harmonic distortions estimator, a multilayer perceptron, with two inputs, an output, and a single hidden layer, is sufficient as discussed in the literature presented before.However, the number of neurons in the hidden layer is chosen based on observations over the resultant MSE of five folds of the number of neurons as shown in Fig. 10.
Commonly, a small value of the MSE is satisfactory for ANN systems in many applications.Yet, the harmonic distortions estimator is required to have the lowest possible error to avoid misestimation of the actual distortion through the ANN system.The lowest MSE of 0:6 Â 10 À4 was achieved by using 270 neurons in the hidden layer, and it has saturated afterwards for the given training algorithm.The main reasons for the high number of neurons are the amount of data in the training set and the high accuracy required for such an application.Fig. 11 illustrates the fitting of the resultant signal of the ANN (in blue) to the simulated current (in red) of the solar PV-2 system in Case 2 with different numbers of neurons.
The necessity for the lowest MSE in the training stage for the harmonic estimating system is evident.The solution of 30 neurons introduces a minor improvement to that of 10 neurons.However, with a higher number of neurons, the solution is much improved and predicted to result in an accurate fitting to the actual signal compared to the lower number of neurons solutions, which does not seem to capture the actual distortions of the solar PV-2 current.
After training the ANN and ensuring its superior performance with the actual signal, now the system is almost expert and ready for the prediction stage.

ANN prediction stage
In this section, the expert ANN system performance is evaluated for different solar irradiance points within the training range.A mathematically generated pure sinusoidal voltage signal of 1p.u.amplitude along with the solar irradiance signal in form of vectors are applied to the expert ANN system developed in MATLAB.Then, the predicted results are compared with the independently simulated system results for the same solar irradiance with a sinusoidal PCC voltage as shown in Fig. 5.The prediction is performed on three equivalent cycles to reduce the computational burden.The input and output signals of the ANN system are processed as samples, while the simulated results at a steady state are generated with respect to the simulation time.The expert ANN performs well for solar irradiances within the training range.In Fig. 12 and Fig. 13, when a pure sinusoidal voltage signal is applied to the expert ANN system, for 800 W=m 2 and 1000 W=m 2 solar irradiance values, respectively, the predicted signals show a good agreement with that of the simulated system connected to an ideal power source as in Case 2 and Case 4, which reflect the true harmonic distortion of the system under the estimation.The FFT solution was performed in MATLAB for the two signals and the results emphasis the accuracy of the ANN system in terms of the individual significant harmonic components with a maximum error of about 4 %.
Another evaluating index of the performance of the proposed ANN-based harmonic distortions estimator is the THD of the predicted signals.The results of the simple power system simulated was used as benchmark and reference to train and optimize the performance of the proposed estimator.The results predicted by the ANN harmonic distortion estimator are expected to closely match the results of the PV inverter harmonic performance when it is connected to a pure sinusoidal power source, which is the actual harmonic emissions.Table 2 shows the error of the THD of the actual and predicted signals, which is calculated as: A relatively small error in the simulated and predicted THD can be observed.This is attributed to the uncharacteristic harmonic components in the predicted signals obtained from the proposed estimator and is related to the none zero ANN performance error.An important factor that requires to be considered in the training and prediction stages is the computational effort of the ANN system with different numbers of neurons.For the given size of data, the more neurons in the hidden layer, the more computational time is required for convergence.For instance, the 270 neuronsbased system requires roughly 250 and 40 sec.for the training and prediction process, respectively.This computational burden could be further reduced by computers with higher computational capability and larger memory size to process the large size data.The process of the proposed ANN-based harmonic distortion estimator is described in Fig. 14.

Validation of the proposed ANN-based estimator
To validate the proposed ANN-based harmonic distortions estimator, the IEEE 34-bus test feeder with the solar PV-2 system and different harmonic sources presented in [41] is modeled and simulated using the Simulink/MATLAB.The feeder loading conditions were preserved following the specifications provided by the IEEE Power & Energy Society working group [42].In this section, the IEEE 34-bus test feeder and the aspects on which the decision on the simulated system was based are introduced.The harmonic sources simulated are also presented.Furthermore, the results obtained are analyzed and discussed.

IEEE 34-Bus test feeder
Even though the IEEE 13-bus is the most commonly used feeder for validating harmonic estimation and identification solutions, it only consists of six medium-voltage three-phase buses, which restricts the connection of different harmonic sources.The IEEE 34-bus test feeder depicted in Fig. 15 was utilized in this fashion because of its length and light loading condition, making it appropriate for connecting the harmonic sources adopted in this paper.There are 23 three-phase buses in the IEEE 34-bus.However, the solar PV-2 system and the different harmonic sources adopted will be connected to the green-highlighted nodes.Each harmonic source will be connected to a separate bus for each run, while the solar PV-2 system will remain connected to bus-860.

Harmonic sources
Since the purpose of this research focuses on the harmonic distortions estimation of a PE-based application, the solar PV-2 system, different harmonic sources: Six-pulse and Twelve-pulse power rectifiers, Static Frequency Converter (SFC), Thyristor Controlled Reactors (TCR), and DC motor are simulated.These harmonic sources are modelled by harmonic current sources following the field measurements provided in [41].The phase angle of the current components of the harmonic sources is assumed to be aligned to the fundamental current components.Table 3 presents the characteristics of each harmonic source adopted in this paper.

Analysis of results obtained
The results were yielded by systematically allocating the different harmonic sources in the 18 feasible three-phase nodes within the green highlighted buses.Based on the two solar irradiance points (800 and 1000 W=m 2 ) and the five harmonic sources given in Table 3, a total of 180 tests were conducted.The simulated voltage and current signals of each run were stored and processed by the proposed ANN-based harmonic distortions estimator to predict the harmonic distortions of the solar PV-2 system.The predicted signals obtained from the proposed ANN-based estimator are compared to the harmonic current components shown in Table 4, and the error of each corresponding component for each test conducted is calculated as per (4) For computational effort reduction, voltage and current signals of a-phase were processed to the proposed estimator.The variations at the network level were neglected due to the absence of PFC capacitors and the loading conditions that were maintained unchanged over the simulation time.The harmonic current components of the established harmonic sources were simulated with the base values shown in the Appendix.In addition, the sampling setting for the simulated signals was set as discussed  in Section 4 and the harmonic distortions were calculated using the FFT function developed in MATLAB.
The error plots of each harmonic current component of the solar PV-2 system, obtained from the tests conducted are shown in Fig. 16.The harmonics components from the 5th up to 49th were considered since they are significant in the solar PV-2 current spectra.The errors were computed considering the harmonic currents presented in Table 4 as reference.The use of the Box plots can help visualize differences among different samples and provide more statistical information about the performance of such an estimator.These error results would also help demonstrate whether the proposed estimator can be applied for a quite larger power network including a variety of power harmonic sources.Fig. 16(a) and Fig. 16(b) are for the two solar irradiance points, 800 and 1000 W=m 2 , respectively.
When analyzing the error plots, it is observed that the greatest errors occur for the harmonic components from 5th to 25th.This is mainly because of the harmonic sources that have relatively higher harmonic currents within this range of frequencies.When an indepth analysis is carried out, it was noticed that the greatest errors occur when the harmonic sources are placed electrically close to the bus to which the solar PV-2 system is connected, bus-860.However, for high order harmonics (i.e., higher than 25th), where the effects of the harmonic sources are absent, relatively smaller errors can be observed.
From Fig. 16(a), the maximum error of the estimation of the low-order harmonic distortions is less than 10 % with the highest median of a 5.36 % for the lower solar irradiance, while the greatest error for the case of the higher solar irradiance is about 8.2 % with a median of 5.4 % as shown in Fig. 16(b).For the high-order harmonic components, the proposed ANN-based estimator can perform with relatively higher accuracy.The maximum error in the two plots of 2.22 % occurs at the 37th with a median of 1.2 %.These resultant errors demonstrate the feasibility and accuracy of the proposed harmonic distortion estimator for a quite large power system with multiple harmonic sources and different operating conditions.

Conclusion
Renewable resources-based power sources are predicted to cause significant harmonic distortions in today's power networks due to the utilization of power conversion systems, which are widely recognized as harmonic sources.When harmonic standard limits are violated, effective measures must be taken by the system operator and users to reduce their technical and financial effects.However, identifying the actual contribution of the offending harmonic source can be a challenging task with multiple harmonic sources connected, changes in the system's characteristic impedance, and the intermittent nature of renewable resources.A method based on an ANN system utilizing the location-specific data was developed to capture the actual harmonic distortions of a harmonic source.The proposed method helped model the admittance of the harmonic source under the estimation, captured its harmonic performance over different operating conditions, and provided accurate harmonic distortions estimations.A simple power system was modelled and simulated, and the harmonic performance of a solar PV system for different cases was used to train the ANN system and improve its prediction with a relatively small performance error.The simple implementation and accurate prediction of the proposed system for the given size of data can compromise its relatively high computational burden.Additionally, the expert ANN-based harmonic distortion estimator was validated in the IEEE 34-bus test feeder with different harmonic sources' current components from a test field.The proposed system estimated the individual harmonic components with a maximum error of less than 10 % and a maximum median of 5.4 %.However, insights into data synchronization complexity and implementation challenges for experimental validation with real data using a digital data acquisition system are under the consideration for future work.The renewable resources-based power sources such as the solar PV systems are associated with inevitable uncertainties originating from a partial/full shading and faulty cells/panels that must be addressed for reliable estimation.Besides, the fault tolerance of such an ANN-based estimator should be investigated to ensure reliable and robust estimating performance.It is also worth mentioning that the advances in neural networks such as the deep neural networks could also be a potential for such an application with large size of data to process.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Fig. 5 .
Fig. 5. Solar PV System supplied by a pure sinusoidal power source.

Fig. 8 .
Fig. 8. Performance of the simple power system simulated for Case 3, including a sinusoidal grid voltage under the solar irradiance of Profile 1.

Fig. 9 .Fig. 10 .
Fig. 9. Performance of the simple power system simulated for Case 4, including a sinusoidal grid voltage under the solar irradiance of Profile 2.

Fig. 11 .Fig. 12 .
Fig. 11.Training stage of the ANN-based system (three cycles are shown for illustration), simulated current (in red), and ANN output (in blue).(For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)

Fig. 15 .
Fig. 15.The IEEE 34-bus test feeder single-line diagram including the proposed ANN-based harmonic distortions estimator.

Fig. 16 .
Fig.16.Errors obtained to estimate the harmonic distortion of the solar PV-2 system using the proposed ANN-based estimator in the IEEE 34-bus test feeder, (a) for 800 W=m 2 and (b) for 1000 W=m 2 .

Table 1 A
Summary of the ANN-based methods for estimating the power harmonic distortions.

Table 2
THD Comparisons between simulated and predicted signals.

Table 4
Solar PV-2 actual harmonic current components used as a reference for the validation.Thamer A.H. Alghamdi, Othman T.E.Abdusalam, F. Anayi et al.