Grey Wolf Optimization-Based Optimum Energy-Management and Battery-Sizing Method for Grid-Connected Microgrids

: In the revolution of green energy development, microgrids with renewable energy sources such as solar, wind and fuel cells are becoming a popular and effective way of controlling and managing these sources. On the other hand, owing to the intermittency and wide range of dynamic responses of renewable energy sources, battery energy-storage systems have become an integral feature of microgrids. Intelligent energy management and battery sizing are essential requirements in the microgrids to ensure the optimal use of the renewable sources and reduce conventional fuel utilization in such complex systems. This paper presents a novel approach to meet these requirements by using the grey wolf optimization (GWO) technique. The proposed algorithm is implemented for different scenarios


Introduction
With the ever-growing energy demand, greenhouse gas (GHG) emission reductions, energyefficiency improvements, and adequate clean power have become major challenges in the energy sector.A promising solution to this issue is the development of microgrids with renewable energy sources such as solar, wind and fuel cells.The microgrids can be self-sufficient power grids (standalone microgrids) working with local sources or grid-connected microgrids attached to the conventional utility grid.Irrespective of the microgrids' form, they have succeeded in reducing the CO2 amount and cutting energy costs [1,2].However, due to the fluctuations and intermittency of renewable-energy sources such as wind turbines (WTs) and photovoltaic (PV) units, the utilization of storage devices has become crucial in the microgrids [3].These storage devices can inject auxiliary power to the grid during a power shortage or store the surplus power from the renewable sources during off-peak load demands.
As mentioned above, the storage devices' participation (charging/discharging) in microgrids is essential to maintain the power balance.Nevertheless, excessive battery capacity would increase the cost while a very small battery capacity results in insufficient power that leads to instabilities or increases the cost of conventional fuel usage.Therefore, finding the optimum capacity or size for storage devices is highly important for minimizing microgrid dispatch problems and optimizing operation costs [4][5][6].
In addition, intelligent energy-management methods aim to specify the optimum size of the battery, as well as reduce the use of conventional fuel and overall operating cost.As a result, several types of research have been conducted to address the optimal sizing of renewable-energy sources.The authors in [7] described the technical and economical sizing comparison of energy-storage systems (ESS) with three renewable-energy sources PV, wind, and wave power, using a heuristic optimization stand on an adaptive storage operation.Aghamohammadi and Abdolahinia [8] determined the optimal size of the battery energy-storage system (BESS) based on the primary frequency control of the microgrid.A mixed-integer linear programming algorithm was utilized to address the optimum dispatching power flow in the microgrid, as well as the optimum sizing of storage devices [9][10][11][12][13][14]. Meta-heuristic algorithms have been applied in the hybrid energy system to find the optimal size of the battery devices in the microgrid [15][16][17][18][19][20].A dynamic programming algorithm was employed in [21,22] to find the optimal scheduling problem, considering the efficiency and operating characteristics of storage devices in microgrids with isolated and grid-connected modes.
A genetic algorithm (GA) was utilized in [23,24] based on an optimization method to find the optimum sizing of microgrid components that consisted of a PV array, fuel cell (FC) and storage device as well as distributed generation (DG) units under the hybrid electricity market.This method was conducted to increase the lifecycle cost and minimize the GHG of the microgrid.However, some researchers employed particle swarm optimization (PSO) to evaluate the optimum size of BESS at a lower total cost [25][26][27].
Conversely, some researchers were concerned about minimizing the operation cost of the power networks that affect the optimum sizing of the components of a microgrid.Ahmadi and Abdi [28] demonstrated an efficient method that depends on a hybrid big bang-big crunch algorithm, which reduced the total present cost of the system.A non-linear programming optimization model was proposed to determine the optimal operation and sizing of the storage systems, reducing the cost of the hybrid system while satisfying the service requirements [29].Active distribution networks (ADNs) are optimal operations used to minimize network losses, as well as the cost of power imported from the external grid.Nick et al. [30] considered the ESS size which is the main factor that affects the performance of ADNs.The differential evolution algorithm was utilized in [31] to determine the size of the renewable-energy sources, reduce power losses, enhance voltage constancy of the system, and reduce the cost in the microgrid.
Recently, hybrid algorithm techniques that combine more than one algorithm have been widely utilized to solve optimization problems and satisfy problem constraints.GA based on the fuzzy expert system was used in [32] to determine the sizing of the ESS and set its power output.GA based on multi-objectives called photovoltaic-trigeneration optimization was used in [33].A new sizing method based on simulink design optimization was employed in [34] to perform technical optimization of the hybrid system components.A PSO algorithm integrated with the fuzzy logic expert system that was applied to different scenarios was used in [35] to enhance the performance of storage devices in supplying power in the microgrid.A decision tree on a linear programming based on fuzzy and multi-agent systems was implemented to adapt pricing rules and minimize the generation cost for a typical autonomous microgrid [36].Appendix A provides more details about the related works' approaches.
However, some of the meta-heuristic algorithms search only in the neighborhood space for the best solutions without paying attention to the global space.This type of algorithm may mislead the search process and leave the optimization-searching space stuck to a local solution only.Furthermore, some algorithms have perfect global search abilities, but their local exploration capability is limited.Due to these limitations, more robust algorithms are needed for premature concurrence and accelerate the exploration process.In this regard, a new advanced meta-heuristic algorithm named grey wolf optimization (GWO) that has a good balance between the local and global search spaces is implemented in this paper.The main objective of this study is to minimize the operation dispatch costs in the microgrid by taking into account the optimum size of the battery-storage devices.The proposed algorithm is based on the hunting attitude of a pack of grey wolves with a high balance between the exploration and exploitation [37].Finally, to verify the performance and the stability of the proposed algorithm, it is implemented on a typical low-voltage microgrid system.Different scenarios have been conducted and the simulation results compared with other optimization methods.The GWO results prove the capability of the proposed method in finding the best global optima in the optimization problem in terms of solution quality and computational efficiency.The main contribution of this study can be presented as follow: (1) proposing a novel approach to an intelligent energy-management method that increases the penetration of the renewable-energy sources and reduces the dependence on fossil fuel in the microgrid; and (2) takes into account the effect of the optimum size of battery-storage system on the operation management as well as the overall cost of the microgrid.
This paper is organized as follows: Section 2 illustrates the mathematical problem formulation of the operational cost management in the microgrid.Section 3 gives a brief description of the proposed grey wolf algorithm.The implementation of the GWO in the microgrid and the monitoring method for the storage devices are described in Section 4. Numerical results and a discussion are presented in Section 5. Finally, Section 6 provides the conclusion of this research.

