An Online Archimedes Optimization Algorithm Identiﬁer-Controlled Adaptive Modiﬁed Virtual Inertia Control for Microgrids

: Single widespread employment of renewable energy sources (RESs) contributes to the shortage in the inertia of the microgrid (MG). After this, frequency stability may regress as a result of power imbalance or minor load ﬂuctuations. This paper proposes an explicit adaptive modiﬁed virtual inertia control (VIC) based on an online Archimedes optimization algorithm (AOA) identiﬁer for MG containing thermal, wind, and solar photovoltaic power plants. The Rung Kutta approach is used to construct the proposed online identiﬁer, which acts as a model of the MG. AOA predicts the coefﬁcients of the online identiﬁer based on the input and output of MG to mimic the frequency deviation of the MG online. AOA estimates online the inertia and damping coefﬁcients of the VIC system with an energy storage device based on online AOA identiﬁer coefﬁcients. The frequency deviation of the MG based on the proposed explicit adaptive modiﬁed VIC is compared with the conventional VIC based on ﬁxed parameters and the VIC system based on optimal parameters using AOA ofﬂine under mutation in loads, weather-dependent input, and MG parameters using MATLAB/Simulink software. Furthermore, the proposed explicit adaptive modiﬁed VIC based on an online AOA identiﬁer is evaluated with the adaptive VIC system based on fuzzy logic control, which adjusts only the inertial gain online. The simulation results demonstrate the capabilities of the proposed explicit adaptive modiﬁed VIC to improve the frequency stability and enhance low-inertia islanded MGs with RESs.


Introduction
In recent decades, RESs such as solar, wind energy, and micro-turbines have been growing dramatically due to the focus on the protection of the environment from hazardous pollutants, the reduction of fuel consumption, and the stimulation of economic growth [1].
RES has replaced many traditional grid units to improve system dependability and decrease voltage droop and transmission system losses. Otherwise, its impact on the power systems performance is a deficiency of system inertia [2] and alters the system's parameters, which in turn impacts the active power perturbations. In order to deal with the change in the power system parameters, several studies have recently turned to system identification [3,4]. Simulation and modeling software are required to analyze the MG system [5]. Recently, system identification has gained prominence as a useful technique for defining the external behavior of the system [6]. An adaptive neuro-fuzzy inference system and a radial bias function neural network (RBFNN) have been used as a modeling approach for forecasting the power response of a wind turbine [7] and the nonlinear behavior of the photovoltaic (PV) power plant [8].
Indirect adaptive controllers are thought to be more powerful than intelligent controllers for reducing oscillations and enhancing power system stability as they combine an online identifier and a controller. For online model identification and online monitoring of changes to system parameters, the parameter's identifier is used. After that, the controller is updated. The regulation of motor drive speed has been suggested, using an indirect adaptive controller [9][10][11]. An explicit adaptive power system stabilizer inhibits perturbations and improves system reliability [12,13]. This technique is suitable for online applications as it offers unique modeling, training, and stability characteristics. Therefore, this study uses the proposed explicit adaptive modified VIC based on an online AOA identifier, where the online identifier changes the gains of the proposed VIC (i.e., inertia and damping coefficients) to handle loads/renewables uncertainties. As a result, the power variation of the energy storage system is used for inertia support to the MG studied.
Depending on how connected the MG is to the grid, the grid works in either the grid-connected mode or the islanded mode. Due to load changes and renewable generation sources, regulation of MG in the islanded mode is difficult [14,15]. Therefore, this study tries to maintain the frequency stability of the islanded MGs.
The frequency oscillations of the system will be substantial as RESs can penetrate MGs at a greater rate. As a result, frequency regulation is made more difficult when there is a discrepancy between power generation and load demand. The system's inertia and stability are increased by the strong resemblance of MGs to real synchronous generators. The response of primary movers is simulated using a virtual synchronous generator (VSG). The VIC improves the stability of the islanded MG using an energy storage system (ESS), such as a battery ESS (BESS), flywheel ESS, or superconducting magnetic energy storage (SMES) [1,16,17]. The majority of early investigations used the VIC concept, which focuses on the derivative technique to boost the performance of the power systems as multiple high voltage direct current (HVDC) interconnected power systems [18][19][20]. The frequency dynamic performance of an islanded MG under contingencies has been improved using the H-infinite robust control method by the VIC [21], and VIC-based CDM used the chaotic crow search algorithm (CCSA) [22]. The VSG uses virtual primary and secondary controllers in addition to the virtual rotor concept [23]. When the distributed generation sources and the time delay between them increase, affecting frequency stability, the robust model predictive controller (RMPC)-based VIC [24] and a self-adaptive VIC incorporating fuzzy logic [25] are adopted. A robust VIC for a low-inertia microgrid has been proposed to minimize the undesirable effects of a phase-locked loop (PLL), and improve the microgrid frequency stability [26]. A VIC based on robust model predictive controller (RMPC) which takes into consideration the time delays in microgrids improves frequency stability [24]. The frequency regulation issue of an MG has been improved using a modified golden jackal optimization (mGJO) based on an adaptive fuzzy PID structure with a derivative filter (AFPIDF) controller with VIC [27]. To regulate the system frequency, a VIC is applied to the superconducting magnetic energy storage (SMES) [28], a VI scheme predicated on electric vehicles (EVs) [29], and a VIC and PID based on an intelligent Salp swarm algorithm (SSA) [30].
Recent studies have considered both the VI and virtual damping to guarantee reliability and consistency in the frequency control investigation. In addition, the frequency response improves with higher levels of inertia and damping; in real-world applications, however, raising these values too high would result in overshoots and higher building costs. The frequency stability of low-inertia power systems has been enhanced using the modified VIC [31] for the Egyptian power system (EPS) [32], the MPC-controlled VSG [33], the synthetic inertia control (SIC) system based on electric vehicles (EVs) [34], the novel analytical tuning approach under the influence of VIC [35], and the adaptive VIC based on MPC [36]. Novel modeling for VIC and a cascade controller based on a combination of the FOCs and 3DOF as a secondary controller have been presented to improve the MG frequency performance [37].
In this study, an online AOA identifier controlled explicit adaptive modified VIC for an islanded MG was designed which takes into consideration the high penetration of RESs, which simulates damping and inertia features simultaneously to improve system performance and stability under many different system operations. The virtual damping component depends on the system's frequency deviation in terms of the fast system's setting time when the virtual inertia component is produced using a derivative technique. In contrast, most literature suggests that the design of VIC systems relies on constant inertia and damping coefficient values, which may have a substantial impact on the frequency stability of microgrids at various levels of renewable energy penetration, where fixed values of virtual inertia and damping coefficients or inappropriate value selections may lead to higher frequency oscillations. To overcome such a problem, an explicit adaptive modified VIC is proposed. In this concept, the virtual inertia and damping coefficients are automatically adjusted using Archimedes optimization algorithm (AOA) based on an online AOA identifier, avoiding unsuitable selection and delivering a rapid response. The Rung Kutta approach is used to construct the proposed online identifier, which acts as the MG model. To imitate the frequency response of the MG online, the AOA predicts the coefficients of the online identifier based on the MG's input and output. Based on the online AOA identifier coefficients, the AOA is used to regulate the inertia and damping coefficients of the VIC. The effectiveness of the proposed explicit adaptive modified VIC is then evaluated in comparison to the conventional VIC based on the fixed parameters used in [31], the VIC system based on optimal parameters using AOA offline, and the adaptive VIC system based on fuzzy logic control [25] under mutation in loads, weatherdependent input, and MG parameters using MATLAB /Simulink software. The results highlight enhanced frequency stability and demonstrate the efficiency of the proposed explicit adaptive modified VIC in accommodating low-inertia islanded MGs with RESs and load fluctuations.
The remainder of the paper is structured as follows: Section 2 explains the mathematical structure of MG. Section 3 depicts the proposed explicit adaptive VIC technique based on an online AOA identification. Section 4 gives the simulation results and a discussion. Section 5 presents the conclusion.

