A Two-Loop Hybrid Method for Optimal Placement and Scheduling of Switched Capacitors in Distribution Networks

This paper presents a method to find the optimal size and place of the switched capacitors using a hybrid optimization algorithm. The objective function includes the active and reactive power of power plants, the capital and maintenance costs of capacitor banks, and the cost of active and reactive power losses in distribution lines and transformers. The impact of the load model on the optimal sizing and placement of switched capacitors is studied using three different scenarios: In the first scenario, all loads are voltage-dependent; in the second scenario, only a portion of loads are voltage-dependent; in the third scenario, all loads are voltage-independent. The proposed hybrid algorithm incorporates an outer and two inner optimization layers. The outer layer is executed by a genetic algorithm (GA), while the inner layer is performed by a GA, an exchange market algorithm (EMA), or a particle swarm optimization (PSO). The performance of GA-GA, GA-EMA, and GA-PSO hybrid schemes are compared on an IEEE 33-bus test system. Moreover, IEEE 33-bus and 69-bus networks are used to verify the effectiveness of proposed hybrid scheme against the gravitational search algorithm (GSA), a combination of PSO and GSA (PSOGSA), cuckoo search algorithm (CSA), teaching learning-based optimization (TLBO), and flower pollination algorithm (FPA). The results highlight the advantage of the proposed hybrid optimization scheme over the other optimization algorithms.


I. INTRODUCTION
Minimizing power system losses results in the power system performance improvement from economical and technical points of view. According to [1], most of the power system losses occur in the distribution networks. The consumed reactive power in the distribution networks has a direct impact on the power system losses. High reactive power consumption occupies the power transfer capacity of lines and significantly The associate editor coordinating the review of this manuscript and approving it for publication was Malabika Basu . drops the operating voltage across a distribution feeder [2]. The negative impacts of highly inductive loads can be mitigated by utilizing switched capacitors. Switched capacitors can improve the distribution system voltage profile, reduce the power system losses, and release the system power transfer capacity [3]. Therefore, finding the optimal size, switching pattern, and location of the capacitors is of particular importance.
The optimal planning of the capacitors in the distribution systems is investigated in [4]. Optimal operation and placement of capacitors are surveyed in [5]. Optimal capacitor placement using an efficient heuristic algorithm is investigated in [6]. In [7], genetic algorithm (GA) is utilized to determine the optimal location and capacity of capacitor banks for reducing the power system loss and improving the voltage profile. Optimal placement of parallel fixed capacitors is studied by using GA for minimizing the power losses and reducing the cost of the capacitors and the network [8]. In [9], a mixed integer non-linear programming (MINLP) approach is presented for optimal placement of capacitors for decreasing the investment cost and minimizing the power loss. The optimal capacitor placement problem is solved by the particle swarm optimization (PSO) algorithm in [10].
In [11], a modified PSO algorithm is used to implement optimized Volt/VAr control by utilizing switched capacitors and on-load tap changers. Binary PSO is used in [12] for optimal circuit reconfiguration and switching of capacitors to minimize the loss. In [13], fuzzy adaptive hybrid PSO method is used for optimal capacitor placement.
The simultaneous optimal network reconfiguration and capacitor bank placement is studied in [14], [15]. The integration of capacitors and renewable energy sources into the distribution systems is analyzed in [16]. In [17], distributed generators (DGs) and capacitor placement are optimized through weight improved particle swarm optimization (WIPSO) algorithm and gravitational search algorithm (GSA). The objective function includes voltage stability and loadability improvement indices, energy loss reduction, and total loss minimization. In [18], a hybrid algorithm is proposed for minimizing the loss and maximizing the voltage stability using switched capacitors.
In [19], first, the location of capacitors is selected through sensitivity analysis. Then, the capacity of the capacitors is optimized by using the ant colony algorithm. Sensitivity analysis and Gravitational Search Algorithm (GSA) are utilized to find the optimal fixed capacitor location for reducing the loss and operational cost of the distribution network in [20]. Optimal location, size, and the number of fixed and switchable capacitors are discussed in [21] by executing the nondominated sorting GA II (NSGA-II). Some other heuristic methods used for optimal placement and sizing of capacitor banks are bacterial foraging solution based on fuzzy logic decision [22], integrated evolutionary algorithms [23], cuckoo search algorithm [24], fuzzy theory method [25], modified monkey search optimization technique [26], and harmony search approach [27].
The majority of the available methods used for optimal placement and sizing of capacitor banks rely on a fixed distribution network load behavior. However, due to the probabilistic nature of distribution networks, considering the probabilistic model of the network to obtain accurate results is of significant value. Moreover, in the conventional twostage capacitor optimization schemes, the optimal location and capacity of capacitor banks are obtained in two distinct stages. i.e., the optimal capacity is calculated after the installation location is finalized which may not lead to the most optimal solution.
In this paper, a two-layer hybrid optimization scheme for optimal placement, sizing, and switching of switched capacitors is presented. The first layer determines the optimal location of the switched capacitors. The objective function includes the distribution network active and reactive power losses, the capital and maintenance costs of capacitors and the cost of active and reactive power generation in power plants. The second layer renders the capacitors' optimal size and switching pattern.
The main innovative contributions of the proposed method if compared with previous ones are as follows: • The probabilistic model of the distribution network is used with respect to the uncertainty in the power consumption of the network. Moreover, the impact of voltage dependency of loads on the optimal capacitor placement and sizing is investigated.
• As opposed to the conventional schemes, in this paper, the optimal location and capacity of capacitors are calculated simultaneously in the form of a bi-level optimization. This strategy makes the proposed scheme more robust in finding final optimal solutions.
• In addition to optimal size and location, the optimal hourly switching scheduling of capacitor banks have been found for determined operation interval that affects the optimal value of capacitors size and locations.
• A new objective function by considering all operation costs has been assumed, such as transformers loss cost, reactive power generation cost and etc. The rest of the paper is organized as follows: In Section II, load uncertainty is modeled. In Section III, the objective function and constraints are determined. In Section IV, the method used for power flow is explained. Section V describes the heuristic algorithms used in the two-layer optimization scheme. Moreover, the proposed two-layer hybrid optimization scheme for optimal capacitor scheduling is elaborated in Section VI. In Section VII, the simulation results are presented. Section VIII concludes the paper.

