Multi-Objective Optimization of Microgrids Based on Recent Metaheuristic Methods

As the technology develops in the modern world, the need for electrical energy has increased. Renewable energy sources have emerged as an alternative energy source to fossil energy sources. Micro grids are the hybrid energy sources for both renewable and non-renewable energy sources. The choice of the microgrid depends on meeting the supply and low cost requirements while avoiding environmental pollution. Therefore, emission, reliability and sizing of a micro grid have been investigated in the present study. In addition, Swallow Swarm Optimization (SSO) and Hybrid Particle Swallow Swarm Optimization (HPSSO) algorithms were not found in micro grid related optimization studies. Performance of SSO and HPSSO algorithms was also evaluated. Particle Swarm Optimization (PSO), SSO, and HPSSO were adjusted in this study as multi-objective optimization method for increasing the reliability, decreasing emission and sizing energy resources of a microgrid feeding a 10 MW residence. A microgrid consisting of 8 MW solar panel, 4,5 MW wind turbine, 15 MW diesel generator, and 4 MW battery has been taken into consideration. The efficiencies of these algorithms were compared for different iterations and populations. In this study, the best results were obtained with the SSO algorithm. Loss of power supply probability (LPSP) = 0, Renewable factor (RF) = 1, with this algorithm our micro-grid has achieved a safe energy and minimum emission to feed the residence. In addition, a system that connects and disconnects the energy resources in varying load conditions was actualized with the SSO algorithm. With this algorithm LPSP = 0, RF = 1, Psize = 0,001. Maximum reliability, zero emission and minimum sizing of the energy sources in our microgrid were achieved with loads of up to 50%. Moreover, LPSP = 0.39, RF = 0.086, Psize = 0,21 values were obtained for loads 50% and above and good results were obtained for reliability, emission and sizing of energy sources.


