An implementation of inertia control strategy for grid-connected solar system using moth-flame optimization algorithm

As the solar power system power system grows rapidly, inertia control strategy (ICS) becomes crucial to enable stable grid integration. However, the existing ICS lacks of dynamic weather analysis with maximum power point tracking (MPPT) and fault-ride through (FRT) capabilities such as low voltage ride-through (LVRT) and high voltage ride-through (HVRT). In this work, an inertia weighting strategy and the Cauchy mutation operator are introduced to improve the moth-flame optimization (MFO) algorithm to support vector machine prediction of photovoltaic power generation. In this paper, the proposed adaptive VICS with variable moment of inertia (J) and damping factor $ ({{D_P}} ) $ (DP) demonstrates its effectiveness with faster frequency recovery, less overshooting and continuous stable operation under grid fault and dynamic weather. The MFO algorithm is used to implement inertia control strategies for grid-connected solar systems. Accurate simulation results confirm the inertia control of the emulsion and the control of the solar system. The results of the simulation show a significant improvement in frequency with the designed MFO and compared to Horse Herd Optimization (HHO). The proposed method contributes to improve photovoltaic energy prediction, reduces the impact of photovoltaic power penetration into the grid and maintains the system reliability.


Introduction
Environmental challenges, particularly climate change, and growing energy demand are closely linked challenges to the modern world [1].To ensure the sustainable supply of energy and maintain the stability of the ecological environment, all countries in the world are vigorously developing renewable energy.Compared with fossil energy, renewable energy like wind, water, solar and ocean energy are rich in reserves, green and clean [2].Among the numerous energy sources, solar energy is becoming increasingly popular in various countries with large reserves, wide distribution, simple acquisition methods and no pollution [3].As the global photovoltaic (PV) installed capacity increases gradually and the scale of the PV industry has continued to expand, the form of PV power generation has gradually evolved from the early distributed off-grid to the centralized grid-connected model [4].
PV power generation has become a major component of the decarbonization of the modern power industry [5].Hydropower, thermal power and other power generation modes have the characteristics of controllable electric energy, adjustable and continuous power generation.
However, influenced by the form and principle of power generation, the randomness and uncertainty of meteorological factors result in obvious intermittent and discontinuous peculiarity of PV power generation [6].As the grid penetration of PV power increases, PV its variability poses challenges to the real-time dispatching of power grids and system reliability [7].
In the modern power system, the conventional synchronous generators (SG) are being replaced by distributed RESs.Consequently, the mechanical inertia generated by the SG rotors is decreasing.It makes the modern power grid inertia less or low-based [8].The mechanical inertia governs the balance between the active power generation and demand, based on which the frequency is maintained [9].Thus, the decrease of mechanical inertia challenges the grid frequency stability and alternative inertia is demanded.Various inertia emulation strategies of power converters were proposed to enhance the system inertia [10], which inspires the exploration of the inertia provision of RESs.
This study is necessary to predict the output power of PV accurately [11].The PV output power prediction is mainly divided into short-term, medium-term and long-term prediction according to the time scale [12].This study focuses on the short-term prediction of PV output power.Short-term prediction is mainly used for the forecast of PV power generation within three days, which is beneficial for the power sector to formulate power generation plans timely and plan power grid dispatching rationally [13].Short-term forecasts can be used to optimize resources and stabilized grid dispatching.Besides, short-term PV generation lays the foundation for the generation of renewable energy distributed grids, the improvement of distributed generation capacity and management of energy strategy under different application scenarios [14].This study makes sense to make short-term predictions of PV output power.
In the field of data prediction, support vector machine (SVM) is a popular machine learning (ML) technique [15].Compared with the artificial neural networks (ANNs), the SVM model has fewer parameters and requires less data.Moreover, the excellent generalization abilities for high-dimensional, nonlinear and small sample problems make SVM more suitable for short-term prediction of PV output power [16] .However, the performance of SVM is affected by internal parameters, and it is necessary to select parameters to optimize its predictive performance [17].This study develops a novel moth-flame optimization (MFO) algorithm to optimize SVM parameters.The powerful global optimization capability of intelligent optimization algorithm [18].
The lack of study in dynamic weather with varying irradiance (EE) and temperature (T), MPPT integration and real-time emulated HIL hardware with SCADA are the identified research gaps for synchronverter [19] .Solar power is prone to intermittent changes in term of irradiance and temperature.The recent researches lack of dynamic weather consideration with varying irradiance and temperature in the result analysis [20].The MPPT is not enabled and analyzed alongside with the synchronverter operation [21].
In this paper, a novel VICS is proposed by presenting an analysis of the impact of dynamic fluctuations in irradiance and temperature on the performance of different synchronverter controller technologies [22].Hence, to alleviate the aforementioned research gaps, the major contributions of this paper include the design of a novel ICS with dual FRT capabilities consist of LVRT and HVRT to ensure the continuous emulation of VI under grid fault and the investigation of the operation of synchronverter under dynamic realworld weather with varying irradiance and temperature [23][24][25][26].The novelties and original contributions of this paper are listed as the following: • A new concept of virtual inertia control strategy (VICS) based on adaptive controller is designed and deployed for synchronverter by manipulating the adaptive moment of inertia (J) and damping factor (DP) for the balance between recovery speed and stability.• The proposed VICS is tested and evaluated in a grid-connected solar power system under dynamic weather with varying solar irradiance (EE) and operating temperature (T) to study its dynamic characteristic and operating stability.
• The regulations of grid frequency (fg) and voltage (vg) are achieved by the proposed VICS with fault ride-through (FRT) capabilities to ensure the grid stability and the continuity of electricity supply.
The rest of this paper is organized as follows.Section 2 presents the operating mechanism of VI and the fundamentals of a three-phase grid-connected synchronverter for the solar power system.With the mathematical control strategy, the instability issues of a typical synchronverter are explored, and the methodological setup of VICS has been proposed to address the formulated problems in Section 3. The effectiveness of the proposed control to improve the stability is verified through MATLAB ® /Simulink simulation results in Section 4. Finally, Section 5 summarizes the contributions of this paper and provides the concluding remarks.

