Battery Energy Storage Systems (BESSs) and the Economy-Dynamics of Microgrids: Review, Analysis, and Classification for Standardization of BESSs Applications

The literature on microgrid (MG) studies can be categorized as those that investigated the dynamics or economics of MG systems. Due to the important roles of battery energy storage systems (BESSs) in MGs, the BESSs have been involved in both economics and dynamics studies but mostly separately due to the different time constants of studies. Whereas, in the complicated modern MGs, the BESS is the joint point that bridges these two studies. Thus, studying merely one aspect of economy-dynamic without considering the other aspect would not be accurate. To bridge this gap, this paper reviews, analysis and classifies the BESSs applications, based on their time constants, by merging of which helps researchers to develop joint economy-dynamics models that would be the future trend in the field. The classified BESS applications are 1) inertia synthesis, 2) primary frequency response to compensate slow response time of micro-sources (MSs) for load tracking, 3) real-time energy management for the integration of intermittent renewables, 4) economic dispatch and optimal power flow for improving steady-state performance, and 5) slack bus realization. The research gaps and future trends have been discussed throughout the paper and are summarized in the future trend section.

HE MICROGRID (MG) concept, with a hierarchical control system, is considered a key solution to address the optimality, power quality, reliability, and resiliency issues of modern power systems that arose due to the massive penetration of distributed energy resources (DERs) [1]- [2]. The energy management system (EMS), executed at the highest level of the MG's control structure, is responsible to implement economic dispatch/optimal power flow to make the MG economicallytechnically efficient by minimizing the energy cost/power losses [3].
On the other hand, autonomous control of MGs, performed in the islanded operation mode, is essential to improve the reliability of supplied power to the local loads as well as enhancing the resiliency of power systems [4]. The former is realized through the uninterruptable supply of power to the local/sensitive loads [5], and the latter is achieved as a part of demand response programs implemented to compensate for the shortage of generated power, which the system may face due to the intermittent (uncontrollable) nature of renewable energy resources (RESs) [6]. In this regard, the collaboratory primary controllers, in the lowest control level of the MG's control structure, are responsible to hold the instant productionconsumption (Prod.−Cons.) balance and, thus, dynamically stabilizing the autonomous system [7]. In the intermediate level, a secondary controller has been adopted to maintain the system variables within the tolerable bands to preserve the power quality [8].
Despite the multiple time scale of different control levels, the battery energy storage systems (BESSs) are assumed to play crucial roles to achieve the control targets in all control levels. For instance, the low-inertia inverter-interfaced distributed generation (IIDG) units, including slow response micro-sources (MSs) and intermittent RESs, can be compensated by BESSs. Furthermore, the BESSs are increasingly used for enhancing the hosting capacity of the electric grids. Also, the presence of uncertain modern electric loads (like electric vehicles) and considerations about the flexible electricity markets, demand response programs, peak shaving, etc., justify the utilization of BESSs. In this light, the BESSs are supposed to accomplish the following tasks, which we have ordered based on the time constants of the applications: 1. Inertia synthesis (0~1 ): inertia is essential to stabilize a power system from two aspects: a) smoothing the transients by preventing rapid variations of the power system variables, particularly the frequency as the most critical variable, and b) limiting the maximum frequency deviations. These two are implemented simultaneously and inherently in synchronous machines due to the physical characteristics of the rotor mass. Whereas in the context of IIDG units, the former is achieved through the control design of the IIDG's control loops, and the latter is realized via adopting BESSs with rapid power injection capability with an appropriate control strategy [9]. Nevertheless, the control loops of these two targets must be coordinated to be effective. 2. Primary frequency response (1~60 ): BESSs with high power/energy density can provide sufficient energy to meet load changes for compensating the slow response characteristics of the prime-mover MSs for load tracking. 3. Covering intermittent renewables (1~15 ): For facilitating the integration of RESs, such as photovoltaic (PV) cells and wind turbines (WTs), the output power of the RESs is monitored through a real-time program and the state of charge (SoC) of BESSs is managed to meet load demands [10]. 4. Economic programs for steady-states (15~60 ): The BESSs charging/discharging are scheduled to increase economic efficiency while realizing peak shaving schemes. In the advanced models, the operational strategy (OS) of the BESS is optimally determined considering the battery's operating/aging costs, cycle life, and degradation cost and in accordance with the electricity tariffs and demand response programs. 5. Slack bus realization (0 ~ 60 ): In the conventional power systems, the generation unit at the slack bus is assigned with a small/zero droop gain and is responsible to produce power as much as needed to hold the instant Prod.−Cons. balance. This allows other generation units to operate at optimal points and also diminishes the frequency variation due to the droop control mechanism. However, the small-scale/slow response of MSs as well as the current limitations of semi-conductor switches are the main obstacles in allocating an IIDG unit as the assigned generation unit for the slack bus. Besides, a large number of uncertainties arising from RESs and the frequent load variations in the distribution level may cause the results (given from the power flow study) to go beyond the slack bus margins. The BESS is the best candidate to carry out this task by immediately providing the required power for frequency stabilization and incorporating the uncertainties in the power flow studies.
In all applications, the similarity of the BESSs duty is to hold the Prod.−Cons. balance but the difference lies in the various time constants of the BESS responses. Also, in the first four applications, the BESS is controlled as a grid-feeding inverter, while in the fifth application the BESS is controlled as a gridforming inverter since the control system of the associated inverter also affects the response characteristics of the BESS.

Research gaps
Due to the importance of the above-mentioned quintuple tasks, they have been investigated extensively in the literature. However, the majority of studies draw a line between dynamic and steady-state analyses due to the multiple time scales of the tasks. The economic dispatch and optimal power flow studies fall into the steady-state operation, whereas the virtual inertia or primary frequency response are investigated when the dynamic stability concerns are considered. Despite this distinction, the performance of the BESSs affects both the economy and dynamics of an AMG. Because utilizing the BESS for dynamics programs affects its optimal operating point and vice versa. As an example, if the BESS is tasked with providing virtual inertia, a portion of its capacity should be reserved for this purpose and cannot be allocated to economics/steady-state programs. This, also, imposes degradation costs which affect its optimal operation. Additionally, providing the frequency support may cause the SoC of BESS to not follow the optimal schedule given by steady-state programs, like economic dispatch, or even may make the BESS goes beyond its SoC limits [11]. This issue is more vital in the low-voltage MGs where the loads change randomly and frequently.
Also, for dynamics applications, the virtual inertia and primary frequency response are characterized by different time constants and objectives and require different control schemes. However, this issue has not been clarified in the literature and some of the suggested control techniques for inertia synthesis are effective for primary frequency response considering their inherent time delay for frequency estimation caused by lowpass filters (LPFs) or dead-band/hysteresis controllers adopted in their control loops. This issue is important in AMGs regarding the small time constant of droop-controlled gridforming inverters.
From another point of view, the dynamic stability of power systems, specifically in the context of an AMG, can be studied from two aspects: 1) analyzing the stability of the control system through small/large signal methods [12], and 2) maintaining the Prod.−Cons. balance in dynamics/steady states. The former has been carried out while investigating the droop controller dynamic stability/performance in the primary level of AMGs, using state-space modeling [13]- [14], impedance shaping [15]- [16], etc., and the latter has been considered by taking the energy storage into account. In the majority of works, these two have been distinguished, whereas, with regard to the first and fifth applications (i.e., the inertia response and the slack bus realization), the BESS can be helpful to improve stability of an AMG from both points of views. This is due to the fact that the inertia response and realization of the slack bus are necessary to secure dynamic (frequency) stability in an AMG, which also impact the optimal power flow for the steady-state analysis. This has not been clarified in the literature.
Finally, it should be noted that there are ambiguities in the naming and classification of each of these applications in different studies. For example, the slow response of the prime resources has been addressed in some studies but has been named as inertia response. Alternatively, most studies that investigated the steady-state performance of AMGs claim the intermittent nature of RESs as the main motivation, which is misleading because system dynamics or even the steady-state performance have not been considered.
Considering the mentioned problems and due to the crucial importance of the BESS for the stable/efficient operation of AMGs, this paper aims to classify the BESS applications in the MGs based on a comprehensive review of the extant literature. The target is to recognize the existing gaps and to provide suggestions for further analysis and research. Less stress has been put on the hierarchical control system of AMGs [17], the performance of the primary/secondary levels [18], the control system of the IIDG units [19], and different ESSs/BESSs technologies [20], [21], which have been well-established in the literature [22]- [23]. Instead, this work attempts to discover and classify the BESS applications in the MG based on the time constants of the BESS responses which cannot be found in the literature and have not been standardized yet.

