Multiobjective Sizing of an Autonomous Hybrid Microgrid Using a Multimodal Delayed PSO Algorithm: A Case Study of a Fishing Village

Renewable energy (RE) systems play a key role in producing electricity worldwide. The integration of RE systems is carried out in a distributed aspect via an autonomous hybrid microgrid (A-HMG) system. The A-HMG concept provides a series of technological solutions that must be managed optimally. As a solution, this paper focuses on the application of a recent nature-inspired metaheuristic optimization algorithm named a multimodal delayed particle swarm optimization (MDPSO). The proposed algorithm is applied to an A-HMG to find the minimum levelized cost of energy (LCOE), the lowest loss of power supply probability (LPSP), and the maximum renewable factor (REF). Firstly, a smart energy management scheme (SEMS) is proposed to coordinate the power flow among the various system components that formed the A-HMG. Then, the MDPSO is integrated with the SEMS to perform the optimal sizing for the A-HMG of a fishing village that is located in the coastal city of Essaouira, Morocco. The proposed A-HMG comprises photovoltaic panels (PV), wind turbines (WTs), battery storage systems, and diesel generators (DGs). The results of the optimization in this location show that A-HMG system can be applied for this location with a high renewable factor that is equal to 90%. Moreover, the solution is very promising in terms of the LCOE and the LPSP indexes that are equal to 0.17$/kWh and 0.12%, respectively. Therefore, using renewable energy can be considered as a good alternative to enhance energy access in remote areas as the fishing village in the city of Essaouira, Morocco. Furthermore, a sensitivity analysis is applied to highlight the impact of varying each energy source in terms of the LCOE index.