Overview of an Islanded Microgrid System
In this study, the proposed online AOA identifier controlled adaptive modified VIC was investigated with the islanded MG studied, which has a system base of 15 MW which incorporates 15 MW TPP, 8.5 MW WPP, 4.5 MW SPP, 5 MW residential load, 10 MW industrial load, and 4.5 MW ESS, as shown in Figure 1. Table 1 shows the values of the MG parameters [36].
Variations in wind, load, and solar power are considered system disturbances. For valve gate opening and shutting, the generating rate constant (GRC) and rate limiter are incorporated into the exact perception of the MG.
On MG frequency deviation, primary, secondary (i.e., LFC), and inertia controls have the following effects: where

Concept of Virtual Inertia Control
An MG's frequency diverges from its nominal value when a disturbance is applied because the disturbance creates a power imbalance. A power system performs several control procedures over a long period to sustain power generation and load balance. Initially, the primary frequency control (governor) minimizes the MG's frequency variation within the first few seconds. The automatic generation control (secondary control) returns the nominal value of the frequency within minutes. The reserve control action addresses current or anticipated MG disruptions [38]. Until the primary frequency control state vector, disturbance input vector, Energies 2022, 15, 8884

of 27
As a result, the following covers the overall state-space representation of the MG considering RESs and ESS:

Concept of Virtual Inertia Control
An MG's frequency diverges from its nominal value when a disturbance is applied because the disturbance creates a power imbalance. A power system performs several control procedures over a long period to sustain power generation and load balance. Initially, the primary frequency control (governor) minimizes the MG's frequency variation within the first few seconds. The automatic generation control (secondary control) returns the nominal value of the frequency within minutes. The reserve control action addresses current or anticipated MG disruptions [38]. Until the primary frequency control is enabled, the kinetic energy stored in the rotors counteracts this imbalance through inertial reaction. The initial 10 s of using RP sources result in a poor inertial response, which causes a rapid RoCoF and a significant frequency variation [39]. As a result, a low inertia MG may cause the tripping of frequency relays, load-shedding, or cascade outages [38]. The injection of synthetic or VI into MGs with low inertia is required to alleviate this problem. Inertia is the term used to describe the kinetic energy stored in rotational motion, and it is calculated as follows: where J stands for the MG's inertia, and the angular frequency is denoted by ω. The swing equation can be used to roughly determine how a frequency disturbance will impact a power system's frequency: where the generated power and the power demand, including losses, are denoted by P G , and P d , respectively.
The power system's inertia constant H equals the kinetic energy of the connected generators in the system, normalized to apparent power S g : Equation (12) can be written as follows: 2H ω by substituting the frequency, f, for the angular frequency, where df dt is the RoCoF of the system. As a result, by changing the power imbalance over a brief time, determining and reducing RoCoF is the main objective of such a VI imitation technique. Figure 2 depicts the structure of the proposed VIC (i.e., imitating both damping and inertia features). In comparison to conventional VI control methods (i.e., imitating only the inertia feature), a graphic representation of the presented methodology's effects on response time, steady-state error, and damping is shown in Figure 3, including speedy response, reduced steady-state error, and improved damping. The online AOA optimization algorithm has been applied in the proposed explicit adaptive VIC system to choose the appropriate values for K Dv and, K Hv while taking into consideration the dynamically changing variables of the MG. The structures of the online identifier for MG, as well as the proposed explicit VIC, are described in the following sections.

