The Optimal Allocation of Distributed Generators Considering Fault Current and Levelized Cost of Energy Using the Particle Swarm Optimization Method

The power requirements of grids have risen as artificial intelligence and electric vehicle technologies have been used. Thus, the installation of distributed generators (DGs) has become an essential factor to streamline power grids. The objective of this study is to optimize the capacity and location of DGs. For this purpose, an objective function was defined, which takes into account the fault current and the levelized cost of energy, and a modified particle swarm optimization method was applied. Then, we analyzed a case of a single line-to-ground fault with a test feeder (i.e., the IEEE 30 bus system) with no DGs connected, as well as a case where the DGs are optimally connected. The effect of the optimally allocated DGs on the system was analyzed. We discuss an optimal layout method that takes the economic efficiency of the DG installation into account.


Introduction
Classical unsymmetrical fault analysis is based on node equations and sequence network and was presented by Kimbark in 1946 [1]. These methods were also presented by Anderson and Kundur [2,3]. Many modern fault analysis and control methods that are model or signal based [4] are presented by many researchers. The application of new technologies such as artificial intelligence and electrical vehicles has increased the burden of power grids. Modern distributed generators (DGs) have an ability to reduce the burden by injecting active power and reactive power based on power electronics [5].
Recently, fault diagnosis methods based on convolutional neural networks [6], Bayesian networks [7], and support vector machines [8] were also presented. Modern DG installationcost optimization methods based on supervisory control and data acquisition (SCADA), hardware-in-the-loop [9], and power-flow management systems [10] were presented by researchers. A standard guideline for connecting DGs to a grid was presented by IEEE [11]. This guideline suggests connecting DGs as current sources. That is, when a fault occurs, DGs inject current. Thus, the fault current should be taken into account for the problem of DG installation optimization.
These previous methods of fault diagnosis and DG installation optimization have demonstrated the possibilities of more complex systems being analyzed by system data, including DGs. However, none of the previous studies have optimized the location and capacity of DGs with an objective function that takes into account not only the short-circuit current of DGs that act as a current source, but also the levelized costs. Thus, in this paper, we present a method to calculate the single line-to-ground fault current at a test feeder (e.g., the IEEE 30 bus system). Based on the fault current, we optimize the location of DGs while considering the levelized cost of energy (LCOE) using particle swarm optimization (PSO). A proper objective function for the PSO method was selected by examining the various objective functions and comparing their performance indices.
According to Sörensen and Glover's definition, a metaheuristic algorithm is a highlevel algorithmic and problem-independent framework for developing heuristic algorithms [12]. The purpose of a metaheuristic algorithm is to find a near-optimal solution with reasonable computational cost [13]. Most metaheuristic algorithms such as particle swarm optimization (PSO), the genetic algorithm (GA), and ant colony optimization are inspired by nature [14]. Such algorithms are widely used to solve optimization problems. According to the literature, PSO and GA are highly popular for solving DG allocation problems [15][16][17][18].
In this study, PSO was used because it gives better solution quality and takes a smaller number of iterations than GA [19]. The major advantages of the PSO method are the implementation simplicity, fast convergence, short computation time, and high efficiency in finding the global optima [19]. Thus, in this study, we present a method for accurate DG allocation that calculates single line-to-ground fault current in a test feeder. Based on the fault current, we optimize the location and capacity of DGs while considering the LCOE using the PSO algorithm. A proper objective function for the PSO method was also selected by examining the various objective functions and comparing their performance indices.
The rest of this study is organized as follows. Section 2 presents the problem statement. In Section 3, we discuss the definition of DGs, their modeling, and the fault analysis method and present a case study to show how much DGs affect the fault current. Next, Section 4 presents the proposed methods. Section 5 presents the detailed optimization method and the results. Finally, in Section 6 and 7, we discuss our research and summarize our conclusions.

Problem Statement
In this study, we consider a method for connecting DGs with their optimal capacity in their optimal locations. For this research, the fault current was determined in the IEEE 30-bus system, which is a test feeder system used by researchers to implement new optimization studies. The fault current level and the LCOE are equally weighted in the objective function. In addition to the weight in the objective function, various well-known objective functions were evaluated through performance indices in order to find the optimal objective function. A PSO method is presented using the objective function including the fault current and the LCOE for the optimal allocation of DGs. The performance of the PSO method was compared to that of a GA.

