Simultaneous Planning of the Medium and Low Voltage Distribution Networks under Uncertainty: A Bi-Level Optimization Approach

Distribution network expansion planning (DNEP) is one of the important matters in the field of planning and operation of electrical power systems. Since many costs and losses have occurred in the distribution networks, it has increased attention towards this network.'e electrical energy distribution network is divided into two parts: the medium voltage (MV) network and the low voltage (LV) network.'emain problem in this field is that planning is done either only on theMVnetwork or only on the LV network. While planning in each of these networks has a significant effect on the other networks, this important case has not been considered in most research studies. 'erefore, this study has tried to do integrated planning in the form of a bi-level model in the presence of different types of distributed generations (DGs) and consider the uncertainties of renewable sources and load demand in bothMV and LV networks so that the planning and operation costs are minimized. In the proposed bi-level model, the upper-level section aims to minimize the investment and the operation cost of the MV network, and the lower-level problem minimizes the investment and the operation cost of the LV network considering the DGs and pollution emission. 'e obtained results show the effectiveness of the proposed model.


Motivation and Aim.
e distribution network expansion planning (DNEP) problem is one of the most important issues in the power system planning with the aim of supplying the distribution network's demand through specifying the location and capacity of distribution substations, distribution transformers, and feeders. is problem can be expressed in two ways: expansion planning and reinforcement planning. In the expansion planning problem, the planner selects new rights of ways (feeders) or locations and the capacity for new distribution substations and distributed generations (DGs). In the reinforcement problem, the network is reinforced in some feeders. e DNEP problem can be considered in both medium-voltage (MV) and low-voltage (LV) distribution networks.
In this study, the applied model uses the contradictions that exist in the planning of both MV and LV networks in such a way that each of the MV and LV network, from their point of view, may suggest a specific location and capacity for distribution transformers, and therefore, this view may not be appropriate for another network perspective. erefore, by using a bi-level model, an attempt has been made to propose a location and capacity for distribution transformers that are acceptable from the point of view of each network. e applied model considers the MV network at the upper level (UL) and LV network planning at the lowlevel (LL) of the bi-level model. e applied problem is described in Figure 1. e objective of the UL problem is to determine the best decisions about the distribution substations and MV feeders to meet the demand of the system with the minimum investment and operation cost. e LL problem aims to minimize the total cost of the LV system considering the cost of the pollution emissions and the power loss of the network. e general basis of the work is based on the fact that first a location and capacity for the distribution transformers are proposed (S max c ) by the UL problem, and then, in the LL model, the power injected into the distribution transformers (S s,t,i,c ) is determined by the demand and the specifications of the DGs. is variable is sent to the UL problem to update the optimal decisions at this level if needed. If the constraints of the problem are not met at any level, then the capacity of the distribution transformers must be changed within the allowed range and the problem will be re-examined.
is process continues until an optimal point is reached.