INTRODUCTION
In comparison with the traditional and centralized power generation systems, future generation systems are small-scale and non-centralized grids comprised of Renewable Energy Resources (RES). Moreover, power quality and operation stability may be affected adversely due to the intermittent and uncertain characteristics of RES. Distribution generation and microgrid technology provide a possible solution to balance RES [1]. The concept of microgrid has come to the forefront due to increased energy demand, the operation of the grid close to stability limits, costly transmission infrastructure and the increasing impact of Distributed Energy Resources (DER). Microgrids are small power distribution comprised of DER, battery storage systems and loads [2]. Microgrid provides a competitive contribution to market models and new technologies [3]. There is an increasing interest to microgrid in many countries due to its ability to meet user demands, its restructuring of the electrical industry as well as its advantages for transmission and distribution systems. Microgrids are operated in two modes: grid-connected and islanded. Under normal conditions, a microgrid is connected in parallel to the grid and operated as such. Some grid-connected systems comprise a backup system to be used when RES is not sufficient to feed the microgrid [4]. Optimization is the action of acquiring the best result under certain limitations and conditions. In practice, optimization is used to determine the minimum value of a function. Mathematical programming techniques are generally applied for determining the minimum value of the variables generally under certain limitations. The formula is given in Eq. x x X f X . .
Subject to the constraints: l j = 0, j = 1, 2, …, p where, f(X) is the objective function. X is an n-dimensional design vector. g j (x) and l j (x) are inequality and equality constraints. n is the number of variables while m represents the number of inequality constraints. There are many different optimization techniques available subject to the characteristics of the problem. There may be more than one solution for any design problem. Hence, an objective function should be selected for comparing the alternative acceptable solutions in order to select the best solution. The selection of the objective function depends on the problem. Some objectives conflict with each other. The structuring of the objective function makes up the most important decisions for the whole optimum design process. The objective functions can be examined under four categories: technical, economical, environmental, and socio-political [5]. Metaheuristic algorithms have displayed a promising performance for solving the non-linear and real-life optimization problems. All metaheuristic algorithms display a global search and random variation. These algorithms may provide a good solution for difficult optimization problems in a reasonable amount of time.
Metaheuristic algorithms are used effectively in many fields for global optimization [6]. PSO is a metaheuristic algorithm inspired by birds. PSO starts a population of particles that registers solutions and looks for the next best solution. PSO explores the variable area depending on the fitness function of the best solution [7]. Characterized by a position vector and a velocity vector in the optimization process, each particle benefits from its own search trajectory and the historical experience of its neighbor. Since PSO can be applied easily in practice, it has been used in the solution of real-world optimization problems [8]. Neshat et al. proposed the SSO algorithm, which is an optimization technique based on herd intelligence. Swallows have high intelligence at very high speed. These birds communicate by making different sounds in different situations [9]. SSO algorithm has been used in many applications, inspired by the intelligent social life relationship of swallows such as high-speed flight, hunting skills and migration of large groups [10]. The HPSSO algorithm was created by including the most important features of SSO in the PSO formulation. The HPSSO algorithm has a mechanism that allows them to learn not only the most experienced particles, but also promising particles [11].
Azaza and Wallin investigated the potential in different Swedish cities for an independent hybrid microgrid investment. The multiobjective PSO has been used to find the optimal sizing for each location.The results showed that the hybrid microgrid has significant potential in Sweden [12]. Bukar et al. used Grasshopper optimization algorithm (GOA), PSO, cuckoo search optimization algorithm to size the microgrid in the Yobe State of Nigeria. The simulation results showed that GOA has the most appropriate size compared to other algorithms and the system cost is reduced by 14% [13]. Kerdphol et al. sized the battery to avoid micro grid instability and system crash after power failure. They proposed an optimum battery size using frequency control based on the PSO method. They conclude that this method can significantly increase the stability of the power system, network security and planning flexibility [14]. Trivedi et al used Whale Optimization algorithm (WOA), Ant Colony Optimization, Gradient Method and PSO to minimize the fuel cost and emission of the microgrid. Compared to other algorithms, WOA achieved the lowest cost [15]. Wang et al. created a moth flame optimization model to obtain the minimum operating cost of the microgrid. The results showed that the optimization model can reduce the cost effectively [16]. Javid et al. used the Hybrid Optimization Model for Electric Renewables method to reduce the cost and emission of the microgrid. The results showed that the proposed model reduced the cost and emission of the microgrid [17]. Bouzıdı and Rıffı benefited from SSO to solve the famous problem of the traveling salesman. The experimental results on the selected samples showed that SSO is more effective when compared to other metaheuristic methods [18]. In Revathi and Krishmoorthy Soft computing, they used PSO, artificial fish swarm optimizastion and SSO algorithms. The SSO algorithm has proven to have a faster convergence rate with a lower number of iterations [19]. Neshat et al. benefited from the PSO, Artifical Fish Swarm Optimization and SSO algorithm for the simultaneous calculation of multimodal functions. The SSO algorithm has been tested with the benchmark function 19. The SSO algorithm has optimized the problem better than other optimization methods [20]. Kaveh et al. tested the SSO and HPSSO algorithms by solving eleven mathematical optimization problems and six truss weight minimization problems. The numerical results prove that the HPSSO algorithm performs better than the standard PSO and PSO enhanced versions. The HPSSO algorithm also provided a good balance between global and local search [11]. C. Sam. and Ali used the PSO and HPSSO algorithm to estimate the location and depth of a crack in the krish structure. The HPSSO algorithm has shown very good accuracy in the crack definition with less calculation effort [21]. Kaveh et al. proposed the PSO, SSO and HPSSO algorithm for optimization of highly nonlinear dynamic truss shape and size optimization with multiple natural frequency. The HPSSO algorithm displayed a higher performance compared to other optimization techniques [22].
The operation of the microgrid at maximum performance is not a single purpose. The efficient operation of the microgrid depends on many reasons such as being able to meet the energy demand, being a clean energy and having minimum sizing. If these goals are optimized, the performance of the micro-grid increases and its cost decreases. In this study, emission, sizing and reliability of the microgrid have been optimized with the help of PSO, SSO and HPSSO algorithms.
SSO and HPSSO algorithms have been applied in different fields of science and successful results have been obtained. However, these optimization methods have never been used before to optimize the micro grid. Therefore, a study has been conducted on SSO and HPSSO in order to add innovation to science. Simulation results showed that SSO and HPSSO algorithms are suitable for microgrid. Contrary to majority of the studies in which HPSSO algorithm displayed a better performance, SSO delivered a better performance in this study.
The aim of this study was to increase the reliability of the micro grid and to minimize emission and sizing. For this purpose, PSO, SSO and HPSSO algorithms were used. The PSO algorithm has been used in many scientific studies to optimize the microgrid and successful results have been obtained. This algorithm is used to compare the new optimization methods of the SSO and HPSSO algorithms. If successful results are obtained with the SSO and HPSSO algorithms, it can be applied to different studies related to micro grid. Optimization can be improved or the objectives in the microgrid can be changed if poor results are achieved. In addition, these optimization techniques can contribute to different areas of science.
All optimization methods used in the study were compared via tables and graphs. The study was organized as follows: the Sect. 2 covers the theoretical background, Sect. 3 describes the suggested method, Sect. 4 presents the optimization results and Sect. 5 presents the results.

