A Mixed-Integer Linear Programming Model for Simultaneous Optimal Reconfiguration and Optimal Placement of Capacitor Banks in Distribution Networks

Optimal capacitor placement and network reconfiguration are well-known methods to minimize losses, enhance reliability, and improve the voltage profile of electric distribution networks (EDNs). Distribution network reconfiguration (DNR) consists of altering the system topology by changing the states of ties and sectionalizing switches, while the optimal placement of capacitors (OPCAs) involves sizing and finding the optimal location of capacitor banks within the distribution network for reactive power control. DNR and OPCAs are challenging optimization problems involving both integer and continuous decision variables. Due to the nature of these problems (combinatorial optimization problems), most approaches that deal with DNR and OPCAs resort to metaheuristic techniques, and they are limited to applications in small-size distribution networks. Although these techniques have proven to be effective when dealing with non-convex optimization problems, their main drawbacks lie in the fact that they require the fine-tuning of several parameters and do not guarantee the finding of a globally optimal solution. This paper presents a mixed-integer linear programming (MILP) model to solve simultaneous DNR and OPCAs in radial distribution networks. The proposed model can be solved by commercially available software; it guarantees to obtain globally optimal solutions and requires low computational effort when compared with metaheuristic techniques employed for the same purpose. Several tests were carried out on seven benchmark EDNs ranging from 33 to 417 buses. In all cases, the proposed methodology was able to replicate the results reported in the specialized literature. Regarding the DNR alone, a novel solution was found for the 119-bus test system which is 1.86 % better than that previously reported in the specialized literature. Furthermore, new solutions are reported for the simultaneous optimal DNR and OPCAs for medium and large-size EDNs. The power loss reduction in the test system ranged from 21.12 % to 68.93 % evidencing the positive impact of the proposed approach in EDNs.