Proposed system
The single-line diagram of a typical grid-connected solar power system is shown in Figure 1.It consists of a direct current (DC) input from solar energy, three-phase inverter bridge, inductor-capacitor inductor (LCL) filter, line impedance, local resistive load, point of common coupling (PCC) and controller.A three-phase voltage-source converter is connected to the alternating current (AC) power grid after an inductor-capacitor-inductor (LCL) filter.In this paper, it is assumed that the inverter is connected to a simulated solar panel under dynamic weather with varying solar irradiance (EE) and operating temperature (T).

PV array model
A detailed PV model is necessary to optimize the core design of a PV system by considering the effects of climate, irradiation ratios, thermal dissipation of Solar array, as well as the interconnection of series -parallel module to build an array.Figure 1 shows the circuitry of a photovoltaic cell.The section outlined by red dotted line represents the perfect PV cell, which acts as a  DC voltage source.In a standard method of the PV cell, the interface resistant and resistance value of a diode are mixed in series -parallel to imitate the PV cell's real behaviour.Using a single-diode model, the analogous circuit of a PV cell is displayed in Figure 2.
A PV system is composed of numerous PV modules connected in series and parallel, respectively, to increase voltage and boost current.Owing to the presence of bypass diodes, the P-V characteristic curve in PSCs exhibits several peaks, also known as local and global maximum points.Bypass diodes placed in parallel with each PV module reduce the possibility of hot spots in PSCs, when the shadowed modules acts as a demand rather than providing power.
The output in the form of current is given in Equation ( 1) The following definitions pertain to the symbols used in the model: I PV : PV source current; R S : The total resistance caused by all the elements in the course of a current should be as minimal as possible; R P : to depict the leakage out across P-N junction, that should ideally be as wide as feasible; I: difference between both the diode current ID and the photocurrent I PV .When T is the temperature coefficient and G is the irradiation level, Equations ( 2)-( 4) are used to calculate the PV cell current, saturation current and thermal voltage.
Saturation current is given as, Thermal voltage is given as, PV systems are made up of a grid of PV cells.Current I is improved by the parallel cell combination while voltage V is added by the series cell arrangement.The number of parallel cells is Np, whereas the number of series cells is Nm.Equation ( 1) is transformed into Equation (5).
The primary issue with PV MPPT approaches has been partial shading (PS), which considerably lowers the system's efficiency.MPPT methods are developed to address this issue.Global and local maxima cannot be distinguished by conventional gradient-based MPPT techniques like P&O and IC.These methods can only be used on a single point, and the decision is made solely based on whether the gradient is positive or negative.The effectiveness of these gradient-based approaches is severely hampered by PS's many peak locations on the curves.The GM can be located using bio-inspired optimization approaches, which have been successfully used to PV MPPT applications.

