A Novel Method of Optimal Capacitor Placement in the Presence of Harmonics for Power Distribution Network Using NSGA-II Multi-Objective Genetic Optimization Algorithm

: One of the e ﬀ ective ways of reducing power system losses is local compensation of part of the reactive power consumption by deploying shunt capacitor banks. Since the capacitor’s impedance is frequency-dependent and it is possible to generate resonances at harmonic frequencies, it is important to provide an e ﬃ cient method for the placement of capacitor banks in the presence of nonlinear loads which are the main cause of harmonic generation. This paper proposes a solution for a multi-objective optimization problem to address the optimal placement of capacitor banks in the presence of nonlinear loads, and it establishes a reasonable reconciliation between costs, along with improvement of harmonic distortion and a voltage index. In this paper, while using the harmonic power ﬂow method to calculate the electrical quantities of the grid in terms of harmonic e ﬀ ects, the non-dominated sorting genetic (NSGA)-II multi-objective genetic optimization algorithm was used to obtain a set of solutions named the Pareto front for the problem. To evaluate the e ﬀ ectiveness of the proposed method, the problem was tested for an IEEE 18-bus system. The results were compared with the methods used in eight other studies. The simulation results show the considerable e ﬃ ciency and superiority of the proposed ﬂexible method over other methods. methodology, M.E.M. and H.F.; project administration, H.F.; resources, M.E.M., H.F., and M.F.; software, M.E.M.; supervision, H.F.; validation, M.E.M. and H.F.; visualization, H.F.; writing—original draft, M.F.; writing—review and editing, M.F. All authors have read and agreed to the published version of the manuscript. Conﬂicts of Interest: The authors declare no conﬂicts of interest.