Literature Review and Contributions.
Most previous DNEP studies have been done at the MV level. In [1], an optimal power flow approach is developed to model the DGs in the optimal planning problem of the MV distribution networks. In [2], the reliability of the MV networks increases in the planning problem in the presence of the DGs and storage units. e DNEP problem of the MV networks is mathematically formulated as a multiobjective planning model in which the first and second objectives aim to improve the costs and reliability, respectively [3]. In [4], a mixed-integer linear programming (MILP) model is proposed to minimize the annualized investment and operation costs by installing new circuits, upgrading existing circuits, and installing capacitor banks in the MV network. e DNEP problem in the MV networks in the presence of DGs is investigated considering the uncertainties of the demand and energy price in [5]. In [6], a new approach is presented for the loss allocation in an MV distribution system in the presence of different models of DGs. A hybrid evolutionary algorithm is proposed to optimize the planning of the DGs in MV networks in [7] to improve the power loss and voltage stability index. In [8], a metaheuristic approach is proposed based on grey wolf optimizer (GWO) and particle swarm optimization (PSO) for the optimal DNP in the MV side, considering DGs and a battery storage system (BSS). In [9], a new approach to the DNEP problem in the MV network under uncertainty in the presence of wind energy is proposed to improve the reliability index. In [10], an MILP model is proposed for the DNEP problem, which chooses a set of candidate feeders with a minimum cost with specified reliability.
e DNP problem is formulated in [11] as a  multistage stochastic programming (MSP) approach considering the uncertainty of DGs. e objective function of this model is to minimize the planning costs subject to the operation and the investment constraints. A stochastic riskbased method is developed in [12] for the resilient DNP problem to model the uncertainties of wind energy, demand, storm duration, and fragility of the system components. In [13], the DENP problem is considered at the MV level in the presence of BSSs and photovoltaic (PV) arrays and uncertainty of the demand. In [14], a mixed-integer second-order con programming is proposed for the DNEP problem at the MV level that tries to search for the optimal decisions for transformer and feeder upgrades and also for PV and BSS. In [15], a flexible multistage planning approach for the DNEP is proposed, and the planning problem is formulated based on the Markov decision process for the MV network. In [16], a multiobjective model for DNEP is proposed in the MV network. Two conflicting objective functions are considered: costs vs. CO 2 emissions, and then, scenario reduction is applied within a two-stage stochastic formulation. In [17], a new approach for the DNEP problem based on geographic information systems (GIS) is proposed for MV and LV networks, independently. e proposed approach combines Delaunay Triangulation with a MILP model. In [18], a new approach based on spanning tree to solve the expansion of lines and allocation of DGs considering the uncertainty of load demand and RESs is proposed for the MV distribution network. In [19], an improved particle swarm optimization algorithm based on particle swarm optimization for adaptive improvement is proposed for the DNEP problem in the MV part, in which the feasibility and superiority of the algorithm are illustrated.
A few DNEP studies have been done at the LV level. e power loss and reliability of the LV networks improved in the DNP problem considering the DGs in [20]. In [21], new planning principles are described for rural LV networks considering DGs to minimize total costs. In [22], optimal sizing, sitting, and scheduling of BSSs are calculated in an LV distribution system. Some studies investigated the DNEP problem for both the MV and LV (integrated) networks. In  [23], by determining the reinforcement of existing lines and substations, an integrated methodology is proposed for the DNEP problem, in which the objective function is to maximize the reliability of the network. In [24], a single objective function is presented which minimizes the cost of LV circuits, MV substations, MV DGs, MV circuits, and high voltage substations where the problem is solved by the imperialist competitive algorithm (ICA). In [25], a multiobjective mixed-integer nonlinear programming (MINLP) is proposed for the integrated DNEP problem, which tries to minimize the investment cost of feeder routing and substation alternations while maximizing the utilization of the proposed charging stations. e reviewed studies until now are compared with each other in Table 1.
Due to the nonlinear nature of the DNEP problem, many heuristic and metaheuristic methods have been used to investigate this problem, for example, genetic algorithm (GA) [23], particle swarm optimization (PSO) [5,27,28], tabu search (TS) [26], harmony search algorithm (HSA) [29][30][31], imperialist competitive algorithm (ICA) [24,32], grey wolf optimizer (GWO) [8], firefly algorithm (FA) [33], strength Pareto evolutionary algorithm (SPEA) [34], simulated annealing (SA) [35], perturbation mechanism [36], pseudodynamic programming technique [37], artificial immune systems (AIS) [38], clonal selection algorithm [39], shuffled frog leaping (SFL) [40], and artificial bee colony (ABC) [41]. It should be noted that this problem can be solved using the solution methods available in [42,43]. e noteworthy point in the mentioned approaches is that planning has been done only at one level of the distribution network, while in the model presented in this study, planning is done simultaneously at both levels of the MV and LV distribution networks. e main gaps concluded from the previous studies are as follows: (i) Although the DNEP problem of the MV and the LV networks should be modeled simultaneously, this issue is only addressed in a few studies [24][25][26]. (ii) Determining the location and the size of the distribution transformers is the common decision between the DNEP problems of the MV and LV networks. erefore, when the DNEP problem is modeled for both the MV and LV networks (integrated), the effect of the decisions in both networks on the location and the size of distribution transformers should be considered. is is considered only in [26]. (iii) Although modeling the pollution emissions of the nonrenewable DGs and the main grid can change the output decisions of the DNEP problem in the presence of renewable-based DGs, this issue is not considered in [26]. Also, modeling the uncertainties of the demand and the output power of RESs is not investigated in [26].
It needs to be said that power system planning studies are always done in two phases or two steps. In the first phase, with the help of simplified mathematical equations, a general model for network modeling is expressed, in which the program execution time does not matter. In the first phase, the obtained answers are saved. In the second step, the obtained answers in the first step are analyzed in more detail, including reliability and short-circuit studies. What is done in this study and in most studies in this field is in the first phase of planning. e DNEP problem of the MV network is modeled as an upper-level (UL) problem in which the obtained size and location of the distribution transformers are sent to the lower-level (LL) problem. en, the DNEP problem of the LV network considering the different DGs, the pollution emissions and the uncertainties are formulated in the LL problem. is problem is optimized by considering the size and location of the distribution transformers obtained in the UL problem. e optimum power injected into the distribution transformers obtained in this stage is sent to the UL problem. In the following, the main problem will be solved using the genetic algorithm (GA) with special coding and division of the model into several subproblems.
For this study, the main contributions are as follows: (1) Modeling the DNEP problem of both MV and LV networks, simultaneously considering the uncertainties of the demand and RESs using a bi-level model (2) Considering the amount of energy purchased from each upstream grid (3) Modeling the pollution emission in the objective function of the LV model (4) Applying the GA to solve the proposed bi-level model