A. Inertia Fundamentals
The rate-of-change-of-frequency (RoCoF) and frequency nadir (FN) are the critical indices that affect the power systems dynamics and stability, see Fig. 1. Synchronous generators are vulnerable to pole-slipping and tripping by protective relays at a high-RoCoF event, and an excessive FN may lead to unwanted load-shedding, cascading failures, and large-scale blackouts [24]. RoCoF and FN are also critical factors in the inverter-based MGs [25]- [26]. The frequency variation dynamically controls the phase angle, and the sensitivity of active/reactive power to the phase angle is very high, i.e., proportional to the square of voltage divided by line impedance (∝ 2 ⁄ ) [13]. Particularly, in MGs, the power network impedance (specifically the X/R ratio) is low, which raises stability issues [27], [28].
From another perspective, the frequency dynamics at power systems are mostly affected by two factors: 1) The inertia response provided by rotatory elements of synchronous generators, which can be simplified as where is the inertia constant that represents the kinetic energy stored at rotatory masses in the grid, is the frequency of the grid, and . and . are the power Prod.−Cons., respectively. One can see that the RoCoF is inversely proportional to the inertia constant in the grid However, the penetration of low inertia IIDG units reduces the inertia constant of the grid, and thus its stability margins, which limits the hosting capacity of the grid [29].
2) The droop mechanism established by governors for power-sharing [30]- [31]; although there is not any rotatory element in inverter-based MGs to govern the frequency dynamics, the droop-controlled grid-forming voltage source converters (VSCs) [19] emulate load−frequency droop characteristics (governor performance) of synchronous generators to realize power-sharing among dispatchable DERs. Thus, the same situation (active power-frequency drop) exists in the inverter-based MGs [31].
The power (droop) control loop at the grid forming VSCs in MGs are designed to smooth RoCoF through different methods such as embedding an LPF and virtual damping [31]- [32], adaptive droop gain ( ∝ ( ⁄ ) ) [33], or by emulating inertia characteristics of synchronous generators [34]. Nevertheless, lacking available instant kinetic energy in an inverter-based MG coupled with the limited short-circuit withstand current of inverters [35] and the occurrence of lowfrequency oscillations (due to the interaction of droop controllers) [28], narrow the stability margins of the system. In this sense, among different techniques for inertia response [36], the BESSs play a crucial role to provide immediate power (like an energy buffer similar to the kinetic energy of rotor mass) to establish the instant Prod.−Cons. balance and to increase FN and smooth RoCoF.
In this light, we highlight Remark 1, as follows: The virtual inertia is helpful to stabilize the control system by smoothing the disturbance effect and providing plenty of time for power-sharing controllers to be effective and stable. This should be distinguished from the primary frequency response which is provided to compensate slow response of prime-mover MSs.

B. Classification of Applications
After clarifying the concept and application of the inertia response via Remark 1, the BESSs applications in AMGs can be classified more clearly, see Fig. 2: 1) At the onset of a disturbance, which could be load changes or generation fluctuations due to intermittent RESs, the initial inertia response (0~1 ) by BESSs smoothes and stabilizes the frequency (and thus the system) dynamics. 2) Then, dispatchable DERs are responsible to meet load changes. However, their slow response should be compensated by a primary frequency response (1~60 ) by BESSs to avoid frequency/voltage collapse. 3) At the next stage, a real-time program (1~15 ) monitors/predicts RESs production and the consequent balancing market price and runs an online/offline optimal scheduling (optimal power flow) program to manage/optimize SoC of BESSs. It may prepare the system for a pre-planned control scheme for BESSs/DERs/loads. 4) A day-ahead program runs the unit commitment (UC) and economic dispatch to establish an optimal charge/discharge schedule of BESS considering the costs of BESSs degradation, DERs-originated production, forecasts of RESs output, and balancing market prices. The above applications are realized by controlling the BESSs through a grid-feeding VSC [19] and are reviewed/studied in Sections III, IV, V, and VI, of the paper, respectively. In some works, the BESSs are controlled through grid-forming VSCs, which results in a different approach and thus we studied them separately in Section VII, as the: 5) Slack bus realization.

III. VIRTUAL INERTIA SYNTHESIS
In the literature, normally, the frequency has been monitored as a criterion to trigger the inertia response via BESSs controlled by the grid-feeding VSCs [37], coordinated with other sources of synthetic inertia such as wind power plants [38], smart loads [39], and DC-link capacitor [40]. Some requirements should be considered to successfully provide dynamic inertia/frequency support.

1) Activation/trigger of the inertia response controller
Since FN is an indicator to activate load shedding relays, the BESSs should be activated before the critical FN. However, the exact time of activation needs to be carefully determined.
Selecting a comparatively large threshold may lead to an unnecessary discharge of BESS, while choosing a value close to FN may impose delay and thus the inertia synthesis would not be effective. Therefore, selecting the proper threshold requires a more in-depth analysis. RoCoF also can be an indicator to trigger the BESS and activate the inertia synthesis. However, the frequency estimation is still a matter of concern and creates a significant challenge [36], particularly, considering the small time constant of the inverters. For instance, the phase-locked loop (PLL) dynamics affect the frequency estimation performance [41] and the estimated frequency by PLL might be too noisy to be adopted in the synthesis of virtual inertia. To address this issue frequency locked-loop (FLL) is used to estimate RoCoF [24], but FLL is very sensitive to jitter [42]. The inertia controller using ⁄ as suggested in [43] is subject to severe bandwidth limitation and using a LPF to stabilize the controller makes it less efficient due to the imposed delay [44]. Combining the and RoCoF has also been proposed as an effective solution but still needs more investigation [45]. Alternatively, the data-driven approaches are used to identify the frequency response of the power system for providing inertia response/frequency support [46], [47] so that RoCoF measurement is not required.
Despite all efforts, we highlight Remark 2, as follows.

Remark 2.
We argue that the frequency variation is not an appropriate indicator for activating and delivering virtual inertia response. Because, while the frequency is a global variable, its variation (RoCoF and FN) at dynamics may vary in the power network nodes depending on the network impedances. Its measurement is also challenging.
Some models along with quantified low-frequency oscillations have been presented in [28] that support Remark 2. It is also aligned with the frequency divider concept, which is presented in [48] as a new formula to estimate frequency deviations at power network nodes of a conventional power system. This concept is updated for the power grids with inverter-interfaced resources and loads [49]- [50]. In [50], estimating frequency variations through active power measurements, rather than using PLLs, is proposed by introducing the concept of rate-of-change-of-power (RoCoP) and its relation with the frequency deviations [50]. Nonetheless, the plug-and-play application seems to be the main problem with this method. In addition, the power measurement/calculation process (e.g., using an LPF to achieve average power) affects the obtained RoCoP. Also, for gridfeeding converters, that are designed to deliver the pre-set active and reactive power, the RoCoP as the criterion of RoCoF is meaningless.

