Optimal design and performance analysis of coastal microgrid using different optimization algorithms

Owing to the stochastic behavior of renewable energy activity and the multiple design considerations, the advancement of hybrid renewable energy-based microgrid (HREMG) systems has become a complex task. This study proposes a design optimization algorithm for the long-term operation of an autonomous HREMG along with the optimal system capacities. The investigated energy system comprises photovoltaic panels, wind turbines, diesel generators, and batteries. It aims to energize a remote coastal community with a daily load demand of 400 kWh in Marsa Matruh, Egypt. Since most studies utilize commercial tools in the design optimization procedure, the African vultures optimization approach (AVOA) is developed to find the optimal energy alternative and determine the optimal component’s capacity considering achieving the minimum energy cost and loss of power supply probability. Moreover, an adequate energy management strategy is suggested to coordinate the power flow within the energy system in which renewable energy sources are fully penetrated. To check the AVOA robustness and efficacy, its performance is compared with the HOMER Pro most popular commercial tool as well as with new metaheuristic algorithms, namely the grasshopper optimization algorithm (GOA) and Giza pyramid construction (GPC) under the same operating environment. The results revealed that the proposed AVOA achieved superior economic results toward the least net present cost ($346,614) and energy price (0.0947 $/kWh). Moreover, over 20 independent runs, the AVOA showed a better performance in terms of convergence and execution time compared to other tools/algorithms. The obtained findings could be a useful benchmark for researchers in the sizing problem of hybrid energy systems.


Background and context
In 2019, the number of people without access to electricity reached 770 million who mostly live in sub-Saharan Africa, rural areas, or developing Asia [1].Despite the global efforts and progress for the energy access policies to achieve development and sustainable electricity for all, it is estimated that about 670 million people will still lack access to electricity by reaching 2030 [2,3].These developments were based only on fossil energy which causes a global fossil energy crisis and environmental problems [4,5].Consequently, much focus has been given renewable energy sources (RESs) such as wind, solar, wave, and hydroelectric due to their various advantages such as low running cost, clean, and rich characteristics [6,7].The huge development of RESs can be realized in Fig. 1a and b which describes the most recent indicators for both country and technology, respectively [8].From Fig. 1a, energy generation from PV and wind technologies combined offer about 68% of the RESs.As China stays at the top of the PV market in the world, a significant reduction in new PV facility embellishments occurred in 2020 due to COVID-associated interruptions.RESs are expected to cover 99% of global demand growth by 2025 as shown in the last statistics offered by the IEA in Fig. 2 [7].Although the wind and solar energies have fast growth, the randomness and intermittence make the system an excessive size when only one energy source is used [9].Also, this randomness reduces the reliability of the standalone system since the generated energy is influenced by both solar irradiance and wind speed variabilities [10].Moreover, RESs require a high cost of investment besides the large land area for construction.To overcome the problem of weather variability, energy storage systems (ESSs) are integrated with these sources to form hybrid renewable energy systems (HRESs).Although the use of ESS ensures a steady power supply for load leveling, they increase the total system cost and reduce the energy conversion efficiency [11,12].Also, to overcome the cost issue, optimal planning and capacities of systems' components should be accomplished.Recently, HRESs are developed as a green and cost-effective solution for reliability, cost, land area issues, and technoenvironmental challenges of conventional sources.The use of the HRESs in standalone or grid-connected applications has been addressed in many studies [15][16][17][18].The optimal capacity planning problem of HRES can be solved using different metaheuristic algorithms (MA) as reviewed in [19,20], and [21] or via various commercial software tools such as Hybrid Optimization Model for Electric Renewables (HOMER) [22], Hybrid Optimization by Genetic Algorithms (iHOGA) [23], REopt [24], System Advisor Model (SAM) [25], PVWatts [26], and RETScreen [27].