II. LOAD UNCERTAINTY MODELING
In this paper, the optimization problem is solved seasonally. In each season, the hourly average and variance of power consumption are calculated from past recorded data. The hourly active power consumption is computed by the normal distribution function where, x, µ, and σ are a real number, average, and standard deviation of normal distribution values, respectively. The reactive power profile is calculated with 10% probabilistic error using the power factor of the distribution network [28].

III. PROBLEM FORMULATION
This section summarizes the objective function and constraints used in the optimization problem. VOLUME 8, 2020

A. OBJECTIVE FUNCTION
The objective function consists of minimizing active and reactive power generation costs of power plants, capital and maintenance costs of capacitors, and of cost of power losses. Regarding the considered components, the profit of the network is maximized. The overall objective function of the optimization problem can be defined as where f is the annual profit of the distribution network. And, R p sell , C p gen , C q gen , and COST cap are the annual revenue, annual cost of active power generation, annual cost of reactive power generation, and the capacitors' capital cost, respectively.
The annual cost of active power generation is given as where I line j,h,s and I trans i,h,s are the current of the j th branch and current of the transformer connected to the i th bus at h th hour and s th season, respectively. Additionally, the variables r Lj and r Ti are associated with j th branch resistance and resistance of the transformer connected to the i th bus, respectively. Using the triangular approach, the annual cost of reactive power generation of the power plant can be expressed as [29].
and sin θ h,s is: In (9), q h,s,i represents the reactive power consumption of the i th bus at h th hour and s th season. n c is the number of installed capacitors.
where I line j,h,s is the j th branch current and I trans i,h,s is the i th bus transformer's current at h th hour and s th season. Additionally, the variables x Lj and x Ti are associated with j th branch reactance and i th bus transformer's reactance, respectively.
The capacitors capital cost including investment and installation costs are obtained using where C k cap is the capacity of the k th capacitor. inv cap denotes the cost of the capacitor installment. crf is the coefficient converting initial cost to the annual cost. i 1 is the annual interest rate and n is the number of years of operation. The annual revenue is where cost energy,p is the price of energy. p h,s,i denotes the active power consumption of the i th bus at h th hour and s th season.