Overview of Archimedes Optimization Algorithm (AOA) [40]
The AOA simulates what happens when weights and volumes of matter are submerged in a liquid using a population-based method. The weight of the liquid that the matter has displaced is applied to it as an upward force (a buoyant force), as shown in Figure 4.
Assume that there are several matters submerged in the same liquid, as shown in Figure 5, each of which is attempting to reach equilibrium. Varied densities and volumes of submerged matter create different accelerations. The matter will be in balance if the buoyant force F and weight W are equal.
where the density, volume, and gravity or acceleration are denoted by p, v, and a, respectively. Liquid and submerged matter are indicated by the subscripts b and o, respectively.
If the matters collide with each other (r), the following equilibrium condition results:

Overview of Archimedes Optimization Algorithm (AOA) [40]
The AOA simulates what happens when weights and volumes of matter are submerged in a liquid using a population-based method. The weight of the liquid that the matter has displaced is applied to it as an upward force (a buoyant force), as shown in Figure 4.
Assume that there are several matters submerged in the same liquid, as shown in Figure 5, each of which is attempting to reach equilibrium. Varied densities and volumes of submerged matter create different accelerations. The matter will be in balance if the buoyant force F and weight W are equal.
where the density, volume, and gravity or acceleration are denoted by p, v, and a, respectively. Liquid and submerged matter are indicated by the subscripts b and o, respectively.
If the matters collide with each other (r), the following equilibrium condition results:

Overview of Archimedes Optimization Algorithm (AOA) [40]
The AOA simulates what happens when weights and volumes of matter are submerged in a liquid using a population-based method. The weight of the liquid that the matter has displaced is applied to it as an upward force (a buoyant force), as shown in Figure 4.  Assume that there are several matters submerged in the same liquid, as shown in Figure 5, each of which is attempting to reach equilibrium. Varied densities and volumes of submerged matter create different accelerations. The matter will be in balance if the buoyant force F b and weight W 0 are equal.
where the density, volume, and gravity or acceleration are denoted by p, v, and a, respectively. Liquid and submerged matter are indicated by the subscripts b and o, respectively.   AOA begins the search with a random population of matters with different positions in liquid, volumes, densities, and accelerations. Once the beginning population's fitness has been assessed, the iteration procedure is continued until the dismissal condition is satisfied. AOA modifies the density and volume of each matter during each iteration.
Whether or not the matter collides with any other surrounding matter affects acceleration. The revised volume, acceleration, and density are used to establish a matter's new position. Below is a thorough mathematical expression of the AOA phases: Step 1: For each ith matter, the position, volume (vol), density (den), and acceleration (acc) of all the matters are set to their initial values using the following formula: The ith matter in a population of N matters is called x . lb and ub stand for the minimum and maximum boundaries of the search space, respectively. den = rand, vol = rand (20) where the D-dimensional vector (rand) produces a random number between [0, 1].
The matter is selected with the best fitness value after evaluating the first population. Allocate x , den , vol , acc .
Step 2: For iteration t + 1, the density and volume of matter i are changed as follows: where vol and den stand for the best matter's volume and density, and rand is a randomly generated number with a uniform distribution.
Step 3: After a period of time has passed since the first collision, the matter then seeks to attain equilibrium. The search is changed from exploration to exploitation, employing the transfer operator TF as follows: If the matters collide with each other (r), the following equilibrium condition results: AOA begins the search with a random population of matters with different positions in liquid, volumes, densities, and accelerations. Once the beginning population's fitness has been assessed, the iteration procedure is continued until the dismissal condition is satisfied. AOA modifies the density and volume of each matter during each iteration.
Whether or not the matter collides with any other surrounding matter affects acceleration. The revised volume, acceleration, and density are used to establish a matter's new position. Below is a thorough mathematical expression of the AOA phases: Step 1: For each ith matter, the position, volume (vol), density (den), and acceleration (acc) of all the matters are set to their initial values using the following formula: The ith matter in a population of N matters is called x i . lb i and ub i stand for the minimum and maximum boundaries of the search space, respectively.
where the D-dimensional vector (rand) produces a random number between [0, 1].
The matter is selected with the best fitness value after evaluating the first population. Allocate x best , den best , vol best , acc best .
Step 2: For iteration t + 1, the density and volume of matter i are changed as follows: where vol best and den best stand for the best matter's volume and density, and rand is a randomly generated number with a uniform distribution.
Step 3: After a period of time has passed since the first collision, the matter then seeks to attain equilibrium. The search is changed from exploration to exploitation, employing the transfer operator TF as follows: Hence, until the transfer TF crosses 1, it steadily rises. The iteration number and maximum iterations are denoted by t and t max , respectively, In a similar way to how the density-decreasing factor d supports AOA when searching from a global to a local level. When using (24) over time, it becomes smaller: Hence, as time passes, d t+1 becomes smaller, permitting convergence in a predetermined appropriate area. AOA will balance between exploration and exploitation phases if this variable is handled properly.
Step 4: (Exploration phase): If matters collide with each other (TF ≤ 0.5), a random material (mr) is nominated and the matter's acceleration is adjusted for iteration t + 1 using: The density, volume, and acceleration of matter i are called den i , vol i , and acc i , respectively. Moreover, using the subscript (mr) means the density, volume, and acceleration of random material. During one-third of iterations, TF ≤ 0.5 guarantees exploration. When a number other than 0.5 is used, the behavior of exploration and exploitation is altered.
(Exploitation phase): If matters don't collide with each other (TF > 0.5), the acceleration of matter is adjusted for iteration t + 1 as follows: (Normalization): the percentage of change is determined by normalizing the acceleration.
The normalization ranges u and l are adjusted to 0.9 and 0.1, respectively. The percentage change in each agent's step is specified by acc t+1 i, norm . If a matter's acceleration value is high and it is far from the global optimum, that matter i is in the exploration phase; if not, that matter i is in the exploitation phase. The acceleration factor often begins high and gradually decreases in usual cases. This enables search agents to steer clear of local solutions and toward the best global solution.
Step 5: The ith matter's position for iteration t + 1 during the exploration phase was determined by: where the constant C 1 = 2. If not, the following updates the positions of matters during the exploitation phase: where the constant C 2 = 6. T grows with time in the interval [C 3 × 0.3, 1] and starts taking a percentage from the optimal position. Using the flag F alters the direction of motion.
Step 6: Determine the optimal solution path so far for each matter using the objective function f. Allocate x best , den best , vol best , acc best .
The working mechanism of the proposed AOA is illustrated in Figure 6.
where the constant C = 6. T grows with time in the interval C × 0.3, 1 and starts taking a percentage from the optimal position. Using the flag F alters the direction of motion.
Step 6: Determine the optimal solution path so far for each matter using the objective function f. Allocate x , den , vol , acc .
The working mechanism of the proposed AOA is illustrated in Figure 6.