Introduction
Electricity has become one of the most essential parts of modern life. Nowadays, the electricity sector is facing serious challenges, such as ensuring sufficient supply to keep up with the ever-increasing demand of electrical energy, reducing its costs, and limiting polluting emissions. For these reasons, the use of REs has become a global priority for most of the world's countries.
In this regard, the Moroccan government plans to decrease the use of fossil fuel energy by producing more than 40% of electrical energy using only clean and RE resources by 2020 [1]. Besides, they begin to take advantage of RE resources by exploiting the high potential of solar and wind resources through inaugurating several energy projects and implementing several research projects to extend the use of the RE resources. Currently, with these projects and considering the country's deployment of solar and wind energies, the national RE production will rise to 52% by 2030 [2]. Moreover, Moroccan climate is favorable for the installation of the medium and small scale A-HMG projects as a means to bring electricity production closer to consumption, limit investment in transmission, and reduce losses in distribution networks. RE in the form of an A-HMG system offers a reliable and optimal cost-effective solution for centralized RE installations. A-HMG can operate in both off-grid and grid-connected configuration. However, A-HMG systems provide an opportunity to use the advantages of RE resources in combination with conventional ones [3].
In the recent literature, the primary goals are to formulate and implement energy production strategies with greater flexibility, higher efficiency, and lower LCOE. However, reaching these goals cannot be accessible due to the nonlinear behavior of RE production and storage systems, which are strongly dependent on weather changes. So, to overcome these problems, many optimization techniques are employed in several scientific contributions in the literature.
e optimization problem can result in a mono-objective or multiobjective problem, which can include the minimization of the LCOE, LPSP, and the pollutant emissions. Two frequently used optimization techniques are stochastic dynamic programming methods for optimizing the energy management problem with multidimensional objectives and metaheuristic techniques to solve the problem of optimization with multiconstraints, multidimensional, and highly nonlinear combinatorial problems.
Based on the literature review, we found several research contributions that are focused on the HMG systems optimization problems. e authors in [4] proposed a generalized formulation for intelligent energy management of a HMG in using multiobjective optimization to minimize the operation cost and the environmental impact, where they applied artificial neural network to predict RE generation and load demand. e problem formulation in this work includes optimal battery scheduling taking into account the uncertainty of the HMG exogenous variables and forecasted entities. However, the proposed approach, does not take into consideration the REF as an objective and the optimal sizing of battery storage is not taken into account.
In the research presented in [5], a technical and economic method is proposed to optimize a HMG based on mixed integer linear programming. In this paper, the cost function is solved via linear programming based on a general algebraic modelling system, where the optimization phase of the HMG system was performed via HOMER software. e authors have analyzed WT, PV, and biomass resource potential of a selected area in province Punjab, Kallar Kahar. e cost of energy is calculated for different peak load, energy demand profiles, and grid availability. However, the proposed formulations do not introduce any storage solution to solve the intermittence problem of RE and to minimize the emission of polluting gases by biomass resource.
Taha and Yasser [6] presented a robust algorithm based on a predictive control model for an isolated HMG in four different case studies to minimize the total operating cost, to minimize the pollutant CO 2 , and to minimize the dump energy. e results showed that the optimal battery daily number of cycles, minimum SOC, and the initial SOC of the battery storage depend the pool-price variation. Moreover, the number of scenarios required to achieve a good results makes the problem very large and time-consuming to solve.
A mixed method is proposed for microgrid energy management in [7]. is was achieved by using linear optimization methods to obtain an optimal energy storage system size. e grid-connected microgrid system consists of solar PV, two identical solid oxide fuel cells, and a battery bank operated parallel with the load. Moreover, the proposed methodology neglected many important constraints on the LPSP and REF indexes.
e authors in [8] analyzed an energy management system for a hybrid AC/DC microgrid in an isolated community that employs a PV system for desalination in order to minimize the daily operating costs, by using the mixed integer nonlinear programming. e aim of the proposed methodology is to manage all system assets to ensure stable operation of the hybrid AC/DC microgrid and secured clean water supply for the customers. is contribution has neglected the REF and the availability objectives.
Correa et al. [9] proposed an energy management system based on a virtual power plant. e studied microgrid has solar panels and storage systems and works in an interconnected manner. ese elements are modeled using linear programming methods to minimize the operating costs. REs are incorporated into an energetic model and are mainly based on hydric resources. Moreover, the authors concluded that the battery sizing plays a crucial role in operational cost of the microgrid. However, this contribution has considered a single objective optimization problem, since the statement of a number of objective optimization problems affects the convergence speed and the stability of the adopted algorithms.
In the research presented in [10], an intelligent energy management system is proposed for HMG system in three stations in Iran. e objective for this study is to minimize the operational costs and environmental impacts by using a multiobjective particle swarm optimization algorithm. e LCOE and the LPSP are defined as objective functions. e result of optimization shows that HMG system can be applied for one of the three proposed locations with a high REF. However, the optimal configuration and the LCOE index are not a standard value, which depends on location. e authors in [11] presented an energy management system for a PV/WT/DG stand-alone HMG, which is optimized using a particle swarm algorithm with Gaussian mutation. is paper minimizes both the capital and fuel costs of the system. However, the authors mainly concentrated on economic evaluation of hybrid energy systems but they do not examine other aspects of sustainability of these systems.
Katsigiannis et al. [12] used multiobjective optimization techniques to size an A-HMG while simultaneously minimizing LCOE and CO 2 emissions. e obtained results of LCOE are not competitive. e previous reviewed studies for A-HMG optimization have recorded the following gaps: (1) Few research contributions have considered more than two objective optimization problems considering the computational complexity that affects the convergence speed and the stability of the adopted algorithms.
(2) Many studies have dealt with the techno-economic analysis of the A-HMG system, while the optimal configuration and the LCOE index are not a standard 2 Computational Intelligence and Neuroscience value, which depends on several variables such as location, weather, and the applied optimization technique.
Based on the results presented by the studies mentioned above, the prime aim of the present work is adopting an efficient variant of PSO algorithm referred to as a MDPSO, which is developed recently by Song et al. [2]. e MDPSO is applied to design an optimal A-HMG with a high REF and minimal values of the LCOE and the LPSP indexes. e elements of innovation of the present work are the following: (1) A recent MDPSO metaheuristic algorithm was adopted for an A-HMG system optimization. (2) e stability and the convergence of the adopted MDPSO algorithm were evaluated to build A-HMG with a high REF and minimal values in terms of the LCOE and the LPSP indexes. (3) e application of MDPSO improves the convergence speed of the traditional PSO algorithm and decreases the probability of converging to local optimum. So, the entire search space will be explored efficiently. (4) e applied optimizer demonstrates a high efficiency to build an optimal A-HMG system for a fishing village that is located in the coastal city of Essaouira, Morocco. (5) e developed A-HMG system present minimal values in terms of the LCOE and the LPSP with a high renewable factor compared to different A-HMG models developed in the literature.