I. INTRODUCTION
Distribution network reconfiguration (DNR) plays a key role in modern electric distribution networks (EDNs). The DNR problem consists of finding a new topology for the system to improve certain conditions, such as minimizing power losses, enhancing network reliability, and ameliorating voltage profile. DNR is carried out by altering the states of sectionalizing and tie switches, which are normally open and closed, respectively.
DNR is a classic optimization problem in electrical engineering that has become more important with the advent of automation systems. The seminal work of [1] in 1988, laid the groundwork for later studies on the subject. In 1989, the authors in [2] presented a heuristic approach to solve the DNR problem of resistive line losses under normal operating conditions. In 1993, the authors in [3] propose the use of artificial neuronal networks within the DNR problem for loss reduction. This methodology was applied to the 14bus test system proposed by [1]. In 1996, the authors in [4] implemented network partitioning theory to solve the DNR problem. In 1998 the authors in [5] solve the DNR along with the service restoration problem. The aforementioned early studies regarding DNR were limited to small-size EDNs. This is because DNR is a challenging optimization problem involving discrete and continuous decision variables. Furthermore, from the standpoint of mathematical optimization, the DNR problem is non-linear and non-convex. Several modeling and solution techniques have been applied to solve the DNR problem. Among these approaches, two main optimization paradigms stand out: metaheuristic techniques and mathematical programming methods.
Metaheuristics are search techniques generally inspired by natural phenomena or biological processes. These techniques have been widely used to solve non-convex optimization problems in engineering [6]- [9]. In [10]- [12], Particle Swarm Optimization (PSO) is applied to solve the DNR problem. This technique is inspired by the behavior of bird flocks and fish schools. In PSO, every particle represents a candidate solution, and its position and velocity are influenced by the local and global best-known positions; which in turn are updated as better positions are found by other particles. In [10], the authors proposed an Improved Selective Binary Particle Swarm Optimization (IS-BPSO) algorithm. They also introduced a new sigmoid function to control the rate of change of the particles and improve the convergence process. Tests are presented on 33 and 94-bus test systems. In [11], PSO is modified by using an inertia weight that decreases linearly during the simulation, allowing the PSO to explore a larger area at the beginning of the optimization process. In [12], a discrete version of PSO is applied for DNR and load balancing.
Genetic Algorithms (GAs) are inspired by the process of evolution. In this case, every candidate solution is represented by a gen. All candidate solutions must pass through the steps of selection, reconfiguration, mutation, and substitution in the current population until a given number of generations has elapsed. In [13], a non-revisiting GA is implemented for DNR to reduce line power losses; while in [14], a multiobjective GA is implemented within the DNR problem to minimize power losses as well as improve voltage profile and load balancing indexes.
In [15], [16], the authors use tabu search (TS) to solve the DNR problem. This technique employs local search methods and two types of memory structures to perform optimization. In [15], the tabu list is considered with variable size according to the system. Furthermore, a random multiplicative move is implemented in the search process to diversify the search process. In [16], the authors propose a heuristic to reduce the neighborhood size, and graph theory is used to generate an initial radial topology.
Harmony search (HS) is a metaheuristic algorithm that mimics the improvisation process of musicians in finding a pleasing harmony in a musical group [17]. An enhanced version of this technique was developed in [18] to solve the DNR problem. In this case, the authors also introduce a process to detect islands and meet the radiality constraint. In [19], HS is hybridized with path relinking to reduce the computational burden of the DNR problem and accelerate the convergence of the search process.
A metaheuristic technique inspired by the flashing behavior of fireflies is implemented in [20] and [21] to solve the DNR problem for power loss minimization. In [20], the simultaneous reconfiguration and DG sizing are implemented. In this case, an explicit radiality verification is proposed based on the Hamming dataset approach. This allowed to significantly reduce the search space and computation time of the algorithm. The authors in [21], complement the firefly algorithm with a load flow analysis criterion to reduce the search space of the DNR problem.
In [22], the authors propose a Chaos Disturbed Beetle Antennae Search (CDBAS) approach to solve the DNR problem with the presence of DG, using a non-linear modeling of the network. A detailed account of the metaheuristic techniques applied to solve the DNR problem is out of the scope of this paper; nonetheless, a literature review on the subject can be consulted in [23].
Mathematical programming approaches have also been considered to solve the DNR problem. The main advantage of these techniques, when compared to metaheuristics, lies in the fact that a globally optimal solution is guaranteed if the model is linear or convex. Furthermore, as opposed to metaheuristic approaches, there is no need to tune a set of parameters. Multi-objective modeling is proposed in [24] that takes into account active power losses and reliability enhancement. The proposed model is solved through the epsilonconstrained method implemented in GAMS software. In [25], the authors developed a decomposition algorithm in AMPL using CPLEX to solve a mixed-integer two-stage optimization formulation of the DNR problem for power loss minimization. A mixed-integer linear programming model is proposed in [26] to find the three minimum active power losses in EDNs. In [23], the authors solve the DNR problem using AMPL software; the main advantage of this approach is that it can be applied to real-size distribution networks.
Reactive compensation is carried out in EDNs to im-prove the voltage profile and minimize power losses. Several methodologies have been proposed in the specialized literature regarding reactive compensation, specifically for OPCAs. In [27], the authors use linear sensitivity factors for the optimal location and sizing of capacitor banks in EDNs. In this case, only commercial bank sizes are considered. Furthermore, to evaluate different alternatives from an economic viewpoint, the net present value is applied to select the best options. A multiverse optimizer approach is developed in [28] for the optimal allocation of capacitor banks in EDNs. A three-level optimization framework is implemented in [29], to solve the OPCAs considering unbalanced EDNs. The first step consists of solving a multiphase optimal power flow where the reactive power and the number of fixed and switched capacitor banks are determined. In the second step, the capacitor locations are found through a GA; finally, the third step determines the states of the switched capacitors, using binary optimization. In [30], the authors implemented a PSO approach for the optimal placement and sizing of capacitors considering the effect of harmonics in unbalanced EDNs. Other methodologies to approach the OPCAs include graph search [31], water cycle algorithm [32], tabu search [33], deterministic algorithms [34], and GAs [35].
The previous studies handled the OPCAs and optimal DNR as two different problems. Nonetheless, integrating the DNR and OPCAs within a single optimization problem may yield better solutions for the power loss minimization of EDNs. The simultaneous DNR and OPCAs has been a recent topic of interest; however, due to the non-convex nature of this problem, most of the studies reported in the specialized literature use metaheuristic techniques, and they are limited to small-scale distribution systems. For example, [36] and [37] propose an ant colony optimization (ACO) algorithm to solve the simultaneous DNR and OPCAs. ACO is a multiagent search method inspired by the behavior of ants when looking for food. In [38]- [41], the authors implement GAs to solve the simultaneous DNR and OPCAs; in [42], a HS algorithm is implemented for the same purpose; and in [43] the authors implement a sequential procedure for DNR and OPCAs. Initially, they use Lagrange multipliers and optimal power flow for system reconfiguration, and then a heuristic constructive algorithm for OPCAs.
A hybrid approach is presented in [44] that combines a minimal spanning tree algorithm for network reconfiguration and a GA for OPCAs. Another hybrid algorithm combining HS and artificial bee colony (ABC) is proposed in [45]. In [46], the authors use binary PSO, [47] addresses the problem through ordinal optimization. In [48], the authors introduce a new stochastic optimization framework-based bat algorithm; [49] presents an oppositional krill herd (OKH) algorithm, which is compared with the conventional krill herd (KH) algorithm, obtaining slightly better results with the first one. In [50], the authors propose a fuzzy-based framework to transform objective functions into fuzzy memberships and combine them into a single objective function, which is optimized using the Big Bang Big Crunch algorithm com-bined with PSO. In [51], the authors introduce a modified flower pollination algorithm (MFPA) for cost minimization by simultaneous network reconfiguration and capacitor placement. Graph theory is used to generate feasible combinations of tie-switches before the implementation of the optimization algorithm; [52] utilizes cat swarm optimization, [53] presents a hybrid heuristic search algorithm called Moth Swarm Algorithm to minimize the system power losses, decrease the total cost, and maintain the voltage profile, [54] uses a combination of Salp Swarm Algorithm and genetic algorithm (SSA-GA), [55] proposes three modified versions of optimization algorithms; namely, Modified Biogeography Based Optimization, Binary Teaching Learning Based Optimization, and Discrete Dolphin Echolocation. In [56], the authors present a Qualified Binary PSO and a modified Grey Wolf Optimization algorithm applied to a multi-objective function comprising real loss minimization, increasing savings cost and voltage enhancement of system buses. Also, the Direct Backward Forward Sweep Method (DBFSM) is used to calculate the voltage, losses, and other load flow calculations. [57] proposes the use of chemical reaction optimization (CRO), which is inspired by the kinetics of chemical reactions, and quasi-oppositional CRO (QOCRO). Also, chaos behavior is integrated with the QOCRO to speed up the convergence of the proposed algorithm. In [58] and [59] network reconfiguration is carried out using Johnson's algorithm, which is a combination of both Bellman-Ford and Dijkstra's algorithms, and an Adaptive Whale Optimization Algorithm (AWOA) is used for optimal capacitor placement. [60] proposes the use of the Modified Biogeography-Based Optimization (MBBO) algorithm, the Cuckoo Search (CS) algorithm, the Modified Imperialist Competitive (MIC) algorithm, and the Modified Bacterial Foraging-Based Optimization (MBFBO) algorithm to find the optimal selections of open switches, locations, and sizes of capacitors for radial distribution systems. A mixed-integer second-order cone programming model for solving the problems of the reconfiguration of feeders and the allocation of capacitor banks simultaneously is presented in [61]. The approach includes a voltage-dependent load representation and a representation of the operation of capacitor banks. [62] presents a multiobjective framework for DNR along with a capacitor allocation problem over multiple time intervals considering distributed generation, energy storage systems, and photovoltaic units. The operation cost, reliability, and voltage stability index are considered as objective functions. The proposed method to solve the problem is a combination of improved particle swarm optimization and modified shuffled leaping algorithms. [63] proposes a modified particle swarm optimization (MPSO) algorithm for both network reconfiguration and optimal capacitor bank allocation, considering different loading conditions scenarios such as light, normal, and heavy load. Finally, an exhaustive load flow analysis is carried out in [64] for optimal placement of shunt capacitors and network reconfiguration.
It was evidenced from the literature survey that many VOLUME -, 2022 techniques based on stochastic search and hybrid versions have been used to solve the simultaneous DNR and OPCAs problem. These techniques feature a higher probability of obtaining local optimal solutions due to premature convergence. Furthermore, computation time can be prohibitive for large distribution systems. To overcome these drawbacks, the authors present a MILP model to address the problem at hand. To the best of the author's knowledge, simultaneous DNR and OPCAs has not been approached with this type of model. Therefore, the proposed methodology consists of recasting the simultaneous optimal DNR and OPCAs problem into a single MILP model. In this context, the main features, and contributions of this paper are as follows: 1) it presents a MILP model to solve the simultaneous DNR and OPCAs; 2) due to its nature, the proposed model can be solved by commercially available solvers, guaranteeing a globally optimal solution; and 3) the proposed model can be applied to real-size distribution networks. To summarize, the objective of this paper is to present a MILP model for the simultaneous optimal DNR and OPCAs suitable for real-size distribution networks that provides global optimal solutions.
Furthermore, this paper aims to serve as a reference for future research regarding DNR studies. This is because many benchmark test systems, commonly found in the specialized literature for this type of study, were used to validate the results. The seven systems under study feature 33, 69, 83, 119, 136, 202, and 417 buses. Regarding the optimal DNR problem alone, the proposed model was able to find better solutions than those reported in the specialized literature for the 119 and 417-bus test systems, while for the other test systems, the same solutions reported in the specialized literature were found. As regards the simultaneous DNR and OPCAs which is the core of this paper, a quite similar solution was found for the 33-bus test system; nonetheless, with less capacitive compensation, and a better solution was found for the 69-bus test system with a similar degree of capacity compensation. According to the literature survey, the simultaneous DNR and OPCAs has been limited to small-size EDNs; nonetheless, new solutions are reported for the 83, 119, 136, 202, and 417-bus test systems that can be used by researchers for comparative studies in future research. This constitutes an advantage of the proposed approach, along with the fact that the DNR and OPCAs can be solved using commercially available software; it guarantees to achieve global optimal solutions (as opposed to heuristic and metaheuristic methods) and can be applied in real-size EDNs. Such features are not present in previously reported studies regarding the same topic.
The rest of the document is organized as follows: section II presents the MILP model proposed in this paper; section III details the results obtained with the model for several EDNs; Section IV presents a comparison of results, and Section V presents the conclusions of the paper.