Literature survey
Considering the scope of this paper, this survey focuses on studies that employed metaheuristic algorithms, commercial software, or both.Table 1 summarizes the different up-to-date studies that addressed the problem of HRES optimal planning.HOMER software has been widely used in countless research works employing different types of energy solutions for distinct kinds of load demand.For example, the floating PV units were utilized to feed a small electrical system in Bangladesh where the techno-enviro-economic investigations were discussed to present the mini-system profits [28].In [29], the authors developed a systematic technoenviro-economic design optimization for a PV, wind, diesel, and batteries energy production system using HOMER.The results revealed that the optimal solution has a TNPC of 351,223 $ and COE of 0.2262 $/kWh.In [30], HOMER was used to optimize the cost of 13 scenarios that consist of a hydrogen system, PV, wind, and grid.The authors in [31] used HOMER to investigate optimal solutions regarding the energy, economic, and environmental of an HRES connected with a desalination plant in the new capital airport in Egypt.In another study, the authors in [32] reported using the HOMER software to investigate the techno-economic sustainability of the HRESs using different elements such as PV, wind, pumped hydro storage, diesel, and batteries.
The MA have been broadly used in a wide range of applications in the electric power system; this is due to their various applicability merits [33,34].Nevertheless, the applications of the MA are not limited to the field of power systems.In [35], the cyclical parthenogenesis algorithm was employed for layout optimization of truss structures with frequency constraints.Also, the authors in [36] introduced plasma generation optimization as a new physically based metaheuristic algorithm for solving constrained optimization problems.In [37], the dolphin echolocation optimization algorithm was introduced to reduce the computational efforts and time which remain the main challenges that face the MA users.Another efficient metaheuristic optimization algorithm, namely colliding bodies optimization (CBO), was introduced in [38].The presented algorithm developed straightforward formulation to discover minimum or maximum of functions and does not rely on any interior parameter.Besides, an enhanced version of the CBO algorithm was addressed in [39] for design problems with discrete and continuous variables as well as to escape from local optima dilemma.Likewise, another physically inspired non-gradient algorithm, namely water evaporation optimization (WEO), was developed for solution of global optimization problems to impersonator the evaporation of a small quantity of water particles on the solid exterior [40].
The HOMER and the MA were implemented in different articles to compare and assess their performances.In [41], the GWO was applied to achieve the optimal techno-economic PV/wind/battery system sizes for Ras Shaitan in Egypt.The obtained results achieved by GWO are compared with those of PSO, WHO, and GA.The study focused only on meeting the load requirements and minimizing the COE.In [42], fuzzy logic controller is used in the GSA to determine the effect of the batteries and diesel systems in the HRESs.In another relevant study [43], the economic and environmental aspects were compromised for hybrid PV/wind energy and batteries using the diesel generator as a spare source.The proposed method is achieved using GA and PSO, and the results are compared with HOMER.The optimal COE and CO 2 , which GA and PSO accomplish, have the lowest values compared with that obtained using HOMER software.In [44], the authors proposed a method to optimize the PV, wind, and battery hybrid systems for a specific region in Manipur using a backtrack search algorithm.The obtained results are compared with HOMER by considering the number of wind turbines, PV units, batteries, cost, fluctuation rate, and LPSP.Meanwhile, the authors in [45] used demand-supply management with PSO to design the optimal off-grid system with PV, diesel generator, and battery to energize residential buildings.The results were compared with HOMER considering the economic, technical analyses, and sensitivity evaluation in terms of TNPC, COE, RF, and CO 2 .
Recently, AVOA has been proposed and used to achieve different objectives such as tuning the gains, optimal reconfiguration, and optimal sizing [46][47][48].In [46], the AVOA is just proposed instead of the PSO to tune the gains of the proportional-integral (PI) controllers for extracting the maximum power from the PV and wind systems.Meanwhile, in [47], the AVOA is adopted in the PV system to overcome the partial shade condition (PSC) where this phenomenon has a negative effect on the PV array which increases the power loss, causes hot spots, and reduces the generated power.Further, in [48], the AVOA is presented to obtain the optimum configuration for a HRESs.The HRESs in this study consist of FC/wind/PV where the grid is the main factor in this investigation.The purpose of this study was to determine the optimal number of HRES components to achieve the lowest TNPC and LOPSP.Although the obtained results have been compared with other MAs, they have not been compared with any commercial software such as HOMER.In addition, the results are used for supplying a building in Ahvaz, Iran, although the main factor was the grid.In [49], an evaluation of PV/WT hybrid renewable energy system forecasting and sizing techniques has been presented.

Research gaps and contributions
To the best author's knowledge, the proposed AVOA has not been employed before in the optimal sizing of the ISOLATED SYSTEM, which is based on a   with HOMER, the trusted global standard software in hybrid power system modeling, and up-to-date metaheuristic methods of the grasshopper optimization algorithm (GOA) and the Giza pyramid construction (GPC).• Providing a systemic and comprehensive energy-economic-environmental analysis of the winning HRES design to understand better the system behavior with the proposed solution based on AVOA.