Autonomous Hybrid Microgrid
System Description e proposed A-HMG system is composed of wind turbines (WTs), photovoltaic (PV) panels, diesel generator (DGs), and battery storage bank as shown in Figure 1, which can vary greatly depending on specific parameters, such as the availability of renewable resources and desired services to provide [13]. ese parameters have a high impact on decision-making, and, accordingly, on the LCOE and reliability of the system. In the following section, a detailed modelling of each component of A-HMG is introduced and discussed.

Photovoltaic Energy System
Model. Morocco has a favorable climate conditions for implementing large solar energy projects. Various models for calculating the output power of the PV system have been proposed in the literature [2]. In this work, a simplified model that considers ambient temperature and solar irradiance is used, as shown in the following equation [10,14]: where (i) P pv and P r are the output power of the PV and the rated power in watts (W) at the standard test condition (STC), respectively; (ii) K is the temperature coefficient, defined by (−3.7 × 10 −3 (1/°C)); (iii) T ref denotes the cell temperature (°C) at STC; (iv) T amb denotes the ambient temperature (°C) (T amb � 25°C ); (v) G is solar radiation (W/m 2 ); (vii) G ref is solar radiation at STC (G ref � 1000 W/m 2 ); (viii) TNOCT is the nominal operating cell temperature.

Wind Turbine Energy System
Model. Wind energy offers enormous benefits for Morocco, where this energy is regarded as being abundant, climate-friendly, easy to operate, and cost-efficient. Additionally, the wind potential in Morocco is highly important due to the ideal geographical position of the country.
To determine the WT generator output power, the measured wind speed at reference height is first converted to corresponding WT hub height. e power-law equation is computed by the following correlation [10]: where α is the power-law exponential (also known as Hellmann exponent, wind gradient, or power-law exponent) e WT output power can be expressed as [4,15,16]    e battery capacity of the system is designed to meet the energy demand during periods of non-availability of renewable energy (RE) sources. In this regard, the battery capacity is designed in accordance with the desired autonomy day (AD) and with the energy demand P load using the following equation: where Moreover, the state of charge of a battery at any given time is SOC(t) and it is bounded by maximum SOC(SOC max ) and minimum SOC(SOC min ). e WT and PV systems could produce a surplus or deficit energy. A surplus/deficit energy represent the power absorbed/delivered by the battery storage system and it can be expressed as follows: where (i) P Bat (t) < 0 is an indication that the power generation has deficit in energy demand (ii) P Bat (t) > 0 indicates a surplus in power generation e battery storage bank charging occurs when SOC(t) < SOC max and when (P pv (t) + P WT (t) > P load (t)). erefore, the SOC(t) can be expressed as follows [17]: Furthermore, when there is a deficiency in the power generation and SOC(t) > SOC min , the battery storage bank then discharges the energy stored into it to achieve the energy demand according to where (i) c denotes the self-discharge rate of the battery storage bank

DC/AC Inverter Model.
e inverter DC/AC converts the electrical energy from DC to AC with the desired frequency of the load. Its efficiency is defined by the following equation: where P, P 0 , and k are determined by using the following equations [18][19][20][21]: where η 10 and η 100 are the efficiency of the inverter at 10% and 100% of its nominal power, respectively.

Diesel Generator Model.
Diesel generator (DG) works as a secondary source of energy in the case of battery depletion during peak energy demand. e efficiency and the hourly fuel consumption of the diesel generator should be considered in designing a hybrid energy system and can be expressed by the following expression [22,23]: where (i) P DG is the generated power (kW) (ii) F(t) is the fuel consumption (L/hour) (iii) P r is the rated power (kW) of the DG (iv) a and b are constant parameters (L/kW), which represent the coefficients of fuel consumption, and can be approximated to 0.246 and 0.08415, respectively [24] Similarly, the efficiency of the DG is calculated by the following equation [25]: where (i) η overall represents the overall efficiency of the DG (ii) η brak−thermal is the brake thermal efficiency of the DG