II. MATHEMATICAL MODEL
This section presents the proposed MILP model to solve the DNR problem along with the OPCAs. It is worth mentioning that both problems can be solved either separately or together.

A. MATHEMATICAL MODELING OF THE NONLINEAR POWER FLOW
The power flow implemented in this paper is designed for radial EDNs and takes into account the following conditions: • The topology for the steady-state operation of the EDN is radial. • The EDN is represented by a monophasic equivalent. • Load is represented as a constant power. • Only an electric source (substation) is considered. • Active and reactive power losses in distribution lines are concentrated in their sending bus. • The capacitive reactance of distribution lines is not taken into account. According to Fig. 1, the power flow modeling for radial EDNs is given by equations (1)-(7) [65], [66].
The objective function is given by (1), which consists of minimizing the cost of active power losses. k e represents the interest rate of the cost of active power losses, Ω l is the set of branches, R ij and I ij are the resistance and current of branch ij, respectively.
Active and reactive power balances at each bus are given by (2) and (3), respectively. P ki and Q ki represent the active and reactive power flows in branch ki; while P ij and Q ij are the active and reactive power flows in branch ij, (kW, kVAr) respectively. P s i and Q s i are the active and reactive power supplied by the substation at bus i (kW, kVAr). P d i and Q d i are the active and reactive power demands at bus i (kW, kVAr). R ij and X ij are the resistance and reactance of the branch ij (kΩ), respectively. Finally, Ω l is the set of buses.
Constraint (4) represents the drop voltage in each branch ij of the EDN. Voltage magnitude is calculated in terms of the power flow through the branch and its electrical parameters. The authors in [67] proposed eliminating the voltage angle to obtain constraint (4). In this case, V i is the voltage at bus i (kV) and Z ij is the impedance of branch ij. Constraint (5) relates the square of current times the square of voltage, and the active and reactive power flows in each branch ij. Constraints (6) and (7) limit the voltage in buses i and the current through branches ij, respectively. In this case, V i and V i are lower and upper voltage limits at bus i (kV), while I ij and I ij are the lower and upper current limit of branch ij (A), respectively.