Distributed Generators
DGs offer many advantages to power systems. For example, they contribute to lowering greenhouse gas emissions because they promote clean power generation [20]. They are also based on renewable energy, enabling sustainable urban designs. Thus, DGs provide technical, economic, and environmental benefits [20].
Grids are usually as complex as cobwebs. A grid to which a DG is connected becomes a more complex system. In these situations, technical problems such as an increase in short-circuit currents, the selectivity of the protection system, and the perturbation of voltage levels often occur [21]. DGs can be classified as: • Rotational DGs such as wind power and gas turbines; • Stationary DGs using inverters such as solar power and variable-speed wind power.
When as more loads and equipment are connected to the grid, classical power systems generally deliver power from conventional centralized power plants (e.g., coal, gas, and nuclear power stations) to users. However, these systems may not effectively solve energy problems such as abrupt increases in power injected by DGs, worsening power quality, or complex interactions with the energy market. To relieve these problems, a method of optimally connecting the DGs to the grid can be used.

Distribution Generator Modeling Method
Distributed generators are sometimes connected to the grid as either a voltage or current source. To analyze the effect of faults of DGs on the grid, DGs should be modeled in one of these two ways.

Voltage Source
In Figure 1, rotational machine-based DGs (e.g., synchronous generators) can be modeled as a voltage source in the short-circuit study [22]. For example, the DG connected to the grid in Figure 1a can be reduced into Thevenin's equivalent circuit model (i.e., Figure 1b). That is, the DG consists of a voltage source E a , or the generator interval voltage, and a source impedance Z s [23]. Thus, E a and Z s correspond to Thevenin's voltage and impedance for the DG. Each fault current value is determined by solving a combination of positive-, negative-, and zero-sequence networks [24]. Kirchhoff's voltage law determines the terminal voltage of the DG (i.e., V a ): (1)

Current Source
Stationary DGs (e.g., current source inverter based DGs) can be modeled as a current source [22]. In this case, the DG is reduced into Norton's equivalent circuit model. That is, the DG consists of Norton's equivalent current source I s and a parallel admittance Y s [23]. These values are also derived by Thevenin's and Norton's source transformation theorem: (2) Figure 1 shows how DGs are modeled by Thevenin's or Norton's equivalent circuit.

Unsymmetrical Electrical Fault
In a three-phase power system, the following short circuits can occur in order of frequency of occurrence: single line-to-ground (SLG), double line-to-ground (DLG), line-toline (LL), and balanced three-phase faults. When an unsymmetrical fault occurs in the grid, the sequence networks are combined at only the faulted bus or node [24]. This means that in a pre-fault situation, each sequential network is decoupled. Figure 2 shows uncoupled general sequence networks: zero-, positive-, and negative-sequence networks.

General Analysis Method of Single Line-to-Ground Fault
An SLG fault that occurs at phase a in a general three-phase power grid is shown in Figure 3a. From the figure, the following is derived:

Fault conditions in phase domain
Single line-to-ground fault We transform Equation (3) to the sequence domain: By using Fortescue's theorem, From Equations (4) and (5),

Fault conditions in sequence domain
Single line-to-ground fault Equation (6) can be satisfied by connecting the sequence networks in series at the fault point through the fault impedance 3Z F , as shown in Figure 3b. From this figure, the sequence components of the fault currents are:

Short-Circuit Current Calculation Example
To verify the impact on the fault current when a DG is connected to the grid, a small 5-bus power system with a base of 100 MVA was modeled. The grid has a slack generator at bus 1 and a three-winding transformer connected in a wye-delta-grounded wye between buses 1 and 2 and lines in buses 2, 3, and 4. There is a step-down transformer between buses 4 and 5 connected in a ground wye-delta. An inverter-based distributed generator (IBDG) is connected to bus 5 with a capacity of 10 MVA. These are illustrated in Figure 4. For confirming the impact of the DG on the fault current, this study assumes that an SLG fault occurs at bus 3 in Figure 4. Also, we suppose an IBDG is connected to the system as a current source. Many technical standards suggest connecting DGs to the grid as a current source with grid codes [11]. When a fault occurs in the grid, Thevenin's voltage source (i.e., a slack generator) and Norton's current source (i.e., IBDG) inject the fault current. For example, it is generally known that an IBDG contributes two times its rated current for more than a 0.5 cycle [22]. The overcurrent duration is also typically 3 to 7 cycles [25][26][27][28][29]. To model the fault current level injected by IBDGs designed as an ideal current source, Norton's equivalent impedance, or Z NORT = 1/Y s , in Figure 1 can be set as the infinite [22]. The study proposed 10 4 p.u. as a sufficiently large value [22]. As a result of the trial and error calculations, the value decreased up to 10 3 p.u. does not change the fault current in the following optimization study. Thus, we assume a Z NORT of 10 3 p.u. Figure 5 shows the situation.