Structure of Explicit Self-Tuning Adaptive Control (ESTC)
The characteristics of the MG are being altered by the growing demand for renewable energy and will eventually be unknown. As a result, identification for a power system is now more frequently used. This study tended to use explicit self-tuning adaptive control, which depends on the identification concept. As shown in Figure 7, explicit self-tuning adaptive control entails modeling, control law design, implementation, and validation. The "Identification" block, which acts as a model of the process (i.e., MG), is used to estimate the model parameters online. In this study, the online AOA identifier is

Structure of Explicit Self-Tuning Adaptive Control (ESTC)
The characteristics of the MG are being altered by the growing demand for renewable energy and will eventually be unknown. As a result, identification for a power system is now more frequently used. This study tended to use explicit self-tuning adaptive control, which depends on the identification concept. As shown in Figure 7, explicit self-tuning adaptive control entails modeling, control law design, implementation, and validation. The "Identification" block, which acts as a model of the process (i.e., MG), is used to estimate the model parameters online. In this study, the online AOA identifier is chosen as a model of the MG. The controller design, which uses a specified approach, determines the controller parameters [13]. In this study, AOA was used to adjust online the parameters of VIC. determines the controller parameters [13]. In this study, AOA was used to adjust online the parameters of VIC.

Structure of the Online AOA Identifier
The MG is considered to have a known model structure but unknown parameters. AOA is used to estimate online the changing values of parameters. The main concept is a comparison between the frequency output of the MG with the frequency output of the identifier. Through optimization, the difference between the MG and identifier output is reduced to a minimum using a fitness function. The fitness function is an indicator of convergence between the response of the identifier and the measured response of MG. The differential equation of the MG is as follows [41]: where f and g are linear or nonlinear functions, and p stands for the unknown parameter vector containing the inertia and damping coefficients of the MG (H, D) that will be determined. The differential equation of the identified model of the MG is as follows [41]: where the same MG input that was used to feed the MG model is u, and p is the estimated parameter vector which contains the identified inertia and damping coefficients of the identified model (H , D ). The structure of the identified model is represented as the MG structure (31) using the Rung Kutta method (Appendix A). The MG input, MG response, and estimated coefficients are used to determine the response of the identified model. The difference between the responses of the MG y and the identified model y is used to evaluate the estimated parameters. Therefore, the definition of the fitness function is: The fitness function depends on the estimated parameter vector, p . Next, the identification challenge considers a problem of optimization. Figure 8 shows the AOA construction depending on the parameter identification approach online. First, both the MG to be identified and the MG model receive the MG input, u. Then, the performance