B. CHANGE OF VARIABLES
The linealization of (1)- (7) proposed in [65], [66], was adapted in this paper. Initially, variables V 2 i , V 2 j and I 2 ij are replaced by V sqr i , V sqr j and I sqr ij ; therefore, the model given by (1) and (7) is modified accordingly.

C. OBJECTIVE FUNCTION
The objective function given by Eq. (1) is modified as follows to include the cost of the OPCAs: where k l i is the installation cost of a capacitive bank and k c i is the installation cost of one kVAr at bus i. D is a depreciation factor applied to installation and purchase cost of capacitor banks, W ca i is a binary variable that indicates if a capacitor bank is placed at bus i, and Q ca i is the reactive power in kVAr supplied by the capacitive back at bus i.

D. REACTIVE POWER BALANCE CONSTRAINTS
The reactive power balance constraint given by Eq. (3) is modified as follows to include the reactive power injected by the capacitor bank at bus i:

E. VOLTAGE DROP IN BRANCHES
The voltage drop in branches is given by Eq. (4) is modified as follows to consider the optimal reconfiguration: (10) where b ij is an auxiliary variable that takes different values when the branch ij is open or closed.

F. LINEARIZATION
The left-hand side of (5) can be linearized as follows: In this case, S is the number of discretizations, ∆ V is the discretization step, and x j,s is the binary variable used in the discretization of V sqr j . The variable P c j,s is the power correction used in V sqr j I sqr ij . Constraint (11) is a linear approximation of the V sqr j I sqr ij product. It is calculated using the middle point of the first interval of the discretization of the square voltage magnitude multiplied by the square current flow magnitude, plus the successive power corrections (P c j,s ). Constraint (13) indicates that the variable x j,s−1 must be lower than the binary variable x j,s . Constraint (12) represents the range of values that voltage (V sqr j ) can take in the proposed linearization. Constraint (14) represents the type of variable used in the linearization (binary variable). Constraints (15) and (16) define the values of P c j,s . If x j,s = 0, then P c j,s = 0, and I sqr ij ≤ I ij ; otherwise, P c j,s = ∆ V I sqr ij . The right-hand side of (5) can be linearized as follows: 0 ≤ ∆Qij,y ≤ △S ij ; ∀ij ∈ Ω l , ∀y ∈ 1..Y Constraint (17) represents the linear approximation of the square active and reactive powers (P 2 ij ,Q 2 ij ). Constraints (18) and (23) represent the values that variables P ij and Q ij can take as a function of the auxiliary variables P + ij , P − ij , Q + ij , and Q − ij . Constraints (19) and (24) indicate that |P ij | and |Q ij | are equal to the sum of the values in each block of the discretization. Constraints (20) and (25) are the upper and lower limits of the contribution of each block of |P ij | and |Q ij |, respectively. Constraints (21), (22), (26), and (27) define the nature of the auxiliary variables P + ij , P − ij , Q + ij , and As regards the linearization of P 2 ij and Q 2 ij the following variables are considered: Y is the number of blocks of the piece-wise linearization; m s ij,y is the slope of the y th block of power flow at branch ij; ∆P ij,y and ∆Q ij,y are the values of the y th block of |P ij | and |Q ij |, respectively; ∆S ij is the upper limit of each block of the power flow at branch ij; P + ij and P − ij are non-negative auxiliary variables used to obtain |P ij |; and Q + ij and Q − ij are non-negative auxiliary variables used to obtain |Q ij |. The values of m s ij,y and ∆S ij are calculated as indicated in Eq. (28) and (29).

G. VOLTAGE AND CURRENT LIMITS
Equations (6) and (7) are modified as indicated in (31) and (32) taking into account the change of variable described in section II-B.