B. CONSTRAINTS
Active and reactive power equilibrium equations are described as Moreover, the total reactive power injected by capacitor banks in each hour must be less than or equal to the total required reactive power as shown in On the other hand, the selected capacity should not exceed the maximum available capacity of capacitor banks which is described as The voltage security constraint can be expressed as where V h,s,i is the voltage of i th bus at the h th hour and s th season. V min h,s,i and V max h,s,i are the desired minimum and maximum voltage, respectively.
Distribution network feeders are divided into two categories of 20kV cables and overhead lines. Cables and overhead lines have specific rated kVA capacity due to their thermal limitation. In addition, distribution transformers have specific nominal capacity and should be operated by respecting this limitation. During the operation of distribution networks, feeders and transformers should not be overloaded considering their nominal capacity. Maximum allowable power for feeders and transformers are described as where Q b j,h,s and P b j,h,s show the reactive and active power through the j th branch in the h th hour and s th season, respectively. In (21), the b is an indication of the word 'branch'. The S trans i,h,s denotes the power of the transformer connected to the i th bus in h th hour and s th season. S j,max and S trans max,i are the maximum nominal power of the j th branch and the maximum nominal power of the transformer connected to the i th bus, respectively.

IV. POWER FLOW METHOD
In this paper, forward-backward (FB) power flow is utilized for calculating the elements of the objective function. In the power flow model, it is assumed that loads are voltagedependent. The initial value of voltage is assumed to be 1 p.u. In each iteration of power flow, the load active power value changes based on voltage variations according to where v i denotes the ratio of i th bus's new voltage over the old voltage. p new,i denotes the load of the i th bus at v i . p base,i denotes the load of the i th bus when its voltage is equal to 1 pu. Equation (23) is extracted using Table 1 listing active power consumption variations for different v i values [30]. Table 1 presents the percentage of the active power increment per ratio of current voltage to the previous voltage. Since capacitor banks improve the voltage profile of the network, the ratio of current voltage to the previous voltage will be always greater than one, therefore Table 1 only presents the active power increment due to the voltage enhancement after the capacitor banks allocation. The curve fitting method in MATLAB is used to extract (23). As seen, when v i is equal to 1, the value of the active power consumption stays intact. In addition, Fig. 1 shows the flowchart of the power flow algorithm.
Power flow steps are as follows: Step 1: Network's data including loads, network arrangement, number of buses, and the impedance of lines are considered as the input data.
Step 2: The current at each bus is calculated using where P i and Q i are the consumed active and reactive power in the i th bus.
Step 3: The current of each branch is obtained from the current of the busses. The branch currents are used to calculate the voltage drop across branches.
Step 4: New voltages of the buses are backwardly calculated by considering the branches' voltage drop. Step 5: If the voltage of a bus changes compared to its previous value and the related load is voltage-dependent, the value of the load is updated in the current iteration by (23).
Step 6: The maximum difference between the results of the previous iteration and a new iteration is calculated.
Step 7: If the calculated value in Step (6) is greater than a maximum allowable error, the algorithm returns to Step (2). Otherwise, the obtained results are desirable, and the algorithm is terminated.
Step 8: Active and reactive power loss are calculated from the result of the power flow.

V. PRELIMINARIES OF OPTIMIZATION ALGORITHMS
Three algorithms are candidates to select the optimal bi-level combination. The first algorithm is GA that due to utilizing the mutation concept is highly effective in optimizing problems with many local optimum points. The second selected algorithm is PSO that is one of the most used memorybased optimization algorithms. This algorithm utilizes own experiment in past iterations in finding optimal routes in each iteration. The last algorithm is EMA that is one of the recently developed algorithms and has efficient performance in solving power system optimization problems. This algorithm utilizes two searching operators and is performed in two different solution spaces that lead to fast convergence and powerful optimization ability.
In this section, the preliminaries of GA, PSO, and EMA optimization algorithms are provided. These algorithms will be later investigated and compared for the implementation of a two-layer hybrid optimization scheme.