Paper organization
Besides the introduction described in Sect. 1, the mathematical models of the proposed HRES components are presented in Sect. 2. The problem formulation and the employed AVOA-based metaheuristic optimization are discussed in Sects.3 and 4. The obtained simulation and optimization results considering the adopted case study data used are discussed and analyzed in Sects.5 and 6.Finally, the most important conclusions are summarized in Sect.7.

System description and mathematical modeling
Before the optimization procedure, employing the appropriate mathematical modeling of the PV/WT/DslG/BESS hybrid systems illustrated in Fig. 3 is a prerequisite.A description of the technical and economic specifications of the HRES is given in Appendix.Also, the detailed mathematical modeling of each component in the system is offered in Supplementary.

Formulation of the design optimization problem
In this section, the design criteria and constraints, as well as the objective function of the optimization problem, are formulated and discussed.

Total net present cost
Different criteria are used to examine the feasibility and performance of HRES.However, the total net present cost (TNPC) (also called total life cycle cost) approach is yet used as a benchmark criterion for the economic analysis of HRES [50].This is because TNPC represents all outlay and income costs over the project lifetime by summating the capital cost (CapC), the operating and maintenance cost (O&MC), the replacement cost (RepC), the fuel cost (FuC), and the salvage cost (SavC) as in Eq. ( 1).
The entire CapC of the HRES is calculated by Eq. ( 2) in which C PV_Cap , C WT_Cap , C DslG_Cap , C BESS_Cap , and C Conv_Cap are the initial capital costs of the PV, WT, DslG, BESS, and converter, respectively.Also, N PV , N WT , N DslG , N BESS , and N Conv are the number of PV modules, WTs, DslGs, BESS, and converter, respectively.
The FuC of the hybrid system, which is represented in the DslG, can be calculated by Eq. ( 3), where FC/yr is the total yearly fuel consumption in liters.

FuC FC/yr
The annual O&MC of the system's components is calculated by Eq. ( 4) in which C PV_o&m , C WT_o&m , C DslG_o&m , C BESS_o&m , and C Conv_o&m are the operation and maintenance costs of the PV, WT, DslG, BESS, and converter, respectively.Also, D r , N oi , I r , and N are the discount rate, nominal interest rate, inflation rate, and project lifetime, respectively.
where D r Since the lifetime of DslG, BESS, and the system converter is usually shorter than the project lifetime, they must be substituted at some stage during the project lifetime.Therefore, the RepC of the system's elements is expressed in Eq. ( 5) in which C DslG_rep , C BESS_rep , and C Conv_rep are the replacement costs of the DslG , BESS, and the converter, respectively.Also, N c is the lifetime of each component, and N r is the number of the needed replacement for the system components.

RepC
where N r The salvage cost is the estimated resale value of HRES at the end of its lifetime.It is subtracted from the cost of a fixed asset to determine the amount of the asset cost that will be depreciated.It can be expressed as given in Eq. ( 6) where T rem is the remaining time of the component, which is calculated using Eq. ( 7).The cost data used to calculate the life cycle cost of the HRES are given in Table 10 in Appendix.

Penalty of emissions
When the diesel generator is running, it produces different harmful gases such as carbon dioxide (CO 2 ), carbon monoxide (CO), sulfur dioxide (SO 2 ), and nitrogen oxides.However, carbon dioxide has the dominant quantity, and it harms the surrounding environment.So, the penalty cost of the gas emissions will be applied only to the Co 2 emissions as in Eq. ( 8) in which PnR (30 $/ton) is the penalty rate of the environmental policies in the country.

Cost of energy
The COE is commonly used to calculate the financial viability of HRESs in which the CRF represents the capital recovery factor during the project lifetime, as represented in Eq. ( 9) [59].
where CRF

Capacity constraints
The capacity constraints of the four components in the system are subjected to the constraints shown in Eq. (10).Besides, N PV,max , N WT,max , N DslG,max , and N BESS,max are the maximum number of PV panels, wind turbines, diesel generators, and batteries, respectively.

Battery lifetime constraints
The energy collected in the BESS is restricted by the state of charge (SOC) limits as represented in Eqs.(11)(12)(13) [60], whereas V BESS and C BESS are the BESS' voltage and rated capacity in Ahr, respectively.