Fault Current Contributed by a Voltage Source
To consider how much the voltage source contributes to the fault current, we assume the current source is an open circuit. This means the original fault current value occurs when the DG is not connected to the grid. This situation is illustrated in Figure 6. The fault current is calculated by Equation (8). The value of the fault current at phase a is calculated as:

Current Injection Method
If a stationary DG is connected to the grid, it works as a current source, so we need to conduct current source analyses in addition to a voltage source analysis. For such an analysis, the detailed current injection method is introduced in other studies [30][31][32]. For example, the current source is located on the transformer side of the positive-sequence circuit, so the fault current can be calculated as: That is, when the DG is connected as a current source, the fault current contributed by the DG can be found by the principle of the current divider. This is illustrated in Figure 7. The fault current of phase a is calculated as:

Effect of Current Source
The impact of a DG working as a current source on the fault current of phase a is calculated using the results calculated in Sections 3.4.1 and 3.4.2: As the calculation result shows, when a stationary DG is connected to the grid, it contributes to an increase in the fault current, so we need to take the proper location and capacity of DGs into account to solve the proposed optimization problem.

Particle Swarm Optimization
PSO was presented by Kennedy as an optimization method for nonlinear functions [33]. It was found through a simulation of a simplified social model [33]. PSO is similar to a GA that mimics clustered individuals. While a GA mimics the evolutionary mechanisms of natural selection, PSO is based on the social behavior of a biomass.
When using the PSO algorithm, individual solutions are represented as particles, and solution groups are represented by a swarm [34]. Each particle searches for its optimal solution in multi-dimensional space and moves to the optimal location using its own information and the swarm information. Each particle moves and searches under constraints: • Inertia: the velocity of particles at the previous step.

•
Cognitive force: the distance from the known best position of each particle, which is also called the individual best. • Social force: the distance from the known best position of the swarm, which is also called swarm best.
Particles know where they have moved in the previous step and remember the location with the most optimal path from where the particles pass. They share the place with the best value in the swarm. By combining the three directions with vector operations in Figure 8, we can estimate the moving direction of the next step by the following equation: where V j i = velocity in jth step w= weight of inertia ϕ = acceleration r i = random number P i = individual best position P g = swarm best position  If the velocity is too high, particles may pass the location of an optimal solution, and if the velocity is too low, particles cannot find the search space sufficiently, so the design of an appropriate value is required, which was determined by trial and error in this study. The inertia controls the effect of the speed that came from the previous step. If the value of the inertia is large, the ability to search the entire search space becomes strong, and if the value of the inertia is small, the ability to search the region becomes strong. The procedure of PSO is illustrated in Figure 9.

Fault Current and Levelized Cost of Energy
If a DG that works as a current source is connected to the grid, the proposed method calculates the fault current using the current injection method presented in Section 3.4.2. LCOE is a numerical value that considers all costs incurred during the operation of power generation facilities. LCOE is the cost required for the power plant to generate 1 kWh of electricity. For example, the International Renewable Energy Agency defines the LCOE as the ratio of lifetime costs to lifetime electricity generation [35].

Objective Function
In most optimization problems, the convergence speed and the result of the optimization depends on the suitability of the objective function. Therefore, properly designing the objective function and the normalization of variables are some of the most important steps in the optimization problem, so many researchers have conducted the optimal design of an objective function. We chose five objective functions from other works [36][37][38]. The variable x is the normalized fault current, and the constraint y is the LCOE associated with the normalized capacity.
The Rosenbrock function is used to test an optimization algorithm. It was presented by Harry Rosenbrock in 1960 [39]. The function formula is as follows, and a = 1 and b = 100 are generally used.
The Himmelblau function was presented by David Himmelblau in 1972 as a multimodal function and is used to test the performance of optimization algorithms: The Beale function is a non-convex mathematical function used to test the performance of optimization algorithms: The Goldstein-Price function is another non-convex function used to test the performance of optimization algorithms: f (x, y) = 1 + (x + y + 1) 2 19 − 14x + 3x 2 − 14y + 6xy + 3y 2 30 + (2x − 3y) 2 The Ackley function is a continuous and non-convex mathematical function used as a performance test for an optimization problem: f (x, y) = −20 exp −0.2 0.5(x 2 + y 2 ) + exp[0.5(cos 2πx + cos 2πy)] + e + 20 (18)