A. GENETIC ALGORITHM
In this paper, GA [7] is utilized to find the optimal location of capacitor banks. GA is also proposed as a candidate for finding the optimal size and switching schedule of each capacitor bank. In the optimal location optimization problem, the capacitor location candidates are considered as genes. For the cross-over operator, multipoint displacement and probabilistic selection of points are used. The probabilistic roulette wheel method is used to select the best population and the cross-over implementation among them. Different steps of probabilistic roulette wheel method are as follows: Step 1: Calculate eval(w i ), i.e., the fitness value of each chromosome w i .
Step 2: Calculate the fitness of the total population, F, using where popsize is the total number of populations.
Step 3: Calculate the probability of selection for each chromosome, P (i), as Step 4: Calculate the cumulative probability for each chromosome, Q (i), as Step 5: Generate a random number, v, between one and zero.

B. PSO ALGORITHM
PSO [10] is proposed as a candidate for finding the optimal size and switching program of each capacitor bank. In PSO, each problem solution is considered as a particle. Also, the injected reactive power of capacitor banks are the coordinates of the particles. The number of coordinates of each solution is equal to the number of capacitor banks. A specific error threshold is defined as the stopping criterion. Considering GA to find the optimal location of switched capacitors, PSO determines the optimal capacity and switching schedule for each capacitor location proposed by GA. In PSO, the velocity and position of particles are updated using where p i (k) is the current position of each particle and p i (k + 1) is the next position of each particle. p i best (k) denotes the best position of each particle. g best (k) is the best position in the whole population. V i (k) and V i (k + 1) are the previous and next velocities of each particle, respectively. c 1 r 1 and c 2 r 2 are the constant coefficients. w(k) is a constant coefficient, in which its value decreases with a constant rate in each iteration.

C. EXCHANGE MARKET ALGORITHM
EMA is a powerful tool in solving non-linear, non-convex, and mixed integer optimization problems [31]- [34]. In this paper, EMA is proposed as a candidate for finding the optimal size and switching program of each capacitor bank. EMA has two searching operators and two absorbing operators. In EMA, there are two different states for the exchange market, namely oscillating and balanced. In the oscillating state, first, second, and third groups include 20%, 30%, and 50% of the total members of the market, respectively. In the balanced state, first, second, and third groups include 20%, 50%, and 30% members of the total market, respectively. These groups identify high, medium, and low ranked members. EMA is used to find the optimal capacity and capacitors' switching schedule for the capacitor locations identified by GA. The injected reactive power of each capacitor bank is assumed as a share of each member.

1) BALANCED STATE OF EXCHANGE MARKET
In this state, the market condition is balanced and there is no oscillation. Members, regardless of risk, can perform their exchanges in the market. In this condition, market members are divided into three distinctive groups as follows.
• Members with high rank: Members of this group do not change their shares.
• Members with medium rank: By utilizing the highranked members, members of this group form their exchanges as where r 1 and r 2 are two random numbers. n k is the number of third group members. pop group(3) k is the k th member of the third group. S k denotes the change of the share of the k th member.