Paper
Organization. e mathematical model is presented in Section 2. Modeling and handling the uncertainties are presented in Section 3. A solution approach is presented in Section 4. A numerical study is reported and discussed in Section 5, and finally, the conclusions are given in Section 6.

UL Model.
e objective function of the UL problem is composed of five terms as follows: where 4 International Transactions on Electrical Energy Systems In this objective function, F 1 is the investment cost of installing a new line or feeder between nodes i and j in the MV network, F 2 is the investment cost of installing a new substation, F 3 is the investment cost of installing a new distribution substation, F 4 is the cost of losses, and F 5 is the cost of purchase power from the transmission network. e constraints of the UL problem are described in (3)- (8): Radial Structure of medium − voltage part � 1, Equation (3) shows the nodal balance in the MV network. e operation limitations of the MV feeders, substations, and distribution transformers are modeled in (4)-(6), respectively. e voltage limitations in all nodes of the MV network are modeled in (7), and equation (8) is used to ensure that the radial structure of the MV network is maintained.

LL Model.
e objective function of the LL problem is composed of six terms as follows: where International Transactions on Electrical Energy Systems In this objective function, F 1 ′ is the investment cost of installing new LV circuits between nodes i′ and j′ in the LV network. F 2 ′ and F 3 ′ are the investment and operation costs of installing DGs, respectively. F 4 ′ is the cost of line and F 5 ′ is the cost of purchasing power from the UL network, and finally, F 6 ′ is the cost of pollution emission. It is Northway that the term in the bracket in equation (14) denotes the distribution transformer's losses, and the first and second terms in equation (15) denote the cost of pollution associated with nonrenewable DGs and the cost of pollution associated with the main grid, respectively. e constraints of the UL problem are described in (16)-(20):  International Transactions on Electrical Energy Systems Constraint equation (16) shows the nodal balance of the LV network. e operation limitations of LV circuits, node voltage, and DGs are modeled in equations (17)- (19), respectively. Finally, equation (20) is used to ensure that the radial structure of the LV network is maintained.