THEORETICAL BACKGROUND
Engineering design problems generally contain complex objective functions with a large number of decision variables. A long period of time is required for solving engineering design problems via traditional search methods. Even though these methods yield promising results for many problems, they may fail in more complex design problems. There may be a large number of decision variables in actual design problems and their impacts on the objective function may be too complex. More efficient optimization methods are needed in such cases. Metaheuristic algorithms displayed a promising performance for the solution of non-linear real-world optimization problems. All metaheuristic algorithms use a certain random change and perform a global search. These algorithms may provide optimal or near-optimal good solutions for difficult optimization problems in a reasonable time [23].
There are many reasons for the popularity and success of metaheuristics. These algorithms were developed by imitating the most successful biological, physical, and chemical processes in real life. The best performance of metaheuristics in nature is based on how well they imitate the best characteristic of nature. It is a common criterion that the best remains alive. The current best solution is updated over and over again. Moreover, certain elitism is required. This should indicate that the best or the most proper solutions are not lost and are passed down to posterity [24].
Even though metaheuristic algorithms try to reach their goals subject to their paradigms and philosophies, some of these are specialized for certain cases. This has increased the need for hybrid metaheuristics. Hybrid metaheuristics is an algorithm that does not follow a single traditional metaheuristic concept. Moreover, it combines various algorithmic ideas outside the field of metaheuristic. The hybridization of different algorithmic concepts generally displays a better performance by combining the advantages of different algorithms [25].
The common properties of almost all metaheuristic algorithms can be stated as follows: they get inspiration from nature, they use random variables, they do not require significant gradient knowledge and the problem has several parameters. Metaheuristic algorithms have many advantages with regard to robustness and performance for noise environments. High performance metaheuristics are required for overcoming certain optimization problems. These are some of the metaheuristic algorithms: Genetic algorithm, PSO, differential evolution, artificial bee colony algorithm, SSO, HPSSO, cuckoo algorithm, ant colony optimization, simulated annealing, artificial immune systems, and tabu search [27].

Particle Swarm Optimization
PSO is an optimization method with inspiration from nature and has been introduced by Kneddy and Eberhart. The PSO algorithm that imitates the social behaviours of bird and fish swarms cooperates and interacts to search for a solution in the problem space. All particles in PSO continue learning from the best personal experiences p best and the best global solution of the swarm (g gest ) [27].
PSO is a stochastic algorithm and does not require gradient knowledge for its objective function. The PSO method may provide high quality solutions at shorter calculation times in comparison with other stochastic methods [28]. When compared with other evolutionary algorithms, PSO does not have many parameters. PSO has a concise framework that can easily be implemented [29].
The particles in the algorithm initially start a search space with the following characteristics: (i) position and velocity (ii) objective function of these positions (iii) neighbouring information: the best position and objective function value (iiii) storage of the best position found. The stopping criteria are determined by two conditions: stopping at a predetermined number of repetitions or when it is not possible to make any improvement [31].
ω denotes the inertia weight, while r 1 and r 2 is the vector of random values between 0 and 1, c 1 and c 2 are cognitive and social components, p best is the best position of the particle g best , is the best position of the swarm, v is the particle velocity, x is the particle position. The particle velocity is calculated via Eq. (4) and the particle position is calculated via Eq. (5) [31].
The starting population is started randomly as seen in the flowchart shown in Fig. 1. The fitness values of all particles in the population are calculated. If the value of e i is greater than p best , it is equal to p best , while the value of e i particle is equal to itself if its value is not greater than p best . If the value of e i particle is greater than g best , it is equal to gbest, while e i is equal to itself if its value is not greater than g best . The velocity and position values of all particles in the population are calculated. If the criterion is met, the iteration is stopped and if the criterion is not met, the iteration returns to the beginning and the fitness value of the particles is calculated.