Mathematical Problem Formulation
The optimum sizing and load dispatch are important aspects of power-system management.The mathematical objectives and constraints considered in GWO formulation can be presented as follows:

Objective Function
This paper aims to reduce the operation cost while satisfying all the constraints, Therefore, determining the potential cost of the generation sources in the microgrid is extremely important, and based on that the different cost functions of the generation sources are determined as follows [3,12,38,39]: where , =  ,  ,  , , =   × (0,  , −  ,−1 ) , =   × (0,  , −  ,−1 ) S , =   × (0,  ,−1 −  , ) , =   × (0,  ,−1 −  , ) = (  +   +   +   ) ×  (10) The total operation dispatch of the microgrid is comprised of the operation dispatch cost of the utility grid, the costs of fuel DG units, the price of the battery energy storage (BES) operation, operation and maintenance costs of DGs, costs of startup/shutdown of Micro-Turbine (MT) and Fuel Cell (FC), and the total cost per day of BES (TCPDBES).The cost of BES constraints is determined by considering the one-time fixed cost (FCBES) and the annual maintenance cost of the battery (MCBES); these costs are proportional to the battery size.The storage cost when the size of the battery is equal to its maximum size is calculated by considering the FCBES and the MCBES, which are as follows: The time horizon (T) used in this paper is one day (24 h), in which the calculation of the operation time was based on that time.TCPD is determined in this study by accounting the interest rate (IR) of the financing installation and the lifetime (LT) of BES, which is as follows [3,12]:

Constraints
The minimization of the operational cost in a microgrid is subjected to a number of constraints including the balance of the electrical load demands, the boundaries of DGs constraints, the operation reserve (OR) constraints, and the BES constraints.Details of the aforementioned constraints are described below.

Balance of Electrical Load Demands
The microgrid power generation sources that including MT, FC, PV, WT, and the power injected from BES or the external power from the utility grid, should satisfy the demands of the electrical load (PD,t) in the microgrid with minimum operating costs.This constraint can be represented by using Equation (13).

Boundaries of Distributed Generation (DG) Constraints
The output operation of the distributed generators of each unit should be within the maximum and minimum limits [40], which is as follows:

Grid Constraints
The power supplied from the utility grid should be within the maximum and minimum limits in each time step:

Operation Reserve (OR) Constraints
The reserve power can be pumped into the microgrid in less than 10 min from the electrical power generation by turning on the MT, FC, utility and BES, and is formulated as follows [3]: where ORt is 10 min.

Battery Energy Storage (BES) Constraints
The lithium battery is used for the BES system for the microgrid in this research.This type of battery has many advantages such as lack of memory effect, a high energy density, and its ability to lose power is slow when not engaged [3,12,41,42].Battery constraints can be classified into charging and discharging modes: where Charging Mode where where The boundary limits of BES power in discharging and charging modes are expressed in Equations ( 21) and (23), respectively.The battery capacity in charging and discharging modes are expressed in Equations ( 20) and (22), respectively.The maximum power of BESS is expressed mathematically in Equation ( 24), whereas the minimum power of BES is expressed in Equation (25).The proposed storage device should satisfy all the constraints from ( 20)-( 25).

Grey Wolf Optimizer (GWO)
Grey wolf optimizer (GWO) is one of the powerful meta-heuristic algorithms proposed by [37].As a newly developed algorithm it has the ability to compete with others algorithms such as PSO, GA and many other algorithms in terms of solution accuracy, minimum computational effort, and aversion of premature convergence.GWO was inspired by grey wolves, members of the Canidae family which are leading predators on top of the food chain.This type of wolves lives in groups of 5 to 12 members.
The leader of the wolf pack is called alpha, and is responsible for the pack.While beta is the second level after alpha who reinforces the alpha's instructions throughout the pack and delivers feedback to alpha.The lower level of the grey wolf hierarchy is called omega and usually plays the role of scapegoat.Moreover, if the wolf is not alpha, beta or omega, then he or she is called delta.The duties of delta wolves are as scouts, sentinels, elders, hunters and caretakers.Figure 1 illustrates the social dominant hierarchy of the grey wolves.The GWO steps for hunting the prey are presented in the next sub-section.

Mathematical Formulation of GWO
The behavior of the GWO can be formulated mathematically, where the alpha (α) wolf position is assumed to be the best answer in the proposed GWO algorithm, while the beta (β) and delta (δ) positions are the second and third best answers, respectively.The omega (ω) represents the rest of the answers to the problem.The hunting in GWO algorithm is directed by α, β, and δ, while the omega follows them.The attacking process of the grey wolves involves several steps before they catch the prey.First, the wolves tend to encircle the prey to stop her from moving, this encircling behaviour can be represented by the following set of equations: where  → and  → are the vector coefficients,   → is the vector location of the prey, t is current iteration, and  → is the location vector of a grey wolf.The encircling equations can be obtained by finding the  → and  → vectors.
where  → is linearly changed from 2 to 0 during the algorithm iterations, and r1 and r2 are random values between (0, 1).In each iteration, the best solutions from alpha, beta and delta are saved and the other wolves (omega) update their positions based on the best solutions.These steps are represented by the following equations: The vector positions of the prey can be determined based on the alpha, beta and delta positions using the following equations: The exploration and exploitation of the grey wolf agents depend on the parameter A, by decreasing A half of the iterations are devoted to exploration (|A| ≥ 1).Meanwhile, when the (|A| < 1) the other half of the iterations are devoted to exploitation.The pseudo-code of the GWO (Algorithm 1) is presented in the following form:

The GWO Implementation of the Optimal Operation Management of the Microgrid
In this research, a GWO is used to solve the operation management issues in the microgrid by finding the optimal values of the parameters that help to minimize the operational cost of the generation sources in the microgrid and fulfil all the constraints (13)-( 25) in each step of the GWO algorithm.Figure 2 shows the flowchart of the grey wolf algorithm performance for operation management in the microgrid.

End for t
Since the OR's constraints should be met, the penalty factor value considered in this paper is 10.The grey wolves' numbers (search agents) and the iterations numbers are set.The population vector of the GWO can be represented as follows: where n represents the control variable numbers or search agents positions.The population number (grey wolves) is represented by p.
To minimize the operational cost in the microgrid, we employed a monitoring method for the microgrid operations to set the charging and discharging rules for storage devices that integrated with the grey wolf algorithm.The method is based on evaluating the economical price factor of the microgrid within 24 h.Therefore, the batteries' decisions in the microgrid charge and discharge are based on the difference between the highest and lowest mean price of the utility market and the DGs within 24 h.The grey wolf algorithm makes the charging decision by comparing the dispatch cost of the storage devices with other DGs such as gas and the dynamic generation price of the utility grid.
Moreover, a switching mechanism is integrated with the GWO that controls the storage devices' operation by comparing the instantaneous capacity of storage devices with its full practical capacity.
A signal indicates when the battery capability goes below full-capacity status.This signal indicator will be considered under other price factors: A. The charging signal will be activated when the price of local distribution generators is below the mean value of the price of DGs or the utility market price.
B. The discharging signal will activate to supply electrical power to loads of the microgrid when the battery-charging price is lesser than the other prices of the generation source.
C. A standby signal is generated when the charging cost of storage devices is above the DG price, or when the storage devices have been charged with a higher price than other generation sources in a microgrid at the time of comparison.
The following equations illustrate the conditions of charging and discharging operations of the storage devices: The GWO will treat the battery devices as a source, load or standby source depending on the generated signals at the time of comparison, as shown in the equations below: ,  , +  ,  , +  , +  , +  ,  , +  , =  , ,  , +  ,  , +  , +  , +  , =  , +  ,  , ,  , +  ,  , +  , +  T, +  , =  , To validate the efficiency of the monitoring method with different capacities of the battery and to select the optimal size of the battery, the maximum capacity of the battery device is set as a control variable, and the minimum capacity set to 10% of the maximum capacity.This means that the optimization and the energy stored in the BES after determining the operation cost should be within the range [50 kWh-500 kWh].The step size between the maximum and minimum capacity of the BES is 100 kWh in each step and the algorithm takes it gradually until the optimal size of the BES is reached.Figure 3 illustrates the sizing process for selecting the optimal size.

Numerical Results and Discussion
The effectiveness of the developed grey wolf algorithm is demonstrated in this paper by utilizing it to solve different non-linear parameters and complex problems by considering the load dispatch issues in the microgrid.