Modeling of Uncertainties
In this section, the uncertainties of the demand and the output power of renewable energy sources are modeled.
According to [44], three qualitatively different types of uncertainty ethical, option, and state space uncertainty are distinct from state uncertainty, the empirical uncertainty that is typically measured by a probability function on states of the world. Ethical uncertainty arises if the agent cannot assign precise utilities to consequences. Option uncertainty arises when the agent does not know what precise consequence an act has in every state. Finally, state space uncertainty exists when the agent is unsure of how to construct an exhaustive state space. ese three types of uncertainty are characterized International Transactions on Electrical Energy Systems along three dimensions, natures, object, and severity, and the relationship between them is examined.
In this study, the uncertainties include the uncertainty related to load demand and renewable energy resources that have specific probability density functions (PDF). e Monte Carlo simulation method is a simulation approach based on probability and statistics theory and methodology. At present, the Monte Carlo simulation method has been applied to many fields of engineering and scientific theory, with the advantages of simple principles and realization, insensitivity to the dimension of problems, avoidance of any constraining assumptions, and strong adaptability. In the Monte Carlo simulation method, the state of each component in the system is obtained by sampling. e components include various system equipment, such as generators, transmission lines, transformers, and different load levels. erefore, the MCS is applied to handle the uncertainties.

Modeling the Uncertainty of Demand.
In general, the electric charge and energy price are estimated by the normal probability distribution function (PDF). Since this ordinary PDF is a continuous function, therefore, the probability of each point is not shown. To overcome this problem, the continuous function must be estimated with a normal discontinuous function. In this approximation, if the intended steps are smaller, the approximation error will be smaller. e next step is to generate PDF-based loading scenarios. For this purpose, the roulette wheel mechanism (RWM) is applied. us, the load surfaces are normalized to the range and then a random number is generated. If, among the load levels, a random number, generated in the normalized probability region of a load prediction level, is placed on the roulette wheel, the load prediction level is selected by RWM as the scenario. is process is repeated until scenarios called RW/MCS are generated [45].

Modeling the Uncertainties of WT and PV.
One of the functions used to model wind speed is to use the Weibull PDF. e output power of a WT is shown as follows [45]: e output power of a photovoltaic array is shown as follows [45]: where In this formulation, the parameter G T is an uncertain parameter that is based on the Beta PDF.

Handling the Uncertainties by Monte Carlo Simulation.
Monte Carlo methods are a set of computational algorithms based on random sampling iterations to calculate results. Monte Carlo methods are generally used when it is impossible to calculate the exact result with a definite algorithm. erefore, due to the reliance of this method on the repetition of calculations and random numbers, it is suitable for calculation by a computer. Monte Carlo methods are, in fact, one of the most comprehensive tools for evaluating uncertain studies [46]. e general pseudocode for handling the uncertainties-based Monte Carlo International Transactions on Electrical Energy Systems methods is shown in Figure 2, where F (X i ), β,E(F), and V represent experiment function, variance coefficient, estimated value, and variance index, respectively.