Swallow Swarm Optimization
Neshat et al. proposed SSO based on the collective movement of swallows [18]. Each colony is divided into sub-colonies with neighbouring positions in a region. Each colony generally has an experienced leader. If the suitability of the group for leadership decreases for some reason, another bird with higher suitability takes its place. Swallows always follow the leader on the condition that it has the required abilities. There are two types of leaders: first is the local leader that manages the internal colony and points out a local solution. The second is the head leader which is the particle that is responsible from the leadership of the whole colony and points at the best solution point [20]. The explorer particle is responsible from searching the problem space. This search behaviour takes place under the impact of a series of parameters [32].  Position of the local leaders.  Position of the global leaders.  Best individual experience along the path.  Previous path.
Each particle has a personal feature. However, their common feature is having a flying central colony. Every particle examines the environment with an adaptive radius and displays smart behaviours. The states of the neighbouring particles are accepted as global leader and local leader. These particles move parallel to each other and they always interact. Actual borders between the subcolonies are never marked since swallows move at very high velocities and dynamics. Advantages of the SSO algorithm can be listed as below [33]:  Move faster on flat surfaces.  Display smart contribution in different groups.  Have high convergence rates.  Acquire local extremum points.
Eq. (8) is used to calculate the leader velocity, Eq. (11) is used to calculate the velocity of the lead leader, Eq. (12) is used to calculate the particle velocity and Eq. (13) is used to calculate the position of the particle [20]. 1 HL i V  is the head leader velocity, α HL is the acceleration coefficient of the head leader, rand 0 -1 is a random number, e best is the best value for the explorer particle, e i is the explorer particle and β HL is the acceleration coefficient for the head leader, HL i is the head leader and LL i V is the velocity of the local leader, V i+1 is the velocity of the explorer particle, e i+1 is the explorer particle.

Figure 2 SSO flow diagram
The starting population is randomly generated as seen in the flowchart of Fig. 2. The fitness value of all individuals in the population is calculated. The particle with the smallest fitness value is determined as the aimless particle. Calculate α LL and β LL according to Eq. (6) and Eq. (7). Calculate the velocity of the local leader. Calculate α HL and β HL according to Eq. (9) and Eq. (10). Calculate the velocity of the head leader. Calculate the velocity and position of particles in the population. Calculate the aimless particles. If the aimless particle is greater than the head leader, the aimless particle is equal to the head leader, while the aimless particle is not greater than the head leader, the aimless particle is equal to itself. If the local leader is greater than the head leader, the local leader is equal to the head leader, while the local leader is equal to himself if the local leader is not greater than the head leader. If it meets the criteria, stop the iteration. If it does not meet the criteria, repeat the iteration.

Hybrid Particle Swallow Swarm Optimization
HPSSO algorithm is a hybrid algorithm comprised of PSO and SSO algorithms. HPSSO consists of explorer particle, aimless particle, and leaders. Explorer particle is the particle that carries out explorations in the design space. The aimless particle is the individual with the worst fitness value whereas leaders have the best fitness value in the colony. The initial population, velocity, and position are started randomly. The population velocity and position are updated until the iteration ends. When compared with PSO, it contains an additional term for explaining the contribution of the local leader [22]. Eq. (14) and Eq. (15) show the velocity and position formula respectively. Three possible options are taken into consideration in Eq. (16) for the objective particle. (i) only a random search is made as is the case in SSO. (ii) a local search is made in the neighboring of the local leaders. (iii) a dynamic search is made in the neighboring of global leaders. 1 1 1 k i X  is the updated position of the particle, k i X is the previous position of the particle, 1 k i V  is the updated velocity of the particle, is the weight of inertia that controls the impact o of previous velocity, while r 1 , r 2 , r 3 represent a random number in the interval (0, 1), c 1 , c 2 , c 3 is the learning factor,   k l i P is the local leader of the subcolony that the ith particle contains. rand (−1, 1) is a random number between 1 and −1. min s and max s are the lower and upper limits of the design variables. λ k is a parameter defined for creating an effective search interval for the local leader or global optimum. λ max and λ min are the first and last iteration values of the algorithm. In the present study, they were set as 0.01 and 0.001. Population update was as follows [11]. Fig. 3 shows the explanation for the flow diagram of the HPSSO algorithm.  Copying the head leader and the local leader from one belt to the next can be interpreted as an elite strategy.  Search carried out by the explorer particle for moving the population towards the best region of the design area.  A dynamic search by the aimless particle in the neighboring of the local leader and head leader.
The starting population is selected randomly, as can be seen from the flowchart in Fig. 3. The fitness value of each particle is calculated. Calculate the global leader, local leader and aimless particle. Calculate the velocity and position of the particles. Calculate the fitness value of the explorer particle. Update the aimless particles according to Eq. (16). Calculate the fitness value of the particles. If the criterion is met, stop the iteration. If the criteria are not met, repeat the iteration.

