Direct approach for optimal allocation of multiple capacitors in distribution systems using novel analytical closed-form expressions

In this paper, novel and efficient analytical closed-form expressions are proposed for the optimal allocation of multiple capacitors in distribution systems to maximize the total cost reduction (CR) while considering power losses. The proposed expressions are novel since they can directly solve the allocation problem without requiring iterative processes or optimization algorithms. Specifically, two analytical closed-form expressions are introduced to determine the optimal number, locations, and sizes of multiple capacitors. The first analytical expression computes directly the optimal sizes of multiple capacitors where it is employed for the optimal sizing of capacitors for all possible combinations of locations. In turn, the best combination is then assigned by using a second analytical expression which directly evaluates all the combinations in terms of their contribution in CR. Unlike the existing methods/expressions that utilize sensitivity factors or optimize each capacitor individually, the proposed analytical closed-form expressions involve a unified mathematical model for multiple capacitors. The proposed direct approach is tested using a 69-bus distribution system. The accuracy and efficacy of the proposed analytical closed-form expressions are verified by comparisons with existing methods and intensive simulations of various allocation scenarios.

ing inverter of particular renewable energy sources, thereby reducing their active power curtailments [9][10][11]. Besides, capacitors require lower initial and operational costs compared with other effective voltage control devices.
It is a fact that allocating several capacitors at improper locations with erroneous sizes could worsen the performance of distribution systems. Indeed, the problem of capacitor allocation means determining the best combination of locations for installing capacitors with their optimal capacities so that their benefits are maximized. In addition, the number of capacitors is a critical variable that needs to be optimally calculated. This optimization problem has combinatorial nature where several continuous and discrete variables are required to be solved [12][13][14]. For such nature, exhaustive search methods are not helpful considering their computational burden, especially with a high number of capacitors to be allocated.
As illustrated in the aforementioned literature review, various research studies have been focused on the optimal allocation of capacitors in distribution systems. Due to the stochastic nature of NB, HB, and AIB methods, the global optimal solutions are not guaranteed where the solutions often stuck in local minima. In turn, AB methods could have more reliable and accurate solutions, whereas complex unified models are a must. However, most of the existing AB methods simplify the allocation problem by adopting some assumptions, e.g., priority list of potential locations of capacitors, uniform loading, and/or ignoring the cost of capacitors. Besides, other AB methods determine the optimal locations of capacitors by a sequential manner that can lead to a suboptimal solution. To fill this gap in the literature review, this work has been directed proposed an efficient AB method by introducing efficient analytical closed-form expressions.
In this paper, a novel AB method is proposed for directly solving the optimal allocation of multiple capacitors for minimizing the total cost, i.e., the costs of capacitors and losses. The proposed method is based on efficient analytical closedform expressions which requires the power flow results only for the base case for solving the allocation problem. Two analytical expressions are driven for the optimal capacitor sizing and the selection of the optimal combination of locations. By utilizing these expressions, a solution process for determining the optimal number, locations, and sizes of multiple capacitors is introduced. The most distinguishing feature of the proposed method is that the global optimal point of the optimization problem can be accurately determined. This feature is accomplished since all possible combinations of capacitor locations are evaluated, thanks to the proposed direct analytical expressions and the unified mathematical model for multiple capacitors.

Proposed approach
The cost function (CF) of the capacitor allocation problem is firstly presented in this section. Second, we propose an ana-lytical expression for directly calculating cost reduction (CR) with capacitors. Then, an analytical expression is proposed for the optimal sizing of capacitors. The solution process of the proposed approach is given in the last subsection.

CR formulation
The objective function of the allocation problem is to minimize CF that involves the cost of capacitors and losses. If we consider allocating N c capacitors to specified set of locations {c 1 . . . c n }, donated by Ω c , in a power distribution system, the CF formula can be expressed as follows: (1) in which where P Loss is the total real power losses (kW); Ω b = {b 1 . . . b n } is the set of receiving buses for all lines in the system; P In j and Q In j are the incoming active and reactive powers at bus j, respectively; v j is the voltage amplitude; r j is the line resistance; Q ci is the capacitor size (kvar) at bus i; K p is the cost per unit losses ($/kWh); K ci is the cost per kvar production of the capacitor at bus i; K Ins is the installation cost for each capacitor; and T is the number of hours.