Solution Approach
To solve the proposed MINLP model, the GA is employed. is algorithm is inspired by the process of natural selection that belongs to the larger class of evolutionary algorithms. e GA is commonly applied to produce high-quality solutions to optimize and search problems by relying on biologically inspired operators such as mutation, crossover, and selection. e GA makes it possible to look for optimal solutions in a nonconvex space, which can be achieved with an initial configuration. is configuration is also achievable in a heuristic way. After evaluating the configuration, specific topologies are suggested. ese topologies are called neighbors, and due to the high number of topologies, a specific number of them are selected according to the conditions of the problem. e best configuration is selected from the topologies. is strategy continues until the end condition is reached to obtain a global optimal point, which is the best answer in terms of minimum cost. e pseudocode of the GA is shown in Figure 3. Subsequently, other parameters of the algorithm are explained.
e coding system can be in the form of a string, array, list, or tree. e choice of each of these methods is made according to the type of problem and the search required to solve and optimize it. Meanwhile, string coding is more useful than other methods due to its ability to create a more chromosome diversity in less space. e encoding of the UL chromosome and LL is shown in Figure 4. In this study, to handle the constraints, Deb's method [47] is employed. Deb's method is actually a parameterless penalty strategy based on the following three rules: (i) Any feasible solution is preferred to any infeasible solution (ii) Between two feasible solutions, the one having the better objective value is preferred (iii) Between two infeasible solutions, one having the smaller constraint violation is preferred After applying genetic actuators (crossover and mutation) to chromosomes, new answers are obtained that may not be true in the problem's constraints. is happens in many cases with constraints. e simplest solution is to use the penalty function for the objective function. As a result, the selection process tends to the true chromosomes. After deciding how to encode chromosomes, the initial population must be created.
is step is usually done by randomly selecting values within the allowable range.
First, it is required to determine the location, capacity, and amount of power injected into the transformers, which is suggested by the UL problem. However, load distribution equations in the MV network cannot be calculated due to the uncertainty in the amount of power injected into the transformers. In other words, the UL objective function, equation (1), is specified with the UL constraints when the amount of power injected into each transformer is determined. When the location and capacity of the transformers are determined in the UL problem, the LL problem is solved to determine the amount of power injected into the transformers. After determining the amount of power injected into the transformers, the amount of the UL objective function can also be calculated. e flowchart of the proposed algorithm is shown in Figure 5.