2) OSCILLATING STATE OF EXCHANGE MARKET
In this state, market members perform their exchanges by predicting the future state of the market as well as by considering reasonable risks. Market members are divided into three groups as follows: • Members with high rank: Members of this group will not change their shares and will not participate in exchanges.
• Members with mean rank: Members of this group consider risk. However, they perform their exchanges in such a way that their total shares remain constant. Members' share exchanges are performed using where n t1 denotes the amount of the share that should be randomly added to some shares. n t1 represents the total initial shares value of the t th member. S ty is the y th share of the t th member. Information about the exchange market is shown by δ. r is a random number. η 1 is related to the risk that members consider in the second group. The variables t pop and n pop represent the number of the t th member in the exchange market and the total number of the members, respectively. Thus, µ is a constant number for each member. In addition, g k 1 denotes the amount of the risk of the k th member. g 1,max and g 1,min are the maximum and minimum risk of the second group members, respectively. iter max and k represent the total number of iterations and iteration number, respectively.
• Members with Low rank: Members of this group consider a higher risk for their exchanges. The total share of each member can change according to where n t3 is the randomly added share amount to the shares of the third group's members. r s is a random number in the range of [−0.5, 0.5]. η 2 is the third group member's' risk. g 2 is a variable risk factor for the members of this group. VOLUME 8, 2020

VI. TWO-LAYER HYBRID OPTIMIZATION SCHEME
In the two-layer hybrid optimization scheme, the outer layer finds the optimal place of capacitor banks. While the inner layer finds the optimal capacity and switching schedule of capacitors. GA is used in the outer layer. For the inner layer, this paper separately employs PSO, EMA, and GA and compares them to recommend the most optimized hybrid optimization scheme. To this end, three different combinations of GA-GA, GA-EMA, and GA-PSO algorithms are investigated. Fig. 2 illustrates the optimization process, assuming that GA is utilized in both outer and inner layers. In this flowchart, ε 1 and ε 2 denote the stopping criterion for the outer and inner layers, respectively. iter max1 and iter max2 denote the maximum iterations for the outer and inner layers, respectively. n pop_1 and n pop_2 denote the number of populations for the outer and inner layers, respectively. According to Fig. 2, firstly the initial population includes installation locations, which is generated randomly for the outer layer. At the next stage, for each solution of the outer layer, the separate population with the specific size is generated stochastically, and for each population member of the inner layer, the objective function is calculated for the whole year. After computation of total objective function for each member of the inner layer population, the optimization algorithm, GA, is applied to them and this process continues until reaching the maximum iteration number of the inner layer or acceptable error value. The inner GA is implemented on each solution of the outer layer population to find the optimal capacity of capacitor banks and their yearly switching scheduling. After the calculation of objective function for all members of the outer layer and sorting them, the GA is applied to the population of the outer layer. The presented algorithm continues until reaching the acceptable error value or maximum iteration number of the outer layer. Figs. 3 and 4, are used for implementing the proposed GA-GA, GA-EMA, and GA-PSO hybrid schemes. The considered optimization problem is solved by MATLAB software. It is assumed that loads connected to the network are highly sensitive for which V min h,s,i and V max h,s,i are set to 0.95 and 1.02, respectively. The maximum available capacity for capacitor banks, C max , is set to 1 MVAr. The hourly active power data used for generating stochastic power consumption is provided in Table 2 [35]. Figs. 5 and 6 show the active and reactive power consumption graphs, respectively. For power flow calculations, base power and the base voltage are 100 kW and 12660 V, respectively. The resistance and reactance of the transformers are 0.01 pu and 0.005 pu, respectively. Stepped prices are chosen such that the average price follows the United States average energy price [36]. Table 3 shows the cost of active power consumption. The capacitor banks purchasing cost rate is 12 $/kVAr for all 7 capacitors [37]. Also, the capacitor banks' installation and maintenance costs rate is 8 $/kVAr. The coefficients a, b, and c  are equal to 0.00482, 7.97, 78, respectively [38]. The interest rate is 0.1 [39].

IEEE 33-bus and 69-bus test systems, illustrated in
The initialization of algorithms controlling parameters has been done by the trial and error method. By varying the controlling parameters of each algorithm in the specific interval, their appropriate values have been obtained. The mutation probability of GA has been selected equal to 0.015. In order to improve the performance of PSO, the cognitive factor (c1) and the social factor (c2) have been selected 1.