2) Power injection
The BESS power injection response time in transients is another issue that needs to be considered. It is shown that the superconducting magnetic ESS reveals better performance in rapid power injection to handle fault transients [51]. The amount of power injection is also important as it affects the optimal operation of the BESS and thus should be effective and optimum. FN and RoCoF are used to specify the optimum/effective amount of power that must be injected via BESS to provide effective virtual inertia [52]. However, as we In this paper, we combine the economic dispatch and peak shaving in the steady-state study as task 4 and present slack bus realization study (via grid-forming VSCs) as task 5. In dynamics, more power chapacity of BESS is used, while when it reaches to the steady-state some capacity is reserved for dynamics support programs. stressed in Remark 2, it has been argued that estimating the local frequency is not a reliable index to measure the inertia constant of the grid or for providing an inertia response [53]- [55].
Furthermore, the impact of frequent rapid power injections on the battery degradation costs is an important factor that affects the optimal/efficient operation of the system. For instance, it affects the pricing mechanism of the virtual inertia response through BESSs in the electricity market which is yet to be developed.

3) Duration and end of support (energy support)
The power injection should last for a given time interval to complete the inertia response. After the end of the delivery duration, the BESS should follow a ramp-down power injection before terminating the inertia response program to avoid another sudden disturbance to the AMG, or it should be connected to the primary frequency response.
Further, the response time of the inertia controller, including measurement, identification, communication, and activation, must be faster than RoCoF/FN protective relays [54]. So, in light of the above requirements (1, 2, 3), we feature Remark 3:

Remark 3. From a technical point of view, the requirement of an automatic controller, that does not rely on frequency monitoring/estimation to provide virtual inertia response, remains a gap in the literature.
Besides, the interaction between BESS and other gridforming VSCs while providing inertia response must be considered in the controller design, which has been neglected in the literature. The grid-forming VSC, which automatically responds to load variations, might be a better option for this purpose [32], [56]. DC-link voltage variations at grid-forming VSCs due to power fluctuations can be an indicator of load change [57]. However, the DC link voltage is kept constant at BESSs by the bidirectional dc-dc converter. As a solution, in [58], a DC voltage droop rule is applied to the dc-dc converter, and the consequence DC-link voltage drop is adopted as the criterion to deliver inertia response [58].
Nevertheless, the dynamics of the grid-forming VSC are affected by droop controllers and power-sharing mechanisms (as investigated in Section VII). Also, the impact of the virtual inertia response of the BESS on its economy and the steadystate performance should be considered.
As per Remark 3, the existing works in the field, although rendering a solution for providing virtual inertia, fall in the second group of applications, i.e., primary frequency support proportional to frequency variations. In this regard, the current works in the field are reviewed/classified in the next section by investigating their shortcoming for providing inertia response.

IV. PRIMARY FREQUENCY RESPONSE
Generally, the primary frequency response in power systems is required to compensate for the slow response of primary resources to instantly meet the load changes. In a synchronous machine, the frequency deviation is the consequence of a load change. Therefore, the primary frequency response is provided proportional to frequency variation through an automatic generation control (AGC). Whereas in the inverter-dominated AMGs, the characteristics of frequency excursions/restorations followed by load changes are different from those in conventional power systems. Although droop controllers arbitrarily drop frequency proportional to droop gains (to establish power-sharing in the AMG), the frequency is immediately restored to the nominal value by a purely cyber frequency restoration loop (the secondary controller) that manipulates the frequency setpoint [31]. While the primemover MS of the dispatchable IIDG unit is responsible to hold Prod.−Cons. balance at the DC-link. In this light, we highlight Remarks 4 and 5 as follows.

Remark 4.
In contrast to a conventional synchronous machine, where the power-frequency control is physically coupled and controlled with the AGC, different processes are followed in a dispatchable IIDG unit for controlling active power generation (by the prime-mover MS) and frequency restoration (through cyber control loop). Thus, the conventional AGC (proportional to frequency variations) is not effective in an inverter-based AMG.

Remark 5. In an AMG, the slow response characteristic of the prime mover MSs of dispatchable IIDG units, that are responsible for load tracking, leads to a DC-link voltage drop at disturbances that consequently causes overmodulation and results in distortion in the ac voltage waveform. In other words, the voltage is also critically affected.
Considering Remarks 4 and 5, in an inverter-based AMG with the − droop rules, the frequency variation may be adopted as a criterion for triggering the primary frequency response control loop, but the duration and the end of the support should be controlled according to the time constants of prime-mover MSs. Therefore, the conventional primary frequency response should be enhanced for inverter-based AMGs. In the following, firstly, the relevant works that studied the frequency support (mostly in the conventional fashion) are reviewed. Then, a few studies, that dealt with the slow response of MSs, are examined in Section D.

A. Control Schemes
The control loop for frequency support can be applied to the dc-dc converter (DC-link) or it can be realized by directly controlling the active power of the dc-ac inverter of gridfeeding VSCs [59]. The control system of the grid-feeding VSC is well-established in the literature [19], [37], [60].

1) Frequency response through DC-link control
In this method, the DC-link current is controlled proportional to frequency variations, which affects the DC-link voltage, and consequently, a DC-link voltage controller is used at the grid side of the inverter to control the inverter's output power [61]. However, the response time of the cascaded control system for inertia support is not sufficient since choosing a higher bandwidth for the PI controller of the DC-link voltage puts the system at instability risk due to its interaction with the PLL dynamics [62]. A sliding controller (switching between different controllers) has been developed in [63] for the dc-dc converter to control the output power/current of the BESS. Nevertheless, the virtual inertia response has not been discussed. Providing frequency response through BESSs for islanded energy systems (French island of Guadeloupe) has been discussed in [37]. The frequency dynamic support is activated if frequency variations and RoCoF go beyond given empirical threshold values which are determined based on a simulation model and trial and error. So, it does not provide a general model.

2) Frequency response through ac power control
The output active/reactive power of the grid-feeding VSC of the BESS can be controlled proportional to the frequency and voltage deviations. In this light, the concept of the electric spring [64], for providing voltage support through a capacitorfed current source inverter, is modified in [65] to establish a current-controlled BESS that provides frequency support. To this end, the frequency variation is estimated through a PLL, and power injection is performed proportional to frequency variations. To control the SoC of the BESS, the following rule is adopted: where is the injected power of the BESS, is the signal for controlling power to adjust the SoC of BESS, and is the signal of the intended power for frequency support. is a parameter that compromises between the frequency support and the SoC of BESS which is determined as: where k is a parameter that determines the profile of . To obtain a more realistic model of providing frequency response based on frequency variations (∆ ), the time constant and inertia factor as well as the time delay ( ) of the communication link can be incorporated ( − ) [66]: where − ≈ 1 − 1 + ⁄ models the time delay associated with the communication/digital controller, is the Laplace operator, and and denote the inertia factor and time constant of the inertia controller that are adjusted to achieve the desired performance. If the primary frequency response is provided through droop controllers, to share the duty among multi-inverters, the controller can be modeled as (including time delay) [66]: where and are the droop gain and time constant of the LPF in the droop control loop. It is worth noting that the − droop controller, i.e., = ( ), is used for controlling the grid-feeding VSCs that operate based on frequency measurement (grid-supporting). Due to the time delay imposed by the LPF, the controller's time constant is consistent with the primary frequency response and is not effective to provide inertia response (compared with the time constant of the droop controller at the AMG which is relatively low).
In [67] a low-voltage AMG with resistive impedance has been considered and the BESSs are controlled in the mode. The BESSs are in charge of voltage support (such as the AGC in resistive power networks) and their output power are controlled based on the local voltage variations, global voltage variation (voltage at a given node in the AMG), and the SoC of BESSs. The storage characteristics of the ESSs, i.e., energy capacity, power rating, and response time, have been taken into account as an exponent of SoC. However, the selection of is not elaborated and solely arbitrarily changed in the simulation to evaluate the results. The SoC is estimated with the Coulomb counting method: where , is the rated energy capacity of the BESS, is the output current of the BESS, and is added as the acceleration factor to make changes in the SoC visible, despite the small simulation time.

B. Dynamic Modeling
The fast and intense discharge of BESS for providing primary frequency response affects its DC-link voltage and SoC. Therefore, the development of a dynamic model is important for performance/stability analysis.