Diesel generator operational constraints
Since the performance of the DslG becomes more effective at greater load demand, the minimum necessary load is adjusted at 40% of the DslG nominal power.Consequently, the DslG can work after fulfilling the limitation displayed in Eq. ( 14) [61] in which η Conv is the converter efficiency.

System reliability constraints
Power system reliability is defined as the capability of this system to offer uninterruptible energy for a specific time at particular conditions.The reliability in this study is assessed utilizing the LPSP factor, which is defined by the hourly loss of power supply (HLPS) and hourly energy load demand E L (t).The HLPS is determined based on the hourly produced energy, load demand, and BESS energy levels.The HLPS and LPSP are calculated using Eqs.( 15) and ( 16), respectively [62].The objective function is subject to a reliability index of 0% LPSP.

Objective function
The objective function for the optimal design of the HRES is formulated to minimize the TNPC in $ and penalty cost associated with the carbon emission (PnCE) in $, subject to maintaining various constraints.The summation of the two terms represents the overall cost incurred by the HRES throughout its lifetime period.The objective function for the optimal design of the HRES is formulated to minimize the TNPC and penalty cost associated with the carbon emission subject to various constraints.The objective function (ObjFn) principally hinges on four numeral decision parameters (i.e., number of PV panels (N PV ), wind turbines (N WT ), diesel generators (N DslG ), and batteries (N BESS ).The optimization formula is described in Eq. ( 17).[63].These vultures are considered environmentally beneficial animals that can prevent the carcass from stretching and infecting.Also, they play an important extra-terrestrial role, and their destruction poses several serious risks to human health.They are distributed around the world except in Australia and Antarctica.In recent years, their population has started to decline, and they are more popular in African countries and follow the same lifestyle to find food and sometimes fight each other for food [64].The African vultures can be split into three categories [65].The first category includes the vultures, such as the front-footed vulture, which are more likely to be preyed upon than others due to their healthy physical condition.The second category includes vultures that are physically weaker than the first type, such as white-backed African gyps.The last category includes vultures that are physically weaker than the other two categories, such as the Necrosyrtes monachus hooded vulture.The AVOA follows the behavior of the African vulture during the foraging and navigation behavior to find the optimal solution to a problem.The following subsections will present the steps in the AVOA optimization approach and how AVOA can be used to solve the design challenges of the HRESs in the city of Marsa Matruh.
The complete pseudocode of the AVOA is described in Algorithm 1.It is assumed that N vultures, representing the initial population of a problem, live in a particular environment.Vultures are physically divided into two groups in their natural environment.The first group was designed to compute the fitness function (i.e., objective function) for the entire original population and select the best positions for the first and second vultures.In contrast, the other group forms a population to shift or replace the best two vultures in each presentation.The AVOA optimization algorithm consists of four steps to find the optimal solution to a problem.

Finding the best vulture in any group
The best and second-best vultures are selected after the randomly initial population is evaluated throughout the objective function.At the same time, the other possible solutions move to the first and second groups by using Eq. ( 18).In addition, a new population is recalculated for each fitness function.
where BestVulture 1 is the best vulture in the first group during the current iteration, BestVulture 2 is the best vulture in the second group during the current iteration, and L 1 and L 2 are the parameters that should be measured before starting the search process and their sum equals one.The probability of choosing the best solution is determined by selecting each of the best solutions for each group using a roulette wheel, as in Eq. ( 19), where F is the rate of vultures' starvation.

Defining the rate of vultures' starvation
A vulture's behavior while searching for prey depends on its energy.When satisfied, vultures can travel long distances in search of prey.However, if they are hungry and unable to find prey due to a lack of flying energy, they will forage from more closed-up vultures and exhibit aggressive behavior.Satisfaction levels can be modeled using Eqs.( 20) and (21).
where i is the current iteration number, the MaxIt iteration is the total number of iterations, w is a constant number that should be set before running the AVOA, and both z and h are random numbers.The range of z is [− 1, 1], while h is in the range of [− 2, 2].When z is greater than zero, the vulture will be satisfied, while the vultures are starved if it is below zero.

Exploration phase
Vultures can travel long distances in search of food for long periods of time.They have high visual abilities and high abilities to detect prey and dry animals.They can explore different random areas using two strategies, where the parameter P 1 can control the selected chosen.Furthermore, P 1 should be randomly selected from the range of [0, 1] before the search operation.In this way, the methodology of these two strategies can be defined by Eqs.(22-25).

P(i + 1)
Eq. ( 23) ifP 1 ≥ rand P1 Eq. (25) ifP 1 < rand P1 (22) where P(i + 1) is the position vector of the vulture during the following iteration step, R(i) is one of the best vultures in the current iteration, u b and l b are the lower and upper bound of the variables, X is the vultures that move randomly to protect food from other vultures, and rand 3 is a random number to increase the coefficient of random nature while solving the problem.

Exploitation phase
During the exploitation stage, the efficiency of the AVOA can be investigated.Two strategies are available at this stage, depending on the parameters P 2 and P 3 .The parameter P 2 is used for the first phase, while P 2 is employed for the second Fig. 4 Food competition for position vectors [63] phase.These two parameters can have a value between 0 and 1 and must be evaluated before each phase is started.
First phase If the absolute value of F is between 1 and 0.5, then the AVOA enters this first phase.It is controlled by Eq. ( 26).The powerful vultures do not like to share their prey with other vultures, as shown in Fig. 4.During this time, the weaker vultures will try to feed around the healthy vultures and cause some disturbance, which can be modeled as in Eqs. ( 27) and (28).
Eq. (30) ifP 2 < rand P2 (26) where D(i) is defined from Eq. ( 24), R(i) is one of the best vultures of the two groups, P(i) is the current vector position, and rand 4 is a random number between [0, 1] to increase the random coefficient.Sometimes, during flight, the vultures move in a spiral direction.This spiral model is created between all vultures and the two best vultures, as shown in Fig. 5a, and it can be expressed as in Eqs. ( 29) and (30).
S 2 R(i) rand 6 P(i) 2π sin(P(i)) ( 29) where rand 5 and rand 6 are random numbers in the range of [0, 1] to enrich the randomization coefficient.

Second phase
In this phase, aggressive food competition is created between the vultures.According to the value of rand 3 Fig. 5 Position vectors during a the rotating flight of vultures and b aggressive competition for food [63] and the parameter P 3 , the next position of a vulture can be defined by Eq. (31).
When vultures are starving and there is huge competition for food, several vulture species can flock to the same food source simultaneously as in Eqs. ( 32) and (33).
The food competition also could be aggressive in this exploitation phase, where the leader vulture becomes starved and weak and loses its energy to fight against other vultures, as shown in Fig. 5b.Then, other vultures start moving toward the leader vulture from different directions as in Eq. (34).
where d(t) denotes the distance between the vulture and one of the best vultures in each of the two groups, and levy flight (LF) is used to increase the AVOA's effectiveness [66] and can be expressed as in Eqs.(35) and (36).
where d denotes the dimensions of the problem, u and v are random numbers between [0, 1], and β is a constant of 1.5.

Development of AVOA for the optimal HRES design
This part describes integrating the AVOA algorithm to determine the optimal solution to the current optimization problem.The AVOA is a new metaheuristic optimization algorithm motivated by the African vultures' social behavior, as mentioned earlier.The advantages of AVOA are as follows: easy to implement due to its simple structure, less storage and computational requirements, faster convergence due to continuous reduction of search space; its ability to avoid local minima; and having the ability to find the optimal solutions for problems with nonlinear relationships between its variables, hence better stability, and robustness.The overall result of this optimization problem is to determine the optimal capacity planning for the city of Marsa Matruh operating in an isolation mode, given the constraints and minimal costs throughout the project lifecycle.An energy management strategy (EMS) is required to coordinate the flow of power between different distributed generations in the system.The proposed EMS is designed according to a cyclic charging strategy as shown in Fig. 6.In this strategy, renewable energy is fully utilized, where it always operates at the maximum power point under current climate conditions.It has a rule-based algorithm in the form of "if" and "then" implementation.Also, the diesel generator has two switchedon or switched-off positions.In this way, when the diesel is running (i.e., switched on), it produces its rated power according to the capacity obtained from the AVOA algorithm.The dummy load is used to absorb the surplus power in the system when charging the BESS to its maximum allowable capacity.The EMS algorithm starts by calculating the annual available power from the PV and WT based on the given mission profile at the DC bus.Then, the remaining power ( P), in the microgrid, can be calculated by subtracting the load, PV, and WT powers at the AC bus to check if the system needs additional power or if there is already surplus power in the system.In the case of P > 0 (that is, extra power is needed), the diesel must operate at its rated capacity to meet the load requirements.At low RESs power and high loading demand, the design maybe not be sufficient to cover all the remaining load demands, which the available power of the BESS should cover.Furthermore, there could be a load shedding condition, in which the battery cannot deliver at minimum capacity due to lifetime consideration.In such a case, the HLPS should be computed, and it will be greater than zero.
The complete flow diagram clearly illustrating the proposed AVOA for the optimization problem under study is shown in Fig. 7.It starts by loading the input data, such as meteorological data (solar irradiance, ambient temperature, and wind speed) related to the location of the current study.Then, the load demand profile over the year, the technical and economic factors of the HRES components, and the desired Minimum and maximum values (l b , u b ) Eq. (37) limits are also loaded as specified in Sect. 2. The next step is to define the parameters associated with the optimization algorithms, as given in Table 2.The dimension of the current optimization problem consists of four variables: N PV , N WT , N DslG , and N BESS .Finally, the search space of the components' capacity can be listed in Eq. (37).123 Fig. 9 Hourly, daily, and monthly load power Then, like any metaheuristic approach, a random population set is generated within the search space limit of each dimension.Then, the fitness function is evaluated for each possible candidate in this list to determine the best first and second positions of the vultures.The fitness function will include initial, maintenance, replacement, and salvage costs.Also, to act against climate change, we have included, within the fitness function, the penalty due to carbon emission.To check the feasibility of the proposed optimization method in solving this HRES capacity planning, we have compared it with up-to-date optimization approaches for this type of problem.The comparison algorithms include the GOA [67] and GPC [68].Their parameters are given in Table 2.

Case study
In this study, the proposed AVOA algorithm is tested and validated considering the case study and corresponding input parameters analyzed previously by the authors in [29].In this previous examination, the design optimization of HRES was performed by HOMER software.This offers the ability to adequately assess and compare the results of the proposed AVOA with the benchmark model of HOMER, in addition to the other applied metaheuristic algorithms of GOA and GPC.The examined locality represents an urban community in Marsa Matruh city (Egypt) at geographical coordinates of 30°54.3N and 28°23.73E. The simulated solar irradiance and wind speed profiles of the examined community area, which are collected from the National Aeronautics and Space Administration (NASA) [69], are illustrated in the heat maps given in Fig. 8.Both solar irradiance and wind speed significantly vary each hour, day, and month.From Fig. 8a, the maximum value of the solar irradiance occurs in June with 0.958 kW/m 2 , while the minimum value occurs in December with 0.393-kW/m 2 .Meanwhile, in Fig. 8b, the maximum value of the wind speed occurs in March with 8.03 m/s, while the minimum value occurs in October with 3.43 m/s.The electrical load demand in the examined community represents a group of 60 households, school one school, one healthcare center, two shops, and one community center.The details of the energy consumption of each load are collected from [29].
The hourly, daily, and monthly load demand profile is given in Fig. 9, from which the maximum load demand occurs in January at 30.28 kW while the minimum load demand occurs in September at 8.2 kW.Table 3 summarizes the project's economic input parameters and various adopted technical constraints of the optimization problem.The economic inputs, such as the nominal discount rate and the expected inflation rate, depending on the economic situation of the country where the project is established.They are essentially used to obtain the real discount rate, which converts between the one-time and annualized costs.It is worth mentioning that an emission penalty of 30 $/ton was assumed in the current study to reflect the environmental policies in the country.

Results and discussion
In this section, the optimization results of the proposed AVOA are presented and analyzed in detail.For clarifying the efficacy of the presented AVOA, two up-to-date metaheuristic optimization algorithms, the GOA and GPC, and the HOMER optimization software, were also employed to solve the optimization problem, and the results were compared.As mentioned above, the studied HRES was adopted from the investigation accomplished by the authors in [29] using HOMER, but with consideration of emission cost in the objective function.

Design optimization results
The metaheuristic optimization algorithms are independently executed around 20 times to extract the statistics results, as summarized in Table 4. Therefore, it is obvious that the pro-  posed AVOA for optimal HRES design provides the best values compared to GOA and GPC.The convergence curves of the three adopted algorithms, including the proposed AVOA, GOA, and GPC, are shown in Fig. 10.It can be recognized that the proposed AVOA has a better convergence rate (i.e., the lowest value of the objective function) and statistical measures compared with the GOA and GPC approaches.The algorithms started with initial estimations and remained until the termination condition was fulfilled.Table 5 describes the optimal results of the three metaheuristics optimization algorithms and the HOMER optimizer with their relative ObjFn and execution time.It can be distinguished that the AVOA takes less time than other approaches and attains superior economic results at minimum lifecycle cost (346,614 $) and energy price (0.0947 $/kWh).The AVOA reached the optimal solution at the 17th iteration, while the GOA and GPC algorithms found the optimal solution at the 38th and 80th iteration, respectively.The GPC algorithm appears in the second rank, followed by GOA concerning ObjFn, despite taking a longer execution time than the GOA.
Meanwhile, the three optimization algorithms show better financial performance than the HOMER, which gives the highest ObjFn among all methods.For further explanation, Fig. 11 displays the optimal capacities of the different components obtained by the different metaheuristics optimization algorithms and the HOMER software.It can be noticed that the three metaheuristic algorithms did not consider employing WTs in the optimal solution, contrary to the HOMER, which considered 6 × 2.6 kW WTs.Also, HOMER requires the highest number of batteries (104 units), and thus, the ObjFn resulting from the HOMER will be higher than the other optimization algorithms.Besides, the GOA ranked third due to the high rating required for the PV units (62 Fig. 11 Optimal capacities of the HRES obtained by the different approaches kW) and 87 batteries compared to the other metaheuristic algorithms.

Economic analysis
The detailed economic analysis of the metaheuristic algorithms and HOMER is summarized in Table 6 and portrayed in Fig. 12 for further demonstration.It can be seen that the proposed AVOA has the best optimal cost distribution among all optimizers with the lowest TNPC and LCOE of 346,614 $ and 0.0947 $/kWh, respectively.The initial cost of the AVOA optimal configuration is fewer than that of HOMER at 40.5%.Besides, the TNPC using the AVOA is reduced by 6.5% compared to HOMER.The optimal configuration suggested by HOMER has an LCOE of 0.239 $/kWh, while that suggested by the AVOA is 0.0947 $/kWh, recording a 60.3% reduction.Besides, the suggested LCOE by both the GOA and GPC algorithms is almost the same.It can be distinguished from the obtained results that the AVOA is more efficient than the HOMER and both the GOA and the GPC algorithms.It is worth mentioning that besides the results convergence of the metaheuristic algorithms with HOMER, the former is further accommodating in control preferences and model advancements.The cost summary of each component in the optimal configuration is also generated from the different optimizers, as summarized in Table 7.It should be noticed that there are no data generated from the metaheuristic algorithms regarding the WT cost since the optimal solution with each algorithm was reached at zero number of WTs.In contrast, the use of HOMER has resulted in six turbines in the optimal solution (see Table 5).

Energy analysis
The average monthly energy production from the optimized HRES configuration with both the AVOA and HOMER is displayed in Fig. 13.The optimal capacity planning achieved with the AVOA promotes 37.5 and 62.5% energy share from the PV and the DslG, respectively.Meanwhile, the contributions of the PV units, WTs, and DslG in the case of HOMER are 40.1,25.7, and 34.1% of the total energy produced.As anticipated, it is indicated that the energy production curves for solar and wind generation match the wind speed and solar irradiance profiles in the investigated locality.The figure also reveals that the load demand is efficiently fulfilled using both optimization methods, and the surplus energy is transferred to the batteries.
Moreover, Fig. 14a demonstrates the hourly profile of energy share of the optimal system components and batteries SOC during a year.From Fig. 14a and aided with Fig. 13a, it can be seen that the optimal system candidates by the AVOA share the produced power between the PV system (high share in summertime) and the diesel generator (higher share in wintertime).Besides, samples of two consecutive days during the wintertime and the summertime are indicated in Fig. 14b and c, respectively, from which the energy management and power flow within the optimal system can be verified.Similarly, the hourly profile of energy share using HOMER Pro is indicated in Fig. 15.With a closer view of the yearly profile in Fig. 15a, the SOC of the battery does not have a full charge state which discovers that occasionally the extra power does not transfer to the batteries.The main reason behind this is the kinetic model of batteries utilized by HOMER that relies on the charging/discharging record of the batteries.
Furthermore, the reliability and renewable penetration of the optimal HRES were assessed using three major parameters by the different optimizers: the loss of power supply possibility, the renewable fraction, and the unmet load ratio.Figure 16 shows the results of the different optimizers regarding the discussed parameters.It can be recognized that the three metaheuristic algorithms efficiently served the load demand with zero unmet load ratio, while for HOMER, there is a small portion of the load demand still unserved 123  (0.0669%).Because the optimization problem is constrained by a zero-capacity shortage or a zero LPSP, the different optimizers successfully maintained the reliability limits by 0.0067, 0.0002, 0, and 0.0978% for the AVOA, GOA, GPC, and HOMER, respectively.Since the optimal HRES was attained at the highest PV capacity share, the GAO algorithm has the highest renewable fraction ratio (59.6%) among all optimization approaches.A similar value (59.3%) was reached in the case of HOMER owing to the integration of both PV units and WTs in the derived optimal HRES configuration (see Fig. 13).The AVOA and GPC methods have nearly renewable fractions of 40.38 and 44.23%, respectively, due to the conjunction of the PV rating in both methods.

Emission analysis
The impact on the environment is also assessed based on the amount of produced CO 2 by the optimal HRES configuration with each solution approach.Table 8 indicates the diesel generator and corresponding CO 2 emission data.The annual amount of CO 2 obtained using the AVOA is estimated at 79,089.1 kg, almost the same resulting from the GPC algorithm.Besides, the amount of CO 2 estimated by HOMER is the lowest at 47,778 kg/year since the projected diesel has the lowest fuel rate consumption with 18,251 L every year.

Conclusions and perspectives
This study investigates the feasibility and optimal capacity planning of an autonomous HRESs comprising solar, wind, diesel, and battery sources.The system aims to electrify a remote urban community with 400.09 kWh/day in Marsa Matruh, Egypt.Four optimization approaches include three up-to-date metaheuristic algorithms, AVOA (proposed method), GOA, and GPC, in addition to the HOMER software.The optimization problem is formulated to minimize the TNPC and the emission penalty of HRESs subject to various design and reliability constraints.In addition, the COE, renewable fraction, and unmet load ratio were evaluated and analyzed.The simulation results proved the effectiveness and robustness of the proposed AVOA in applications of hybrid electrical systems under different conditions, as summarized in the following:  • The metaheuristic algorithms showed fast execution time, with AVOA being the first ranked with an average of 18.66 s, followed by GOA (19.51 s) and GPC (7.84 s).
In contrast, HOMER has taken significantly longer than the metaheuristic algorithms to find the optimal solution (130 s), which is time-consuming.
Further investigations are recommended for future work, including analyzing new design criteria (e.g., social and technological) in more comprehensive multi-objective optimization.In addition, other active energy management approaches (e.g., demand-side management) could potentially be advantageous in the analyzed research considering the impact of varying the input cost and technical parameters.

Fig. 1
Fig.1RESs growth by a country and b technology[8]

( 17 )
ObjFn minLC (N PV , N W T , N DslG , N B E SS ) min e PV , W T , DslG, B E SS, Conv (TNPC + PnCE) e 4 Proposed solution method 4.1 The African vultures optimization algorithm lifestyle of African vultures

Fig. 6 Fig. 7
Fig. 6 Overall flowchart of the proposed EMS

Fig. 8
Fig. 8 Renewable potential in the examined location a solar irradiance b wind velocity

Fig. 10
Fig.10 Convergence of the three adopted metaheuristic algorithms

Fig. 12
Fig. 12 Illustration of the economic results obtained with AVOA, GOA, GPC, and HOMER

Fig. 13
Fig.13 Average monthly contribution of optimal system: a AVOA and b HOMER

Fig. 14
Fig.14 Hourly power sharing of the optimal system using the proposed AVOA: a yearly profile, b 2 days in winter, and c 2 days in summer

Fig. 15
Fig.15 Hourly power sharing of the optimal system using HOMER: a yearly profile, b 2 days in winter, and c 2 days in summer

Table 1
Recent literature survey on capacity planning of HRESs

Table 2
Parameters of different optimization approaches in the current study

Table 3
Input parameters and constraints of the optimization problem

Table 4
Statistics of the metaheuristic algorithms for 20 independent runs

Table 5
Comparison of the optimization results of different approaches

Table 6
4% savings compared to HOMER results, respectively.•The design based on AVOA efficiently served the load demand with zero LPSP with an acceptable value for a renewable fraction of 40.38%.

Table 8
DslG and carbon dioxide emission data