A. HYBRID OPTIMIZATION SCHEME UNDER DIFFERENT LOAD MODELS
To account for load-voltage dependency, three different scenarios are considered. In all scenarios, GA is used for finding the optimal location of capacitors. However, all three algorithms (GA, EMA, and PSO) are applied for finding optimal capacity and switching schedules of the capacitors in the inner layer of the hybrid optimization scheme [18]. The three types of loads are explained as follows: • First Scenario: In this scenario, it is assumed that network loads are dependent on the voltage. As a bus voltage drifts apart from 1 pu, the active power of connected load changes according to (23).
• Third Scenario: In this scenario, network loads are constant and do not change with respect to the voltage variations. The results of the optimization for all 3 scenarios are presented in Table 4. L indicates the optimal location of the capacitors and C represents the optimal capacity of the capacitors. Table 5 compares the different hybrid optimization schemes from the perspective of the annual network's profit and distribution system minimum voltage.
As seen in Table 4, some capacitors are assigned a zero capacity. This means that less than seven capacitors are  required to minimize the objective function. In other words, the proposed algorithm is capable of optimally determining the number of capacitor banks connected to the network with 7 as the maximum number of capacitors. According to Table 4, in all scenarios, the outer layer of the presented approach has been optimized by GA. In other words, in all scenarios, the optimization of capacitor locations is done by GA. The reason for such selection is the high capability of GA in the optimization of binary and discrete optimization problems. By considering the optimal results in three different scenarios, it is observed that the majority of the capacitors are located close to the end of the circuit when all the network loads are voltage-dependent. As the number of voltage-dependent loads decreases, the capacitors are dispersed throughout the circuit more evenly.
According to Table 5, when the loads are voltagedependent, the total profit is less than other scenarios; however, the proposed hybrid optimization scheme results in the highest percentage of the increased profit for this scenario. The third scenario incorporates the highest profit values. As the number of voltage-dependent loads increases, the profit decreases but the impact of optimal capacitor placement on annual profit is more salient. When the voltage is less than 1 pu, the voltage-dependent load value will be less than the base amount. So, the sold power and profit is decreased. Since the load is voltage-dependent, capacitor placement has more effect on the voltage profile and the power consumption, as well as the profit, is improved. However, the impact of capacitor utilization on the profit increase will be less in the voltage-independent load state.   In terms of the profit increase percentage, all three hybrid optimization schemes render close improvements. According to Table 5, with the increase in the number of voltagedependent loads, the minimum voltage of the network increases and the voltage profile is improved. The reason is that if the voltage of voltage-dependent load bus decreases, the active power of load decreases according to (23) which impedes further bus voltage reduction.
Figs. 7-10 illustrate the optimized capacitor switching schedules. Figs. 11-14 show the voltage of different buses when the loads are voltage-independent and GA-EMA is applied. As seen, spring has the highest voltage profile due to the lowest loading level, while summer renders the lowest voltage profile due to the highest loading level. The PSO, EMA, and GA algorithm convergence rates are plotted in Fig. 15.  In Fig. 15, the horizontal axis is related to the iteration number of the outer layer. The reason for selecting a maximum of 60 iterations of the outer layer is that after iteration VOLUME 8, 2020   60, there is not any change in the fitness value and the algorithms are converged to their optimal value at a maximum of 60 iterations of the outer layer. By considering 10 iterations for the inner layer, the total iteration of hybrid algorithms will be equal to 600 iterations.