H. CONSTRAINTS RELATED TO THE DNR PROBLEM
The current limit in branches represented by the constraint (31) is modified according to (33). Also, constraints (34) to (40) are added to the model for considering the optimal DNR.
In this case, b ij is an auxiliary variable, which is zero if branch ij is closed according to Eq. (37); otherwise, this variable is free to take values within the constraint given by Eq. (38) to comply with Eq. (39); y + ij and y − ij are binary variables associated with the power flow direction of branch ij. If both variables are equal to zero, the branch is open, if any variable is equal to one, it means the switch in this branch is closed. Constraint (33) represents the current limit in function of the variables y + ij and y − ij . Constraints (34) and (35) represent the limit of variables P + ij and P − ij . Constraint (36) represents the limit of the reactive power flow in branch ij. Constraint (37) represents the limit of b ij . Constraint (38) guarantees that the EDN is radial. Constraint (39) allows one of the binary variables related to the power flow direction in branch ij to be equal to one. Constraint (40) defines the types of variable for y + ij and y − ij . Finally, N is the number of buses.

I. CONSTRAINTS RELATED TO THE OPCAS
The following linear constraints are added to the model to consider the OPCAs: 45) where N ca i is an integer variable that indicates the number of capacitive units installed at bus i, Q ca unit is the reactive power in kVAr injected by each capacitive unit, N ca is the maximum number of capacitive units that can be installed at bus i, N ca syst is the maximum number of capacitive banks that can be installed in the EDN. A capacitor bank is made up of N ca i capacitive units. Constraint (41) defines the reactive power injected by the capacitor bank at bus i. Constraint (42) represents the limit of capacitive units that can be installed at bus i. Constraint (43) represents the maximum limit of the capacitor bank that can be installed in EDN. Constraint (44) and (45) represent the type of variable for N ca i and W ca i in the OPCA problem.

J. MILP MODEL FOR OPTIMAL DNR AND OPCAS
As indicated in the previous subsections, the proposed MILP model for optimal DNR and OPCAs is as follows:

III. TESTS AND RESULTS
The model proposed in this paper was implemented in AMPL and solved with CPLEX, called with the default options.
All simulations were carried out on a computer with an Intel i7-8850H processor. Several benchmark distribution test systems were used to show the effectiveness and applicability of the proposed model. All systems data is available in [68]. For each EDN tested, the following cases are considered: -Case I: Base case.
-Case IV: Simultaneous optimal reconfiguration and OP-CAs.
The following hypotheses are considered in all simulations: 1) The number of blocks of the piece-wise linearizations (Y ) and discretizations (S) were calculated through a sensitivity analysis for each test system. These values are presented in Table 1.
2) The interest rate of the cost of active power losses (k e ) is equal to is 168 US$ /kW-year [59].
3) The installation cost of each capacitor bank (k l i ) is 1600 US$/bus regardless of its location in the network [59]. 4) The installation cost of one kVAr (k c i ) is equal to 25 US$/kVAr regardless of its location in the network [59]. 5) The depreciation factor D was considered as 10% [69], [70]. 6) The maximum number of capacitive units (N ca ) for the 33, 69, 119 and 136-bus systems is equal to 3, and for the 83, and 202-bus systems, it is equal to 5, and for the 417-bus system, it is equal to 4. 7) The reactive power of each capacitive unit (Q ca unit ) is 50 kVAr.
The validation of results was carried out through a comparison with several published papers; nonetheless, only those papers that provided enough data to reproduce their results were considered. To overcome this drawback and contribute to future research, we have made all our data available in [68].

A. COMPARATIVE ANALYSIS BETWEEN LINEAR AND NONLINEAR POWER FLOW
The computation power flows plays a key role in most studies regarding transmission and distribution networks [71]. Therefore, counting on an accurate model to compute power flows is of paramount importance in studies regarding optimal DNR and OPCAs. This paper implements a linear version of the power flow applied to EDNs. The number of piece-wise linearizations (Y ) and discretizations (S) used in the proposed power flow model (for each test system) was the result of several simulations with different values of these parameters. Table 1 presents a comparison of results between the non-linear power flow (exact solution), and the linear approximation developed in this paper in terms of total power losses, minimum voltage, and computational time. Note that for all test systems, the linear model obtains quite similar solutions to the exact model. Furthermore, the computation time required for the linear power flow is lower than the time of the non-linear power flow for all test systems.  [68]. Table 2 summarizes the results obtained with the 33-bus test system for the four cases under study. Note that for the base case (Case I), the total cost of power losses is 34,048 US$/kW-year and the minimum voltage magnitude of the network is 0.9131 p.u. For the optimal reconfiguration alone (Case II) the power losses are 139.54 kW. In this case, switches 7, 9, 14, 32, and 37 are open. This topology VOLUME -, 2022 represents a reduction of 31.15 % concerning Case I. Note that the CPU time is 0.46 s. It is worth to mention that the solution found for this system is the same as the one reported in [15], [72]- [82]. Furthermore, the cost of power losses for the optimal reconfiguration alone is reduced from 34,048 US$/kW-year to 23,442 US$/kW-year. The proposed mathematical model for OPCAs (Case III) proposes installing 350 kVAr at bus 13, 550 kVAr at bus 24, and 1050 kVAr at bus 30. The investment cost for this case is US$ 5355, and the power losses are 132.20 kW. The reduction in power losses, with respect to Case I is 34.77%, and the CPU time is 2.13 s. It is worth mentioning that in this case, no reconfiguration is considered; therefore, the same topology (open switches) of the base case is kept. Despite this fact, an important reduction in power losses is obtained by the OPCAs alone.
For the simultaneous optimal reconfiguration and OPCAs, the model proposes to install 400 kVAr at bus 8, 550 kVAr at bus 24, and 950 kVAr at bus 30. The investment cost is US$ 5230, and the power losses are 92.65 kW. The reduction of power losses, with respect to the base case, is 54.28 %, and the CPU time is 2.06 s. For cases III and IV, the savings from power losses justify the investment in the capacitor banks. Furthermore, the minimum voltage magnitude in Case IV is 0.9583 p.u. which represents an increase of 4.7% with respect to the minimum voltage magnitude of Case I. Fig. 2 presents the voltage profiles of the 33-bus test system for the four cases under study. Note that the improvement in voltage magnitudes is evident after the optimal reconfiguration, and it is further improved with the OPCAs and when both strategies are combined. In this case, sudden changes in voltage profile, such as the one on bus 18, indicate the beginning of a branch near the substation. The same is observed in other distribution test systems.