Maximum power point tracking (MPPT)
The type of the chosen MPPT controller is incremental conductance (IC) which is a conventional MPPT.The inputs including solar panel voltage (V PV ) and current (I PV ) are fetched into the MPPT controller.The maximum power point (MPP) is achieved whenever the dp dv is equivalent to zero, where P = V * I.The integral regulator is used to minimize the error of dI dV + I V .Equations ( 6) and ( 7) are the fundamental equations that mathematically describes the operation of IC-based MPPT.
The IC-based MPPT is implemented to control the DC-DC boost converter with an integral regulator technique.It is used to optimize the DC output before fetching to the input of the synchronverter.There is limited research on the MPPT-enabled synchronverter.The Incremental Conductance (IC) MPPT technique is a conventional MPPT.A typical solar power system is defined as Equation ( 8) in terms of its solar power and voltage.
where P is the active power, V is the voltage and I is the current.At maximum power point (MPP), the gradient of power versus voltage line (dP/dV) is equivalent to 0 at its peak, by defining the Equaion (8) as 0, the equation can be rewritten as Equation (9).
The MPP is tracked by comparing the instantaneous conductance (I/V) to the incremental conductance ( I/ V).Hence, this type of MPPT is known as incremental conductance (IC) term, as incremental is the measurement of one of a series on a fixed scale and conductance is the ratio of I over V, as opposed to the resistance.The efficiency of the IC-based MPPT controller is similar to the conventional perturb and observe (P&O) MPPT controller, but with greater power yield under rapidly changing atmospheric conditions.

Inertia control design
Large-scale synchronous generators with large mechanical inertia can strongly support and adjust the system voltage and frequency.But recently they are gradually replaced by renewable energy sources.The similar output characteristics including virtual inertia and damping factors, as well as primary frequency control characteristics, can be emulated through power electronics with the VIC methods.The rotation equation of the synchronous generators is expressed by Equation (10).
P set is the mechanical input power of the rotor, P e is the output electromagnetic power, D p is the damping factor, un is the nominal angular frequency, ω is the actual angular frequency, J is the moment of inertia.By analogy with Equation (10) in a power form, the inertia equation in DC systems can be derived as Equation (11) in a current form.
I set is the reference input current in converters, I dc is the output current to the DC bus, K d is the virtual damping coefficient, U * dc is the reference voltage, U dc is the actual voltage, C v is the virtual inertia.In AC systems, the frequency is adjusted by the energy injected or released during the rotor spinning, and J indicates the ability to maintain the system frequency.In DC systems, the system voltage is adjusted by the current injected into or released from the bus, and C v indicates the ability to prevent sudden voltage changes.It's noticed that there is a strong correspondence between these two parts.
The introduction of virtual inertia transforms the output characteristics of RESs into those of conventional synchronous generators.Damping coefficients help to suppress the oscillation of frequency or voltage.In addition, owing to the similar characteristics, the existing control or scheduling methods in power systems don't need changing a lot for high RES penetration.Furthermore, analogous to the primary frequency control characteristics, the droop control characteristics in DC systems are manifested, that is the reference voltage decreases as the output power or current increases.By the droop control, the output power among ESBPs in steady states is allocated without the central controller.
Combining the dynamic and steady performances, a novel VIC is proposed, as Equation (12).
U N is the nominal voltage, K dr is the droop coefficient.The steady power distribution is adjusted by these droop parameters.The transient voltage fluctuations are suppressed by the virtual inertia and damping.The dynamic and steady parameters can be independently designed and decoupled.

Moth-flame optimization
MFO's inspiration mainly comes from a navigation method called transverse orientation when moths fly in the night, which makes the flight path of moths at a fixed angle with respect to the moon.The moon is far away from the moth, so its rays are parallel light relative to the moth, which ensures the straight flight of the moth.When a moth approaches an artificial light, such as a bulb, it will fly spirally towards the bulb because the light from the bulb spreads in all directions.The mathematical model of the MFO is described as follows: MFO is a population-based intelligence optimization algorithm which simulates the spiral flight of moths around the flames.It should be noted here that moths and flames are both solutions of the function.The difference between them is the way we treat and update them in each iteration.The moths are the result of movement in the search space and the flames are composed of the historical optimal solution of the moths.
Let M and OM matrix represent the position of the moth population and the fitness values of the moth individuals, respectively.The F matrix represents the position of the flames, and OF is the fitness values of the flames at the current position.These matrices are expressed as follows: OF n (14) where n, d denote the number of moths and the number of dimensions, respectively.