Structure of the Online AOA Identifier
The MG is considered to have a known model structure but unknown parameters. AOA is used to estimate online the changing values of parameters. The main concept is a comparison between the frequency output of the MG with the frequency output of the identifier. Through optimization, the difference between the MG and identifier output is reduced to a minimum using a fitness function. The fitness function is an indicator of convergence between the response of the identifier and the measured response of MG. The differential equation of the MG is as follows [41]: where f and g are linear or nonlinear functions, and p stands for the unknown parameter vector containing the inertia and damping coefficients of the MG (H,D) that will be determined. The differential equation of the identified model of the MG is as follows [41]: where the same MG input that was used to feed the MG model is u, andp is the estimated parameter vector which contains the identified inertia and damping coefficients of the identified model (Ĥ,D). The structure of the identified model is represented as the MG structure (31) using the Rung Kutta method (Appendix A). The MG input, MG response, and estimated coefficients are used to determine the response of the identified model. The difference between the responses of the MG y and the identified modelŷ is used to evaluate the estimated parameters. Therefore, the definition of the fitness function is: The fitness function depends on the estimated parameter vector,p. Next, the identification challenge considers a problem of optimization. Figure 8 shows the AOA construction depending on the parameter identification approach online. First, both the MG to be identified and the MG model receive the MG input, u. Then, the performance evaluator generates the fitness function J using the output from the MG and its model. The AOAbased identifier identifies the unknown parameter vectorp (i.e.,Ĥ,D) using the calculated fitness function J. At every sampling time, the iteration number reaches a maximum, after which the estimated parametersp (i.e.,Ĥ,D) update the MG model. The obtained value of p at this moment is considered to be the initial value for the next sampling time to reduce the number of iterations, and reach the optimum values of the AOA identifier achieved for the fitness function quickly. Table 2 gives the values of the online AOA parameters. evaluator generates the fitness function J using the output from the MG and its model. The AOA-based identifier identifies the unknown parameter vector p (i.e., H , D ) using the calculated fitness function J. At every sampling time, the iteration number reaches a maximum, after which the estimated parameters p (i.e., H , D ) update the MG model. The obtained value of p at this moment is considered to be the initial value for the next sampling time to reduce the number of iterations, and reach the optimum values of the AOA identifier achieved for the fitness function quickly. Table 2 gives the values of the online AOA parameters.

Parameters
Value  Figure 9 shows a reduced representation of the MG, taking into consideration the VIC system. In Figure 10, G(s) represents the linearized transfer function of the MG studied without the VIC loop, as shown in Figure 9. Furthermore, H(s) represents the transfer function of the VIC, as shown in Figure 9, which acts as the feedback controller. Then, the transfer function of the closed loop of the MG with the VIC will be:

TF(s) = G(s) 1 + G(s)H(s)
where G(s) represents the power system transfer function and H(s) represents the feedback transfer function.
From   Figure 9 shows a reduced representation of the MG, taking into consideration the VIC system. In Figure 10, G(s) represents the linearized transfer function of the MG studied without the VIC loop, as shown in Figure 9. Furthermore, H(s) represents the transfer function of the VIC, as shown in Figure 9, which acts as the feedback controller. Then, the transfer function of the closed loop of the MG with the VIC will be:

The Proposed Explicit Adaptive Modified Virtual Inertia Control
where G(s) represents the power system transfer function and H(s) represents the feedback transfer function.           From Figure 9:

Parameters Value Parameters Value
Therefore, the following formula can determine the parameters of a closed-loop secondorder system: the characteristic equation of a closed-loop second-order system will be: by substituting Equation (35) in Equation (34) However, Figure 11 explains the construction of the MG, taking into consideration the proposed online AOA identifier controlled explicit adaptive modified VIC. The Rung Kutta approach, which depicts the structure of the identified model of the MG studied, uses AOA to determine its unknown parameters. Therefore, the AOA identifier estimates the inertia and damping coefficients of the identified model of the MG (Ĥ,D) online according to the measured input and the MG output, whereas, AOA updates online the values depending on the objective function, which is the difference between the MG output and the identifier output. With the optimum values of the inertia and damping coefficients (Ĥ,D), the AOA identifier acts as a model for the MG studied (i.e., the output of the AOA identifier should mimic the frequency deviation of the MG studied). The controller design uses AOA to achieve online the optimum values of the VIC gains (i.e., inertia K Hv and damping K Dv features) based on the identified coefficients (Ĥ,D). AOA initializes these gains values (K Hv , K Dv ) with random values between 0 and 10. Table 3 shows the selection of the other parameters. AOA then updates online the initial values to achieve the objective function J, which is a function of the identified coefficients of the MG (Ĥ,D), and the VIC gains (K Hv , K Dv ). Therefore, based on the AOA identifier's parameters, the following parameters can be derived for a closed-loop second-order system:     Figure 11. The MG with the proposed online AOA identifier controlled explicit adaptive modified VIC. The objective function J can be represented as follows:

Parameters Value Parameters Value
After the perfect values of the VIC gains have been obtained, the VIC gets these gains to reduce the frequency deviation during a system perturbation. Moreover, the current values of gains are employed as initial values to launch the optimization approach at the next sampling time, to shrink the iteration numbers and save the MG stability and robustness. This approach is repeated at every sampling time to adjust the values of VIC gains, which improves the performance of MG faced with various load/RES disruptions.

Simulation Results and Discussion
Using the MATLAB/Simulink software, the frequency deviation of the proposed online AOA identifier controlled explicit adaptive modified VIC for the islanded MG was compared with the conventional VIC based on fixed parameters executed in [31], and the VIC system based on optimal parameters using AOA offline under various operational scenarios. Table 4 presents the parameter values of the AOA algorithm used to adjust the inertia and damping coefficients of VIC offline and the coefficient values of VIC.

