Review on the cost optimization of microgrids via particle swarm optimization

Economic analysis is an important tool in evaluating the performances of microgrid (MG) operations and sizing. Optimization techniques are required for operating and sizing an MG as economically as possible. Various optimization approaches are applied to MGs, which include classic and artificial intelligence techniques. Particle swarm optimization (PSO) is one of the most frequently used methods for cost optimization due to its high performance and flexibility. PSO has various versions and can be combined with other intelligent methods to realize improved performance optimization. This paper reviews the cost minimization performances of various economic models that are based on PSO with regard to MG operations and sizing. First, PSO is described, and its performance is analyzed. Second, various objective functions, constraints and cost functions that are used in MG optimizations are presented. Then, various applications of PSO for MG sizing and operations are reviewed. Additionally, optimal operation costs that are related to the energy management strategy, unit commitment, economic dispatch and optimal power flow are investigated.


Microgrid description
Microgrids (MGs) have provided substantial motivation for the development of a smarter, more resilient and cost-effective approach for producing energy. MGs are mainly constructed from renewable energy sources (RESs) by focusing on the independence of local energy supplies, as illustrated in Fig. 1. Distributed energy resources (DERs), which are also known as distributed generation (DG), can be combinations of conventional energy sources, such as diesel units (DUs) and combustion gas turbines, and RESs, such as wind turbines (WTs) and photovoltaics (PVs). The integration of groups of DERs and energy storage systems (ESSs) such as batteries, capacitors, hydrogen, and flywheels, with loads that are interconnected by a local electric power distribution system, is called an MG [1][2][3]. Hybrid renewable energy systems (HRESs) consist of a group of two or more RESs and conventional energy sources and are often referred to as MGs [4][5][6].
An MG, DER or HRES can take the form of an AC, DC or hybrid AC-DC network depending on the generation sources or load connections. The characteristics of AC, DC and hybrid AC-DC networks are compared in [7,8]. Furthermore, various ESS technologies and MG control types are presented in [7]. The authors in [9] have classified MGs in four scales, as listed in Table 1.
An MG encourages the integration of RESs to realize the objective of sustainable development. This improves the reliability, efficiency, and security of power supply systems. An MG can connect to the grid (in grid-connected mode) or operate independently without a grid connection (as an islanded grid, off-grid, standalone grid, or autonomous grid).
The main economic issue for MGs is the efficient utilization of renewable and conventional energy sources. The energy cost is minimized by tuning the size and operations of MGs [1,[10][11][12]. The authors in [10] provide an approach for realizing an optimal operation and sizing 1 3 of an MG that guarantees the minimum energy cost. In [11], the authors demonstrate the influence of the size on the operational cost. Small sources and storage may not provide economic benefits, flexibility or reliability in an MG. However, large sources and storage require higher investment and incur higher maintenance costs [12]. Thus, it is highly important to know how the MG operates when sizing the system. The optimal size is found when the energy cost is minimized and may be subject to technical and environmental constraints. Furthermore, the minimum energy cost is made possible by energy management strategy (EMS), unit commitment (UC), economic dispatch (ED) and optimal power flow (OPF), which are parts of an optimal operation strategy. The uncertainties of renewable energy sources may affect the cost-benefits of MGs. Thus, it is difficult for grid operators to control and manage these energy sources. Renewable power forecasting is an important task for the grid operator for enhancing the effectiveness of the grid operation. Furthermore, renewable power forecasting has attracted attention from academic research communities [13] since it can play an important role in identifying the optimal operation [14].

Optimization techniques
Without optimization techniques, the cost-benefit of an MG may not be justified. Optimization aims at identifying the best alternative from a set of specified solutions that are the most cost-effective or have the highest realizable performance under the specified constraints. Many approaches are available for addressing optimization problems when classic optimization techniques are unable to find an optimal solution. Artificial intelligence (AI) is a promising method for cost optimization. The main advantage of AI is the ability to combine more than one method: first, in finding the best primary solution and subsequently, finding a better solution. Table 2 lists various optimization techniques that are used to identify the most feasible solution to the problem of cost minimization in MGs [15][16][17].   Various optimization techniques, such as PSO for MG sizing, are applied in [18]. The authors discuss the convergence speeds of and the quality of the solutions that are derived by various methods. Another application of optimization techniques is presented in [19], namely, finding the optimal parameters of the Weillbul distribution for wind turbine projects in Brazil. In this study, the authors compare the performances of heuristic algorithms with deterministic numerical methods.
A review of various optimization techniques and sizing methods of MG systems is presented in [20]. This paper presents a comprehensive study on finding the best compromise between the MG cost and the system reliability. In another review [6], the authors discuss sizing methodologies for both isolated and grid-connected MGs. Sizing criteria that are related to the operating costs, reliability and loads are investigated. Reference [21] reviews sizing strategies that are based on optimization techniques. It also presents a cost analysis and a reliability index that are used in MG sizing. In [22], the authors focus on optimization techniques for optimal MG sizing. In addition, optimization techniques and computer tools for MG sizing are analyzed. The authors in [23] present an overview of the optimization techniques for MG sizing, placement and design, in which they highlight the successful application of PSO, whereas the authors in [24] focus on optimization techniques and tools that are used for optimal operation and deployment of MGs. In this review, many objective functions are presented for various types of operations and renewable energy sources. The authors in [25] discuss the application of optimization techniques for finding the optimal sizes and operation schedules of MGs. This review focuses on the ED problem for investigating operation scheduling.
Various reviews have been conducted on optimization techniques for MG sizing in the aforementioned studies; only a few reviews examine the optimization techniques for MG sizing, including the optimal operation of MGs. In addition, the optimization techniques are discussed with little detail. No analysis of the efficiency, robustness, or flexibility of the algorithms is provided. However, an optimization technique is required for MG sizing and operations and for enhancing the reliability, environmental effects, and component lifetime.
In this paper, we consider the PSO algorithm and its application to MG optimization. Additionally, we explain how the performance analysis and the selection of parameters and stopping criteria of the PSO algorithm are conducted. To the best of the authors' knowledge, this is the first attempt to identify both the optimal operation and size of an MG via the PSO algorithm. We investigate various types of operations, such as EMS, UC, ED, and OPF. In addition, the cost optimization of the operations and size are outlined. We summarized various objective functions and constraints equations for MG optimization. We classify the cost function type, and linear, quadratic and cubic models, along with smooth and nonsmooth models, are discussed. The comprehensiveness of these models leads to as high of a performance in PSO implementation as any other algorithms.
The remainder of the paper is organized as follows: in Sect. 2, MG cost optimization is presented. Additionally, the versions and combination methods of PSO that are used for MG optimization are described. Section 3 describes the mathematical model for the cost analysis of the MG. Section 4 presents the cost-benefit that is related to the size of the MG. Finally, the cost-benefits that are related to the operations are presented in Sect. 5.

MG cost optimization
Optimization is the procedure of finding the minimum or maximum value of a function by choosing variables, subject to constraints. The optimization function is called the fitness or objective function and is typically calculated using simulation tools.
An optimization method is not always guaranteed to find an optimal solution. Sometimes, this can be unrealized due to the characteristics of the problem. The choice of an optimization technique depends on the type of the cost function to be solved. According to the authors in [26,27], some techniques are unable to deal with nonsmooth and nonconvex optimization. These techniques have difficulty handling inequality constraints.
PSO is a robust optimization technique and is applied in various applications of MGs. It can solve continuous and discrete optimization problems. In addition, it is simple to implement, flexible and computes quickly. PSO is the most frequently used method for MG optimization problems [23]; consequently, approximately 70 research papers that are based on PSO have been studied in this work.

• Classic version of PSO
PSO is based on a swarm (population) of N particles. These particles are randomly placed in the search space D. Each particle i of the swarm is defined by its position X ij = (X i1 , X i2 ,…, X iD ) and its velocity V ij = (V i1 , V i2 ,…, V iD ) in the search space D. Index i varies from 1 to N, and index j varies from 1 to D.
The particles move at each iteration by considering their best position and the best position of their neighborhood. The velocity and position equations are presented as follows: 1 3 where w is the inertia weight, c 1 and c 2 are the acceleration coefficients, and r 1 and r 2 are random numbers between 0 and 1. X k ij is the position of the ith particle in the jth dimension in the kth iteration. V k ij is the velocity of the ith particle in the jth dimension in the kth iteration. P best is the personal best position, and G best is the global best position. V can be limited to [− V max , V max ], where V max is the maximum velocity limit. X is limited to [X min , X max ], where X min and X max are the minimum and maximum particle position limits, respectively. k varies from 1 to Maxite, where Maxite is the total number of iterations. The procedure of PSO is illustrated in Fig. 2.
The choice of parameters and stopping criteria influences the performance of the PSO algorithm. If suitable parameters and stopping criteria are selected, the algorithm can provide a better result. • Parameter selection (1) The optimization parameters determine the performance of the algorithm in searching for the global optimum of a problem. The selection of these parameters is a crucial step in the optimization process. The analysis of each parameter selection is described as follows: -Number of particles (N): if the number of particles is small, it can influence the performance of PSO. If we increase the number of particles, we can decrease the number of iterations. Thus, the algorithm can still find an optimal solution. -Acceleration coefficients (c 1 and c 2 ): the acceleration coefficients c 1 and c 2 guide the particles to move toward P best and G best , respectively. Small values may limit the particle movements toward a satisfactory solution. However, a large value may lead the particles to move away from the solution. -Maximum velocity (V max ): the particle velocity is typically restricted within a specified range to prevent the particles from moving away from the search space. If V max is too small, the particles may only explore the local best, whereas if V max is too large, then the particles may pass over a satisfactory solution. -Inertia weight (w): the inertia weight balances the local and global explorations. A large inertia weight provides a strong global search, whereas a small inertia weight provides a strong local search. The value of the inertia weight can change during the optimization process. Therefore, self-adaptive approaches that modify the value of inertia weight during the search procedure are recommended in the literature.

• Stopping criterion
The stopping criterion is fundamental in PSO optimization because the algorithm must not terminate prior to reaching the global optimum. However, the algorithm must automatically terminate when the optimal solution is found to avoid wasting computational resources during the execution. Therefore, the choice of stopping criterion has a large influence on the duration of the optimization processes. Many stopping criteria are presented in the literature, such as a tolerance, the number of function evaluations, and the maximum number of iterations. • Binary version of PSO (BPSO) In the binary version of PSO, a particle represents the position in binary space and the particle's position vectors can take on a binary value 0 or 1. The same equation as that for the classic version of PSO is used to update the velocity. The equation for updating a particle position is: ij is a random number between 0 and 1, and s k ij is the sigmoid function.
These bounds correspond to the probabilities for the particle position x k ij to change to 0 and 1. The maximum velocity V max = 5 corresponds to a maximum probability for a particle to be 1. The minimum velocity V min = − 5 corresponds to a minimum probability for a particle to be 0. • Many versions of PSO have been introduced in [28,29] and are summarized as follows: - The evaluation of the performance of the algorithm is typically recommended for all optimization problems. We should be able to demonstrate that the selected algorithm provides a superior solution faster than other algorithms. Here, we provide insight into the performance analysis: • Effectiveness The effectiveness consists of the computational effort and the quality of the solution.
-Computational effort: the computational effort is the required time for the algorithm to converge to an optimal solution. The parameters that significantly influence the computational effort of PSO are the swarm size and the number of iterations. The computational effort can also refer to various terms such as the time for reaching the optimal solution, the time for computing each iteration, and the total running time (or the time for computing all iterations). -Quality of the solution: the quality of the solution refers to the closeness of the solution to the optimal solution. If the optimal solution is unknown, it is difficult to evaluate the quality of the solution. This is a common issue when dealing with optimization techniques. In this regard, comparison with a published solution or with a solution that was obtained via another technique is typically required.
• Robustness Robustness is an important criterion for evaluating the performance of an algorithm. It refers to the ability of an algorithm to reach an optimal solution for any instance of various test problems. A robust algorithm must also be relatively insensitive to the parameter values. When the parameters are selected, the measurement of the sensitivity to the small changes in the parameter values is useful for investigating the robustness. • Flexibility PSO is a flexible method that can solve all complex optimization problems. Many definitions are used to define flexibility. In our work, we define flexibility as the adaptiveness of the algorithm, as it can automatically adjust and adapt to consider the uncertainties and to generate the best possible solutions.
Implementation issues can influence the computational effort of the algorithm. Thus, the choices of programming language, libraries, and compiler play a significant role in enhancing the optimization performance, especially in terms of the computational effort. Moreover, the computer characteristics (such as the processor and RAM) and the operating system are important for performing a variety of tasks with high computational performance. The engineers must weigh various choices and identify the solutions that best satisfy the requirements. Furthermore, the engineers must identify the available resources to solve an optimization problem efficiently.

Offline and online optimizations
Offline and online optimizations are required for enhancing MG operations in terms of the power demand, renewable energy resources, and economic aspects.
since it determines the theoretical minimum realizable energy cost. • Online optimization (real-time optimization): the load profile, weather conditions, and fuel costs change over time. Real-time optimization is needed to identify the optimal solution regardless of the variation of these parameters. However, the implementation of online algorithms requires a performance computation tool for evaluating the problem in each time interval, especially when the time step is short.

Single-objective function
In single-objective-function optimization, a single-objective function is minimized or maximized. The following parts summarize the objective functions that are typically implemented in MG optimization: -Power generation [45,46] -Loadability [47] -Net present value [33]

Multi-objective function
When there is only one criterion to be optimized, an optimization problem is described as a single-objective-function optimization problem. In other cases, there are several criteria to be optimized simultaneously; such an optimization problem is described as a multi-objective optimization problem.
Multi-objective optimization (MOO) problems consist of several objectives that must be realized simultaneously. MOO is the process of finding a compromise among conflicting objective functions. Reference [24] summarizes various multi-objective optimizations that are applied in MG, which are listed in Table 3.

Equality constraint
• Power balance: the total power that is generated should match the load demand.
where P load is the load power, N is the total number of generating units, P i is the power output of the ith generating unit and t is the time.

Inequality constraints
• Rate power unit: the power output of each generating unit must be within its minimum (P min ) and maximum limits (P max ).
• Ramp rate power limit: these constraints determine the maximum variation of the power output for each unit [72].
where RU i is the ramp-up limit and RD i is the ramp-down limit of the ith unit. • Minimum uptime/maximum downtime: these constraints specify a minimum time for each unit to be maintained before it can change its status [72,73].
If the unit is turned on, there will be a minimum running time before it can be shut down: where T on t is the duration for which the unit is continuously ON, and MUT is the minimum uptime.
Once a unit has been shut down, it may not be turned back on immediately: where T off t is the duration for which the unit is continuously OFF, and MDT is the minimum downtime.
• Maximum start/stop limits: the maximum number of starts/stops should be included in the optimization process. This depends on the generation unit and the operator [74].
where S start/stop is the number of starts/stops during the simulation time, and N max is the maximum number of start/stop sequences.

Cost functions that are related to MG operations and sizing
In this section, cost functions that are related to operations and sizing are presented. Various cost definitions and equations were reported in a previous research paper [75]. Here, we summarize those that are most frequently used in the literature.
(a) Initial investment cost (IC): this consists of the initial costs for unit installation [76].
where C inv,i is the investment cost of the ith unit ($/ kW), and P i is the output power of the ith unit. (b) Replacement cost (RC): this cost is incurred since the lifespans of the units differ from the project duration [77,78].
SFF i is the sinking factor: where C rep,i is the replacement cost of the ith unit, r is the interest rate of the ith unit, and t is the lifetime of the ith unit. (c) Capital cost (CC): the capital cost for MG power generation and energy storage includes the cost of the equipment and the costs that are associated with its installation [78].
CRF i is the capital recovery factor of the ith unit, which is expressed as follows: where r is the interest rate and y is the lifetime of the system. (d) Levelized cost of electricity (LCOE): the LCOE is the total cost of the installation, replacement, fueling, and maintenance of an MG. It represents the price of electricity per kWh over the system's life. A low LCOE corresponds to a low electricity cost [44,77,79,80].
where E is the annual energy output of the system, MC is the maintenance cost, IC is the investment cost, RC is the replacement cost, and FC is the fuel cost. (e) Maintenance cost (MC): the MC is typically related directly to the power output. It is assumed to have a proportional relationship with the power that is produced [77,78].
where KOM i is the proportionality constant ($/kWh) of the ith unit, P i is the output power of the ith unit, and ΔT is the sampling time. (f) Emission reduction benefit (ERB): compared to traditional generators, renewable energy is clean and pollution-free, thereby reducing the cost of the system in terms of environmental protection throughout the life cycle [77].
where E out is the energy output of the unit, E buy is the purchased energy from the grid, C emis is the emission value of the ith type of greenhouse gas, and C env is the environmental cost of the ith type of greenhouse gas. (g) Start-up cost: the start-up cost of each unit depends on the duration for which the unit has been shut down and is expressed as follows [73]: where a i is the hot start-up cost of the ith unit, b i is the cold start-up cost, T off is the duration for which the ith unit has been continuously shut down, and T i is the cooling time of the ith unit. (h) Net present cost (NPC): NPC can be referred to as the life cycle cost. It is defined as the sum of the capital, maintenance, fuel and replacement costs [81,82].
where CC is the capital cost, RC is the investment cost, MC is the maintenance cost, and CRF is the capital recovery factor. (i) Fuel costs There are many characteristics of fuel cost functions, which can be represented as follows: Smooth cost functions can be represented as first-order equations (linear models), second-order equations (quadratic models), or third-order equations (cubic models). These cost functions are plotted in Fig. 3 and are formulated as follows [83,84]: -First-order function (linear model) -Second-order function (quadratic model) -Third-order function (cubic model) where a, b, c and d are the fuel cost coefficients and P i is the generated power of the ith unit.

Linear (1 st order) Quadratic (2 nd order) Cubic (3 rd order)
Fuel cost ($/hr) Output power (kW) In Fig. 4, a cost function with the valve point effect is plotted. In practical operations, steam turbines have many steam valves that control the power that is generated. The opening of these valves causes losses in the generation unit, thereby resulting in ripple effects on the input-output characteristic cost function. This feature makes the cost model nonsmooth. A sinusoidal function that represents the valve point effect is added to the quadratic cost function and is modeled as [84,85]: where e i and f i are coefficients that are related to valve points of the ith generation unit, and P min i is the minimum power limit of the ith generation unit.

• Nonconvex model
Optimization problems can be divided into two types according to the fuel cost function: convex and nonconvex problems. In a convex problem, the fuel cost function does not consider the valve point effect and is expressed as a quadratic function. The fuel cost function in a nonconvex problem considers the following elements: prohibited operating zones, valve-point loading effects, and combined valve-point loading effects and multi-fuel options [86][87][88][89][90][91][92].
The prohibited operating zones represent the limitations on the power output of the unit that are caused by vibrations in a shaft bearing or steam valve operation. Thus, operation is not allowed in such regions to avoid damage to the unit and to realize the most economical operation [91]. A cost function with prohibited operating zones is plotted in Fig. 5.
where j represents the number of prohibited operating zones of the ith unit, n i is the total number of prohibited operating zones of the ith generating unit, P u i,j−1 is the upper limit of the (j − 1)th prohibited operating zone of the ith unit, and P l i,j is the lower limit of the jth prohibited operating zone of the ith unit [88].
For a power plant with many generators and fuel types for each unit, the fuel cost function for fuel type j of the ith unit is plotted in Fig. 6 and is expressed as:

Implementation of PSO for cost minimization in MG sizing
Among the various factors that influence the behavior of an MG, optimal sizing is of particular interest in MG optimization for determining the minimum cost of the system. In an isolated MG, sizing is more difficult than in a grid-connected MG since it must operate continuously without any support from the main grid. Economic analysis methods for optimal sizing are proposed in [93,94]. Economic indices include Pi,min   Table 4.

Implementation of PSO for cost minimization in MG operations
Many challenges are encountered in operating an MG with high economic benefits. However, many research studies are being conducted to overcome these issues. Thus, it is necessary to have an overview of the MG operations. In this section, energy management optimization problems, including ED, UC, and OPF, are outlined.

Energy management
Depending on the study objectives, energy management problems can cover the MG's supply (energy generation) or demand (energy consumption) side, or the whole system. Various optimization strategies for energy management have been proposed in the literature. These optimization strategies are mostly focused on cost minimization, including maintenance, operating and fuel costs and energy purchases. The authors in [103] implement a PSO for real-time EMS in an MG. The simulation is updated every 3 min. The objective is to minimize the total energy cost of the system. The Levelized cost In [79], PSO seeks to determine the optimal size of an HRES that is composed of a WT, PV arrays and battery energy storage. The objectives are to minimize the system cost based on the levelized cost and to ensure the reliability of the system while satisfying technical constraints Net present value The objective of [95] is to optimize the size of the MG component to maximize the economic benefits, such as the net present value. The MG is composed of a WT, a PV and battery energy storage Systems costs: annualized cost of investments, replacement, and maintenance, and loss of load costs PSO is used to design a hybrid wind/PV/fuel cell system in [96]. The objectives are to find the lowest cost and to ensure the reliability of the system for a period of 20 years. The simulation is conducted over a year with a 1-h time step Net present costs (NPCs): capital, replacement and OM costs The authors in [82] apply PSO to find a suitable size that minimizes the net present costs of the system. The objective function includes all NPCs from fuel cells, WT, electrolyzers, reformers, anaerobic reactors, hydrogen tanks, and converters Cost of energy and total net present cost In [97], PSO is used to find the optimal size of a PV/diesel/biogas generator/biomass generator/ micro hydro generator/battery for 25 years of operation. The cost of energy is the key parameter to be minimized under specified reliability criteria (expected energy not supplied) and economic criteria (net present costs), renewable factor and emission of CO 2 . The objective is to find a suitable combination of a hybrid system that ensures the lowest cost of energy Maintenance costs, operating costs, investment costs, cost of purchasing power from the DG owner and cost of buying power from the substation In [76], the authors propose MOPSO for determining the optimal location, size, and electricity generation price of DG. The optimization objective is to maximize the benefit of DG while minimizing the cost to the distribution company Present value of the total profit, present value of the maintenance costs, capital costs.
In [98], the objective of the PSO is to identify optimal parameter values for PV module installation, including the number of PV modules, their tilt angles, the placement of the PV modules and the distribution of the PV modules among the DC/AC converters. The optimization aims at maximizing the net profit over the total operation lifetime System costs: investment, maintenance, fuel, and replacement costs Reference [99] introduces PSO for sizing the HRES. The strategy is to solve an MOO via the ɛ-constraint approach. The total system costs are represented as an objective function, and LOLP and CO 2 emissions are regarded as constraints. The objective is to minimize the system costs while minimizing the emissions and LOLP Benefit: cost of electricity and heat sales and cost benefit of load reduction The authors in [100] seek to determine the optimal types, sizes, and placement of DERs with the objective of maximizing the benefit-to-cost ratio of MG via the PSO technique. The MG system includes microturbines, DUs, and heat combustion turbines The costs include capital, replacement, operation, maintenance, and production costs for MG and DG.
The authors in [101] employ PSO to design an MG that includes various numbers of PVs, WTs, and batteries. The objective was to find the lowest cost of MG construction based on the pool and bilateral-hybrid electricity markets Depreciation cost of the battery Reference [102] presents an improved hybrid GA-PSO for the multi-objective optimization of the siting and sizing of an MG in consideration of an EV. The objective is to minimize the power losses, voltage fluctuation, EV charging demand, and battery depreciation cost authors have compared the performance of PSO with that of the sequential quadratic programming method. The MOPSO is applied in [104] to determine the optimal configuration and sizes of the MG components for ensuring the reliability and cost effectiveness of the system. The study seeks to minimize the cost of electricity and the loss of power supply probability.
Reference [105] employs PSO to minimize the total operating costs of an MG. The optimization considers the bids and market prices of power exchanges between the MG and the main grid.
PSO is developed for real-time multi-objective optimization in [106]. The process is updated every 30 s over a period of 24 h. The objective is to reduce the gas emissions and energy costs. The results demonstrate that the two objectives are in conflict (if the cost is low, the emissions are high, and vice versa). The simulation was conducted under two optimization techniques, namely, PSO and GA, using the MATLAB tool. The results demonstrate that PSO outperforms GA in terms of computation time.
In [107], the EMS is based on regrouping PSO (RegPSO) with the scheduling of the day ahead. The study is conducted under two scenarios of MG operation: isolated grid and gridconnected. The objective is to minimize the fuel and OM costs and the purchase cost from the utility while maximizing the profits from selling energy to the utility. The result demonstrates that RegPSO yields a better and faster solution than the GA-based approach.
A multi-objective PSO approach is presented for the system configuration and sizing of each location in [54]. The EMS defines the optimal operation of an MG with three conflicting objectives, such as reliability, operating cost and environmental impact.
The authors in [61] propose fuzzy self-adaptive PSO for minimizing the total operating cost and pollutant emissions. To evaluate the performance of the proposed method, they compare the results with those of classic PSO and GA under various scenarios of MG operation.
A real-time EMS that is based on binary PSO is proposed for both energy suppliers and users in [108]. The binary PSO defines the ON/OFF operation of home appliances to identify the lowest electricity tariff and to avoid a peak load.
Reference [109] develops an improved PSO (IPSO) algorithm for home energy management systems in a smart grid. The proposed algorithm minimizes electricity payments and peak loads.
In [110], PSO is applied to an HRES for electricity and water supply in a small village in Nigeria. The optimization aims at minimizing the energy cost of the system by saving on fuel costs. The study is conducted in two operating modes: using RES with diesel engines and using only RES.
EMS-based self-adaptive modified theta PSO is introduced in [111] for the minimization of the operating costs, including the fuel and start-up costs and the power exchange between the MG and the main grid. This study also examined a probabilistic framework that is based on the 2 m point estimate method, which depends on the uncertainty of the RES, the load forecast and the market characteristics.
The authors in [112] describe an EMS-based PSO with three objective functions: to minimize ESS operating costs; to maximize ESS efficiency; and to minimize the lifetime degradation of the ESS. The simulation was conducted for three cases according to each objective function. The simulations are compared by focusing on three criteria: operating costs, efficiency, and lifetime degradation.
Hybrid PSO and pattern search are applied to optimize the design and operation of an MG in [1]. To evaluate the performance of this method, four parameters are considered as key performance indicators (KPIs): cost, reliability, quality, and environmental impact. Each parameter is scaled from 1 to 10 based on the KPI grading. The cost function is comprised of capital, OM and generation costs. The objective is to find the minimum generation cost with the lowest total sum of the overall KPIs.
In [113], the authors use PSO to overcome a master-slave objective function, with the objective of determining the optimal type, size and operation of a smart MG. The master-slave function is based on net present value.
The combination of guaranteed-convergence PSO with Gaussian mutation (GPSO-GM) is reported in [114] for identifying the optimal size and operation of MG systems. The objective is to minimize the capital investment and generation costs. The role of Gaussian mutation and guaranteed convergence is to ensure the accuracy of the results.

Economic dispatch
ED determines the power output of each unit and uses it to find the lowest operating cost while satisfying equality and inequality constraints. ED problems are typically nonlinear. Since classical optimization techniques have difficultly addressing this problem, the application of the AI technique is inevitable. PSO is the most popular approach for solving ED problems due to its fast convergence.
The authors investigate the use of PSO to solve an ED for an MG in [115][116][117]. The optimization objective is to minimize the cost function while considering the fuel, operation and maintenance costs. The optimization problem is defined by a nonlinear function that includes equality and nonequality constraints.
The ED within an MG is solved in [118] using PSO to find the lowest operating cost and emission levels. The operating cost involves both the energy that is sold and the energy that is purchased from the utility.
The authors in [119] study the cost minimization of multiple MGs, including RESs. The modified ED is fixed by PSO. The combination of two or more MGs limits the use of conventional generation and offers substantial economic benefits from RESs. The optimization objective is to find the lowest operating cost using the optimal schedule of a generation unit. The simulation is conducted under two scenarios, namely, with and without multiple MGs, for comparison in terms of the cost effectiveness.
A PSO is reported in [120] for minimizing the cost of the power that is produced by multiple MGs in the interactions with the main grid. The objective function considers the power generation, operation and maintenance costs and the purchase and sale of energy. The study considers a stochastic and probabilistic model of RES and load data in the optimization process.
Reference [121] proposes a stochastic ED model that incorporates wind and pumped storage generators, in addition to the thermal generators. The objective of this paper is to address the proposed stochastic ED problem via the modified PSO method.

Unit commitment
The unit commitment (UC) determines the ON/OFF schedule of generating units in a time frame over a scheduling period. It is formulated as a nonlinear optimization problem with 0/1 variables that represent ON/OFF status. UC plays an important role in MG planning for cost minimization. Frequent start-ups and shut-downs have a negative influence on the lifetimes of components, thereby resulting in an increase of the MG operating costs. The committed units should satisfy the production and demand forecasts.
The authors in [122] focus on a probabilistic UC model for MG operation, which includes the uncertainties of RESs and electric vehicles. The PSO is used to maximize the profit of UC in an MG. The results demonstrate the effects of plug-in electric vehicles on MG operating costs, and the performances of the probabilistic and deterministic UCs are compared.
Reference [123] combines binary PSO with the Lagrange multiplier method to minimize the energy costs in UC with consideration of electric vehicles and vehicle-to-grid (V2G). The constraint of UC with V2G is considered in the optimization problem. A comparison is conducted between two cases of UC: with and without V2G.
A combination method of weighted improved crazy PSO with pseudo code is presented in [124] for solving a UC problem. The objective is to find a compromise between energy costs and gas emissions. Using a weighted sum method, the MOO is converted to a single-objective optimization to minimize the operating costs. The performance result of this proposed approach is compared with those of other PSO forms, such as classic PSO and weighted improved PSO. The use of this approach guarantees the optimal solution and fast convergence speed.
In [125], the UC is solved via quantum-inspired BPSO (QBPSO), and the primal-dual interior point method is used to solve ED problems. The objective is to find a trade-off between the operation costs and emissions. Satisfactory accuracy of the solution and satisfactory calculation speed have been realized using the proposed method. It is concluded that this method is suitable for solving large-scale wind energy generation problems.
Reference [126] analyzes the UC and ED problems of thermal generation units with RES. The unit start/stop selection is performed using a priority list (PL), and PSO determines the optimal power flow, which is used to minimize the fuel costs of thermal units. PL-PSO is compared with PL-GA and DP. PL-PSO is guaranteed to find the optimal solution in minimal computation time.
In [72], the UC of thermal-unit-integrated wind and solar power is solved via GA-operated PSO. The combination of GA with PSO ensures the speedy convergence of the optimization solution. The solution to the cost minimization problem is guaranteed with the proposed method, in contrast to GA, the integer coded genetic algorithm (ICGA), and the Lagrangian relaxation and genetic algorithm (LRGA).
The authors in [127] formulate the optimization problem in two stages: the first stage consists of UC and the second of OPF. The BPSO is applied to select an ON/OFF schedule for thermal units. The proposed technique aims at minimizing the energy cost and identifying a secure optimal UC schedule for thermal units with a solar power plant in gridconnected mode.
In [128], the hybrid differential evolution/evolutionary programming/PSO algorithm is proposed for solving the UC problem of wind and thermal generation to obtain the minimum energy cost. The study analyzes the day-ahead UC scheduling of thermal units via a stochastic approach for wind power generation. The results demonstrate that this approach is more robust than a deterministic approach.

Optimal power flow
The OPF determines the optimal operation of MG, especially for minimizing the operating cost. The optimization constraints may include voltage or power, or other variables that do not exceed the production capacity limits.
The OPF is typically a nonlinear and nonconvex optimization problem. The nonconvexity is due to the power flow and the quadratic equality constraints [129]. Thus, it is not easy to solve this problem. A nonlinear optimization technique is needed for solving a nonlinear problem. For a nonconvex problem, the relaxation method can be used to convert it to a convex problem. However, in some cases, the convex relaxation is not exact. The solution to the relaxed problem could differ from the solution to the original problem [130].
The authors in [131] introduce a discrete PSO, namely, jumping frog PSO (JFPSO), and OPF for overcoming the sitting and sizing problem of DG units. The study aims at minimizing the operating cost by considering various technical constraints, such as voltage limits, thermal limits on lines and transformers, operational and planning limits and a maximum level of penetration of DG. JFPSO is used to determine the locations of the DG units and OPF is used to optimize the capacity of the DG units.
In [132], PSO with a time-varying acceleration coefficient (PSO-TVAC) and backward forward sweep (BFS) is used to solve an online OPF by considering EV charging/discharging, load curtailment and grid exchange. The objective of the first strategy is to minimize the operating cost, and that of the second strategy is to maximize profits. These two strategies are compared in terms of the total cost benefit, which is calculated as the difference between revenue and expense.
PSO is applied in [133] to solve the OPF problem in multiple MGs. The study focuses on cost minimization by comparing the performance results between PSO and GA. The results demonstrate that PSO realizes the best convergence performance. Hence, PSO is more efficient for cost optimization in ED problems than GA.
Reference [134] uses PSO to solve the OPF problem of two MGs, which are each comprised of a controllable load, PV, WT, and BESS. The objectives are to reduce the costs and to shave peak loads of MG systems.

Conclusion
The MG is one of the fastest growing energy sectors, although the cost of the electricity that is generated by it remains high. Therefore, it is important to identify efficient sizing and operation methods to reduce the cost of the electricity. Additionally, due to environmental problems, we are forced to search for strategies that use combustible sources more efficiently. Furthermore, MGs have been demonstrated to be a powerful technology that makes cities and communities more sustainable and resilient. This paper summarizes research developments and the implementation of PSO algorithms in renewable energy systems. Since a general introduction to MGs has been provided, economic analysis is considered a key factor in this paper. This survey of an economic tool for MG operations and sizing can be useful for research on MGs and other power systems.
Throughout this review, comments provide a deeper understanding of cost analysis in MG optimization. Various types of cost functions that are used in MG optimization are presented. Cost minimization approaches have been outlined according to the supply or demand side, such as EMS, ED, UC, and ED. Thus, the features of sizing and operations for cost minimization are analyzed, and they include planning and scheduling problems, with the objective of minimizing the cost.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.