1) Dynamic modeling of BESS SoC for DC-link stability analysis
The SoC modeling and estimation can be performed using a hybrid model of the BESS. Without considering the dc-ac inverter, the hybrid model consists of two parts: 1) nonlinear charging profile for SoC estimation [68], and 2) equivalent electrical circuit (RC) model for deriving the − characteristics curve at the DC side [69]. This hybrid model is vital from the dynamic/transient study point of view for estimating the DC-link dynamics [70] and SoC management [71]. With that in mind, the accuracy of the recovery and rate capacity effects, for the accurate SoC tracking ( − characteristics curve) has improved in [72]. In [68], a DC-link state-space dynamic model is developed considering SoC, DClink voltage, and output current. Then, a −synthesis robust controller is proposed to stabilize DC link-voltage against parametric/linearization uncertainties (i.e., duty cycle, SoC, output current, DC voltage) whenever the ac side power increases rapidly to provide primary frequency responses. Similarly, [73] uses the RC model to develop a robust voltagefrequency controller in PV-BESS microgrids.

2) BESS modeling for grid-side dynamic stability analysis
A generalized dynamic model of inverter-interfaced ESSs for dynamic stability analysis has been developed in [61]. This model, which is developed based on linear differentialalgebraic equations (state-space), consists of two parts: 1) the small-signal model of the inverter's control loops and grid-side electrical circuit; 2) the storage-side model that has been individually developed for a storage unit, which could be a BESS. There are two major issues with this model: 1) the statespace model for the IIDG unit is a high dimensional model that is not suitable in the synthesis of advanced controllers [74]; 2) reducing the order of the model by ignoring the fast dynamics significantly reduces the accuracy of the model [12] as it is the case in [61]. So, a reduced-order model, in which the impact of the state variables with fast dynamics (particularly those associated with the VSC's inner loops) has been preserved (without simply ignoring them), is vital, which is still an open research question. Besides, the state-space model does not give an insightful vision of the system and makes the design process complicated, e.g., for adding an effective and simple loop for stabilizing the system. In this light, some simulation-based reduced-order models have been developed in [60] by using: 1) an ideal DC-link model by replacing the battery and buck/boost converter with an ideal dc voltage source; 2) an average model by replacing switches with ac voltage sources, and 3) a dependent source model by replacing switches with dependent voltage and current sources. Nevertheless, the reduced-order models fail to identify low/high frequency instability issues in the presence of heavy loading/harmonic conditions.
On the other hand, impedance modeling, as an alternative and effective solution, is used, which gives rise to the transfer functions in the frequency domain [70]. However, superimposing the impact of different parts (for example the PLL or DC-link/DC-bus voltage controllers) to develop a unified model is rather complex. Also, if not appropriately modeled, it results in a complicated multi-input multi-output (MIMO) model and/or a less accurate model in the complex domain in the form of transfer matrices [75].

C. Hybrid Systems/Schemes
The hybrid supercapacitor/flywheel-BESSs are also popular due to the ultra-fast response of supercapacitor/flywheel in transients [76]- [77]. The advantages of the supercapacitor are the fast and efficient energy delivery, long cycle life, and no significant chemical process to affect its dynamic response [78]. Moreover, its SoC is easily available as it is proportional to the square of its voltage. So, to preserve the cycle life of BESS and to avoid its degradation, it is ideal to adopt a supercapacitor/flywheel to mitigate possible pulsed loads and letting the BESS be responsible for other duties with larger time constants [79], [80]. The conservative voltage reduction (CVR) technique, which has been used in conventional power systems for frequency support, also has been considered in AMGs to assist BESS [81].

D. Compensating Slow-Response of Micro-Sources
The dispatchable energy resources, such as fuel cells, microturbines, diesel generators, and gas engines may possess slow response times. This would be problematic in dynamics in an AMG when the demand for power increases and MSs fail to track load changes on time. This leads to an unbalanced between Prod.−Cons. and DC-link voltage drop, which may lead to voltage/frequency (or even the AMG) collapse [82]. Some works in the field have specifically studied this issue. The basic concept is illustrated in Fig. 3. The time constant of interest in this application is 1~60 seconds. A cooperative control strategy for BESS and controllable MSs has been proposed in [83]. The BESS immediately injects power at disturbances to hold the Prod.−Cons. balance. However, the amount and slope of power injection have not been discussed.
In an AMG with a dominant resistive power network, the voltage would be the critical variable, which is discussed in [84]. In this work, the voltage variation has been considered as a criterion to control the injected power by BESS to smooth transients and stabilize AMG in dynamics. Furthermore, the fuzzy logic has been adopted in [85] to adaptively tune control parameters and improve the robustness of the control system at different operating points. Perhaps, the main reason that justifies the high investment costs of BESSs is to facilitate the grid integration of RESs, as pointed out by the majority of relevant works (from dynamics to steady-state). If the RESs generation is monitored in realtime, i.e., 5~15 mins ahead, the real-time energy management can be implemented for controlling SoC of BESSs [86], [87], which determines optimal setpoints of the BESS and other DERs [10] and manages the demand response programs [88], [89], [90]. Nevertheless, the real-time management, for covering intermittent production of RESs, affects both the dynamics and the steady-state performance [91]. Because a dynamic reaction is necessary to cover a mismatch between the load prediction and renewable forecast. In this sense, the development of real-time dynamics-aware energy management programs is essential which has been considered in a few works [92] and demands more studies and effective models.
The research works that dealt with the intermittent renewables by defining some logical procedures/operation modes (by inspecting the BESS SoC) are reviewed in this section and the real-time optimization-based artworks are studied in the next section.
Power balance is realized by a management system that determines setpoints of grid-feeding VSCs of PV-BESS [93] and facilitates seamless islanding of WT-BESS [94]. Modeling the problem in steady-state with different types of BESSs is handled in [95] by exploring different modes of operation by inspecting the SoC of BESSs and the status of Prod.−Cons. balance. More operation modes are explored in [96] based on the generated power of RESs using mathematical models of units, and a supervisory fuzzy controller is tuned to control/maintain the SoC of BESS. In the same context of [95], laboratory-scale WT-PV-BESS MGs have been tested in [97] and [98]. Where in [98] a supervisory fuzzy interface system is used at the control stage to compensate for any mismatch between the offline BESS scheduling process and the real-time SoC.
Further, a dual-mode economic-dynamic model predictive control (MPC) of a DC MG with WT-PV-BESS has been developed in [99]. Toward this, the dynamic model of the MG is obtained by combining the state apace models of its components (WT-PV-BESS). MPC is adopted to steer the system states to steady-state at disturbances (i.e., RESs fluctuations), where the cost function of MPC considers the economics of the MG, e.g., the full utilization of RESs and optimizing SoC of BESS. The time constant of the model application is 1~3 mins and thus, the long-term study has not been considered. The paper considers a DC MG, therefore, the frequency dynamics (i.e., the impact of BESS on inertia response and primary frequency response) have not been evaluated.
Ref. [86] studies a co-simulations framework of power systems and communication links to investigate the impact of different communication technologies/structures on the BESS performance in covering the generation offset of PV units. However, the control scheme and system dynamics have not been presented. A droop-based control strategy is developed in [100] to coordinate the BESSs with RESs. In the proposed control scheme, all units (BESSs and RESs) are controlled via a PID-controlled grid-feeding VSC where the droop slope (P gain) is small (infinite) if the units are supposed to be a gridforming (grid-feeding) inverter. Based on the power production of RESs, SoC of BESSs, frequency variation, and some predefined modes of operation, the PID gains are set. The control system is designed to be decentralized, however, changes in the controller's gain impose large transients to the AMG which is a challenging stability issue. Besides, in some modes of islanded operation, all the inverters are intended to operate as a gridfeeding inverter, and it is not clarified how voltage regulation is guaranteed. Similarly, multi-segment P/f characteristic curves with relevant controllers are designed in [101] that can be adjusted autonomously at each generation/storage unit according to the microgrid operating points, i.e., SoC of BESS and PV production.