Analytical expression for CR
An analytical expression is proposed here to directly compute CR after installing multiple capacitors at specified set of locations in a distribution system. Normally, in passive distribution systems, the active and reactive powers flow in one direction from slack bus to load buses, as shown in Fig. 1a, where a 5-bus system is considered. However, if two capacitors are installed at buses 2 and 4 ( Fig. 1b), the reactive power flow through some lines will be influenced by their reactive power injections. This injected reactive power for each capacitor will affect only the power flow through its upstream lines. For example in Fig. 1b, all lines are affected by Q c4 , while only lines 1 and 2 will be affected by Q c2 . This implies that the impact of a capacitor on the system lines varies depending on its location (i.e., bus). On other words, for each capacitor, there are some lines whose reactive power flows are affected by. CF at the base case, i.e., without capacitors (CF wo/c ), can be written as follows: The power flow through the distribution lines of a 5-bus system: a the base case, b with installing two capacitors CF with considering capacitors (CF w/c ) can be written as: where M i, j is equal to 1 if bus j belongs to upstream buses of the capacitor bus i; otherwise, it is 0. Note that Eq. (3) formulates the active loss which is a function of line resistance, but the complete line model is considered in this work. This full line mode is required to calculate the bus voltage (v j ). The analytical expression for calculating CR can be formulated as in (5) with considering (3) and (4): Here, a simple example of generating the matrix M is described. Consider the distribution system given in Fig. 1 in which two capacitors are required to place optimally. For this case, six possible combinations of capacitor locations are available, where the M matrix can be formulated as follows: The above analytical expressions can be employed for directly evaluating the benefit of installing a group of capacitors to specified locations in terms of minimizing the total cost, i.e., maximizing CR, without requiring iterative power flow analysis.

Analytical closed-form expression for optimal sizing of capacitors
This subsection aims at formulating an analytical expression for the optimal sizing of multiple capacitors in distribution systems. Consider a group of capacitors are connected to a system, while the resultant reduction in the total cost can be expressed by (5). It is a fact that the first derivatives of this equation with respect to the sizes of capacitors are equal to zero at the optimal solution. For a capacitor that is located at bus m, the following derivative equation is satisfied: Equation (6) can be rewritten as follows: It is important to note that the number of derivative equations is equal to number of capacitors in Ω c = {c 1 . . . c n }. These equations can be arranged in the following linear matrix form: (8) represents a novel analytical expression that directly calculates the optimal sizes of multiple capacitors (Q c ) so that the CR value is maximum. Unlike the expressions that utilize sensitivity factors or optimize each capacitor individually, the proposed analytical expressions provides a unified mathematical model for multiple capacitors in distribution systems. Besides the light computational burden of the analytical expressions, this novel formulation has several other benefits, such as improving accuracy rate as it allows the assessment of all possible combinations of all sites for capacitors and enabling further planning options of the capacitor allocation. The proposed approach focuses on maximizing the benefits by reducing total cost (CF) expressed by (1) and (2) and maximizing the cost reduction (CR) formulated by (5). It is a fact that voltage quality is not considered in this approach. However, in the proposed approach, we follow a procedure that the voltage quality is attained after installing the capacitors by controlling the reactive power of capacitors by an adopted control scheme.

Proposed solution process
By employing the proposed analytical expressions, an efficient analytical method is developed to accurately determine the optimal number, locations, and sizes of capacitors. The base power flow results are obtained by a forward/backward sweep method given in [35] considering complete distribution line parameters as well as active and reactive load power. The optimal sizes of capacitors are calculated by (8) for all possible combinations of valid locations for capacitors. The number of these combinations (N com ) is based on number of required capacitors to be allocated and number of valid locations, which mathematically is equal to N b P N c combinations.
Having the calculated optimal sizes of capacitors for all possible combinations of locations, the next step is to choose the optimal combination among them. This optimal combination can be assigned with using the proposed analytical expression in (5). This analytical expression is used for evaluating all the combinations in terms of the CR values, thereby finding the optimal combination. As the proposed mathematical formulations are general, the proposed method can be directed to solve any of the following capacitor allocation cases: Case 1: Determining the optimal locations of N c capacitors while their sizes are specified.