First Scenario: Effect of Random Load Variation and Weather-Dependent Random Wind and Solar Power Variation
Using the nominal system characteristics shown in Table 1, the frequency response of the MG with the online AOA identifier controlled adaptive modified VIC was investigated in this scenario. The impact of fast and random variation in industrial and residential demand as well as in RES was employed to examine the frequency response of the proposed explicit adaptive modified VIC, as indicated in Figure 12. to robustly adjust the frequency in all meteorological and seasonal conditions, as well as during periods of peak and low load demand.  The online model identification based on the Rung Kutta method depended on the input and output of MG to mimic the MG response exactly. Moreover, as shown in Figure 13, the AOA modified the MG model coefficients (identified inertia and damping coefficientŝ H,D) based on the variation between the MG and the identified model responses for every sampling instant.   In Figure 14, the dynamic response of the MG with the conventional VIC, the AOA optimized VIC offline, and the proposed explicit adaptive modified VIC are indicated under the influence of random perturbation. The frequency deviation of the MG oscillated between ±0.15 Hz and ±0.075 Hz with the conventional VIC and the AOA-optimized VIC offline, respectively. However, the MG response varied by about ±0.065 Hz as a result of the proposed explicit adaptive VIC. Therefore, it improved the MG performance in terms of speed, steady-state error, and damping. The proposed explicit adaptive VIC has a minimal steady-state error and is well-damped, even when subjected to large sudden changes of loads/renewables uncertainties at 60 s. On other hand, the proposed explicit adaptive VIC handled loads/renewables uncertainties.

Second Scenario: Effect of Various Operating Conditions
The frequency response of the proposed explicit adaptive modified VIC was surveyed under severe conditions. At 40 s, the residential load was cut off from the MG, and The AOA estimated online the VIC gains (inertia and damping coefficients), as shown in Figure 16, for every sampling instant. Furthermore, in every sampling instant, the AOA depended on the previous value of VIC gains as initial values for the current sampling instant. Therefore, these gains tended to settle and save the MG stability when different disturbances occurred. So, the proposed explicit adaptive VIC had the efficiency to robustly adjust the frequency in all meteorological and seasonal conditions, as well as during periods of peak and low load demand.

Second Scenario: Effect of Various Operating Conditions
The frequency response of the proposed explicit adaptive modified VIC was surveyed under severe conditions. At 40 s, the residential load was cut off from the MG, and

Second Scenario: Effect of Various Operating Conditions
The frequency response of the proposed explicit adaptive modified VIC was surveyed under severe conditions. At 40 s, the residential load was cut off from the MG, and wind and solar power connected at the start time, whereas the industrial load connected at 20 s, as shown in Figure 17. The AOA adjusted online the parameters of the identifier (Ĥ,D) which acts as a model of the MG through time change. These parameters tended to steady state when the different disturbances ended. The AOA reached the best values of the parameters of the MG model. Therefore, the performance of the online AOA identifier was identical to the MG response, as illustrated in Figure 18.
the VIC gains (inertia and damping) are shown, where the AOA reached the optimum values of the gains at the first sampling instant and saved the optimum values for every sampling instant based on the previous value of VIC gains as initial values for the current sampling instant to improve the MG stability. Therefore, these gains tended to settle and save the MG stability when different disturbances occurred. So, the most robust and efficient control technique is the proposed explicit adaptive modified VIC.   In Figure 19, the dynamic performance of the MG with the conventional VIC, the AOA optimized VIC offline, and the proposed explicit adaptive modified VIC are shown under severe conditions. The MG response varied between ±0.13 Hz and ±0.05 with conventional VIC and AOA-optimized VIC offline, respectively. However, with the proposed explicit adaptive modified VIC, the MG response fluctuated between ±0.035 Hz. As a result, it enhanced the MG's speed, steady-state error, and damping performance. Figure 20 depicts the reactions of the conventional VIC, the AOA-optimized VIC offline, and the proposed explicit adaptive modified VIC. The power reaction of the proposed explicit adaptive modified VIC is considered to be the best one. In Figure 21, the VIC gains (inertia and damping) are shown, where the AOA reached the optimum values of the gains at the first sampling instant and saved the optimum values for every sampling instant based on the previous value of VIC gains as initial values for the current sampling instant to improve the MG stability. Therefore, these gains tended to settle and save the MG stability when different disturbances occurred. So, the most robust and efficient control technique is the proposed explicit adaptive modified VIC.

Third Scenario: Effect of Various Operating Conditions with Low System Inertia
A reduction in the system's inertia to 75% of its nominal value occurred. Figure 22 represents the high integration of RESs and the 10% step load at 20 s. For every sampling instant, the gains of the online AOA identifier alternated. These gains tended to steady state when the different disturbances ended at 30 s. The AOA reached the best values of the parameters of the MG model (H , D ). So, the performance of the online AOA identifier imitated the MG performance, as explained in Figure 23. In Figure 24, the efficiency of the proposed explicit adaptive modified VIC faced the high integration of RESs, step load, and variations of system parameters. In this case, a significant oscillation reached ±0.5 Hz with the conventional VIC. However, one oscillation decreased to ±0.2 Hz with the