B. COMPARISON OF HYBRID OPTIMIZATION SCHEME WITH OTHER OPTIMIZATION ALGORITHMS
To compare the proposed hybrid optimization scheme with other optimization algorithms, the following criteria, derived from [19], are considered: 1) The switching schedule period is reduced from one year to an hour, and capacitors are considered with a fixed capacity. 2) Capacitors have limited capacity and different capital costs (See Table 6).   3) Three capacitors are required to be installed in the network. 4) The objective function only includes the cost of loss and the capacitors' installation. 5) Simulation is executed on the IEEE 33-and 69-bus radial standard test systems [40]. 6) Loads are voltage-independent. 7) For all algorithms, the total number of objective function calculations are the same. EMA needs to calculate the objective function two times in each iteration. Therefore, the inner layer iterations are 20 for EMA and 40 for both PSO and GA. The outer layer iterations are 10. The objective function is calculated 400 times, which is like [19].  Table 8 show that the proposed hybrid optimization scheme results in a more cost-saving percentage compared to other algorithms. For both IEEE 33-bus and 69-bus test systems, GA-EMA renders the most optimal solution compared to the two other combinations, i.e., GA-GA and GA-PSO. The results of this section suggest that the combination of GA and EMA results in an improved optimization efficiency. The reason is that EMA is highly capable of finding the optimal solution for the capacity of the capacitors and determining their optimal switching schedule due to having two powerful operators, namely Oscillation and Balanced, and three solution spaces. It should be noted that in the proposed hybrid scheme, GA is employed to find the optimal location of capacitors in the outer layer, which is due to the proper performance of this algorithm in solving discrete optimization problems.
Among the selected references to compare results with, [43] has used a conventional and separate two-stage method for finding the optimal solution. This reference firstly calculates the voltage stability index (VSI) for all network busses and determines the optimal locations for installing capacitor banks, then finds optimal capacities for them. On the other hand, [20] and [41] initially decrease the candidate busses by sensitivity analysis and then solve the problem for the remained busses of the network. This procedure can eliminate some parts of the solution space and obstructs the algorithm from finding the absolute optimal solution. The comparison of obtained results with the results of such approaches proves the superiority of the presented method over the other twostage capacitor allocation methods.
In the conventional two-stage capacitor optimization schemes, the optimal location and capacity are obtained in two distinct stages. i.e., the optimal capacity is calculated after the installation location is finalized. As opposed to the conventional schemes, in this paper, the optimal location and capacity of capacitors are calculated together in the form of a bi-level optimization. While finding the optimal location of capacitors, the optimal capacities are calculated in a subproblem inside the main problem for each solution of the population; in other words, the impact of the location and capacitance of the capacitors on each other is considered. This VOLUME 8, 2020  strategy makes the proposed scheme more robust. Moreover, the obtained results from this scheme are closer to the absolute optimal solutions.

C. ANOVA TEST
The ANOVA test is one of the common analytic strategies to assess optimization methods [44], [45]. This test is implemented to analyze the mean-variance of the system's cost function with various optimization techniques. In this work, the ANOVA test has been performed between six optimization techniques when the 33-bus system is optimized, and between seven optimization methods when the 69-bus test system is considered. In other words, degrees of freedom between techniques are equal to 5 and 6 for 33-and 69-bus test systems, respectively. The optimization methods have been run for 50 times, so the degrees of freedom within techniques will be equal to 44 and 43 for 33-and 69-bus systems, respectively. Table 9 presents the ANOVA test results for both test systems.
As seen in the table, the values of F-ratio for both systems are higher than the standard value of F-ratio at 5 percent significance level. The results show that the variation in the obtained optimal cost by different methods is significant and is not just a chance.

VIII. CONCLUSION
In this paper, a new two-layer optimization scheme is proposed for optimal placement, sizing, and scheduling of switched capacitors in the distribution networks. In the outer layer, the optimal location of capacitor banks is selected. In the inner layer, the capacitor banks' optimal capacity and switching schedule are calculated. The objective function consists of annual active and reactive power generation cost, total annual lines' and transformers' active and reactive loss cost, capacitor banks' capital and maintenance costs, and annual revenue of the distribution network.
Three different heuristic algorithms are used in the inner layer. In the outer layer, GA is used. These algorithms are applied to solve the optimization problem and their results are compared. The impact of the load model on the optimization scheme is considered by incorporating three different scenarios based on load-voltage dependency. Results indicate that optimal capacitor bank placement and scheduling has more impact on the networks with voltage-dependent loads. IEEE 33-bus and 69-bus radial test systems are used to highlight the advantages of the proposed hybrid optimization scheme over other optimization algorithms.

IX. FUTURE WORKS
In addition to the used objective function for calculating electricity usage cost, the day-ahead market strategy can be considered in the simulations. This suggestion can extend the simulation results and make the results more robust and closer to the real state. This concept can be included in future works.