PROPOSED METHOD
In this study, the micro grid consists of 3 energy sources: diesel generator, wind turbine and solar panel. The nominal power of the diesel generator is 4 MW and it supplies the residences when the renewable energy source is insufficient. Renewable energy farm consists of wind turbine and solar panels. The nominal power of the wind turbine is 4.5 MW, the nominal wind speed is 13.5 m/s, the maximum wind speed is 15 m/s. The wind turbine is disabled when the wind speed reaches the maximum speed. However, it continues to operate when the wind speed is nominal. The area covered by solar panels is 80000 m 2 and their efficiency is 10%. The micro grid feeds 1000 residences. Daytime consumption is low in the residence, while evening consumption is high.
The aim of this study is to investigate the reliability, emission and sizing of the energy sources of the analyzed micro grid. The aims of the simulation are explained as below:  RF defines the energy amount by comparing RES with diesel generator. When the RF is 100%, it means that the demand is supplied completely by RES. RF provides information on the microgrid emission amount. The RF is calculated as given in Eq. (18) [34].
 Reliability is an important factor related with load demand and it is the system that has sufficient electrical energy for meeting the required load demand. LPSP is defined by hybrid RES as the possibility to actualize the load demand. LPSP interval is between 0 and 1. A value of 1 for LPSP means that the hybrid RES cannot meet the required load demand. A value of 0 for LPSP indicates that hybrid RES can meet the load demand. LPSP is calculated using Eq. (19) [35].
 Sizing of the distribution energy resources does not only decrease power losses but also provides an increase in reliability. Minimum sizing of DER provides a more efficient and reliable electrical network [36]. Sizing formula is given in Eq. (20) [30].
The constraints are given by the following equations: The aim of this study was to increase the reliability of the microgrid, decrease its emission and size the energy resources at a minimum. Objective function was put forth in Eq. (28) in accordance with these objectives. Here, ω 1 , ω 2 and ω 3 are the given coefficients and their sum should equal 1. The objective with greater importance should also have a higher coefficient. These values were selected as 0.6; 0.2 and 0.2 during simulations. Objective function formula is given in Eq. (28).

Comparing the Iterations of PSO, SSO and HPSSO
In this application, PSO, SSO and HPSSO algorithms are compared in terms of different iterations. The effect of different number of iterations on the efficiency of the algorithms was investigated. The size of the population was selected as 100 in the algorithms. Microgrid consists of P PV = 8000 kW, P WT = 4500 kW and P D = 15000 kW. This microgrid feeds of P residence = 10000 kW. In PSO algorithm for n iteration = 800 value, the best results of LPSP = 0.1392, RF = 0.9252 and Psize = 0.11 were obtained. As the LPSP value approaches zero, reliability increases. The RF value indicates the extent to which it benefits from RES. For n iteration = 400, PSO algorithm fed the network from the RES in 92,52%. As it is seen in Tab. 1 of PSO algorithm, as the number of iterations increased, reliability of the obtained microgrid increased and emission and sizing decreased. The increase in the number of iterations for the PSO algorithm led to better optimum results of the algorithm. In SSO algorithm, LPSP = 0, RF = 1 for all iterations. The reliability of the microgrid obtained for all iterations in the SSO algorithm is maximum, emission and sizing is minimum. In this algorithm, aimless particles have obtained high efficiency because they search outside of local search. The explorer has carried out aimless particle searches at points where the particles cannot search. In the HPSSO algorithm, the efficiency of the algorithm decreased as the number of iterations increased. This algorithm obtained the best value with LPSP = 0.1528, RF = 0.9173 and P isize = 0,1 for n iteration = 100. The energy sources obtained with this algorithm are the cleanest. The PSO algorithm obtained P diesel = 2095 KW at 250th iteration and has the highest emission value of the microgrid. The HPSSO algorithm achieved better results in the PSO algorithm for different iteration values. The HPSSO algorithm obtained the highest diesel generator power of the microgrid obtained for n iteration = 400 and produced the highest emission value.