Description of the Microgrid Test System and the Data Inputs
The proposed grey wolf algorithm is designed to work with any application as well as different profiles.Therefore, in order to access the validity and robustness of the algorithm, it is tested on a typical low-voltage microgrid system as depicted in Figure 4.The microgrid system has different generation sources such as MT, FC, PV, WT and a Li-ion battery energy system.In addition, the case study is assumed to have highly rated conductors, and therefore the thermal constraints will not be considered in the dispatch analysis.Furthermore, the feeders supplying distributed loads from the generators have a relatively short distance which does not have a significant impact on the voltage profile (no reactive compensation is required), and hence the power losses are neglected in this study.All the coefficients and source limitations that are used in this paper are referred to [3].The load demand and real forecast utility price that are used to test GWO in the low-voltage network are shown in Figures 7 and 8, respectively [3,12].Several factors are considered in GWO to minimize the economic dispatch of the low-voltage network in this paper.For instance, the OR factor is set to 5% of the load demand for each time step, and the maintenance and fixed labour for BESS installation and operation are set to 465 (€ct/kWh) and 15 (€ct/kWh), respectively.The BESS LT and IR are set to 3 and 0.06, respectively; and tax is set to 10%.The charging and discharging efficiencies of BESS are both set to 90%.The maximum capacity of the BESS is set to 500 kWh, and the minimum capacity is fixed to 10% from the maximum capacity.The minimization cost in this study is performed for one day (24 h).
The algorithms are solved using MATLAB software (2017b) and tested on a 3.6 GHz CUP and 16 GB RAM university computer.Accordingly, in order to verify the performance of the algorithm the GWO iteration is set to 1000, and the number of implemented search agents is set to 100.To study the performance of the GWO, the simulation results are compared with various methods such as GA, the bat algorithm (BA), PSO, and the improved bat algorithm (IBA) [3] and different scenarios are conducted also, as follows: Scenario A: The microgrid operates without BES.Scenario B: The microgrid's BES does not have an initial value (uncharged).Scenario C: The microgrid's BES has an initial value equal to its size (fully charged).

Scenario A
Multiple sources are considered in the microgrid of this case study to compare the performance of the proposed algorithm with other algorithms like GA, PSO, BA and IBA.In this scenario, it is assumed that the microgrid does not have storage devices in its operation and all power should be provided from the DGs (renewable energy source (RES) and non-RES) and the utility grid to satisfy the load demand at any hour during the day.
Based on the daily forecasting load demand curve and the maximum power output from renewable sources and non-renewable sources of this case study, we demonstrated the numerical outcomes of the optimal operation of generation sources under the microgrid circumstances in Figure 9 by using the grey wolf algorithm.GWO is a random method of probability patterns, thus the randomness in the results of the simulation are comprehensible.The load dispatch problem is determined in real-time; hence, the program should approach the optimum solution over time.
Figure 9 shows the best output power from the generation sources to satisfy the load demands during the day.Due to the absence of storage devices in this scenario that act as an ancillary service, the output power of the DGs and utility grid should be greater than the load demands to ensure the stability of the operation system as well as to show the need for purchasing the power from the utility grid for most of the day.Due to the lower bid of the FC source compared with another source (MT), the microgrid uses more power from FC than MT.The status of each DG and utility grid that is dispatched is in Table 1.Table 1.Corresponding status of the generation sources obtained by GWO for Scenario A.

Time (hour) MT FC PV WT Utility Grid
Table 2 shows the optimal, average, and worst-cost solutions obtained from GWO compared with other algorithms, which emphasizes the robust performance of GWO.The agents in the GWO algorithm always update their positions according to alpha, beta and delta behaviour.Thus, the GWO algorithm gives the best results and those results continue to improve with each iteration during the simulation.Due to that, the optimal dispatch cost of this scenario with the absence of the storage device is 813.6850€ct, and the worst-solution dispatch cost of GWO in this scenario is significantly less than the best solution using other methods.Therefore, the grey wolf algorithm shows a significant reduction in cost compared with the GA, PSO, BA and IBA algorithms.The cost saving obtained by comparing the GWO operational cost with other methods is presented in Figure 10.In this scenario, the battery-storage devices are added to the microgrid system with the initial battery charge value set to zero.The battery-storage system is an essential source in the microgrid that helps to maintain system stability, enhance the power quality and mitigate the transit period of the microgrid between the grid-connected mode and islanded mode.Furthermore, the difference between the peak and off-peak of the real market prices gives an opportunity to the BES to be economically beneficial by purchasing the power from the utility grid overnight (off-peak) and selling that power back to the utility grid during peak demand.
All DGs, either renewable or traditional energy sources, should work to fulfil the load demands and operation constraints until the storage devices are charged and can contribute to a microgrid load demand based on how much it is charged in previous hours.The robustness of the proposed algorithm is apparent from its capability to satisfy all the constraints and create reliable results.Figure 11 demonstrates the numerical outputs of the MT, FC, PV, WT, BES and utility grid by utilizing the GWO.It is obvious from the figures that the first five hours from the day the BES is not utilized as a power supply for load demands, whereas for the rest of the day it is used as one of the microgrid-generation sources.Based on Figure 11 and the input data used, the variation in the market price of the utility grid gives the opportunity to the storage device to participate in minimizing the operational cost and to gain some benefits by selling the power back to the utility grid whenever the market price of power is high (peak load) and buying the power from the utility grid overnight due to the low price (off-peak).The status of each DG and utility grid dispatched is shown in Table 3.It is clear that the optimal size of BES in this scenario is 140 kWh.