C. RESULTS WITH THE 69-BUS TEST SYSTEM
The 69-bus test system has 5 normally open interconnection switches, 68 tie switches, and 73 branches. In the base case (Case I), switches 69, 70, 71, 72, and 73 are open. The nominal voltage of this system is 12.66 kV with a total demand of (3, 802.19 + j2, 694.6) kVA. The minimum voltage magnitude is 0.9092 p.u. and the active power losses are 224.99 kW representing a cost of 37,798 US$/kW-year. The data of this system can be consulted in [68]. Table 3 presents the results obtained for the four cases under study. In Case II, when only optimal reconfiguration is considered the power losses present a reduction of 55.72 % with respect to Case I (base case without reconfiguration). The CPU time required to find this solution is 2.42 s and the minimum voltage magnitude is 0.9427. This topology is the same as the one reported in [11], [15], [78], [81], [83]. The proposed mathematical model for the OPCAs proposes to install 50 kVAr at bus 22, 750 kVAr at bus 61, and 200 kVAr at bus 64. The investment cost for this case is US$ 2980, and the power losses are 155.69 kW. The reduction of power losses is 30.8% with respect to the base case, and the CPU time is 1.07 s. In this case, the minimum voltage magnitude is 0.9258 p.u. In Case IV (simultaneous optimal reconfiguration and OPCAs), the model proposes to install 750 kVAr at bus 61, 200 kVAr at bus 64, and 50 kVAr at bus 65. The investment cost for this case is US$ 2980, and the power losses are 69.90 kW. The reduction of power losses, with respect to the base case, is 68.93 %, and the CPU time is 4.04 s. Observe that the topologies for Cases II and IV are slightly different. For cases III and IV, the savings from power losses justify the investment in the capacitor banks. Also, for Case IV the minimum voltage magnitude is 0.9605 p.u., representing an improvement of 5.6% with respect to Case I. Fig. 3 shows the voltage profiles of the 69-bus test system for the four cases under study. Note that as new modifications are carried out in the system (optimal reconfiguration, OPCAs, and both), the voltage magnitudes tend to increase, especially on buses 5 to 27 and from bus 50 on. The nominal voltage of this system is 11.4 kV with a total demand of (28, 350.9 + 20, 700) kVA. The active power loss for the base case, without reconfiguration, is 531.99 kW with a cost of 89,374 US$/kW-year; also, the minimum voltage magnitude is 0.9285 p.u. The data of this system can be consulted in [68]. Table 4 presents the results obtained for the four cases under study. For the optimal reconfiguration (Case II), power losses are 469.87 kW, representing a reduction of 11.67 % with respect to the base case. In Case III, when only OP-CAs is considered (without reconfiguration), the algorithm proposes to install 1500 kVAr at buses 1, 19, 34, 71, and 81. In this case, the investment cost is US$ 19550, and the power losses are 405.22 kW; which represents a 20.86% reduction with respect to the base case. Also the minimum voltage magnitude is 0.9591 p.u. This solution is found with a CPU time of 7.83 s. In Case IV, the model proposes to install 1500 kVAr on buses 7, 71, and 79, 600 kVAr at bus 20, and 900 kVAr on bus 53. The investment cost is US$ 15800, and the power losses are 368.05 kW; which represents a reduction of 30.81 %; the CPU time, in this case, is 242.91 s, and the minimum voltage rises to 0.9628 p.u. For cases III and IV, the savings from power losses justify the investment in the capacitor banks. Fig. 4 depicts the voltage profiles of the 83-bus test system for the four cases under study. An evident improvement in voltage magnitudes is observed even when only reconfiguration is considered. On the other hand, the best voltage profile is observed when both reconfiguration and OPCAs are simultaneously considered.    [68]. Table 5 summarizes the results for the four cases under study. In the case of optimal reconfiguration (Case II), the power losses are 853.58 US$, which presents a reduction of 34.16 % with respect to the base case, and the CPU time is 10.73 s. In this case, only with optimal reconfiguration, the minimum voltage magnitude improves 7.3% (from 0.8687 to 0.9322 p.u) being now an acceptable value. It is worth mentioning that the best solution reported in the specialized literature for the reconfiguration of this EDN has a power loss of 869.71 kW. All reviewed papers ( [15], [72], [74], [77], [78], [80], [81], [83]- [85]) present the next open switches:

VOLUME -, 2022
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication.     24,27,35,40,43,52,59,72,75,96,98,110,123,130, and 131. The model proposed in this paper was able to find a solution 1.86% better than the one reported, and the open switches are shown in row 2 of Table 5. For Case III, the proposed mathematical model proposes installing 1500 kVAr on buses 52, 77, and 116. The investment cost of this solution is US$ 11730, and the power losses are 950.80 kW. The reduction in power losses is equal to 26.66 %, which compensates the investment costs; also the CPU time is 3.72 s. In Case IV, the model proposes to install 1500 kVAr on buses 52 and 78, and 1400 kVAr on bus 116. The investment cost for this solution is US$ 11480, and the power losses are 687.78 kW. In this case, the reduction in power losses is 46.95 % with respect to the base case. This reduction on power losses justifies the investment in capacitor banks; furthermore, the CPU time is 194.44 s and the minimum voltage magnitude is 0.9495 p.u. which represents an improvement of 9.3 % with respect to the base case. Fig. 5 illustrates the voltage profiles of the 119-bus test system considering the four cases under study. As observed with the voltage in the other test systems, the greatest improvement in voltage magnitudes takes place in Case IV.

F. RESULTS WITH THE 136-BUS TEST SYSTEM
The 136-bus test system has 21 normally open interconnection switches, 135 tie switches, and 156 branches. In the base case, switches 136, 137, 138, 139, 140, 141, 142, 143, 144,  145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, and 156 are open. The nominal voltage of this system is 13.8 kV with a total demand of (18, 313.8 + j7, 932.5) kVA. The active power loss for the base case, without reconfiguration, is 320.36 kW and the minimum voltage magnitude is 0.9306 p.u. which is an acceptable value. The data of this system can be consulted in [68]. Table 6 presents the results for the four cases under study. In the case of optimal reconfiguration (Case II), the power losses present a reduction of 12.55 %, and the CPU time is 7.07 s. This solution is the same as reported in [72], [85], [86] with a minimum voltage magnitude of 0.9581 p.u. In Case III, the proposed mathematical model proposes to install 1000 kVAr at bus 12, 1050 kVAr at bus 35, and 1400 kVAr at bus 155. The investment cost is US$ 9105, and the power losses are 285.08 kW, representing enough savings to justify the purchase of new equipment. In this case, the reduction in power losses is 11.01%, the CPU time is 39.45 s and the minimum voltage magnitude is 0.9694 p.u. In Case IV, when both, optimal reconfiguration and OPCAs are considered, the model proposes installing 1250 kVAr at bus 35, 13350 kVAr at bus 56, and 900 kVAr at bus 155. The investment cost US$ 9230, the minimum voltage magnitude is 0.9729 p.u., and the power losses are 252.67 kW. The reduction of power losses is 21.12 %, and the CPU time is 39.45 s. In this case, the savings from power losses justify the investment of the capacitor banks. Fig. 6 shows the voltage profiles of the 136-bus test system for the four cases under study. A greater improvement in voltage profile is achieved in Case IV.

G. RESULTS WITH THE 202-BUS TEST SYSTEM
The 202-bus test system has 15 normally open interconnection switches, 201 tie switches, and 216 branches. In the base case, switches 202, 203, 204, 205, 206, 207, 208, 209, 210,  211, 212, 213, 214, 215, and 216 are open. The nominal voltage of this system is 13.8 kV with a total demand of (27, 571.56 + j17, 084.54) kVA. The active power loss for the base case, without reconfiguration, is 548.89 kW which represents a cost of 92,213 US$/kW-year. Also, the minimum voltage magnitude is 0.9574 which is an acceptable value. The data of this system can be consulted in [68]. Table 7 presents a summary of the results for the four cases under consideration. In the case of optimal reconfiguration (Case II), the power losses present a reduction of 6.87 %, and the CPU time is 64.91 s. In this case, the total cost associated with power losses reduces from 92,213 US$/kW-year to 85,876 US$/kW-year with no investment in the network. This solution is the same as the one reported in [78]. In Case III when only OPCAs is considered without reconfiguration, the model proposes to install 1500 kVAr on buses 53, 113, 129, 193, and 200; with an investment cost of US$ 19,550 which is justified by a reduction of power losses of 21.64%. The CPU time, in this case, is 17.54 s and the minimum voltage magnitude of the network is 0.9714. In Case IV, the model proposes to install 1500 kVAr at buses 42, 54, 120, 132, and 193. The investment cost is US$ 19,550, and the power losses are 402.57 kW. The reduction of power losses is 26.65 %, and the CPU time is 216.07 s. In this case, the savings from power losses justify the investment in the capacitor banks. Furthermore, the minimum voltage magnitude is 0.9724. Fig. 7 depicts the voltage profiles of the 202-bus test system for the different cases under study. As with the previous systems, the voltage profile improves with reconfiguration and gets better with OPCAs as well as when both strategies are simultaneously implemented.