Numerical Study
To demonstrate the effectiveness of the proposed model and validate the solving approach, it is applied to a sample distribution network shown in Figure 6. e proposed planning has been executed in a MATLAB programming environment (R2016a) on a laptop with an Intel Core i7-
International Transactions on Electrical Energy Systems 13 lines are illustrated by dotted and solid lines, respectively, in Figure 6. e candidate nodes for installing distribution transformers are shown by the letter "T" beside them. All the low-voltage nodes are candidates for installing DGs. Twelve different types of conductors (Table 4), three types of substations (Table 5), five types of distribution transformers (Table 6), and six types of DGs, including WT, PV, GT, MT, FC, and DE, are considered (Table 7). e pollution emissions of the DGs and the grid are shown in Table 8.
Uncertainty in electrical loads is calculated by a normal probability function with the mean values listed in Tables 2   and 3 and a standard deviation value of 3%. Other required specifications and information about the studied network are given in Table 9.
To validate the proposed methodology, three different cases are considered as follows: (i) Planning of the MV and LV networks independently considering uncertainty in demand and energy price (case #1) (ii) Integrated planning considering uncertainty in demand (case #2) WT (3) WT (3) WT (2) GT (1) PV (2) PV (1) GT (1) GT (1) GT (1) GT (2) GT (3) GT (1) GT (2) GT (1) (1) (1) (1) (1) (1) Figure 9: Configuration of the network in case #3. In case #1, the planning is executed while the mediumand low-voltage networks are two independent networks. e results of all the case studies are shown in Figures 7-9 and Table 10. e types of lines and transformers installed on the network are marked with parentheses on them. e overall results from Table 10 show that the minimum total cost is obtained in case studies 2 and 3, which actually use the proposed algorithm; as expected, the minimum planning cost was obtained for the third study, in which DGs were used. Figure 10 shows a good comparison between the cost components in both networks. e highest planning cost was obtained for the first case study, which shows that the bi-level model reduces expansion plans.
As can be seen, case #3 has the lowest costs, and this is due to the undeniable fact that the penetration of distributed generation sources in the low voltage network allows the installation of transformers and lines of smaller sizes, and that the medium voltage network is also affected, which has the lowest operating costs. is shows that the bi-level model reaches the planning point at a lower cost by considering DGs and, in fact, proposes a topology that also has lower losses.    In case #1, the existing initial lines are more chargeable, and therefore, the existing substation will have a higher chargeability than the proposed substation, and this topology has more technical losses than the other two cases due to the increase in current circulating through the network. e same is true for the medium voltage network, which in case #2 and case #3 causes the electric current of the lines to decrease, and this in turn will reduces the losses of electrical energy. erefore, it can be said that the bi-level model finds solutions that better distribute the current flow in the network. Table 11 compares the material in this study with other studies in this field, and as seen, the proposed algorithm is very efficient.
In Tables 12 and 13, sensitivity analysis was performed on load demand and electric energy price, respectively, and their impact on the total cost, pollution cost, and the cost of DGs has been determined. e results showed that, with the decrease in the price of electric energy, the use of DGs decreased and caused more pollution.

Conclusion
In this study, a bi-level model is presented to simultaneously perform expansion planning in both medium voltage and low voltage distribution networks. To this end, a control variable called the capacity of distribution transformers was used. erefore, first a capacity is selected for the distribution transformers, and then, according to the constraints of the problem, the low-level problem or low-voltage network planning is done in such a way that if the low-level constraints are not satisfied, the capacity and location of the distribution transformers must be changed, and if the constraints are satisfied, then the high-level problem is solved, and again, if the constraints of the highlevel problem are satisfied, the result is checked to check the optimality of the overall solution; otherwise, the location and capacity of the distribution transformers must be changed again.
is process continues until reaching an optimal solution. erefore, by using a bi-level model, an attempt has been made to propose a location and capacity for distribution transformers that is acceptable from the point of view of each network. e proposed problem was solved by a genetic algorithm, and the results illustrate the efficiency of this method because it allows finding good quality settings for the experimental system under study. According to the results, it was particularly clear that planning separately in each medium-voltage or low-voltage network alone cannot be an optimal solution for the entire network. erefore, it is better to consider planning in both medium-voltage and low-voltage networks so that the requirements of each network are met, and in better words, the conflict between the two networks, which is the optimal placement of transformers, is resolved. It should be mentioned that the application of distributed generators is also undeniable in the optimal operation of the network. As a suggestion for future work, the following items can be mentioned: (i) Use of electric vehicles at a low voltage level (ii) Involve private owners and expression new objective functions (iii) Conflict analysis when private owner's express different objectives (iv) Consider correlation among the scenarios in the stochastic approach

Nomenclature
Sets and Indices f: Index for objective functions S: Index for scenario t: Index for time i, j: Index for bodes in the medium voltage part i ′ , j ′ : Index for nodes in the low voltage part B: Index for nodes LB: Index for load nodes c: Index for distribution transformer λ: Index for candidate substation z: Index for existing substation g: Index for DGs e: Index for pollution T: Set of time period

Parameters d:
Discount rate Z ij : Impedance between nodes i and j in the medium voltage part Z i′j′ : Impedance between nodes i′ and j′ in the low voltage part C ij : Cost of installing a new line between nodes i and j in the medium voltage network Z ′ i′j′ : Cost of installing a new line between nodes i′ and j′ in the low voltage network C λ : Cost of installing a new substation C c : Cost of installing a new distribution transformer C ′INV i′,g : Cost of installing a new DG of type g in node i′ C ′OP i′,g : Operation cost of a new DG of type g in node i′ Wind speed (m/s) ρ w : Air density (kg/m 3 ) A w : Wind turbine blade area (m 2 ) η w : Wind turbine power coefficient G T : Solar radiation (kW/m 2 ) G T,STC : Solar radiation in standard test conditions (STC) (kW/m 2 ) T: Cell temperature (°C) P WT : Output power of wind turbine (kW) P PV : Output power of photovoltaic (kW) P PV,STC : Maximum test power in STC (kW) T amp : Environmental temperature (°C) NOCT: Normal operating cell temperature (°C) c: Power-temperature coefficient ′ i′ : Voltage of node i′ in scenario s and time period t in low voltage part S s,t,i,λ : Injected power by a substation λ in scenario s and time period t S s,t,i,z : Injected power by an existing substation z in scenario s and time period t S s,t,i,c : Injected power by a distribution transformer c in scenario s and time period t S DG s,t,i′,g : Injected power by a DG of type g at node i′ in scenario s and time period t.

Data Availability
No data were used to support the findings of the study.

Conflicts of Interest
e authors declare that they have no conflicts of interest.