Battery-Energy Storage (BES)
Table 4 shows the comparison of the operation cost of the microgrid optimal, average, and worst solutions obtained from GWO compared with other algorithms.From this table, it is clear that the significant performance of GWO in minimizing the microgrid dispatch cost to 445.3254 €ct is better than the dispatch cost in Scenario A due to the existing storage devices.The worst-solution dispatch cost of GWO in this scenario is significantly less than the other methods.Therefore, the GWO technique is remarkably more efficient than the other existing methods.The cost saving obtained by comparing the GWO outputs with other methods is presented in Figure 12.

Scenario C
In this scenario, the initial value for a storage device is set to the maximum size capacity of the battery and utilized to complicate the system test and judge the effectiveness of the GWO method with non-linear constraints, and to show the feasibility of the proposed method for the dispatch cost and sizing BES. Figure 13 shows the optimal outputs of the MT, FC, PV, WT, BES and utility grid by utilizing the GWO.It is clear that from the figure that the BES participates in satisfying the load demands during the day and minimizes purchasing power from the upstream power grid.The status of each DG and utility grid dispatched is in Table 5.

Time (hour) MT FC PV WT BES Utility Grid
Table 6 shows the optimal dispatch cost obtained by the proposed GWO method.The simulation results clearly prove that GWO creates feasible solutions.The statistical results from that simulation are compared with other methods, namely, GA, BA, PSO and IBA [3].Considering this scenario with optimal BES size (220 kWh), the dispatch cost by the GWO with BES fully charged is the best (297.5429€ct) among other algorithms.However, the best cost of the other algorithms is IBA (424.1339€ct), which is significantly higher than the worst cost of the GWO, as illustrated in Table 6.The economic cost saving achieved by this scenario is notably higher than that of Scenarios A and B when the initial value of the BES is fully charged, which helps to minimize importing power from the utility grid and at the same time cut down relying on the MT and FC, as presented in Figure 14.The crucial role of the storage devices in minimizing the cost in the microgrid, balancing the operation during the transit period, and identifying the solidity of the proposed grey wolf algorithm can clearly be seen in all scenarios compared with the other algorithms.In addition, the charging and discharging techniques of the storage devices played a crucial role in minimizing the total operation cost of the microgrid as shown by the numerical results of the analysis in the scenarios.

Conclusions
In this paper an intelligent energy-management method and a new algorithm named GWO is proposed to solve the load dispatch problems based on finding the optimal size of the microgrid sources.The GWO method satisfies the load demands and constraints in the microgrid based on the smart use of storage devices among other sources in the network.Different scenarios are employed to illustrate the GWO's applicability.GWO shows a superior performance with storage device charging and discharging techniques by reducing the dispatch cost of the microgrid operation in all scenarios.The storage device technique operates based on tracking the local generation cost of the microgrid and the total cost of the storage device.Charging prices are generated to increase the chance of charging the battery with low prices and increase the opportunity of having cheaper microgrid operation cost during the storage device's lifetime.
The numerical results are tested with other existing methods, namely, GA, BA, PSO and IBA, to validate GWO performance.The GWO algorithm shows superior results over other algorithms, considering robustness, minimum computational efforts, and aversion of premature convergence.Furthermore, the simulation results show that smart utilization of the BES by GWO helped to minimize the operational costs by 33.185%.Moreover, the proposed method helped to cut down the amount of the imported power from the utility grid, and at the same time reduce dependency on fossil fuel (MT and FC) which has a significant impact on the operational cost reduction in all the microgrid scenarios.GWO outperforms other competing methods in battery sizing and energy management in microgrids and, therefore, it has a significant potential to be implemented in a wide range of microgrids in the future.
Author Contributions: All authors contributed to the implementation of the research, to the analysis of the results and to the writing of the manuscript.