Site of Implementation and A-HMG System Descriptions
Moroccan lands are blessed with abundant renewable energy resources, predominantly those of solar and wind energies. In the present study, an A-HMG system was designed for a small fishing village located in a coastal region in the middle of Morocco, nearby the city of Essaouira at a latitude of 31.52°N and a longitude of 9.27°W. is region is characterized by high irradiance levels and an average annual wind speed between 7 and 8 m/s [22,26]. Its exposure to the Atlantic Ocean moderates the temperature amplitudes compared to inland regions. e economic and technical parameters of the A-HMG components are given in Table 1. e hourly load profile is given in Figure 3. Similarly, Figures 4-6 depict the hourly profiles of solar radiation, wind speed, and ambient temperature, respectively. Computational Intelligence and Neuroscience 5 In general, the efficiency of the resources (PV, WT, DG, and battery) is reduced with time with a degradation factor. e energy generated by each resource is equal to the rated energy output multiplied by the degradation factor. However, the impact of degradation on system performance is taken into account in this work, where the PV and WT's degradation factor is considered as 0.5% per year and the DG's degradation factor is considered as 0.7% per year.

The Proposed Smart Energy Management Scheme
Having an efficient SEMS is one of the major criteria to be considered when designing the A-HMG system. e objective of the proposed SEMS system is to coordinate the power flow into the A-HMG system and to maximize the use of renewable energy systems. e proposed SEMS system is based on the following cases: Case 1: Sufficient energy is provided by PV and WT resources, which will supply the load demand. en, the extra energy will be used to charge a battery storage bank if SOC(t) < SOC max . Case 2: e energy that is provided by PV and WT resources exceeds the load demand and the battery storage bank needs (SOC(t) � SOC max ). erefore, the extra energy will be consumed in a dump load. Case 3: e energy generated by PV and WT resources is not sufficient to supply the load demand and SOC(t) > SOC min . erefore, the stored energy in the battery storage bank will be used to satisfy the load demand. Case 4: e energy generated by the PV and WT resources is not sufficient to fulfill load demand and the battery storage bank is also depleted (SOC(t) < SOC min ). erefore, the DG is switched on to supply the load demand and charge the battery storage bank. Moreover, when PV and WT resources start to generate power, the energy produced by DG will be stopped. e main flowchart for the proposed SEMS is shown in Figure 7.

Optimization Problem Formulation
e objective of this section is to provide an optimal configuration of A-HMG system to satisfy the typical load demand presented in Figure 3. e A-HMG system is optimized based on a multiobjective problem, which can be generally defined as follows:    e A-HMG system is evaluated based on the LCOE, the LPSP, and REF. us, they are chosen as the objective functions, where the goal objective is to optimize the system so that it would guarantee reliable power supply at minimum cost and maximize the reliability of the A-HMG system in case of a blackout, avoiding power supply interruptions and their related costs.

Levelized Cost of Energy.
e LCOE is one of the most used indicators of economic profitability of A-HMG systems [23]. e LCOE includes the hybrid system hardware initial cost and the operation and maintenance costs. It is defined as the price per unit produced energy ($/kWh) and expressed with the following equation [27,28]: where (i) TPV is the total present value of the whole system cost and includes the capital, replacement, operation, and maintenance costs (ii) P load (t) is the hourly amount of energy consumed (iii) CRF is the capital recovery factor; these can be expressed as follows: where (i) n is the life span, typically equal to the life span of the PV panels [29] (ii) β is the discount rate considered in the economic appraisal of the proposed system e discount rate is country-dependent and also subject to the investment stability of the energy source. is parameter may vary from 6% to 16% for renewable energy sources in Morocco [30]