Population Comparison for PSO, SSO and HPSSO
In this application PSO, SSO and HPSSO algorithms were examined in terms of different population size. The algorithms were applied for the values of n iteration = 400, P PV = 8000 kW, P WT = 4500 kW and P D = 15000 kW. The population size influenced the efficiency of each algorithm differently. When the PSO algorithm population size is selected as small, exploratory particles in this algorithm failed to perform sufficient searches. As a result, İt was unable to achieve adequate improvement.
In this algorithm, LPSP = 0.1212, RF = 0.9355 and P size = 0.15 were the best values for n population = 60. The microgrid obtained by the SSO algorithm for all population values has maximum reliability and minimum emission values. Maximum efficiency has been obtained by this algorithm compared to other algorithms. This algorithm obtained LPSP = 0 and RF = 1 for all population sizes. The HPSSO algorithm sticked around the local solutions as the population size grew and resulted in poor results. The best value of this algorithm obtained LPSP = 0.3238, RF = 0.8068 and P size = 0 for n population = 20. Fig. 5 shows the power values of the algorithms for different population sizes. As shown in Tab. 4, if the size of the population decreases in the PSO algorithm, the emission value of the obtained micro grid is increased and its reliability is decreased. When the population size of the SSO algorithm is increased, the micro-grid utilizes from the solar energy more than the wind energy. As seen in Tab. 3, HPSSO algorithm has the highest emission and lowest reliability value for the microgrid P diesel = 3136 kW for n population = 60. PSO algorithm gives better results than HPSSO algorithm.

Variable Load Analysis for the SSO Algorithm with the Best Results
The reliability, emission and sizing of the microgrid at 25%, 50%, 75% and 100% load were examined in this application. For this purpose, the SSO algorithm was used which yielded the best results in previous applications. Fig.  6 shows the power values for different load values. The data for the application are provided below. n iteration = 400 P residence load = 10000 kW P solar power plant = 5000 kW P wind turbine = 2000 kW P diesel generator = 4000 kW    0 -25%load  1771  690  0  26 -50% load  3000  2000  0  51 -75% load  5000  2000  500  76 -100% load  5000  2000  955 Tab. 6 shows that the solar power generator and the wind turbine supply sufficient energy to the residence at loads of 25% and 50% and the diesel generator is not used. For these loads, LPSP = 0 meaning that reliability is at the maximum level. Moreover, emission is zero and sizing is at a minimum. As can be seen in Tab. 5, reliable energy was obtained with the SSO algorithm at loads of 75%, 100%. In addition, the energy sources obtained with this algorithm produced minimum results for emission and sizing.

CONCLUSIONS
In the scientific studies conducted with microgrid, no research has been found about SSO and HPSSO. Therefore, the effect of these algorithms on the microgrid is investigated. Possible scenarios were developed with PSO, SSO, and HPSSO algorithm under different iteration values, different population sizes, and varying load conditions in order to improve the analysed microgrid. Simulation results showed that SSO algorithm achieved better results than other optimization methods. This algorithm obtained LPSP = 0 and RF = 1 values for all population and iteration values. This algorithm has achieved better optimum values and high convergence rate. When the SSO algorithm is analysed with different iteration and population values, the reliability of the obtained microgrid is maximum and emission is minimum. In addition, the performance of SSO algorithm over 50% load and over 50% load was examined. The energy sources obtained with this algorithm have achieved minimum emissions up to 50% load, maximum reliability and good results above 50% load. PSO algorithm had better results than HPSSO algorithm. In studies conducted in the literature, HPSSO algorithm has obtained better results than PSO and SSO. However, SSO algorithm performed better in this study. The performance of these algorithms may change if the micro grid is examined from a different perspective. SSO algorithm cannot be claimed to be the best optimization technique. But it has achieved good values.
The SSO algorithm can be applied to many engineering problems. The emission amount, sizing and reliability of the sources can be calculated with the proposed algorithm before the microgrid installation is realized. As a result, the cost of the microgrid is reduced and its performance increases.

V i+1
Velocity of the explorer particle 1 k i X  Updated position of the particle k i X Previous position of the particle 1 k i V  Updated velocity o of the particle r 1 , r 2 , r 3 Represent a random number in the interval (0, 1) c 1 , c 2 , c 3 Learning factor k l i P Local leader of the sub-colony that the ith particle contains rand (−1,1)