H. RESULTS WITH THE 417-BUS TEST SYSTEM
The 417-bus system has 59 normally open interconnection switches, 416 tie switches, and 476 branches. In the base case, switches 418 to 476 are open. The nominal voltage of this system is 10.0 kV with a total demand of (27372.4 + j13237.01) kVA. The active power loss for the base case is 708.94 kW and the minimum voltage magnitude is 0.93 p.u. The data of this system can be consulted in [68]. Table 8 presents a summary of the results for the four cases under consideration. In the case of optimal reconfiguration (Case II), the active power losses are 582.08 kW. This presents a reduction of 17.89 %, and the CPU time is 9941.87 s. The minimum voltage magnitude is 0.9536. This solution is better than the one reported in [73] which presents active power losses of 685.88 kW. VOLUME -, 2022      Fig. 8 depicts the voltage profiles of the 417-bus test system for the different cases under study. As with the previous systems, the voltage profile improves with reconfiguration and gets better with OPCAs as well as when both strategies are simultaneously implemented.
It is worth mentioning that for all EDN under study, the simultaneous optimal reconfiguration and OPCAs presented lower power losses than the optimal reconfiguration or the OPCAs when they are considered separately. On the other hand, the simultaneous optimal reconfiguration and OPCAs presented lower investment costs than the OPCAs alone with the initial topology of the system, and the savings from power losses justify the investment of the capacitor banks. More-over, the voltage profiles of the tested EDNs are improved in all tests performed, especially when the simultaneous optimal reconfiguration and OPCAs is carried out.

IV. COMPARATIVE ANALYSIS OF RESULTS
To evidence the applicability and effectiveness of the proposed mathematical model, this section shows a comparative analysis of results with other papers reported in the specialized literature. Only papers reporting enough information to reproduce their results and that implemented the simultaneous optimal DNR and OPCAs were considered. Note that the comparison is carried out only with the 33 and 69-bus test systems since, as already mentioned, the studies reporting results of DNR and OPCAs are limited to small-size EDNs. In this paper, we also provided results with test systems of 83, 119, 202, and 417 buses that can be used for comparative purposes in future studies.   Table 9 presents a comparison of results for the 33-bus test system. Three capacitor banks are considered in this paper for comparative purposes with [59] and [51]. Nonetheless, it is worth mentioning that the proposed model allows selecting any number of capacitor banks to be installed in the system. Furthermore, if the number of capacitor banks is excessive, the model would limit their installation up to the point where savings on power losses no longer compensate for the installation cost of capacitors.
The active power loss found by the proposed model is 92.65 kW. This is the second-best solution reported in the specialized literature since with the methodology proposed in [54] power losses are 90.35 kW. Nonetheless, this last reference employs 7 capacitor banks that add up to 2400 kVAr, while our solution only allocates 3 capacitor banks with a total of 1900 kVAr. Clearly, the solution proposed in this paper results in lower investment costs and therefore might be more attractive, even if power losses are slightly higher. As regards the topology of the EDN, the same open switches are reported in all papers except for [59]. Also note that in [49] and [57], only bus 27 is selected for placing capacitor banks.    [49] and [57].

V. CONCLUSION
Network reconfiguration and capacitor placement play an important role in modern EDNs since they allow to reduce power losses and enhance network reliability. This paper presented a MILP model to tackle the optimal reconfiguration and placement of capacitors in electric distribution networks. The proposed model is able to perform either optimal reconfiguration, optimal placement of capacitors, or both simultaneously. A linear power flow for radial distribution networks was implemented. Results in terms of total power losses, minimum voltage, and computational time were compared with the non-linear power flow (exact solution), obtaining quite similar solutions. Furthermore, for all test systems, the computational time required by the linear power flow was much lower than that of its non-linear counterpart.
Several tests were performed on benchmark EDN with sizes ranging from 33 to 417 buses. For the optimal reconfiguration alone, the proposed model was able to obtain the optimal solutions reported in the specialized literature. On the other hand, the solutions found for the 119-bus and 417bus EDN were better than those previously reported in the specialized literature. The optimal DNR and OPCAs applied to EDNs as proposed in this paper showed higher power loss reduction when they were considered simultaneously than when they were computed separately. Furthermore, the simultaneous approach presented lower investment costs than the OPCAs alone, and the savings from power losses justified the investment cost of the capacitor banks in all test systems. Finally, the voltage profiles of the tested EDNs were improved in all tests performed, especially when the simultaneous optimal DNR and OPCAs were carried out.
As opposed to the approaches consulted in the specialized literature that have been tested in specific small-size distribution networks, the proposed formulation proved to be effective for solving the reconfiguration and optimal placement of capacitors in a wide variety of EDNs with different sizes and characteristics.
The results obtained demonstrated that the simultaneous optimal DNR with OPCAs is able to improve the voltage profile and reduce power losses. The results found in this case are better than those reported in the specialized literature. Furthermore, new solutions are also reported for real-size distribution systems that can be used by other researchers for comparative purposes in later studies.

APPENDIX
For quick reference, the nomenclature used in this paper is provided here.

Nomenclature
Sets Ω b Set of buses.