VI. ECONOMIC PROGRAMS FOR STEADY-STATE OPERATION
Improving the steady-state performance of AMGs includes the optimal sizing/allocating/scheduling of DERs, RESs, and BESSs [102]- [109]. The energy management system (EMS) is implemented through the MG central controller (MGCC) for optimizing the operational strategy (OS) of MG. The OS includes one or more optimization objectives such as optimizing energy efficiency through unit commitment (UC)/economic dispatch (ED) for minimizing energy cost for consumers and maximizing revenue for the MG operator, implementing optimal power flow for minimizing power losses [103], enhancing reliability [110], minimizing environmental concerns (emission) [111], etc. The EMS structure is illustrated in Fig. 4. The BESSs play an important role in realizing the mentioned EMS objectives. This role can be described in the context of the optimization/scheduling process of MGs as follows.

A. MGs optimization/scheduling
Energy management in MGs has been the subject of a vast number of studies that differ mainly based on their optimization objectives, constraints, time horizon, and solution techniques as described in the sequel: 1) An objective function (OF) is defined according to the fuel consumption rate of dispatchable generation units, operational/maintenance/replacement costs of generation units, and BESSs. A typical OF is given as in (1-VI). 1 The sigma indexes, i.e., , , , ℎ and , , are applied to all involved terms of the associated sigma, which have not been written for the sake of simplicity. (1-VI) where 1 , , , ℎ denote year, seasons 2 , days and hours, respectively, , , denote the energy prices of gridpurchased, grid-sold, and load delivered powers respectively, , , are the amounts of grid-purchased, grid-sold, and load delivered powers, respectively. , , present the number of all installed/invested units, number of generation units, and the number of BESSs, respectively. , denote financial coefficient to calculate time value of money and installed size/capacity of units, respectively.
, , indicate the power generated by DERs, the fuel consumption rate of DERs as functions of generated powers, and operation and maintenance costs of DERs as functions of generated powers, respectively. , denote power delivered by BESS and cost function of BESSs (to model battery degradation and life cycle effect) respectively; 2) For optimal sizing [106], [107], by which long-term programs are considered [102], [108] the initial investment costs/future streams of cash inflows/outflows are mapped to the cost function (1-VI) at present time (when the program is being solved) through a financial indicator ( ) such as the net present value (NPV) [109], i.e., the time value of money; 3) For optimal allocation, the optimal power flow is implemented, where some power network factors like voltage profile, power flow constraints, and power losses [109] are considered in the objective function which converts the problem to a multi-objective function. constraints are considered such as the minimum spinning reserve [106], reliability [112], SoC of BESS to meet specific requirements like loss of load expectation (LOLE) [110], dynamics/frequency support [113], voltage limits, and power flow constraints [103]; 6) The load demand, energy/market price, and available power through RESs might be forecasted [114]. Uncertainties associated with the forecasting stage are modeled by various techniques including stochastic optimization [114], [103], robust optimization [105], [115], fuzzy logic [111], Monte Carlo simulation [116], probabilistic dispatch [117], or hybrid methods such as stochastic/robust optimization [118]; 7) The EMS may act as an aggregator/virtual power plant (VPP) [119] for bidding and participating in the power market [120]- [121]. Also, peer-to-peer (P2P) energy trading among local MGs has gained increased attention [122]. 8) Demand-side management (DSM) and demand response programs, coordinated with load agents, improve the EMS performance. Short/long term energy plans, as well as purchase/sale requests and curtailment contracts, are sent to MGCC and optimization module by load agents [105], [123]- [125]. This helps to achieve more reliable demand prediction, to preserve SoC of BESSs, and to maximize social welfare [126], [127]; 9) To implement the above-mentioned steps in the scheduling problem, the problem can be formulated using various methods such as hybrid [3], multi-stage [105], [125], and master-slave [102], [103], [115]; 10) If the objectives are measured with different units, multi-objective functions are defined, which are solved by transforming all objectives to a single unit, mostly cost ($), with appropriate dynamic/fuzzy weighting coefficients [125], [128] or by compromising among them, e.g. by establishing the trade-off Pareto front [102]; 11) Based on the variables and formulation, the final problem can be mixed-integer linear programming (MILP) [110], mixed-integer nonlinear programming [129], quadratic programming [130], etc., which can be solved using different techniques such as Lagrangian multiplier [104], [131], (adaptive) dynamic programming (DP) [132], [133], heuristic methods (PSO, GA, …) [125], [134], etc.

B. MG Planning and BESS Sizing
In the MG planning stage, a compromise between BESS investment cost and operational strategy should be established to optimally size BESS, as shown in Fig. 5. Although BESS improves the efficiency of AMG, it imposes high investment costs (proportional to its energy capacity and rated power/current) [109]. So, an optimum capacity of BESS should be determined while optimizing its operational strategy [107], even by deciding on the year of installation [108].
The BESS characteristics in general, and specifically, its power and energy capacity also depend on certain use cases. For instance, in some applications, the reliability/security of sensitive loads is more critical which can be achieved by using BESS [110]. In [52], the optimal capacity of the BESSs is determined to secure frequency dynamic at the most severe contingencies of generation loss. In [135], Pareto fronts of the trade-off between PV-BESS capacity-autonomy factor have been established. Ref. [52] considers solely the frequency characteristics (RoCoF), based on the inertia constant, for optimal sizing of the BESS and ignores optimal OS in the ED program. Alternatively, some capacity constraints are placed in the OF [106], e.g., minimum/maximum capacity of BESS as given in (5-VI). where is the time period (a day), denotes energy supplied (absorbed/delivered or charged/discharged) by BESS, is power, ℎ , and ℎ are charge/discharge efficiency (%) of BESS, and , is the energy capacity of the BESS. Therefore, the optimal size/capacity of the generation units and BESSs depend on a variety of factors including the load profile, network structure, electricity tariffs, and available energy of RESs at the location of MG. For example, the flexibility of demand response significantly affects the optimum size of BESS [136]. In other words, the optimality of sizing and OS are dependent on each other and must be simultaneously determined [131]. In this light, we highlight Remark 6 as follows:

Remark 6. Incorporating both investment and operational strategy at a single OF does not lead to the global optimum solution since the optimal capacity and the optimal output powers of the units need to be determined at the same time.
Consequently, the output powers of the units need to be fixed to their capacity (as the optimizing variable through inequality constraints) at the same OF, or a new dependent variable should be defined for each unit that specifies power per capacity ratio at each time slot. This results in a conflict by which the convergence of the problem to the optimum solution might be out of reach by linear programming and difficult to set by nonlinear/heuristic methods.
To address this issue, the master-slave (sizing-OS) programming has been developed in [102], where the masterslave OFs are solved iteratively so that both can converge to the optimal solution. Nevertheless, this study considers a simple model for BESS i.e., pre-defined charge/discharge at off/onpeak hours (arbitrage model) which makes the results less accurate. Modeling the appropriate operational strategy of BESS is of high importance and is studied in the sequel.

C. Optimizing the Operational Strategy of BESS in MGs
The operational strategy of BESS, which should be incorporated in the OF (1-VI) and its constraints (2-VI), significantly impacts the optimum results and thus, must be carefully modeled. Different methods have been used in the literature to schedule the charging/discharging of BESSs efficiently and economically [103], [109], [118], [133]. Accurate modeling of the operating cost of the battery, to account for cycle life [137], charging/discharging efficiency, battery degradation, etc., is critical for optimum scheduling of BESS in the UC and ED programs [103], [118], [138].

1) Modeling BESS SoC
The basic duties of the BESSs in the steady-state are covering RESs fluctuations [104], gaining profit based on the energy price (energy arbitrage) [109], and peak shaving [139], where the BESS operation is modeled by its SoC. The stored energy at BESS at each time step ( ) can be expressed by [109]: where ℎ and ℎ denote the maximum portion of the rated energy capacity that can be added/withdrawn to/from storage in an hour, and denotes the battery depth of discharge. The stored energy is constrained by upper/lower bounds and can be calculated at each time step ( ) based on the charge/discharge rate and efficiency and the stored energy at the previous time step ( − 1). The stored energy of BESS should be kept above the maximum depth of discharge ( , ) [113]. Alternatively, the SoC of the battery is updated at two consecutive stages ( − 1, ) [106]: Since the BESS cannot be simultaneously charged and discharged, the operating model can be updated as [120]: to be used in the OF.