Moth search mechanism
To simulate the mechanism of a moth logarithmic spiralling towards a flame, use (15) to update the position of the moths.
where M i denotes the i-th moth, F j represents the j-th flame, D i is the absolute distance between M i and F j , b is a constant that affects the shape of the logarithmic spiral, t is a random number in [−1, 1].When t = 1 means that the moth is farthest from the flame, and when t = −1 means that the moth is nearest to the flame.D i is calculated as follows:

Flame renewal mechanism
Equation ( 15) is a mathematical model of each moth flying to its corresponding flame.However, the moths updating their position with respect to n different flames may reduce the exploitation possibility of the optimal solution.To solve this problem, an adaptive flame regulation mechanism is proposed, which reduce the number of flames NO f with the number of iterations, as shown in (17): where I represents the current number of iterations, N max represents the maximum number of flames, and I max is the maximum number of iterations.During each iteration, flames are determined and arranged according to the fitness values when the flame list is updated, and then the moths fly to the corresponding flames to update their positions.Namely, the first moth always updates its position according to the position of the optimal flame, while the last moth according to the position of the worst flame.And in the final iteration, the moths update their positions with respect to the best flame.

Horse herd optimization
The horse herd optimization (HHO) is modelled by the life behaviour of horses.In modelling the HHO, different patterns in the life of horses at different ages including grazing (G), hierarchy (H), sociability (S), imitation (I), defence mechanism (D), and roam (R) are considered (26).
The movement of the horses in each repetition is presented by where X Iter,AGE m is position of the horse m, AGE represents the age range of the horse, Iter is the present iteration, and V Iter,AGE m is velocity vector of the horse.δ is age range of horses among zero and 5 years, γ related to horses 5 to 10 years, β indicates horses between 10 and 15 years and α represents horses older than 15 years.In the matrix of responses considered in the HHO algorithm, the initial 10% of the matrix represents the α horse, the next 20% refers to the β horses, also the γ and δ horses include the remaining 30% and 40% of the horses.
The behavioural patterns of horses' lives are described below.

Grazing (G)
The grazing area around each horse is modelled with a factor of g.The horses graze without age restrictions for the rest of their lives.The horse grazing behaviour is defined as follows where G Iter,AGE m represents the movement parameter of the horse i, which has a decreasing trend in each repetition linearly proportional to ω g .˘l and ȗ is lower and upper ranges are the grazing space (between 0.95 and 1.05), and p represents a number among 0 and 1, randomly.The value of g is also considered for all horses without age limit of 1.5.

Hierarchy (H)
The horses have a leader who is mostly in charge of humans.A stallion or a mare is also liable for leading a herd of wild horses.The coefficient h in the HHO algorithm indicates the interest of a herd of horses to accompany the most powerful and experienced horse (among horses β and γ ).This hierarchical behaviour is presented as follows: where H Iter,AGE m refers to the effect of the best position of the horse in terms of speed and X (Iter−1) * indicates the position of the best horse.

Sociability (S)
The horses live socially, which is due to their safety and survival.Their social behaviour is expressed by a movement toward the position of the other horses and is represented by the parameter s.Most horses β and γ are more interested in herd life, which is modelled as follows: where S Iter,AGE m represents movement vector of horse i as socially, s Iter,AGE m is the direction of movement of the horse i towards the herd in the Iter iteration.The s Iter,AGE m m in each iteration, considering the coefficient ω s , there is a decreasing trend.N indicates the total horses number and AGE is the age range of each horse.

Imitation
The horses imitate their behaviours, such as finding a suitable pasture.The imitation of horses is considered based on a factor of i.The imitation behaviour is more related to young horses where I Iter,AGE m represents the vector of movement of the horse i towards a horse with locations x, pN is number of horses with the best places (10% of the horses).

Defence mechanism (D)
The horses' defensive behaviour is in the form of running away from the horses and buckling, which is considered as a non-optimal response.Horses' defensive behaviour is expressed by a factor of d.The horses' defensive behaviour is presented as a negative coefficient in the following model to keep the horses away from undesirable solutions  horses number with the worst places (20% of the total horses) and ω d is the reduction coefficient per iteration.