Case 2:
Determining optimal locations and sizing of N c capacitors. Case 3: Determining the optimal number and locations of capacitors while their sizes are specified. Case 4: Determining optimal number, locations, and sizes of capacitors. Figure 2 shows a flowchart of the proposed method with considering the aforementioned four cases. Note that the shaded blocks in this figure represent two subroutines described in Fig. 3. The first subroutine (optimal capacitor sizing) aims at calculating the optimal sizes of capacitors (from 1 to 2 ). The second subroutine (CR evaluation) estimates CR values for all combinations and gets the optimal combination (from 3 to 4 ). For Cases 1 and 2, these subroutines are solved once. However, for the other two cases, these subroutines are repeated according to the acceptable range for the number of capacitors (N max c < N c < N min c ). The process of optimal capacitor numbering starts with allocating N min c capacitors, as shown in Fig. 2. The stopping criteria of this process are satisfied if CR N c <= CR N c −1 or N c = N max c . In this paper, we will focus on testing Case 4 in which all of the three variables (capacitor number, locations, and sizes) are required to be optimally computed. It is important to note that the proposed method provides a direct optimal solution for all the cases with using the power flow results of the base case. The proposed mathematical formulation is general, and therefore, it facilitates any extension raised by power utilities or system operators/planners with respect to the integration of capacitors.
The proposed approach has been formulated based on the radial structure of distribution systems, and so, it is valid for radial distribution systems. However, the proposed method can be extended for meshed distribution systems. Such extension can be accomplished by the following steps: (1) Run the base power flow analysis of the meshed distribution system under study, (2) break all the loops in the distribution system, and (3) solve the capacitor allocation problem for resulting radial distribution system using the proposed method.

Results and analysis
The proposed method is applied on the 69-bus distribution system, which is widely used as a test system for installing capacitors. Figure 4 shows the test system where its data that involve complete distribution line parameters and active and reactive load power are given in [18]. Bus 1 is the slack bus, while all other buses are valid for capacitor installation. In the simulation results, the parameters of CF are set as follows: K p = 0.06$/kW, K ci = 300 $/year for each i location, K Ins = 1000$ for each location, and T = 8760 [29]. The annual total cost of the test system at the base case (CF w o/c) is 118,260$. The proposed method has been implemented in C++ programming environment. In the following subsections, the proposed method is validated with an exact search method that exhaustively determines the optimal solution. The proposed method is also compared with existing methods to demonstrate its effectiveness.

Validation of the proposed method
Here, we validate the accuracy of the proposed closed-form expressions for the optimal allocation of multiple capacitors in distribution systems. For this purpose, the proposed method is applied for installing one, two, and three capacitors (assuming one unit per location) in the test system. To validate the accuracy of the proposed method, the calculated results are compared with the accurate results calculated by a repetitive power flow tool. This tool involves running the backward/forward sweep power flow method for all possible combinations of capacitor sizes, which needs excessive computational efforts. Figure 5 shows the calculated optimal sizes of capacitors for all combinations of valid locations, and the corresponding exact total cost (computed by the power flow tool) and estimated total cost (computed directly by (5)) are given in Fig. 6. It is important to mention that the data in Fig. 6 are viewed after rearranging the exact total cost in descending order, i.e., from the highest to the lowest values. Note that the computed optimal sizes of capacitors have different values for each combination of locations, as shown in Fig. 5. This variation verifies the importance of the proposed method to solve to determine the optimal locations and sizes of capacitors. To show the accuracy of the proposed method, the exact total costs, estimated total costs, and the estimated CR for all location combinations for the 69bus system with single capacitor, two capacitors, and three capacitors are compared in Fig. 6. It is obvious that the exact total cost and the estimated total cost have their minimum values at the same combination of capacitor locations in which the estimated CR is the highest, as illustrated in Fig. 6. Subsequently, the proposed estimated formula for CR evaluation is efficient for assigning the optimal set of locations for capacitors without requiring iterative processes or complex optimization algorithms.