Introduction
The response to electricity consumption growth with maximum economic efficiency, which is the main goal in the design and development of electric power distribution networks, must fully comply with the system's limitations. The large numbers of decision variables in distribution grids, which are caused by the presence of many components in the grid, create serious problems for the design and development of these grids. The steady increase in economic risk caused by the high volume of investment and the rising cost of energy and equipment, especially in restructured grids, encouraged distribution network designers to adopt more precise and appropriate design approaches.
In recent decades, the issue of independent reactive power services, including the optimal placement of capacitors in the grid due to the restructuring of the electricity industry and the creation of a competitive electricity market, received attention from related companies [1]. Shunt capacitor placement was proposed for distribution grids to compensate for reactive power, to adjust and improve voltage profile, to modify power factor, and to reduce power and energy losses [2].
In the case of capacitor placement, the place and the size of capacitor banks should be determined in such a way to maximize all benefits and design objectives while satisfying all the constraints [3].
Utilizing renewable energy in today's advanced power system requires the extensive use of nonlinear elements including semiconductors and electronic power converters, which lead to undesirable effects such as the generation of voltage distortions and the injection of current and voltage harmonics into the power system. This can cause significant operating losses, which can even be considered as a serious threat to the operation of the power system [4,5].
The lifetime reduction of devices, torque fluctuations, the increase in losses, and the severe distortion of voltage waveforms at the joint connection are among the problems caused by harmonic currents due to nonlinear loads in power systems [6]. Even semiconductor-based equipment, which is the main cause of the low power quality of the grid used in modern technologies, such as advanced information technology and microelectronics, needs high-quality power [7].
The place and the size determinations of capacitor banks play an important role in reducing losses and improving total harmonic distortion (THD). On one hand, neglecting harmonics in the capacitor placement problem causes errors in the calculation. On the other hand, lack of proper modeling of nonlinear loads and inappropriate selection of the place and size of capacitor banks can cause more problems in the power quality of the power system by generating resonances at harmonic frequencies between capacitors and multiple inductors installed in the system [2,[8][9][10].
Despite the importance of proper capacitor bank placement in the presence of voltage and current harmonics, this issue receives little attention.
There are serious conflicts between the objectives of reducing investment costs associated with the construction of capacitor banks and improving the quality of system capacity, such that improving one objective can weaken another. In this article, we try to find a suitable solution to this problem.
So far, extensive studies were done to locate the capacitor and determine its optimum type and capacity without harmonics [11][12][13].
In addition to the various studies conducted without harmonics, studies on the placement of capacitor banks in the last decade were carried out considering the effect of harmonics on the power distribution networks, as outlined below.
Masoum et al. proposed a fuzzy logic-based approach to determine the optimum location and size of capacitive banks in radial distribution networks taking into account the effect of harmonics. In this method, the objective functions were the costs of power losses, energy losses, and capacitive banks. In addition, the limits on the voltage, number, size, and location of installed capacitors and power quality limits were also met in accordance with IEEE-519 [14].
In another paper presented by Eajal et al., the harmonics in the unbalanced power distribution network were considered, using a combination of two particle swarm optimization (PSO) algorithms and radial distribution power flow (RDPF) by minimizing the total cost of real power losses while providing operation constraints and power quality. The results showed the necessity of the consideration of harmonics in the problem of optimal capacitor placement [2].
Farag et al. proposed a new algorithm for optimal capacitor placement in multi micro-grid systems considering the island operational mode. The proposed method, which considered probabilistic models of sources of distributed generation (DG), used the genetic algorithm (GA) to solve the model optimization problem [15].
An algorithm including an improved method of reconfiguration and capacitor placement was proposed by Farahani et al. using two methods of discrete genetic algorithm optimization and simulated annealing (SA) [3].
In another paper, Chang et al. used a method based on the combination of fuzzy logic and an immune algorithm to locate and determine the optimum size of shunt capacitor banks; they demonstrated the advantage of this hybrid method compared to the other two methods based on fuzzy and genetic algorithms [16].
In addition to the above studies, a new optimization method called plant growth-based optimization was used by Huang et al. for the placement problem and determining the optimal capacitor size [17].
One of the most noteworthy points in the evaluated references regarding the optimal capacitor placement is that each article has a different perspective on problem solving. In Reference [14], for example, the purpose was to reduce the cost of capacitor placement and power and energy losses, whereas, in Reference [2], only the reduction of the total cost of real power loss in the grid was investigated. However, in all of these studies, special attention was paid to solving the problem in the presence of nonlinear loads that cause harmonics. This paper presents a new method for the problem of optimal location of capacitive banks in the presence of harmonics caused by nonlinear loads. This method was developed in the form of a multi-objective optimization problem, with application of the non-dominated sorting genetic (NSGA)-II algorithm. In the proposed method, the three objectives were to reduce the annual cost of loss and capacitance (cost, total harmonic distortion (THD), and voltage index (VI)). These provide a reasonable compromise among the objectives of the problem. Finally, the efficiency of the proposed model was tested in the 18-bus distribution grid of the IEEE standard and compared with the methods used in eight other studies. The superiority of the Pareto front solutions of the proposed model compared to the other references indicates the efficiency of the proposed algorithm. Since this model offers a Pareto front as a problem solution set, the system designer can select any of the proposed solutions according to the grid properties. Therefore, the proposed model is much more flexible than other single-objective optimization methods.
According to the structure of the present paper, Section 2 presents the system modeling at harmonic frequencies, Section 3 presents the problem of optimal capacitor placement in the presence of harmonics by defining the objective functions and limitations governing the system, and Section 4 presents the proposed NSGA-II multi-objective optimization method. Section 5 deals with the selection method of the ultimate solution. Case studies on the IEEE 18-bus standard grid are presented, along with the results of other studies, in Section 6, where the valuable benefits of the proposed new method are compared with six studies. Finally, in Section 7, the results are presented.

System Modeling at Harmonic Frequencies
The formulations of References [18][19][20][21] were used to model a distribution system at the basic and harmonic frequencies. The system was solved using the forward backward sweep power flow method.
The nature of buses for a system consisting of n buses was defined as follows: • Bus 1 as the slack bus with values determined for voltage |V 1 | and phase angle δ 1 ; • Buses 2 to m − 1 as ordinary linear buses (PQ or PV); • Buses m to n as non-linear buses. The nonlinear load model is shown in the frequency domain. This model describes the relationship between the voltages and the harmonic currents of V (h) and I (h) . The semiconductor-controlled rectifier (SCR) model is available as an example of nonlinear loads [22].
The basic sweep power flow method was used to calculate the grid electrical parameters [23]. According to the harmonic power flow algorithm used in the article, we show in Equation (1) the maximum harmonic order of L.
where ∆M and ∆U vectors are shown in Equations (2) and (3).
The elements of vectors and sub-matrices were defined in References [18][19][20][21]. In the harmonic power flow, the capacitors were considered as fixed capacitor banks and the capacitor placement was performed for the MC buses. MC is the set of buses in which the capacitor is located. Furthermore, the equations in Reference [24] were used for the admittance of linear loads at harmonic frequencies.
The coefficient j before Q j (1) represents the imaginary operator (−1).
The harmonic power flow algorithm calculates the bus voltage vector U for a given system with linear and nonlinear loads.
The flowchart of the seven-step Newton-Raphson harmonic power flow algorithm used is shown in Figure 1.
In the proposed flowchart, |V (h) | and δ (h) are the values of the amplitude and phase angle of the voltage vector of the system buses, respectively. G rm (h) and G im (h) are the vectors of non-linear injective active and reactive currents corresponding to the bus m for harmonic h, respectively. P j t and Q j t are the sum of the fundamental and harmonic components of the nonlinear active and reactive loads in bus j, respectively. The method of solving the harmonic power flow algorithm is fully described in Appendix B via Equations (A1)-(A22).

Optimal Capacitor Placement in the Presence of Harmonics
In this paper, capacitors are assumed with constant and selectable values of C f , and the grid is considered as three-phase balanced with the presence of linear and non-linear loads.
The problem of capacitor placement considering the effect of harmonics in the form of two parts (objective functions and system constraints) is presented below.

Objective Functions
In order to find the optimal capacitor placement and size in this paper, the objective function is defined as minimizing the three variables of cost, total harmonic distortion (THD), and voltage index (VI). min(Cost, THD, VI).
The cost considered in the capacitor placement problem includes the cost of the capacitors, the cost of energy losses, and the cost of power losses according to Equation (5).
where K E denotes the energy loss coefficient [25,26], T is the load duration, P loss is the total system loss, V (h) represents the bus voltage vector at harmonic h, C is the capacitance of the connected capacitor, K cfp denotes the cost per unit of constant capacitor [26,27], C fi is the capacity of the installed capacitor in bus i, and K A is the energy cost savings per megawatt to reduce losses. In general, losses due to non-compensation of the reactive power grid, for two reasons, increase electricity grid costs, as shown in Equation (7). These reasons are the cost of energy losses (F loss ) and the cost of power losses (F capacity ).
Energy losses due to the inadequate compensation of reactive power at all times of the day, including during peak hours of electricity consumption, lead to increased fuel costs and, consequently, to increased grid costs. This loss phrase is specified by the expression "K E TP loss V (1) , . . . , V (L) , C " in Equation (7), where TP loss is expressed by the energy type in MWh, and the coefficient K E is expressed by the $/MWh. The cost of energy losses is a type of operating cost that is incurred at all hours of the day, including during peak hours.
In addition, the inadequate compensation of reactive power during peak hours can increase the cost of occupying the capacity of all upstream network equipment including lines, substations, power plants, etc. This cost is called the cost of power losses. The cost of power losses, which is a type of investment cost and is measured in $, is shown by the expression "K A P loss V (1) , . . . , V (L) , C " in Equation (7).
Total harmonic distortion is one of the important factors in harmonic exposure, where the maximum total harmonic distortion in the grid is considered as the objective function of THD in Equation (6). In this function, the maximum is on i, and the h numbers of the L-th harmonic are considered.
In addition, the maximum voltage index in the grid is considered as the objective function (VI) in Equation (9).
where V i is the i-th bus voltage, V min and V max are the minimum and maximum voltage values of each bus, and the maximum is on i. The total losses can be calculated using the harmonic power flow output as follows: where V i (h) and θ i

Limitations
System limitations based on the IEEE-519 standard should be taken into account in the model [28].
Updating P and Q

Limitations
System limitations based on the IEEE-519 standard should be taken into account in the model [28].

Voltage limitation
2. Voltage distortion 3. Permitted numbers of capacitor units where u f i denotes the constant number of capacitor banks in bus i, and MC is the set of buses in which the capacitor is located. Capacitors must be selected from specified and standard values according to References [26,27]. V max and V min are 1.10 V rated and 0.9 V rated , respectively, in Equation (11).

Proposed Multi-Objective Optimization NSGA-II Method
The mathematical model presented for the capacitor placement problem has a complex and nonlinear nature. In this model, the optimal location and capacitance of capacitors in distribution networks are considered. The objectives of the model optimization include the simultaneous minimization of loss and capacitance costs, harmonic distortion reduction, and voltage index.
The new NSGA-II multi-objective optimization algorithm was used to solve the proposed model. This algorithm is based on References [29][30][31] (described in detail in Reference [32]), and it performs far better than the NSGA algorithm, in which non-dominated fronts, called the Pareto fronts, are obtained for the problem of locating the capacitors in the presence of harmonics for various objectives. Figure 2 shows the flow of the NSGA-II algorithm [32].

Selection the Ultimate Solution
The choice of the ultimate multi-objective solution is up to power system planners. This is done by analyzing the set of Pareto optimal solutions, taking into account the most satisfying values of the three objectives and taking into account the professional experience and perspective of the planner.
In the present paper, a maximum-minimum approach was used to select the best (final) multi-objective solution. Each solution in the Pareto optimal solution set had a related vector (cost, THD, VI). The normalized values of the vector elements of each solution k were calculated using Equations (14)- (16).
where Cost Max , THD Max , and VI Max are the maximum values obtained for the objective functions Cost(k), THD(k), and VI(k), respectively, while Cost min , THD min , and VI min are the minimum values obtained for the objective functions Cost(k), THD(k), and VI(k), respectively.
It is worth noting that the result of this normalization shows the degree of satisfaction of each objective function. Finally, a maximum-minimum method was used to select the best (final) multipurpose replacement solution according to Equation (17) [33][34][35].

Case Studies
In the studied grid, which is an 18-bus IEEE distribution network in the presence of a typical nonlinear load, consisting of a six-pulse converter with 3 MW active power and 2.26 MVar reactive power in bus number 5, the voltage range was between 0.95 and 1.05 and the system loads were of

Case Studies
In the studied grid, which is an 18-bus IEEE distribution network in the presence of a typical nonlinear load, consisting of a six-pulse converter with 3 MW active power and 2.26 MVar reactive power in bus number 5, the voltage range was between 0.95 and 1.05 and the system loads were of commercial, residential, and office types. It was also possible to install capacitors on all buses. Line and bus information from Reference [36], as well as the constant annual capacitor costs and harmonic current, was extracted as a percentage of the basic current for the six-pulse converter from References [26,37].
The IEEE standard 18-bus network information obtained from Reference [36] is provided in Appendix A.
As can be seen in Figures 3 and 4, the front obtained was in the form of a curve for the three objectives of cost, THD, and VI.
To illustrate the capability of the proposed method and to compare the responses with other methods, the magnification of Figure 3 is presented in Figure 4. The IEEE standard 18-bus network information obtained from Reference [36] is provided in Appendix I.
As can be seen in Figures 3 and 4, the front obtained was in the form of a curve for the three objectives of cost, THD, and VI.
To illustrate the capability of the proposed method and to compare the responses with other methods, the magnification of Figure 3 is presented in Figure 4.  In addition to plotting the main and magnified curves of the Pareto front for all three objectives, separate magnification curves for the two objectives of the above-mentioned triple objectives are presented in Figures 5-7. The IEEE standard 18-bus network information obtained from Reference [36] is provided in Appendix I.
As can be seen in Figures 3 and 4, the front obtained was in the form of a curve for the three objectives of cost, THD, and VI.
To illustrate the capability of the proposed method and to compare the responses with other methods, the magnification of Figure 3 is presented in Figure 4.  In addition to plotting the main and magnified curves of the Pareto front for all three objectives, separate magnification curves for the two objectives of the above-mentioned triple objectives are presented in Figures 5-7. In addition to plotting the main and magnified curves of the Pareto front for all three objectives, separate magnification curves for the two objectives of the above-mentioned triple objectives are presented in Figures 5-7.     As can be seen in Figures 5-7, there were solutions for all the Pareto fronts that dominated the results of the other references, demonstrating the efficiency of the proposed method.
In addition to the figures shown, the results of the best solutions are presented below; Table 1 provides the results associated with the lowest cost, lowest THD, and lowest VI, along with the capacitor placements.  As can be seen in Figures 5-7, there were solutions for all the Pareto fronts that dominated the results of the other references, demonstrating the efficiency of the proposed method.
In addition to the figures shown, the results of the best solutions are presented below; Table 1 provides the results associated with the lowest cost, lowest THD, and lowest VI, along with the capacitor placements. Table 1.
Results for the solutions with the lowest cost, the lowest THD, and the most appropriate response.

Results
In this paper, the problem of optimal placement of capacitor banks in the presence of nonlinear load harmonics was modeled in the form of a multi-objective problem with the aim of reducing the annual cost of losses and capacitor placement, reducing total harmonic distortion, and reducing the voltage index, such that a reasonable compromise could be reached among the objectives of the problem. Then, the efficiency of the proposed model was tested in the IEEE 18-bus power distribution network.
As shown in Figures 3-7, using the new NSGA-II approach, the system designer can select any of the Pareto front solutions based on the grid needs and opinions of the power system operators. If cost reduction is prioritized, the solutions with more profit and lower harmonic distortion improvement can be selected and, if the reduction of THD is more important, the solutions close to the solution with the lowest THD can be selected.
Since this model provides a Pareto front as a problem solution set, the system designer can select any of the proposed solutions according to the grid properties. Therefore, the proposed new model is much more flexible than the single-objective methods compared. Moreover, the superiority of the Pareto front solutions of the proposed model with respect to the solutions of previous methods indicates the efficiency of the proposed algorithm.
The valuable results of the proposed method indicate that the following: • The place and the capacity of capacitor banks play an important role in reducing losses and improving the total harmonic distortion (THD), whereas neglecting harmonics in the capacitor placement problem causes errors in the calculation.

•
Lack of proper placement and size of capacitor banks, as well as inadequate modeling of nonlinear loads, not only removes capacitor banks from the optimal placement and size, but also causes further problems in power system quality.

•
The use of capacitor banks solely in order to reduce THD is not recommended, due to the high cost it applies to the grid and the effects it has on the grid.

Conflicts of Interest:
The authors declare no conflicts of interest.

Appendix A
The IEEE standard 18-bus network information obtained from Reference [36] is provided below. Figure A1 shows the IEEE standard 18-bus grid.

Results
In this paper, the problem of optimal placement of capacitor banks in the presence of nonlinear load harmonics was modeled in the form of a multi-objective problem with the aim of reducing the annual cost of losses and capacitor placement, reducing total harmonic distortion, and reducing the voltage index, such that a reasonable compromise could be reached among the objectives of the problem. Then, the efficiency of the proposed model was tested in the IEEE 18-bus power distribution network.
As shown in Figures 3-8, using the new NSGA-II approach, the system designer can select any of the Pareto front solutions based on the grid needs and opinions of the power system operators. If cost reduction is prioritized, the solutions with more profit and lower harmonic distortion improvement can be selected and, if the reduction of THD is more important, the solutions close to the solution with the lowest THD can be selected.
Since this model provides a Pareto front as a problem solution set, the system designer can select any of the proposed solutions according to the grid properties. Therefore, the proposed new model is much more flexible than the single-objective methods compared. Moreover, the superiority of the Pareto front solutions of the proposed model with respect to the solutions of previous methods indicates the efficiency of the proposed algorithm.
The valuable results of the proposed method indicate that the following: • The place and the capacity of capacitor banks play an important role in reducing losses and improving the total harmonic distortion (THD), whereas neglecting harmonics in the capacitor placement problem causes errors in the calculation.

•
Lack of proper placement and size of capacitor banks, as well as inadequate modeling of nonlinear loads, not only removes capacitor banks from the optimal placement and size, but also causes further problems in power system quality.

•
The use of capacitor banks solely in order to reduce THD is not recommended, due to the high cost it applies to the grid and the effects it has on the grid.

Conflicts of Interest:
The authors declare no conflicts of interest.
The grid line information of the IEEE standard 18-bus network is shown in Table A1. In this network, a typical non-linear load (six-pulse converter) with 3 MW of active power and 2.26 MVar of reactive power is located at bus number 5 and the voltage range is between 0.95 pu and 1.05 pu.
The system loads are commercial, residential, and office. It is possible to install capacitors on all buses.
The bus information for the 18-bus IEEE standard network is shown in Table A2. Table A3 shows the harmonic current size as a percentage of the basic current for the six-pulse converter.

Appendix B
The flowchart of Newton-Raphson's harmonic power flow is shown in Figure 1.
The harmonic power flow algorithm calculates the bus voltage vector U for a given system with linear and nonlinear loads. The method of solving the harmonic power flow algorithm is shown below via Equations (A1)-(A22).
Step 1: At first, all nonlinear loads are considered as linear loads. Using one of the basic power flow methods, we calculate the approximate initial value and phase angle for the base voltage of the bus. An initial guess for the size and phase angle of the harmonic voltage of the buses is considered, for example, 0.1 pu and 0 radian.
Step 2: The currents of nonlinear devices G (A1) Step 3: ∆M is calculated using the following equations. If they are small enough, we stop the process.
, . . . , ∆I Step 4: The Jacobean matrix J is calculated using the following equations, and then ∆U is calculated using its inverse.

∆I
Step 5: The U value is updated. . (A19) Step 6: The total power (fundamental and harmonic) in non-linear buses (P t j , Q t j ) is updated, and the total apparent power is specified.