Reliability Analysis.
e reliability of the A-HMG system is assessed based on the LPSP. e LPSP is a reliability index, which indicates the probability of the power supply failure to meet due to low renewable resources or technical failures to meet the energy demand. It can be described by the following equation [31,32]: where (i) P WT (t) is the amount of power generated by the wind turbine at time t (ii) P pv (t) is the amount of power generated by the PV system at time t (iii) P DG (t) is the amount of power generated by the diesel generator at time t (iv) P load (t) is the amount of power consumed at time t (v) P Bat min is the minimum allowable storage capacity of the battery storage system e LPSP is a reliability index, which indicates the probability of the power supply failure to meet the energy demand. e LPSP value must be less than 5% based on the literature.
In this work, the reliability evaluations are carried out in the worst conditions, when P load (t) > P generate (t).   In addition, the following constraints for the number of renewable energy generators (PV panels and WT), DG, and the autonomy days should also be satisfied: where (i) N pv and N WT are the number of PVs and WTs, respectively (ii) N AD and N DG are the number of DGs and autonomy days (AD), respectively (iii) N PV max and N WT max are the maximum number of PVs and WTs, respectively (iv) N AD max and N DG max are the maximum number of ADs and DGs, respectively

PSO Algorithm.
In the past few years, a large number of PSO-based approaches have been proposed for optimal sizing of the A-HMG system. PSO algorithm was developed by Eberhart and Kennedy in 1995 for hard optimization Computational Intelligence and Neuroscience problems. e searching strategy of PSO algorithm is inspired by the social behaviors of birds flocking or fish schooling, where each particle of the swarm acts as a potential solution of certain optimization problem [3]. PSO algorithm is employed to intelligently select optimal parameters from N particles. e initialization matrix contains N particles dispersed in a search space of D-dimension.
At the k th iteration in the searching process, the i th particle stores its historical best position P best as represented by (p best (k) � (p i1 (k), p i2 (k), . . ., p iD (k)), and its global best particle P gbest as denoted by (p gbest (k) � (p gbest1 (k), p gbest2 (k), . . ., p gbestD (k)). e process of displacement of each particle is managed by three rules [33,34]: (1) e particle tends to take the direction of its current velocity (2) e particle tends to move toward its best position (3) e particle tends to move to the best position reached by its neighbors In fact, the position of the particle i will be updated to reach the global optimum based on the corresponding velocity vector. Furthermore, the velocity and the position vectors of the particle i at the iteration k will be updated as follows: where (i) k denotes the number of the current iteration (ii) w denotes the inertia weight (iii) c 1 and c 2 are called the acceleration coefficients, respectively, cognitive and social parameters (iv) r 1 and r 2 are two uniformly distributed random numbers in the interval [0, 1] [2] A variety of approaches has been proposed to improve the capability of the traditional PSO algorithm [35].
Shi et al. [36,37] introduced PSO with linearly decreased inertia weight w on iteration generations; the inertia weight of the current iteration w is given as following equation: where (i) w in and w fi denote, respectively, the initial value and the final value of the inertia weight (ii) it is the number of current iteration (iii) it max denotes the number of maximum iteration Overall, a larger inertia weight would make the PSO tend to the global exploration and, otherwise, a smaller one could achieve the local exploitation.
Hence, the initial and final values w 1 and w 2 are generally set as 0.9 and 0.4, respectively. Additionally, PSO with time-varying acceleration coefficients have been introduced in [2,38] as calculated by the following equations: where (i) c 1i and c 2i are the initial values of the acceleration coefficients c 1 and c 2 (ii) c 1f and c 2f are the final values of the acceleration coefficients e improvement strategies of the traditional PSO mentioned above are principally concerning the parameter studies.

MDPSO Algorithm.
In 2017, Song et al. developed a MDPSO algorithm for the global smooth path planning for mobile robots [2]. e principal novelty of the MDPSO algorithm as a new PSO algorithm is that it integrates two delayed terms in the traditional velocity. e updating terms are the local and global delayed best particles selected from the corresponding values in the previous iterations stochastically and are added into the velocity updating model according to the evaluated evolutionary state. e advantage of this method is to reduce the convergence speed of the traditional PSO algorithm and to decrease the probability of converging to local minimum [2]. e following equations calculate the updating equations for the velocity and the position of the novel MDPSO algorithm.
where (i) w is the inertia weight (ii) c 1 and c 2 are the coefficients for acceleration updated and c 3 and c 4 are equal to c 1 and c 2 , where, c 1 � c 3 and c 2 � c 4 , respectively (iii) r 1 , r 2 , r 3 , r 4 are the random uniformly distributed numbers in [0, 1] (iv) τ i (k) and τ g (k) are the random delays uniformly distributed in [0, k] for the local and the global delayed best particle, respectively (v) S i (k) and S g (k) are the intensity factor of the newly added terms in the velocity updating model depending on the evolutionary factor e newly added terms in the velocity updating model are closely related to the evolutionary factor (EF) defined in [39] to describe the swarm distribution properties. According to the EF in the searching process, the four states are denoted as follows: ξ(k) � 1 is the exploration state, ξ(k) � 2 is the exploitation state, ξ(k) � 3 is the convergence state, and ξ(k) � 4 the jumping out state, respectively. e mean distance between the particle i and the other particles in the swarm denoted as d i could be calculated by where (i) D is the particle dimension (ii) S is the swarm size erefore, the evolutionary factor (EF) is given by the following equation: where (i) di gbest denotes the mean distance between the global best particle and the other particles in the swarm (ii) di min denotes the minimum and the maximum of d i in the swarm (iii) di max denotes the maximum of d i in the swarm e evolutionary state is classified confer to the evolutionary factor by a series of fuzzy functions in [40]. Additionally, in [35,41] equal division strategy is used for the evolutionary state classification for the state prediction depending on a Markov chain. e formulation of evolutionary used in this paper is expressed as follows [13]: Many strategies are used for the evolutionary states and the main idea of these strategies is to adjust the velocity updating model in an adaptive mode confer to the evaluated evolutionary state. In this work, a novel strategy with multimodal delayed information [2] is used to adaptively adjust the velocity updating model and expressed as follows: (i) State 1: e particles in the swarm are expected to fly into the region around the global optimum as soon as possible. erefore, only the normal terms in the velocity updating model remained and the delayed information is ignored (m i (k) � 0 and m g (k) � 0). is state is the convergence state, where ξ(k) � 1. (ii) State 2: e particles in the swarm are willing to exploit the region around the local best particles. So, the local delayed information is added into the velocity updating model; that is, only the local best particles in the previous iterations are randomly selected for the velocity updating with the intensity factor m i (k) � EF (k)). is state is the exploitation state, where ξ(k) � 2. (iii) State 3: In this state the global delayed information is added to explore the whole search space in a more thorough way, that is, the global best particles in the previous iterations are randomly selected for the velocity updating with the intensity factor m g (k) � EF(k) because it is important to search the optima as many as possible. is state is the exploration state where ξ(k) � 3. (iv) State 4: e local best particles are eager to jump out from the region around the local optima. us, it is necessary to provide more power for these particles to escape from this region, so that both of the local and global delayed information are used for this purpose with the intensity factor m i (k) � EF(k) and m g (k) � EF(k), respectively. is state is the state of jumping out, where ξ(k) � 4. e above discussed states for multimodal delayed information can be summarized in Table 2 as follows.where (i) m i (k) and m g (k) denote the intensity factor determined by the evolutionary state and evolutionary factor EF(k) in each iteration e MDPSO algorithm flowchart is depicted in Figure 8.

MDPSO Parameters Configuration.
e parameters configuration play a crucial role in manipulating the convergence speed of MDPSO algorithm. erefore, there are many scientific researchers [2,17,[42][43][44] to improve the PSO algorithm performances because these parameters should be selected carefully.  Figure 8: Flowchart of the proposed MDPSO algorithm.
Inertia weight [17] w in � 0.9 w fi � 0.4   In Table 3, the parameters of the inertia weight and the acceleration coefficients are given by (20)- (22).

Results
Analysis. In this section, the simulation results are presented.
e SEMS for an A-HMG system is performed to fulfill the energy demand of a fishing village that is located in the coastal city of Essaouira, Morocco. e MDPSO method is applied to obtain the best configuration of A-HMG system and for sizing the components. e LCOE, LPSP, and REF are defined as objective functions.
e studied system components are PV panels, WTs, battery storage bank, and DGs, as illustrated in Figure 1. e simulation conditions of the A-HMG optimization process over one year consider a community of 15 houses and the lifetime of the A-HMG has been chosen as 25 years. Table 4 gives the best-found solution. e obtained results in Table 4 show that we should install 15 units of PVs, 1 unit of WT, and 4 kW of DG. e minimum parameters come out to be 0.17 $/kWh for LCOE, 0.12% for LPSP, and 90% for REF. However, PV/WT/DG/ battery as A-HMG system is the best configuration found for the fishing village site that is located in the city of Essaouira, Morocco. e advantages of our system have more reliability and cost-effectiveness compared to those that use only one e convergence characteristics of MDPSO for the A-HMG are depicted in Figures 9-11 for the LCOE, the LPSP, and the REF, respectively. As seen in Figure 9, the value of the LCOE decreases during the iteration process and the same applies to the LPSP in Figure 10. Unlike the REF which increases as shown in Figure 11, we conclude that the MDPSO algorithm reduces the LCOE and the LPSP by moving toward the best system size. Moreover, any decline in the objective function leads to having more information about the optimal size. ese results will be confirmed through a sensitivity analysis to reveal the robustness of the optimization results.

Sensitivity Analysis.
e sensitivity analysis is fundamental because it gives a better understanding of the effects of varying the input parameters of the A-HMG system. e analysis has been extended to qualify and quantify the effect of parametric variation in the LCOE for the A-HMG system, which is computed by the MDPSO algorithm. In addition, the LCOE values become more significant and more sensitive to lower numbers of PV panels, WTs, and DGs, which indicates that any change in the component size can change LCOE. Figure 12 shows the impact of component resizing on the LCOE.
is shows that the LCOE savings of an A-HMG system can be enhanced with the integration of the additional number of green technologies but it increases with the integration of additional number of DGs. It is also important to note that the benefits of RE resources when compared with the brown technologies depend on the availability of the local RE resources, the capacity of the battery, and the level of RE technologies penetration.
In Figure 13, the effect of LCOE was analyzed due to the variation of the number of houses in the village. It can be observed from the graph that the number of houses in the village has a nonlinear effect on LCOE. Table 5 shows the comparison of LCOE with those available in literature. e achieved value of the LCOE index in this work is very interesting compared to   [3,39,40,[45][46][47][48]. So, few studies have considered more than two objective optimization problems considering the computational complexity that affects the convergence speed and the stability of the adopted algorithms. However, many research contributions have dealt with the technoeconomic analysis of the A-HMG system, while the optimal configuration and the LCOE index are not a standard value, which depends on several variables such as location, weather, and the applied optimization technique, the case of some studies in literature [39].

Comparison of LCOE Results with Similar HMG Analyses in the Literature.
Moreover, the present work uses a MDPSO algorithm that improves the traditional PSO algorithm's research strategy and decreases the probability of converging to local optimum.
us, the entire search space will be explored efficiently, contrary to other works in literature that used the conventional PSO algorithm for the optimization problem [48]. e MDPSO is a specific algorithm that gives to the user the ability to modify and add more sophisticated mathematical models for various RE technologies unlike the commercial software tools that restrict the user [46]. Finally, this paper does not used many numbers of scenarios that are required to achieve a good results, where the high number of scenarios makes the problem very large and time-consuming to solve [47].

Conclusions
In this paper, a smart energy management scheme (SEMS) with a multimodal delayed particle swarm optimization (MDPSO) is developed for performing the optimal sizing for the A-HMG system of a fishing village in the city of Essaouira, Morocco. e developed A-HMG system model contains PV panels, WTs, DGs, and battery storage systems. e levelized cost of energy (LCOE), the lowest loss of power supply probability (LPSP), and the maximum renewable factor (REF) are defined as objective functions. e results of the optimization in this location show that A-HMG system can be applied for this location with a high renewable factor. Moreover, the solution is very promising in terms of achieving values of the LCOE (0.17 $/kWh), LPSP (0.12%), and the REF (90%). erefore, using renewable energy can be considered as a good alternative to enhancing energy access in remote areas as the fishing village in the city of Essaouira, Morocco. e obtained results demonstrate a high efficiency of the successful application of the MDPSO for the proposed SEMS compared to several research contributions in the literature. e utilization of the proposed method can help to overcome some of the technical problems that still limit the distribution of A-HMG system projects in Morocco. Finally, sensitivity analysis is also carried out in order to verify the performance of the results.
Data Availability e typical years of solar radiation, wind speed, and ambient temperature time series are obtained using Meteonorm software.

Conflicts of Interest
e authors declare that they have no conflicts of interest.