2) Modeling the BESS cycle life and degradation costs
In practice, a more accurate model of battery cycle life and degradation/aging cost are needed that highly impacts the efficiency/profit profile of the BESS in the long term [140]. For example, violating min/max SoC for a long time increases the internal impedance and decomposes electrolyte in the battery, leading to capacity loss and power fade [138]. Also, cycling, i.e., frequency of charge/discharge, rate of charge/discharge, and maintenance schedule greatly affect BESS (cycle) lifetime.
The battery cycle life can be modeled as a function of the battery's depth of discharge ( ) at Δ which is given as where , and are degradation cost function coefficients provided by the manufacturer [103]. Then, the battery's actual life (kWh) is obtained as: = .
,  On the other hand, for nickel-cadmium batteries, can be directly obtained by through a nonlinear function as where , , are positive constants.
Then the BESS degradation cost function, , is obtained by the BESS capital cost ( ) and actual battery life: Therefore, the battery degradation cost can be modeled as a function of the BESS's charging/discharging power [118].
Alternatively, in [138] an average degradation cost model is adopted based on the real-time given at each chargedischarge cycle: which also has been used in [141]- [142]. The energy of BESS is updated at the next time slot as: Further, the cumulative degradation cost model can be used to reflect practical degradation cost [142]: To limit both charge/discharge cycling/current, the following BESS operating (cycling + degradation) model has been used [129]: where denote hourly degradation cost. To linearize the problem, the quadratic term, 2 , has been approximated by its piecewise expression.
An accurate non-linear semi-empirical battery degradation model is developed in [143] based on experimental tests and theoretical analysis, which is difficult to be directly used in the optimization model due to its non-linearity. Nevertheless, after piecewise linearization that has been formulated in [144], it is used to obtain the cycle aging cost of batteries that participate in day-ahead and real-time energy markets. This model has also been used in the context of MGs to provide primary frequency support/spinning reserve [145].

3) Modeling the BESS operational cost
The operational cost of BESS is also modeled in different ways in the literature. As a simple model of the battery operational cost, the O&M cost of the battery can be modeled linearly proportional to the BESS output power [105]. Ref. [117] uses an SoC-based operating cost model, in which the BESS operation is more economical at higher SoCs since a low SoC causes mechanical stress on the active masses and battery sulfation in lead-acid batteries: Alternatively, [133] has proposed an operating cost model for BESS by conducting an analogy between the fuel consumption cost at generators (the conventional quadratic function) and the energy conversion process in batteries including lead-acid and lithium-ion batteries. The energy price for battery charging comprises of two parts: , where ℎ is the price of energy for BESS charging and is the availability cost of BESS capacity, i.e., the cost to have 1 kWh of storage capacity available: where is actual (usable) cycle lifetime of BESS. To obtain it should be noticed that the end of life of electrochemical BESSs (lead-acid or lithium-ion) is when the battery has degraded to 80% of its rated energy capacity ( , ). Then, considering the battery is discharged to its rated , the average capacity degradation is And by ignoring the capacity degradation from repeated deep discharges and recharges, e.g., in vanadium redox battery, is achieved as: Thus, the is a fixed price reflecting the replacement cost, the rated capacity, and life cycle at the time of purchase. On the other hand, the kWh cost of battery ( ℎ ) is determined according to the battery efficiency, i.e., heat loss due to the internal resistance, at operating (charging/discharging) states: = Δ × , where Δ is the voltage drop and is the output current. The voltage drop at lead-acid and lithium-ion batteries are estimated as [146]: At charging: At discharging: where is the internal ohmic resistance, and is a constant provided by the manufacturer. Therefore, the kWh consumption of BESS during charge/discharge can be calculated as: At charging:

(25-VI)
Despite the accurate operational cost modeling of BESSs in [133], the BESSs are supposed to be charged when the net production is more than load demand, which does not result in the most optimum OS in the grid-connected mode.

4) BESS OS schedule/optimization
In the majority of existing works, the preliminary objective for designing the OS for BESS is to follow/satisfy the grid requirements subject to the BESS constraints. Further, the operation of BESS is optimized in consecutive time steps, each depending on the initial/previous [123]. However, the optimal OS at the preceding time slot was scheduled without considering the receding time slot and it can be argued that the optimized operation schedule of the BESS might be suboptimal OS. In this regard, we highlight Remark 7 as follows:

Remark 7.
A full-day time (receding) horizon scheduling should be established to achieve the most optimum schedule for BESS, which is a challenging task due to the imposed computational burden. This demands more investigations for developing efficient solutions or adopting stronger/advanced computational tools (e.g., quantum computing).
To consider this issue, a hybrid interval-robust adaptive BESS dispatch has been developed in [147]. An optimal dayahead SoC interval is determined first, then, within the SoC interval, the BESS is scheduled during the day while considering the uncertainties. This improves the optimality but still, a high SoC dwell time is expected which leads to BESS degradation [148]. Receding horizon control (RHC) or MPC scheduling methods have been adopted [148]- [152], by which the BESS operation is optimized for a given time horizon (receding time slots). An accurate model of the system is necessary for the synthesis of MPC. For instance, a nonlinear voltage-current model of BESSs is developed in [150] as a function of BESS's terminal resistance and SoC. This model, along with the electrical model of the inverter and power network, is used in the power flow program, which is solved in the receding horizon to schedule the charge/discharge of the distributed BESSs in order to minimize power losses in the MG. However, cost and energy efficiency, i.e., UC/ED among DERs, have not been considered in this work.
In [151], the computational burden is reduced by decomposing the EMS problem into MILP (day-ahead) and non-linear programming (NLP) (2-hour horizon real-time optimal power flow) problems. This decomposition can result in solutions within the desired time spans. Likewise, two upper/lower layers receding horizon programming has been proposed in [138]. In the upper layer, the OS of the hybrid BESS-supercapacitor is specified considering the energy price and degradation cost of storage units. Then, in the lower layer, the quadratic error function is considered as the penalty cost function to make the operation of BESSs follow the optimal OS (determined by upper layer), to minimize forecast error of RESs in short-time scales. However, despite the comprehensive model and two-stage programming in [151], [138], there is only one effective time horizon, and the MPC concept, as it is implemented in dynamic systems (to minimize the combination of all possible solutions at the given time horizon) has not been effectively realized.
Alternatively, distributed optimization has been proposed based on the alternating direction method of multipliers (ADMM) [131], which alleviates the time complexity and makes the problem scalable. A distributed MPC is proposed in [141] to schedule multi-MG systems with hybrid battery/hydrogen ESSs. The problem includes P2P energy trading optimization between two MGs and networked-MGs optimization.
Dynamic programming (DP), and particularly adaptive DP, has gained more attention to deal with the scalability and complexity of optimization problems within EMS [153]- [156]. Given the computational burden, approximate dynamic programming has achieved 98% optimality with 50% less computational time [157].

D. BESS-Assisted Dynamics-Aware ED Programs
The BESS support capacity for providing primary frequency response (spinning reserve), has been considered as a constraint in the scheduling program. In [113], the BESS role for providing primary frequency support is considered in the cost function using an SoC constraint to deal with the worst-case scenario, i.e., curtailment of the largest generation unit and the maximum Prod.−Cons. unbalance ∆ : [Hz], [MW/s], and denote the nominal frequency inertia constant, governor's dead band, maximum governor ramp rate, and the primary reserve of DER , respectively. Constraint (26-VI) ensures that the initial RoCoF does not exceed the specified limit and (27-VI) ensures the amount of the primary reserve by the remaining DERs to meet the contingency of size ∆ . The control schemes for providing inertia/primary frequency responses by BESS have not been clarified and thus the assigned capacity for dynamic support by BESS would not be accurate. Besides, for RoCoF and FN constraints, only the inertia constant and the primary reserve of rotatory generation units are counted. This means that the BESS has not been considered for increasing system inertia constant.
Similarly, the minimum spinning reserve has been considered in [106], [108] considering the available power by BESS and taking the maximum possible contingency as a result of the renewable forecast error. Ref. [110] uses the LOLE as a reliability constraint to determine the optimal size of the BESS in MGs ( < ). However, the optimal energy/power capacity and ramp-rate requirement of BESS to manage the inertia/frequency support have not been considered in these works, which affect the optimal planning/OS of BESS in MG. Most recently in [145], the regulation reserve and forecast error reserve have been obtained through the standard deviations of historic data to incorporate inertia response/primary frequency response in the EMS program. Then, along with thermal generation units, the BESS has been allocated to provide inertia/primary frequency responses using the droop mechanism. However, the frequency dynamics and the associated controller have not been analyzed.
The discussions in the previous sections emphasize that, still, a computationally tractable frequency-constrained EMS has not been fully developed. This can be highlighted as the central core of the current study as stated in Remark 8:

Remark 8.
Developing a suitable control scheme for providing continuous inertia response−primary frequency response in dynamics is a prerequisite to use its information, i.e., the required SoC and ramp up/down limits, and cycling/degradation cost, to develop an effective (real-time) EMS program.
In this light, a data-driven framework has been developed in [92], by which the probability distribution of frequency regulation (AGC) signals, in response to load/RESs variations, are used by a real-time economic dispatch program. However, the platform is developed in the context of conventional power systems where the frequency regulation mechanism is wellknown, and without clarifying the control system of the BESS. Besides a simple degradation cost (proportional to charging/discharging energy) has been used, without modeling the BESS response for inertia/frequency support.

E. Multi-Stage Day-Ahead/Real-Time/Online Scheduling Programs
Multi-stage optimization (UC-ED) improves the system's robustness against the uncertainties imposed by RESs generation, load demand, and market price. First at a day-ahead program, when uncertainties are high, a stochastic-based optimization is implemented for estimating an approximate of the system operation point, e.g., bidding [116], DSM preparation [105], etc. Then, a more accurate result is achieved in real-time balancing to deal with the forecast error, generator outage, and variability of RESs [103]. Specifically, regarding the energy market, generators/loads submit their bids through the day-ahead program and, clearing prices are calculated every 5 min based on locational marginal pricing (LMP) in the realtime operation [120]. The clearing price may not be directly transmitted to the generators and consumers. But it may be adjusted by the MG aggregator, as a third party, which seeks to maximize MG's economic benefits by scheduling BESSs regarding the price and RESs fluctuations. To reduce the computational complexity due to electricity price change, continuous-time optimization has been developed in [158] while handling the nonlinearity of SoC variations from dynamics to steady-state.
Uncertainties disrupt the optimal OS and optimal power flow results given by day-ahead and real-time scheduling programs. Also, the SoC of BESSs might not be aligned with the prescheduled model due to the inertia and frequency support events [92]. To this end, with the aid of a communication link, which provides the information of all other nodes, i.e., generation of RESs, SoC of BESSs, etc., the online optimal scheduling program may be implemented [159]. However, the online realization of dynamic optimal power flow (DOPF) through a central controller raises the scalability issue regarding the dimension of the problem. Besides, relying on the communication link imposes more costs and puts the system at risk of cybersecurity. Hence some works tried to address the issue by proposing decentralized multi-agent methods [160]. Nevertheless, the global optimum solution is not guaranteed to get full benefits of BESS and RESs. To this end, distributed consensus-based real-time/online scheduling method is utilized, which works based on the information at the adjacent nodes to reduce the communication burden [161]. A global information estimation block is utilized to be used in a fully decentralized consensus-based method [162].
It is worth noting that the dynamic optimal power flow program is implemented at the tertiary level of the hierarchical control of MGs. However, due to the small time constant of the online scheduling program, which is closed to the primary level, the secondary controller should take responsibility to coordinate the tertiary and primary control levels [163]. In this sense, the time constant of the BESSs application may cover dynamics and steady states. Therefore, some researchers take a different view of the system as a more systematic way that handles both dynamics and steady states [164]. This motivates proposing the slack-bus realization application which is studied in the next section. Also, at this point, it is worth mentioning that the consensus-based distributed control is successfully tested for both tertiary energy management (offline and realtime) [161] and secondary (voltage/frequency regulation) [165], [166] levels. Thus, consensus control has been chosen as a good option for coordinated control of power and SoC of distributed BESSs in MGs [163], which is studied in part of the next section.

VII. SLACK BUS REALIZATION
The slack bus in power systems regulates the local voltage at nominal value and delivers power (as much as it is needed) to preserve the frequency stability, while other generation units operate at the optimal point. The fast response of the BESS to load changes, along with its energy density, makes it a superior option over dispatchable DERs. To realize slack bus in the inverter-based AMGs for voltage regulation and frequency conservation, BESS is controlled by the grid-forming VSC. The output power of the grid-forming VSCs (as a voltage source) instantly changes following a load change, and thus the frequency estimation is not necessary to trigger the application. However, the challenge is controlling the amount and duration of the injected power in coordination with other droopcontrolled dispatchable DERs and BESSs [167]. To this end, the droop control method is adopted [31]. The droop gains can be adjusted based on the size of DERs, or available capacity and SoC of BESS [168], [169], as a part of the real-time management program.
However, droop control faces several challenges [31], [170]. The main problem with the droop-controlled grid-forming VSCs is that they display poor dynamics in following the reference values to deliver pre-set active and reactive power [171]. Besides, the DC-link dynamics and SoC control must be considered [172] and it is challenging to coordinate the output power of multiple droop-controlled BESSs based on their SoC. Thus, a supplementary controller (like distributed consensus controller [173]) is needed to coordinate the SoC of BESSs and their operation with other dispatchable droop-controlled DERs. Based on the existing works, the application of slack bus does not account for virtual inertia, and a specific control scheme should be incorporated (as per the analysis given in Section II.A, which is a research gap). Also, specifying the optimal operating point of BESSs can be done by selecting droop gains coordinated with other dispatchable units as part of ED. Thus, a time constant of 0~60 mins is considered for the slack bus realization, including grid-forming VSCs' dynamics and realtime SoC management through the required supplementary loops (i.e., consensus control).

A. Centralized BESS
Due to the high power/energy density of the BESS, a BESS has been set as the voltage source (slack bus) in a RESdominated AMG in [174]. Other RESs are controlled as the grid-feeding VSCs in the maximum power point tracking (MPPT) mode. The BESS compensates for the Prod.−Cons. unbalance caused by RESs fluctuations, and a diesel generator is installed at the same bus to control the SoC of BESS. To realize this objective, the diesel generator's output power is controlled by a PI controller to remove the error between and , where the ramp rate of the latter is adjusted based on the output power of the BESS. However, it is not a general approach and is not effective for an AMG with multiple grid-forming VSCs and dispatchable DERs. In [175], [176] the cooperation between the BESS (controlled by a gridforming VSC) and dispatchable DERs is established via adaptive (exponential/elliptic) droop gains. However, timevarying droop gains may impose large transients and frequency restoration would be challenging.