Roaming
In nature, horses search and roam from pasture to pasture for food.The roaming behaviour is a random motion and is defined by the coefficient r.This behaviour is more related to young horses and this behaviour is eliminated with age.Wandering behaviour is defined as follows: where R Iter,AGE m is the horse velocity vector i for escaping local minima, randomly and ω r is the reduction coefficient per iteration.

Simulation results
The EIC and PV systems proposed to match the scale as shown in Figure 3 were used for frequency evaluation.A MATLAB / Simulink simulation model was performed in various cases to verify the reliability of the proposed EIC with a PV system connected to the plate.
Simulink is used to verify the proposed EIC.Here are two scenarios that have been examined in a PV system  that is connected.In the first scenario, the load is different, while in the second, the PV power is different.The primary goal is to estimate the predictable EIC performance during the load transition phase.For a while, an initial 8 kW steady load is added.An imbalance is created by a quick increase in the sample load at t = 0.025 s, and this frequency is acceptable.When the EIC was taken into account with merely a frequency variation, the Nadir frequency system was captured at 49.23 Hz.When the EIC was taken into account without using a hybrid energy storage device, the arrested frequency was 49.564 Hz (Figure 4 Figure 4 illustrates the power of grid, PV, battery and AC load by employing horse herd and moth-flame optimization algorithms respectively. The prediction effect of the BP model is worse than that of the other three models using the SVM.Affected by the fact that the structure of BP neural network contains hidden layers and multiple hidden nodes, the BP model has higher requirements on the number of samples of training data, while the capability of solving problem for small sample is weak.The  The evaluation results indicate that the MFO-SVM model has the best predictive performance, as shown in Figure 5(a) and (b).The RMS values of MFO-SVM model in two weathers are 3.33% and 5.22%, which reduced by at least 1.42% and 0.78% compared with the other models, indicating that the degree of dispersion of the forecast result of MFO-SVM model is less, and the single point prediction effect is superior.Besides, the MAPE values of the MFO-SVM model on the two sets of data are 2.8559% and 6.9274%, which reduced by at least 1.0675% and 0.3406% than the other three models, indicating the MFO-SVM model possesses smaller forecast bias and higher forecast reliability.The R2 value of MFO-SVM model is closer to 1 under the two weather types, which demonstrates that the model has better overall fitting degree.
Finally comes a comparison of the integration, showing the Convergence curve of HHO showing the convergence curve of the MFO optimization, as shown in Figure 6(a) and (b).The HHO takes to settle the convergence time is 4 sec and the MFO take the convergence time is 0.5 sec.Therefore, the Moth flame optimization is best compared to the HHO Technique.The emulated inertia control, along with solar system control not only restricts the frequency but also reduces settling time.Compared to the settling time, the proposed WCO taken low time to settle the steady state.

Conclusion
This paper proposes a novel adaptive VICS for threephase grid connected PV under varying irradiance and temperature.The simulation results from MAT-LAB/Simulink and emulated hardware simulation validated and demonstrated that the proposed VICS exhibits FRT capabilities and grid frequency stabilization.The MFO algorithm is used to implement inertia control strategies for grid-connected solar systems.Accurate simulation results confirm the inertia control of the emulsion and the control of the solar system.The results of the simulation show a significant improvement in frequency with the designed MFO and compared to Horse Herd Optimization (HHO).The proposed method contributes to improve photovoltaic energy prediction, reduces the impact of photovoltaic power penetration into the grid, and maintains the system reliability.

Figure 1 .
Figure 1.single line diagram of a typical grid-connected solar power system.
of the horse i of the horses mean with the worst places, qN represents the

Figure 4 .
Figure 4. (a) Power of grid, PV, Battery and AC Load of Horse Herd Optimization.(b) Power of grid, PV, Battery and AC Load of moth flame optimization.

Figure 5 .
Figure 5. (a) AC side Voltage and current from PV battery system using HHO.(b) AC side Voltage and current from PV battery system using MFO.

Figure 6 .
Figure 6.(a) DC link Voltage, current and power using HHO.(b) DC link Voltage, current and power using MFO.

Table 1 .
PI current controller tuning BY Harris Hawks Optimization.

Table 2 .
PI current controller tuning by moth flame optimization.
of PV output is not satisfactory.The performance of HHO-SVM and MFO-SVM models highly outperform BP model, but there is still a certain gap between them and IMFO-SVM model.Tables1 and 2show the PI current controller tuning with Harris Hawk and moth flame optimization algorithms.