Third Scenario: Effect of Various Operating Conditions with Low System Inertia
A reduction in the system's inertia to 75% of its nominal value occurred. Figure 22 represents the high integration of RESs and the 10% step load at 20 s. For every sampling instant, the gains of the online AOA identifier alternated. These gains tended to steady state when the different disturbances ended at 30 s. The AOA reached the best values of the parameters of the MG model(Ĥ,D). So, the performance of the online AOA identifier imitated the MG performance, as explained in Figure 23. In Figure 24, the efficiency of the proposed explicit adaptive modified VIC faced the high integration of RESs, step load, and variations of system parameters. In this case, a significant oscillation reached ±0.5 Hz with the conventional VIC. However, one oscillation decreased to ±0.2 Hz with the AOAoptimized VIC offline, and ±0.15 Hz with the proposed explicit adaptive VIC. To further the inertia reduction that took place, the BESS power increased with the proposed explicit adaptive modified VIC to counteract the effects of the physical constraints and system uncertainties, as illustrated in Figure 25. Figure 26 displays the VIC gains (inertia and damping coefficients). The AOA still attained the optimum values of the gains at the first sampling instant and saved MG stability, whereas the proposed approach was close to the global optima at every sampling instant. Figure 27 shows the speed convergence of the proposed approach with optimum value for four samples of consecutive instant times. This made the proposed explicit adaptive modified VIC a robust and effective control method. The significant dynamic response of the conventional VIC, the AOA-optimized VIC offline, and the proposed explicit adaptive modified VIC are all summarized in Figure 28

Third Scenario: Effect of Various Operating Conditions with Low System Inertia
A reduction in the system's inertia to 75% of its nominal value occurred. Figure 22 represents the high integration of RESs and the 10% step load at 20 s. For every sampling instant, the gains of the online AOA identifier alternated. These gains tended to steady state when the different disturbances ended at 30 s. The AOA reached the best values of the parameters of the MG model (H , D ). So, the performance of the online AOA identifier imitated the MG performance, as explained in Figure 23. In Figure 24, the efficiency of the proposed explicit adaptive modified VIC faced the high integration of RESs, step load, and variations of system parameters. In this case, a significant oscillation reached ±0.5 Hz with the conventional VIC. However, one oscillation decreased to ±0.2 Hz with the AOA-optimized VIC offline, and ±0.15 Hz with the proposed explicit adaptive VIC. To further the inertia reduction that took place, the BESS power increased with the proposed explicit adaptive modified VIC to counteract the effects of the physical constraints and system uncertainties, as illustrated in Figure 25. Figure 26 displays the VIC gains (inertia and damping coefficients). The AOA still attained the optimum values of the gains at the first sampling instant and saved MG stability, whereas the proposed approach was close to the global optima at every sampling instant. Figure 27 shows the speed convergence of the proposed approach with optimum value for four samples of consecutive instant times. This made the proposed explicit adaptive modified VIC a robust and effective control method. The significant dynamic response of the conventional VIC, the AOA-optimized VIC offline, and the proposed explicit adaptive modified VIC are all summarized in Figure 28.              Figure 29 shows the effect of the change of the computational parameters (i.e., H, D, T g , T t , T W , T S , R and K i ) on the proposed explicit adaptive modified VIC when ∆P d = ∆P w = ∆P s = 0.1 p.u. The frequency response of the MG with the proposed explicit adaptive modified VIC using the nominal system characteristics shown in Table 1 was compared when the value of the computational parameters was reduced by 50%. As a result, the proposed explicit adaptive modified VIC was slightly sensitive to the change of the time constant of the WPP (i.e., T W ) and the time constant of the SPP (i.e., T S ). The proposed explicit adaptive modified VIC then adjusted the frequency efficiently, despite the variation of parameters. ∆P = ∆P = 0.1 p. u. The frequency response of the MG with the proposed explicit adaptive modified VIC using the nominal system characteristics shown in Table 1 was compared when the value of the computational parameters was reduced by 50%. As a result, the proposed explicit adaptive modified VIC was slightly sensitive to the change of the time constant of the WPP (i.e., T ) and the time constant of the SPP (i.e., T ). The proposed explicit adaptive modified VIC then adjusted the frequency efficiently, despite the variation of parameters.

Effectiveness Evaluation of The Proposed Explicit Adaptive VIC
An online AOA identifier controlled adaptive modified VIC was compared with the self-adaptive VIC-based fuzzy logic in [25] to validate its efficiency and robustness. Only the virtual inertia constant was automatically adjusted based on input signals of real power injection of RESs and system frequency deviations, as shown in Figure 30. The output was a normalized value of the virtual inertia constant. The fuzzy rule base in Table 5 was used to evaluate the suitable output depending on the input signals of ∆P and ∆f. The membership functions for the input and output of the fuzzy system are shown in Figure 31.