Variable Normalization
During the optimization process, if there is a large difference in the scale of the optimization parameters (i.e., the short-circuit current magnitude in p.u. vs. the levelized cost in $), normalization is usually needed. Normalization ensures that all data points are reflected with the same importance. We normalized the data based on the worst-case calculation. All data are divided by the worst-case data values, and the data are normalized to values between 0 and 1. In the case of the fault current, a fault at bus 2 is regarded as the worst case. In the case of the LCOE associated with capacity, the worst case is when DGs with a capacity of 100 MVA are connected to all buses except the slack bus.

Conducting PSO in Detail
Because of the characteristics of PSO mentioned in Section 4.1, we set the acceleration of the swarm and particles as the same. Also, since the particles and swarm are individuals, we set each random number and inertia as independent and identically distributed values. These data are determined by trial and error, so the parameters in vector Equation (13) are set as follows: ϕ 1 = ϕ 2 = 2, w min = 0.4, w max = 0.9 r 1 = 0.5 + Rand(0, 1)/2, r 2 = 0.5 + Rand(0, 1)/2 r 1 and r 2 are i.i.d N = 30, Iter max = 1000, V 1 = 0.1 × X 1 (19) where N is the population size,Iter max is the maximum iterations,V 1 is the initial velocity, and X 1 is the initial position of particles. A swarm of particles X is initialized with the fault current and unit vectors. Each individual particle X i (i = 1, 2, · · · N) is given as . Algorithm 1 is implemented based on the following pseudocode [40], and the research environment was in MATLAB.

1:
Set up PSO parameters 2: Initialize position of particles X and velocity V 3: Set iteration counter k = 1 4: For each particle i = 1, · · · , N do 5: Calculate initial fitness F0 i of particle X i 6: End 7: Find index of the best particle b0 of population X and best fitness F b0 8: Select Pbest and Gbest 9: While current iteration k ≤ maximum iterations do 10: Calculate inertial weight w 11: For each particle i = 1, · · · , N do 12: For each dimension j = 1, · · · , D do 13: Pick random numbers r 1 and r 2 14: Update the particle's velocity v i,j 15: Update the particle's position x i,j 16: End 17: Evaluate fitness of particles F i 18: If F0 i < F i then 19: Update Pbest i of population 20: Update best fitness F0 i = F i 21: End 22: End 23: Find index of the best particle b and best fitness F b 24: If F b < F b0 then 25: Update Gbest of population 26: Update best particle b0 = b 27: Update best fitness F b0 = F b 28: End 29: Increase iteration counter k 30: End 31: Print out index of best particle b0 and Gbest 2

GA Details
The population members (e.g., a candidate solution) of the GA are evolved toward a better solution in the following five steps [41]: We randomly produce the initial population members of the first generation by using the fault current and LCOE (at a ratio of 50 to 50 percent) that were artificially generated for the worst case. Then, the objective function value (or the fitness) of every individual is evaluated. Depending on these values, the fitter individuals of the generation are selected to produce a new generation, which is also called the selection process.
In this study, we also used the roulette wheel selection method for reproduction, which is one of the most popular selection methods in the GA. To generate the next population, crossover and mutation operations are performed. For breeding, a pair of parent individuals is taken from the pool selected in the previous step. By using these methods, a newly produced individual (or a child) shares the better characteristics of its parents. The process continues until a new generation of an appropriate size is generated. The possible termination condition is to find a solution set that satisfies the following criteria: (a) A time limit is reached; (b) A fixed number of generations is reached; (c) Sufficient fitness is achieved, or; (d) A combination of these conditions [42].

Simulation Results
When the optimization process was conducted based on the objective function candidates and the proposed optimization algorithm discussed above, we can obtain the following results. We also conducted optimization by a GA with the same weights, the objective function, and the parameters. This study compares PSO with other algorithms to verify the effectiveness of the proposed methods. In the PSO simulation results, the Himmelblau and Ackley functions do not converge to a value. In the GA simulation results, the Himmelblau and Beale functions do not converge to a value either. The convergence values of the Ackley function are too small to compare with the results of PSO, so in this step, the Himmelblau, Beale, and Ackley functions were eliminated.