Conflicts of Interest:
The authors declare no conflicts of interest.

Figure 1 .
Figure 1.The dominance hierarchy of grey wolves.

Figure 2 .
Figure 2. Flowchart of the grey wolf optimization algorithm used in the microgrid.

Figure 9 .
Figure 9. Optimal output of the generation sources obtained by GWO for Scenario A.

Figure 10 .
Figure 10.Cost saving of GWO compared with other algorithms in Scenario A.

Figure 11 .
Figure 11.Optimal output of the generation sources obtained by GWO for Scenario B.

Figure 13 .
Figure 13.Optimal output of the generation sources obtained by GWO for Scenario C.

Figure 14 .
Figure 14.GWO cost saving compared with other algorithms in Scenario C.

Algorithm 1: GWO pseudo-code
Initialize the locations of the grey wolf population Xi (i = 1, 2, …, n Initialize a, A and C Calculate the objective function value for each grey wolf agent Set: Xα as best result of the search agents Xβ as the second best result of the search agents Xδ as the third best result of the search agents While (t < max number of iteration) the termination criterion is not satisfied do

do Part 1: power balance and generation source capacity handling Calculate
However, due to the limitations of the generation sources and the energy-management constraints, the function handle (Algorithm 2) should be utilized as follows: the power difference between the generation sources and load demand Pdiff = (P_MT,t u_MT,t + P_FC,t u_FC,t + P_PV,t + P_WT,t + P_BES,t u_BES,t + P_grid,) − PD,t; Select random generation sources based on their capacity While P_diff ≠ 0 do Subtract P_diffm,t from the selected units Check the capabilities of the generation units based on lower and upper limits as follows: If Pm,FC,t < PFC,min then Pm,FC, = PFC,min; or Pm,MT,t < PMT,min then Pm,MT,t = PMT,min; or Pm,grid,t < Pgrid,min then Pm,grid,t = Pgrid,min; or Pm,BES,t < PBES,min then Pm,BES,t = PBES,min; Elseif Pm,FC,t > PFC,max then Pm,FC, = PFC,max; or Pm,MT,t > PMT,max then Pm,MT,t = PMT,max; or Pm,grid,t > Pgrid,max then Pm,grid,t = Pgrid,max; or Pm,BES,t < PBES,max then Pm,BES,t = PBES,max;

Table 2 .
Demonstration of operation dispatch costs of the microgrid in Scenario A.

Table 3 .
Corresponding status of the generation sources obtained by GWO for Scenario B.

Table 4 .
Demonstration of operation dispatches cost of the microgrid (MG) of Scenario B.

Methodology Best Operation Cost (€ct) Mean Operation Cost (€ct) Worst operation Cost (€ct)
Figure 12.GWO cost saving compared with other algorithms in Scenario B.

Table 5 .
Corresponding status of the generation sources obtained by GWO for Scenario C.

Table 6 .
Demonstration of operation dispatches cost of the microgrid (MG) of Scenario C.

Best Operation Cost (€ct) Mean Operation Cost (€ct) Worst Operation Cost (€ct)
BBES,t, BMT,t, BFC,t, BPV,t, BWT,t Bid of utility, BES, MT, FC, PV and WT, respectively, at time t (€ct/kWh).CBES,min, CBES,max Minimum and maximum size of BES (kWh) CSD_Max Maximum capacity of storage device CSD_Min Minimum capacity of storage devices FCBES, MCBES Fixed and maintenance cost for BES, respectively (€ct/kWh) Iter_max Maximum number of iteration for the GWO algorithm LT Lifetime of the installed BES (year) OMDG Fixed operation and maintenance cost of distributed generators (DGs; €ct)