B. Distributed BESSs
The droop-based grid-forming BESSs are considered as distributed resources in large AMGs with networked power topology. The distributed consensus-based control is the most popular technique, as the supplementary loop for droop controllers, to coordinate the output power of BESSs according to their SoC [177]- [179]. In [177] the droop-controlled BESSs are responsible for frequency regulation with the following droop rule: (1-VII) where * = + (( + ) ( 0 − ) + ) and = − ∑( − ) is the consensus signal, and are the consensus state variables at the local and adjacent buses, and are the proportional and integral gains of the PI controller, and is the cut-off frequency of the LPF. The proposed method aims to establish two important tasks, i.e., frequency regulation via BESSs and energy (SoC) balance among BESSs. The PI controller restores the frequency to the nominal value and the consensus term is for realizing energy balance, so energies of the BESSs are considered as the consensus state variables. The gain is taken as the state feedback gain and is determined by solving the Riccati equation through the linear quadratic regulator (LQR) method. However, the LQR method is effective where the full-state feedback loop is adopted, which has not been clarified in this work. The other disadvantages of the method are its dependency on the communication link and the slow response of the consensus term which might be problematic for frequency regulation in an inverter-dominated AMG. The consensus control-plus-LQR has been tested in [178] as well to establish energy balance among BESSs. SoC-based − droop control is proposed in [179] to preserve SoC balance among distributed BESSs while ̇− droop control is adopted to avoid circulating reactive current among BESSs.
The heterogeneous nature of BESSs (with different sizes and characteristics) has been considered while addressing the active and reactive power sharing and voltage/frequency restoration in droop-based AMGs [180]- [181]. The energy state and output power of BESSs are taken as the states of the system and are controlled via consensus signals: where is the heterogeneous coefficient which scales the heterogeneous BESSs with different sizes/efficiency/cost to a common scale such that it is still effective to maintain an equal energy (SoC) balance. Then, the input signals are given by consensus signals as: A new consensus protocol has been defined in [182] to take the optimality of the frequency restoration loop into account by assuming the dependency of charging/discharging efficiency on the charging/discharging rates that can be approximated by the following linear function = + (4-VII) where and are positive coefficients.
Alternatively, non-linear sliding mode control and feedback linearization are adopted to account for the different sizes/initial SoC of BESSs [183]- [185]. Toward this end, the following sliding mode control function is adopted: where ( ) denotes the SoC of BESS at time , ( ) = 1 ∑ ( ) ∈ is the average SoC of the adjacent BESSs of BESS at time , and are the net generation and consumption of AMG, respectively, and = 1 is the control signal that enables the BESS to fully participate in the droop control. In this way, the SoC of the BESS is continuously monitored and is controlled in coordination with the SoC of other distributed BESSs.

VIII. FUTURE TREND
Based on the comprehensive study presented in this work on applications of BESS in MGs considering their time constants, future directions for bridging the existing gaps are briefly summarized as follows: Transients 1) Due to great flexibility, the BESS can be used to improve the MG performance in large transients caused by faults [51], facilitating fault ride-through (FRT) and smooth/seamless transition to islanded mode. Currently, the researchers are studying the transient characteristics of the grid forming and grid feeding VSCs to ensure safe FRT schemes [35], [191]. Nevertheless, after establishing the suitable models, BESSs would be beneficial to improve the system performance, e.g., by compensating asymmetrical faults components [192]. The critical point in the transient study is the SoC estimation and DC-link performance [68] that demand more investigation for large transients.

Dynamics
2) The frequency estimation, which is critical in the synthesis of virtual inertia/primary frequency response (to instantly inject power following frequency deviations) is an important issue that demands more investigation. The dynamics of the conventional voltage phasor measurements, i.e., the PLL, significantly affect the estimated frequency. Besides, the frequency divider [48] and power flow-based methods do not provide a general scheme to facilitate plugand-play. Moreover, it was argued (in this work) that the local frequency estimation cannot represent a good measure for the inertia constant/response in power systems, which requires more investigations in the context of AMGs. 3) Developing an automatic controller for BESSs to provide virtual inertia response is also an open research topic. While the grid-feeding VSCs need a frequency estimation unit for inertia response, the grid-forming VSCs automatically respond to load changes, but their output power varies based on the grid condition and the performance of droop controllers. A more in-depth study on the droop controllers, VSCs, PLL dynamics, and inertia requirements seems to be vital to develop a unified inertia controller. 4) A new paradigm for the primary frequency/voltage response is necessary for inverter-dominated MGs, in which over modulation/voltage distortion can be adopted as a criterion for properly designing/tuning the associated controller.

BESS-Assisted Joint Economy-Dynamics Programs 5)
Due to the ever-increasing importance of BESSs in both dynamics and steady-state performance, the continuous joint economy-dynamics study [186] seems to be the future of the field of BESS applications in power systems and particularly in AMGs. Similar work to this concept can be found in [187] where a dynamics-aware continuous economic dispatch model is developed for synchronous generators. However, inertia is inherently provided by synchronous machines and virtual inertia response should be included to extend the study for inverter-based systems [145]. 6) The distributed consensus-based control technique has been adopted by the real-time/offline economic programs and also it is used as the secondary controller in the grid-forming BESSs (in the slack bus realization application). These two applications can be combined to develop real-time distributed dynamics-aware economic programs [92]. 7) The power/energy market mechanism must be upgraded by incorporating the virtual inertia/frequency response to facilitate pricing the inertia synthesis [188]- [189]. To this end, developing an accurate/effective battery degradation model, particularly, for the transient response, is necessary to be used in the pricing mechanism. 8) The impact of the EMS/BESS OS on the MG reliability has been analyzed in [112] that reveals the remarkable effect on the reliability indices (on the device level, the BESS lifetime can be increased by more than 50%). Future works can consider developing an online/real-time reliability assessment strategy [193]/degradation model for the realtime schedule/control of BESS to achieve higher efficiency. 9) The power/load flow study can be conducted considering the BESSs controlled by the droop-controlled grid-forming VSCs as the (distributed) slack buses. 10) The optimal allocation of BESS regarding its application on dynamics has not been critically investigated yet. Whereas, it has been shown that the connection topology and allocation of inverters matter on the dynamic stability of the inverter-based AMGs [28], [194].

Small-Scale Batteries 11) Management of small-scale behind-the-meter batteries is
another open research topic that recently has gained great attention [195]. The reason is installing a community-scale BESS demands large capital investment and the reliability of the system is affected by a single point of failure. 12) Realizing a virtual BESS that accomplishes the quintuple tasks by appropriate coordinated management/control of distributed small-scale batteries, like residential batteries [196] and electrical vehicles/boats/manned drones [197], is a future research question [198], [199]. 13) In terms of the electric grids, inertia constant and short circuit ratio (SCR) are two indicators that specify grid strength and the grid hosting capacity for hosting the RESs. This issue has been studied from the inverter's control point of view, but the potential application of the BESS to improve the grid hosting capacity is a future trend [190].

14)
The application of data analysis tools [200] and machine learning techniques for optimal scheduling of BESSs in MGs is another open area of research. As an example, a typical day optimal scheduling is achieved by defining some indices from historic data such as load extreme deviation per time period and resource extreme deviation per time period and are used as constraints for the optimization problem [128]. Also, recently a data-driven frequency response identification/cost modeling has been proposed in [46], [92].

IX. CONCLUSION
The various applications of BESSs in MGs were reviewed in this paper and classified into five major groups based on the time constants of the applications (given by the proposed controllers).
In terms of dynamics, the virtual inertia and primary frequency response were studied. The shortcomings of the existing methods for providing virtual inertia response, i.e., frequency estimation issues and the requirement of an automatic controller as the inertia synthesis, were investigated. Secondly, the real-time SoC management of BESSs for covering the intermittent nature of RESs was discussed. In the next step, the roles of BESS in economic/optimal power flow programs for improving the steady-state performance were explained and the various modeling needs in terms of SoC, degradation, and operation costs were illustrated. The problems related to the current works regarding the achievement of the optimum joint sizing-OS of BESSs were clarified.
Finally, the realization of the slack bus, as a novel application of BESSs in AMGs, was discussed and its implementation through centralized and distributed BESSs was studied. The distributed consensus controller has been identified as an appropriate supplementary loop to improve the performance of droop-controlled BESSs. Nevertheless, an appropriate virtual inertia loop is yet to be developed to stabilize the droop-based AMGs in dynamics/transients.
The major findings of the comprehensive literature review were summarized in Remarks 1 to 8, which highlight the necessity for several main research directions. A suitable continuous joint economy-dynamics model of the BESS operation is required in which the battery's accurate cycling age/degradation cost is appropriately incorporated.
In general, due to the critical impact of the inverter's control system on the BESS response, the requirement of developing a universal control system for BESS, that possesses the advantages of both grid-forming/grid-feeding VSCs in inertia response and voltage regulation/reference tracking is felt to help BESSs accomplish the quintuple tasks.