Index for Objective Function Selection and DG Installation Property
Objective indicators are presented to evaluate the impact of the optimally allocated DGs on a system. We used indicators suggested by Ochoa et al. [43]. They suggested indexes based on reasonable factors in power systems, such as power losses and the enhancement of the voltage magnitude profile.

(a) Voltage Profile Index (IVD)
One of the advantages of the optimal location and size of DG settings is an improvement in voltage magnitude profiles, so this index penalizes a size-location pair that makes the voltage deviation from the nominal value higher. An index value close to zero means improved voltage profile performance.
The fault current level index (FCI) obtained from simulations is related to sensitivity and protection issues because it evaluates the fault current at each bus for the cases with and without DGs [43,44]. The fault current level index is defined as: where I without DG f is the fault current value before installing DGs, and I with DG f is the fault circuit value after installing DGs. The fault current value is the highest when a fault occurs in bus 2, so the current value is taken as a reference.

(c) Real and Reactive Power Losses (ILP and ILQ)
The losses in transmission and distribution lines are an important issue when considering economic and environmental factors. DGs set to the optimal capacity can compensate for the losses. However, a DG set to an excessive capacity can cause reverse power flow, resulting in larger transmission losses. Therefore, the indicator shows how much the transmission loss has been reduced because of the installation of DGs.

Index Results by Function
A detailed analysis based on the proposed indexes is presented in the following results. From the overall indices, it is reasonable to select the Goldstein-Price function as the objective function and proceed with the optimization. Although GA shows a bad score in the voltage profile index, the other indices present a good score. PSO shows a better overall score than GA.

Evaluation of Swarm Intelligence
To evaluate the performance of the optimization algorithms and validate the results, statistical analysis methods can be used [45]. In this study, a statistical analysis was applied to evaluate the results of swarm intelligence and compare PSO with GA. A pairwise nonparametric statistical test and Wilcoxon signed rank test for both PSO and GA are performed. The Wilcoxon signed rank test is usually used when the number of data is small or the data do not follow the normal distribution. Our null hypothesis of the test is that PSO and GA are statistically equivalent without a significant difference. We set our p-value as 0.05. Based on the data in Tables 1-8, Table 9 presents the test results. Compared with the index of Tables 1-4 with Tables 5-8, PSO is more effective than GA for solving the DG allocation problem.

Discussion
In this paper, a case study was conducted to investigate the effect of DGs on a system. After that, using the IEEE 30-bus system as a test feeder, PSO was simulated by reflecting the fault current and LCOE with equal weights. Through this, we not only tried to find a suitable objective function to perform the optimal selection of the capacity and place of DGs, but also selected the optimal objective function.
Our research suggests some key points. First, we found that PSO could be an answer to the optimal allocation of DGs based on the performance comparison indexes. The indexes of Tables 1 and 2 show that DGs can effectively reduce losses but increase the fault current. This happens because the standard guidelines suggest connecting DGs to the grid as a current source. During a fault, because of the control characteristics of the inverter, Norton's equivalent impedance becomes sufficiently large so that most of the current flowing from DGs can be injected to the grid.
Second, we showed the importance of selecting a proper objective function. In Tables 1-4, some objective functions cannot find the optimal location and capacity. Next, as a tool for the optimal allocation of DGs, PSO can be more effective than another meta-heuristic optimization algorithm (e.g., GA) based on the result of a statistical evaluation test (the Wilcoxon ranked value test). That is, through the optimal allocation of DGs in the IEEE 30-bus system, PSO can be a good candidate among meta-heuristic optimization methods.

Conclusions
We selected the Goldstein-Price and Rosenbrock functions as the objective functions. The PSO simulations with the objective functions were successful in selecting the optimal location and capacity of DGs. In addition, we validated that the PSO model could capture the possibility of optimally selecting the location and capacity of DGs. In future studies, we will enhance the PSO model to take into account the change of phase and current direction due to transformers. The modified and advanced simulations would enable us to perform a more detailed investigation of optimally selecting the location and capacity of DGs.

Conflicts of Interest:
The authors declare no conflict of interest. Norton's equivalent admittance V 0 , V 1 , V 2 zero-, positive-, and negative-sequence fault voltages I 0 , I 1 , I 2 zero-, positive-, and negative-sequence fault currents Z 0 , Z 1 , Z 2 zero-, positive-, and negative-sequence fault impedances V F pre-fault voltage source Z F fault impedance V ag , V bg , V cg line-to-ground voltage of phases a, b, and c Z 0 S , Z 1 S , Z 2