Effectiveness Evaluation of The Proposed Explicit Adaptive VIC
An online AOA identifier controlled adaptive modified VIC was compared with the self-adaptive VIC-based fuzzy logic in [25] to validate its efficiency and robustness. Only the virtual inertia constant was automatically adjusted based on input signals of real power injection of RESs and system frequency deviations, as shown in Figure 30. The output was a normalized value of the virtual inertia constant. The fuzzy rule base in Table 5 was used to evaluate the suitable output depending on the input signals of ∆P RES and ∆f. The membership functions for the input and output of the fuzzy system are shown in Figure 31.   Figure 30. VIC-based fuzzy logic controller [25]. The input and output were divided into fuzzy subsets and defined using the linguistic variable. NL represents negative large, NS represents negative small, ZO represents zero, PS represents positive small, PL represents positive large, L represents low, M represents medium, H represents high, S represents small, B represents big, and VB represents very big. The input and output were divided into fuzzy subsets and defined using the linguistic variable. NL represents negative large, NS represents negative small, ZO represents zero, PS represents positive small, PL represents positive large, L represents low, M represents medium, H represents high, S represents small, B represents big, and VB represents very big.
In the third scenario, the frequency deviation of the MG based on the adaptive VICbased fuzzy logic control was changed between ±0.6 Hz, as shown in Figure 32. However, one oscillation decreased to ±0.15 Hz with the proposed explicit adaptive VIC, which proves that the proposed explicit adaptive VIC is more robust and effective than the adaptive VIC-based fuzzy logic control. The BESS power increased with the proposed explicit adaptive modified VIC, as illustrated in Figure 33. Figure 34 displays the proposed explicit adaptive VIC gains (inertia and damping coefficients) and the inertia gain of the adaptive VIC-based fuzzy logic control, whereas the damping gain was neglected in [25]. The significant dynamic response of the VIC based on fuzzy logic control and the proposed explicit adaptive modified VIC are summarized in Figure 35. As a result, indirect adaptive controllers (i.e., the proposed explicit adaptive VIC) are considered more powerful than intelligent controllers (i.e., the adaptive VIC-based fuzzy logic control) in reducing oscillations and enhancing power system stability, as mentioned before in the introduction section. explicit adaptive modified VIC, as illustrated in Figure 33. Figure 34 displays the proposed explicit adaptive VIC gains (inertia and damping coefficients) and the inertia gain of the adaptive VIC-based fuzzy logic control, whereas the damping gain was neglected in [25]. The significant dynamic response of the VIC based on fuzzy logic control and the proposed explicit adaptive modified VIC are summarized in Figure 35. As a result, indirect adaptive controllers (i.e., the proposed explicit adaptive VIC) are considered more powerful than intelligent controllers (i.e., the adaptive VIC-based fuzzy logic control) in reducing oscillations and enhancing power system stability, as mentioned before in the introduction section.  posed explicit adaptive VIC gains (inertia and damping coefficients) and the inertia gain of the adaptive VIC-based fuzzy logic control, whereas the damping gain was neglected in [25]. The significant dynamic response of the VIC based on fuzzy logic control and the proposed explicit adaptive modified VIC are summarized in Figure 35. As a result, indirect adaptive controllers (i.e., the proposed explicit adaptive VIC) are considered more powerful than intelligent controllers (i.e., the adaptive VIC-based fuzzy logic control) in reducing oscillations and enhancing power system stability, as mentioned before in the introduction section.

Conclusions
Widespread employment of renewable energy sources (RESs) reduces the inertia of the microgrid (MG). After this, frequency stability may regress as a result of power imbalance, minor load perturbation, or weather-dependent fluctuations. Most literature suggests that the design of virtual inertia control (VIC) systems rely on constant inertia and damping coefficient values, which may have a substantial impact on the frequency stability of microgrids at various levels of renewable energy penetration, where fixed values of virtual inertia and damping coefficients or inappropriate value selections may lead to higher frequency oscillations. To overcome such a problem, an explicit adaptive modified VIC is proposed. In this concept, the virtual inertia and damping coefficients are automatically adjusted using Archimedes optimization algorithm (AOA) based on an online AOA identifier, avoiding unsuitable selection and delivering a rapid response. An AOA identifier controlled adaptive modified VIC is suggested to boost the frequency stability of MG, which eliminates the effect of RESs oscillation, load variation, and dynamic perturbation (i.e., inertia and damping parameters of MG). The online AOA identifier assesses the coefficients of the MG at every sampling instant. The AOA then adjusts online the inertia and damping parameters of the VIC using the online coefficients of the MG. Using MATLAB /Simulink software, the simulation results demonstrate improved frequency stability, and the capabilities of the proposed explicit adaptive modified VIC to

Conclusions
Widespread employment of renewable energy sources (RESs) reduces the inertia of the microgrid (MG). After this, frequency stability may regress as a result of power imbalance, minor load perturbation, or weather-dependent fluctuations. Most literature suggests that the design of virtual inertia control (VIC) systems rely on constant inertia and damping coefficient values, which may have a substantial impact on the frequency stability of microgrids at various levels of renewable energy penetration, where fixed values of virtual inertia and damping coefficients or inappropriate value selections may lead to higher frequency oscillations. To overcome such a problem, an explicit adaptive modified VIC is proposed. In this concept, the virtual inertia and damping coefficients are automatically adjusted using Archimedes optimization algorithm (AOA) based on an online AOA identifier, avoiding unsuitable selection and delivering a rapid response. An AOA identifier controlled adaptive modified VIC is suggested to boost the frequency stability of MG, which eliminates the effect of RESs oscillation, load variation, and dynamic perturbation (i.e., inertia and damping parameters of MG). The online AOA identifier assesses the coefficients of the MG at every sampling instant. The AOA then adjusts online the inertia and damping parameters of the VIC using the online coefficients of the MG. Using MATLAB /Simulink software, the simulation results demonstrate improved frequency stability, and the capabilities of the proposed explicit adaptive modified VIC to accommodate low-inertia islanded MGs with RESs and load fluctuations compared to conventional VIC based on fixed parameters, the VIC system based on optimal parameters using AOA offline, and the adaptive VIC system based on fuzzy logic control (i.e., estimate only the inertial gain). Therefore, in the simulation results, the battery energy storage system (BESS) should boost the microgrid with a high degree of power, which overcomes the effects of the physical constraints and system uncertainties. As a result, BESS should have a large power capacity, and this behavior may be affected BESS performance for a long time. In future studies, the other ESS may handle the expected problem.