Optimal number, locations, and sizes of capacitors
In this subsection, we demonstrate the efficiency of the proposed method for determining the optimal number, locations, and sizes of capacitors so as to minimize the total costs. Specifically, the proposed method is applied to solve the capacitor allocation problem with considering a maximum capacitor number of 5. The calculated results for different numbers of capacitor are tabulated in Table 1. In general, the   (Fig. 7). It can be noticed that curves of capacitor and loss costs are contradictory in nature; therefore, ignoring any of them can lead to improper installation of these units, as shown in Fig. 7a. Figure 7b shows the total system cost which has a U-shape pattern . In other words, the total cost is initially reduced till a certain optimal capacitor size at which the total cost is increased. As shown in the figure, the optimal number is two capacitors, whereas the total cost is reduced to be only 83,706$/year. This trend demonstrates that increasing the number of capacitors cannot guarantee lower costs. For this reason, determining the optimal number, locations, and capacities of capacitors in a simultaneous manner as accomplished by the proposed method can yield economic benefits, i.e., minimum costs.

Optimal capacitor allocation with predefined sizes
Here, we simulate Case 3 which is described in Sect. 2.4 in which the optimal number and locations of capacitors are required to be determined, while their capacities are predefined. This analysis shows the flexibility of the proposed method which can be adopted by system operators and planners of utilities to quantify the feasible benefits for the allocation problem based on available capacitors. For this purpose, the proposed method is employed to solve the capacitor allocation problem with 1, 2, 3, 4, 5 capacitor numbers, and 300, 400, 500, 600, 700, and 800 kvar. In other words, 30 different capacitor allocation scenarios are simulated. Table 2 shows the determined optimal locations of capacitors with different numbers and predefined capacities by the proposed method. As shown, the optimal set of locations vary significantly among the capacitor allocation scenarios. In Fig. 8, active losses and total costs with different capacitor numbers and capacities for the 69-bus system are plotted. Regarding the active losses (Fig. 8a), their values initially decrease with the number of capacitors and their capacities, but they raise at certain capacitor numbers which can be considered optimal numbers with respect to the losses. However, the figures are different with the total costs shown in Fig. 8b. For each capacitor capacity, the total cost follows the U-shape where the optimal capacitor numbers decrease with the capacitor capacity. For instance, the optimal number of capacitors is 4, 4, 3, 3, 2, 2, and 2 with capacitor sizes of 300, 400, 500, 600, 700, and 800 kvar, respectively. Among the 30 capacitor allocation scenarios, the lowest losses and costs are attained by allocating three capacitors with 600 kvar, as shown in Fig. 8.

Comparison with existing methods
The proposed method is compared with eight different existing methods given in the literature. The CR and loss reduction (LR) are compared for the different methods in Fig. 9. For the proposed method, two and three capacitors are considered in this comparison. The highest values of CR can be achieved with the proposed method (e.g., 29.2% with two capacitors and 28.65% with three capacitors). The corresponding LR values are also relatively high compared with most of the existing methods. We can note the preeminence of the proposed method compared to the existing methods. This positive feature of the proposed method is accomplished since all possible combinations of capacitor locations can be evaluated, thanks to the proposed closed-

Conclusions
This paper has proposed an analytical approach to determine the optimal number, locations, and sizes of capacitors in distribution systems to maximize CR. Novel analytical closed-form expressions are presented for directly allocating capacitors without requiring iterative processes. These analytical expressions can be employed for accurately solving the capacitor allocation problem. The results show that the proposed approach is accurate with respect to the exact solutions computed by exact search-based methods and efficient compared with existing methods. As the proposed approach is direct, it is considered a simple, practical, and efficient tool for allocating capacitors and even evaluating their positive impacts on the distribution systems. In the future, the proposed analytical expressions will be extended for considering load variations and distributed generations in distribution systems. Fig. 9 The percentage of CR and LR for different methods