Coordinated planning of the distribution system and regional energy network in the presence of responsive loads

Reducing loss and providing a secure power supply for customers have always been the main goal of distribution systems planners. Recently, the development of competitive electricity markets and responsive loads participation in such markets together with the integration of regional energy networks (RENs) have resulted in creating some challenges for RENs' owners to increase operating efficiency, and reduce investment costs. In this paper, to overcome these problems, a new modeling for coordinated planning of distribution networks and RENs in the presence of responsive loads is proposed and to achieve the optimal solution of the problem, the genetic algorithm is used. Operation uncertainties due to the installation of wind turbines and photovoltaic resources in RENs are considered. The probability‐tree method is used to generate and model operation scenarios and their variable production, respectively. To validate and confirm the efficiency of the proposed model, numerical studies were applied on a 25‐bus Institute of Electrical and Electronics Engineers standard distribution network, including two RENs equipped with responsive loads. The results show the fact that the flexibility of the demand side in the electrical sector due to the activity of responsive loads causes to increase in the installation capacity of energy resources and storages.

investment is not disturbed while network losses and customers reliability during the operation phase are maintained at the minimum and maximum values, respectively. 2Due to the increasing customer's demand for energy in residential, commercial, and industrial sectors, the use of distributed generation resources such as wind turbines (WTs), photovoltaics (PVs), microturbines, and combined heat and power (CHP) units have become vital to achieve technical and economic goals in DSs. 3 Hosseinalizadeh et al. 4 and Aman et al. 5 have investigated the effect of optimal location and capacity of various distributed generation resources on the planning and operation of the distribution network.With the development of control and monitoring systems in the distribution network and the need for self-sufficiency in supplying local loads, microgrids were gradually formed in the subset of a distribution network, and in addition, the responsive load participation under different types of energy markets was provided.Microgrids consist of a variety of electricity generation resources and consumptions.The existence of variable and uncontrollable production resources such as PVs and WTs 6 in addition to controllable resources such as microturbines, CHP units, 7 and responsive loads with adjustable and shiftable consumption necessitates the need for optimal energy management and planning. 8mart microgrids planning with different objectives such as microgrid type, 9 reducing losses, 10 costs, 11 and improving reliability due to uncertainties related to load demand, 12,13 renewable resources power generation, 14,15 thermal 16 and hydrogen demand, 17 heat storage, 18 demand response (DR), 19,20 and energy price 21,22 have been researched.With the expansion of the energy portfolio and the use of different energies such as electricity and natural gas, various definitions of energy systems including multienergy systems, 23 energy hubs (EHs), 24 and regional energy networks (RENs) have been formed.EH is responsible for transmitting, converting, and storing different forms of energy and considers different energy carriers as inputs to meet different types of demands at the outputs. 3Many studies have been done on the planning of EHs under different conditions.Many papers have studied the planning methods for microgrids.A planning method for a multicarrier energy system is proposed by Wang et al., 25 which optimally determines jointly efficient power generation, conversion and transmission, heating, cooling, and other services with the goal of minimizing the total investment and operation costs.To optimize the payments of each EH to electricity and gas installations as well as customer A stochastic approach for designing an EH integrated with WT resources is presented in Dolatabadi et al. 26 and Javadi et al. 27 Reliability indices such as expected power and energy not supplied are used to model power generation uncertainties by WTs and load demand forecasting as well as accidental failure of components.In Bahrami et al., 28 the management of EH interactions is modeled as a potentially exact game satisfaction with energy consumption in a decentralized manner.Zhang et al. 29 present an EH expansion planning model with several energy carriers.The model presented in this paper determines the optimal location and capacity of energy resources and transmission equipment to supply electric and heating loads, as well as to satisfy technical limitations according to the level of reliability, energy efficiency, and greenhouse gas emissions for the planning time horizon.Also, a mixed integer nonlinear programming model is used for short-term daily planning of the EH to meet the daily cooling, heating, and electricity needs of a hypothetical building with maximum profit. 30RENs are geographical areas that include a number of industrial, household, and commercial consumers that have private owners and include different energy demands (such as electricity and heat).They are connected to different energy utilities (e.g., through gas pipelines and electrical transmission lines) while being managed by central controllers that determine the optimal dispatch models.Regarding operation management and planning of RENs, many studies have also been conducted in the past few years.For example, in Navidi et al., 31 a multiobjective fuzzy-particle swarm optimization method is investigated to solve subtransmission substation expansion planning with respect to the benefits of RENs in reducing costs and losses.Navidi et al. 31 proposed a bilevel Stackelberg game approach for coupled expansion planning programs of subtransmission networks and privately owned regional energy systems.In Navidi et al., 32 a model based on game theory is proposed to determine the optimal places for private owners to invest in RENs to simultaneously meet the electric and thermal loads demand according to the economic and technical constraints.Also, multienergy generation system expansion planning under uncertainty of renewable energy resources and price is formulated in Martinez Cesena et al. 33 According to the literature review, the joint planning and operation planning process for distribution networks and RENs under electricity market conditions is a complex optimization problem in which both technical and economic issues need to be addressed.
Often, this problem is solved using two-stage algorithm, in which, installation capacity and location for PVs, WTs, and CHPs, electrical energy storages (EESs), thermal energy storages (TESs), and boilers in RENs are determined at the first-stage and operation capacities for dispatchable electric and thermal energy resources and storages in RENs and exchange with distribution network are determined at the second stage, separately.Therefore, this procedure causes a suboptimal solution.To address this research gap, the aforementioned complex problem is coded into a genetic algorithm technique.In this paper, an integrated model is proposed for the optimal planning and operation planning of RENs and the DS, simultaneously.In the proposed model, different assets (including CHPs, electrical energy storage (EESs), TESs, and boilers) are taken into consideration along with the uncertainties in PVs and the WTs power generation.A probability-tree tool for dealing with the uncertainties related to nondispatchable operating scenarios has been investigated.In addition, the effects of the time-of-use DR program are investigated in the case studies.The remaining parts of the paper are organized as follows: in Section 2, the mathematical formulation of the proposed model including the objective function and technoeconomic constraints is presented.In Section 3, the solution method based on a genetic algorithm is described.In Section 4, numerical studies are performed on a test distribution network in the presence of two RENs, and simulation results are presented afterwards.Finally, Section 5 concludes this article.

| PROBLEM FORMULATION
In this section, the mathematical model of coordinated planning of the distribution network and RENs including the objective function and constraints is presented.Figure 1 shows the structural details of a typical REN.
A distribution network can include several RENs and exchange electrical energy with them.According to Figure 1, each of the RENs can meet its energy demands using the electrical and heating energy sources and/or energy storage options.Electrical energy sources include WTs, PVs, and CHPs.Also, the electrical energy storages are EESs.Here, in addition to CHPs, boilers are considered as thermal energy resources and also the thermal energy storages are TESs.Therefore CHPs, contribute to supply both the electricity and the thermal energy demand, and also loads participate in DR programs in the electrical section, help the flexibility of the system during the operation phase.The natural gas and electricity energy carriers are considered as inputs of the RENs and the electric and heating loads are assumed as outputs.When the production of electrical and thermal energy in the REN is more than the load demand, energy storages are applied to save surplus energies to use at the time of energy shortage or rising energy carrier prices.Here, electric and heating loads demand including residential, commercial, agricultural, and industrial of EHs, which are assumed to have constant values.
F I G U R E 1 the structural details of RENs connected to the distribution network.CHP, combined heat and power; EES, electrical energy storage; PV, photovoltaic; REN, regional energy network; TES, thermal energy storage.
The objective function is defined as the whole system cost minimization in the coordinated planning of distribution networks and RENs.It consists of equipment investment and operation costs in RENs and loss and reliability costs for the distribution network during the operation phase.Due to the mutual interaction between the independent variables of planning and operation problem, therefore, two problems should necessarily be integrated in the form of an optimization problem.Then, the objective function is formulated as Equation (1).
In the above relation, TC is the total cost of coordinated planning of the distribution network and RENs which consist of equipment installation costs in RENs by symbol  ) .
The total investment cost is calculated according to Equation (2) considering to the total installed capacity by symbol P ec max for each equipment by the symbol C ec .The annual investment cost for each equipment is calculated according to Equation (3) using the effective equipment lifetime k, the return rate r, and the corresponding total investment cost at the planning horizon.IC ec is the investment cost per kilowatt unit of an installed capacity of equipment in the REN.Here, we model the electricity and heat loads demand of customers during a year in the form of seasonal basis with an appropriate loading factor, and the purchase\sale price of electricity from\to the national distribution network during each time period is based on the tariff.In addition, the purchase price of gas from the national natural gas network during a certain thermal load level related to each time period is according to the tariff.The expected operation cost of the whole system under various power generation scenarios of In Equation ( 4), the expected operation costs of WT, PV, electrical, and thermal storage resources are assumed equal to zero.Total expected operation costs can be divided into two parts: the first and second parts are related to the RENs and the distribution network, respectively.For the first part in the objective function, the expected cost of exchanges for the REN is represented by symbol are the thermal power produced by the boiler through natural gas consumption and price of natural gas, respectively.For the second part of the objective function, the expected cost of whole system loss and reliability with symbols C O Ex Loss ( ) and C O Ex Reliability ( ) is calculated according to Equations ( 9) and (10), respectively.ρ is the presence probability for the system operating scenario sc sc ( , ) pvi wtj in each load-level L i and D is the duration of each load level in a year.

| Technical constraints
In this section, technical constraints of the proposed model are formulated, these constraints consist of electrical and heating energy exchanges, installation and operation limits for all equipment, such as WTs, PVs, CHPs, ESSs, Boilers, and TESs, which are given below:

| Electrical and thermal energy exchanges
Each REN has the possibility for bidirectional electrical energy exchange with the national distribution network, and at the same time, it has only the possibility for onedirectional thermal energy exchange and purchasing the natural gas from the national gas network.To model electrical energy exchanges, we will have Equations ( 11)-( 12).
Equations ( 11) and (12) determine the maximum purchased and sold power from\to the upstream distribution network, respectively, according to the thermal limit of the interface line between the distribution network and RENs.Equation ( 13) models the impossibility of buying and selling energy simultaneously during a system operation scenario.The limitation of one-directional purchase of natural gas from the national gas network for consumption in boilers and CHP in RENs is modeled according to Equation (14)., ) .
In the above relation, Q g Max is the maximum capacity of the interface gas pipeline, and it is determined by the technical limits of the gas pipeline, and Q g Min is the minimum capacity of the gas pipeline and equals zero in this study.It shows that the capacity of the gas pipeline could not be negative.

| CHP units
CHP units are considered as a controllable electrical energy generator in the RENs, while generating heat energy, simultaneously.The operating cost and the amount of thermal energy production of this equipment are modeled according to Equations ( 15) and ( 16), respectively.
In the above relation, the indices α, β, and γ are the coefficients of the cost function in Equation (15).Using the K h which is usually between 1.2 and 1.8, thermal power production can be estimated based on the active power generation.

| WT and PV resources
In general, the power generated by WTs and PVs depends on wind speed and solar intensity, respectively.Here the performance of WTs and PVs resources in RENs is modeled based on Equation (17).
In the above relation, v ci , v co , and v r are cut-in, cutout, and nominal speed of WT during operation scenarios, respectively.v sc L ( , ) wtj i is the wind speed at the operation scenario sc wtj of WT at the load-level L i .P r shows the rated power of a WT.Assuming that the PV sources are equipped with a maximum power point tracking system, the output power of the PV resources was modeled during each operation scenario at the load-level L i with the symbol P sc L ( , ) PV pvi i according to Equation (18). .
In the above relation, the indices A PV and η pv are defined as the cross-sectional area of the PV array and the corresponding efficiency for converting radiant energy to electrical, respectively.Η ave t Sun , shows the intensity of solar radiation for the operation scenario at a specific loadlevel L i .

| EES and TES
In general, both EES and TES with application in the charge and discharge operation modes, are often used to reduce total system costs by creating flexibility in the operating process of RENs.In addition, it is possible to cover operating uncertainties during different WT and PV sources production scenarios using electrical storage devices.In Equations ( 19)-( 20), operation of EESs is been modeled., ) .
Min EES e EES pvi wtj i Max EES (22)   Equation (19) shows that the state of charge in EES devices depends on the power injected and absorbed during each operating scenario sc sc ( , ) pvi wtj at the loadlevel L i and the energy stored in the previous period.In Equation (20), the maximum power injected and absorbed by the EES device is modeled, and the two binary variables b Ch EES and b Disch EES are defined to identify the charge and discharge status of the energy storage, respectively.Equation (21) indicates that the presence impossibility of an energy storage device in both charging and discharging modes at the load-level L i , simulta- neously.Equation ( 22) models the stored energy constraint in the electrical storage during different load-levels L i , dynamically.There are similar principles for modeling the performance of TES devices in the REN according to Equations ( 23)- (24)., ) .
Min TES e TES pvi wtj i Max TES (26)   In the above equations, the charge and discharge limits of the TES and the maximum amount of TES have been modeled.

| Responsive loads
The program of responsive load improves the load profile and reduces system operating costs by adjusting or time shifting the load demand.Modeling the performance of responsive loads in a REN is modeled through Equations ( 27)- (28).
Equation ( 27) implies the fixed electricity consumption in the REN over 1 year, and also, the periodic activity of responsive loads based on energy prices in the power market will not affect on total energy consumption.Equations ( 28) and ( 29) model the responsive load limits for the load shedding value, and the increase in consumption during the operation scenario of WTs and PV sc sc ( , ) are two binary variables corresponding to decrease and increase in energy consumption, respectively.Equation (30) shows that at one load-level L i , the responsive load can only increase or decrease the loads consumptions.Equation (31) shows the amount of responsive load participation with symbol P e DR during the operation scenario sc sc ( , ) pvi wtj at load-level L i .

| Operating capacity of equipment
According to Equations ( 32) and ( 33), operating capacity of equipment during all operating scenarios at different load levels in the REN must be less than the installed capacity of equipment., ) .

| Energy generation and consumption balance
In the planning horizon, it is essential that the installed capacity of electrical energy resources beside energy storage facilities and the capacity of purchased energy from the national distribution network be greater than the electrical load demand in the REN.Equation (34) models these conditions.
In the operation planning horizon, under various scenarios of generation due to uncertainty in the power generation of WT and PV resources, the balance between electricity generation and consumption in the REN is created according to the below contract: In the normal state of electricity generation, the total load demand of RENs is met by all available resources.Under these conditions, the electrical energy stored in the storage devices remains constant and DRs are not needed.Equation ( 35) models these operating conditions.
In case of a shortage in power generation, first the responsive loads reduce their consumption in the RENs, if the balancing condition is not satisfied then energy should be purchased from the upstream distribution network, and if the balance is not restored by performing this operation, then the load is shedded from the customers with a minimum value of lost load in the REN.Equation (36) models the operating conditions during the generation shortage scenario.
In the case of overgeneration, first the responsive loads increase the consumption, if the balance is not established then the energy storage devices are charged and if again the balance of production and consumption of electricity is not restored then the surplus energy is sold to the upstream distribution network.Equation (37) Of course, it should be noted that if the CHP can provide a spinning reserve, then this stand-by generation capacity can be used to balancing proccess when there is a shortage of electricity.Equation (36) In the normal state of thermal energy generation, the total heat load demand in the REN is met by CHP and boilers, in such case, the energy of the TES devices remains constant.Equation (39) models these operating scenarios.
In the generation shortage of thermal energy, TES devices in the REN are placed in the discharge state to meet the balancing condition.Equation (40) models these operating scenarios.
In the generation surplus of thermal energy, TES devices are placed in the charging state to balance the generation and consumption of thermal energy in the REN.Equation (41) models these operating scenarios.

| Modeling of DS power flow
Due to the wide range variations and the ratio of r x / , Gauss-Seidel, Newton-Raphson, and so forth power flow methods are difficult to converge in the electrical distribution network, so in these studies, the forward-backward power flow study is used due to the convergence velocity and accuracy.Here, the power generation of resources is modeled as negative power injection at the respective buses in RENs.But, to model the operation of the EES, the charge and discharge states must be considered because the energy storage acts as a load demand during operation in the charging state, while during the discharge state acts as other energy resources in RENs by injecting power into the respective bus.Responsive loads in two operating modes are modeled as increasing and decreasing demand on the respective bus.Initially, it is assumed that the first bus is a reference bus with a known voltage magnitude and angle, and the initial voltage magnitude for other busbars is equal to the reference bus voltage, and the initial loss of all branches is zero.The solution algorithm consists of four steps: calculating the power of the nodes, the backward sweep for summing the power of the branches, the forward sweep for updating the voltage of the nodes, and calculating the voltage mismatch, which uses relations of Chang et al. 34 for the calculations.If the voltage amplitude difference for all busses is less than ε during two consecutive iterations, then the convergence condition is satisfied and the iteration of the algorithm will be stopped.As a result, all the electrical parameters of the DS such as magnitude and phase angle of the buses voltages, active and reactive power losses in the all branches, active and reactive power flow passing through the branches and the reliability of the customers' load points and the whole system can be calculated.

| APPLICATION OF GENETIC ALGORITHM FOR PROPOSED MODEL SOLUTION
Due to the advantages of meta-heuristic algorithms in solving and finding the global optima for solution of the complex mathematical problems, genetic algorithm has been selected here as a tool to solve the coordinated planning problem of distribution networks and RENs.Details of genetic algorithm modeling used for this research are given in Leonori et al., 35 Thomas and Kovoor, 36 and Jong-Bae Park et al. 37 In this section, the application process of genetic algorithms to solve the coordinated planning problem of distribution networks and RENs is described.To use a genetic algorithm and solve this problem, we first form the structure of chromosomes.The set of genes in each chromosome that are equivalent to the problem-independent variables and possible solutions consist of the location and installation capacity of PVs (TGen1), WTs (TGen2), CHP units (TGen3), the location and installation capacity of the EES devices (TGen4), operation capacity of CHP units (TGen5), participation of responsive loads for all load levels (TGen6) are for the electrical part of RENs, installation and operation capacities of boilers (TGen7), and installation capacity of TES (TGen8) are for the thermal part of RENs.
After forming the chromosome structure based on the problem-independent variables, n pop is selected 1000 as initial chromosome populations which are randomly generated for the first iteration of the algorithm.Then, the fitness of each chromosome is calculated using the sum of the objective functions according to Equation (1) and the penalty terms according to Equation (42).Penalty terms have been modeled considering each gene violation from the problem constraints based on Equations ( 11)- (12).If, we represent each independent variable of the problem through the fitted chromosome that has a violation of a certain constraint with X i v and the value of the allowable limit with X i P , then, the penalty is created based on violation from limit according to Equation (43).

 fitness chrom OF chrom
Penalty Geni After determining the suitability of all chromosomes, from the total population, we use the number of chromosomes p n × c pop to apply the crossover process over the pairs of chromosomes.From the crossover of parent chromosomes, child chromosomes are created, which the number of p n × m pop children is produced to apply the mutation process.p c is the probability of crossover and p m is the probability of mutation of each chromosome.
After, the crossover and mutation processes have been applied to the chromosomes, then resort the entire population of chromosomes based on descending order of fitness and n pop chromosomes are selected again for starting the next iteration.The process of crossover and mutation on chromosomes is done considering the convergence criterion of the algorithm and stopping criteria.In this algorithm, two stopping criteria consisting of function tolerance and stall generation are considered.If the weighted average change in the fitness function value over stall generation (50 generations) is less than the function tolerance (0.0001), the algorithm stops.The best chromosome in the last iteration will be introduced as the optimal solution of the coordinated planning problem of the distribution network and RENs.

| NUMERICAL STUDIES AND SIMULATION RESULTS
To validate and confirm the proposed model's efficiency, numerical studies are performed with the aim of coordinated planning of a 25-bus electricity distribution network, including two RENs (REN1 and REN2).Electricity power and natural gas are considered as energy carrier inputs for RENs. Figure 2 shows the single-line diagram of the understudy distribution network.
The apparent power of the substation transformer is 10 MVA.Four load levels are considered with coefficients of 80%, 86%, 93%, and 100%, seasonally.
Bus1-Bus18 are assigned to the main feeder of the understudy distribution network.All consumers are connected to the corresponding buses.Table 1 shows the average active and reactive load demands in the main feeder.Branches and substation transformer impedance information are given in Table 2.
According to Figure 2, two RENs are connected to Bus5 and Bus15.The average heat and electrical load demands of RENs have been shown in Table 3.
Here, the loading factors for thermal demand are 60%, 73%, 86%, and 100%, seasonally.Responsive loads are present in RENs and the participation levels of DR1 and DR2 are equal to 20% and 25% of the total load demand, respectively.In REN1, there are four branches Line5-19, Line19-20, Line20-21, and Line21-22 with impedances j 0.164 + 0.156 , j 1.504 + 1.355 , j 0.495 + 0.478 , and j 0.708 + 0.937 , respectively.In REN2, there are three branches Line15-23, Line23-24, and Line24-25 with impedances j 0.4512 + 0.308 , j 0.898 + 0.709 , and j 0.896 + 0.701 , respectively.The loss cost per kilowatt hour is assumed 0.4 $.The electrical energy price for The single-line diagram of the understudy distribution network.REN, regional energy network.exchange with the national distribution network based on the presence duration at each load level are equal to 0.5, 1, 1.25, and 1.5 $/kWh, respectively.The thermal energy price of natural gas based on the presence duration at each load level is assumed equal to 0.1, 0.45, 0.55, and 0.65 $/kWh, respectively.The technical information of CHP units in RENs is according to Table 4.The design specifications and wind speed of the region for the two WTs installed in the RENs are given in Table 5.
Since, the power generation of WT resources is often uncertain due to wind speed forecasting, the probabilitytree tool is used to model these resources' operation in five scenarios according to Table 6.In this study, the parallelism of 2.5 and 1.5 kW arrays are, respectively, used for constructing PV1 and PV2 in RENs.The optimal number of these parallel arrays for PV resources must be determined by solving the planning problem.PV resources have uncertain power generation in RENs depending on the intensity of sun radiation at the Abbreviations: CHP, combined heat and power; REN, regional energy network.
T A B L E 5 Design specifications and wind speed of the region for the two WTs.regions, which their information is given in Table 7.
Similarly, the probability-tree tool is used to model these resources' operation in three scenarios according to Table 8.It is assumed that the value of lost load for the customers in RENs is equal to 10 $ and 20 $/kWh, respectively.Maximum allowable capacities of electric energy storage devices in two RENs are 10 and 15 kW, respectively.The investment cost of energy storage devices is assumed 3500 $/kW and their lifetime is equal to 10 years.The operating efficiencies of energy storage devices 1 and 2 are considered 92% and 95%, respectively.RENs do not have any restrictions for the sale of electrical energy, but they are limited to a maximum of 30 kW for energy purchases from the distribution network.In the thermal part of RENs, there are two boilers and CHP units to meet the needs of thermal loads.It is assumed that the thermal power generation of CHP units is equal to 1.6 and 1.8 multiplied with active power generation, respectively.The minimum and maximum allowable capacities for boiler 1 are equal to 50 and 150 kW, respectively, and these limits for boiler 2 are equal to 150 and 300 kW, respectively.The investment cost of boilers is 6500 $/ kW-heat, and its lifetime is 25 years.For TESs 1 and 2 installed in RENs, the investment cost is 7250 $/kWheat with a lifetime equal to 22 years.The minimum and maximum allowable installation capacity for TES 1 is equal to 50 and 250 kW, respectively, and for TES 2 is equal to 150 and 350 kW, respectively.Their operating cost is 0.15 $/kW-heat.According to the assumptions, case studies are implemented as follows for two situations: Case study 1: Coordinated planning of the DS and REN in the presence of demand responsive loads.
Case study 2: Coordinated planning of the DS and REN in the absence of demand responsive loads.
The parameters of the genetic algorithm include the initial population of chromosomes, the probability of T A B L E 8 Probability-tree tool for forecasting the power generation of PV resources.Abbreviations: PV, photovoltaic; REN, regional energy network.

F I G U R E 3
The voltage profile of the distribution network in the absence of RENs for the four seasons.REN, regional energy network.
| 3355 crossover, the probability of mutation, and the iterations numbers are 500, 0.7, 0.3, and 50, respectively.The proposed model is coded in MATLAB software environment.It runs on an ASUS laptop with a 2.4 GHz sevencore processor and 8 GB of external memory.The voltage profile of the distribution network in the absence of RENs for the four seasons is depicted according to Figure 3.The proposed planning model in the presence and absence of responsive loads in RENs is solved using a genetic algorithm.Optimal location, installation, and operation capacity of resources and electrical and TES devices in RENs, electrical and thermal energy exchanges with the national grid have determined in addition to the amount of electrical energy losses and system reliability.
Figure 4A shows the characteristic of the convergence curve to the optimal solution for the genetic algorithm in the presence of DRs in RENs, and Figure 4B shows the absence of DRs in RENs.As can be seen from Figure 4, the genetic algorithm converges to the optimal results in the presence and absence of responsive loads in the RENs after 25 and 50 iterations.After running the program, the optimal location of electrical energy resources and storage in the RENs and the presence and absence of responsive loads have been determined according to Figure 5A,B, respectively.
From the simulation results in Figure 5A, in the presence of DRs in the REN1, the optimal installation location of PV1 on the Bus20 with a capacity of  T A B L E 9 Optimal amount of installation capacity for all electrical and thermal devices in the presence and absence of responsive loads in RENs.

Electrical section
Thermal section  122.5 kW, WT1 and ESS1 on the Bus21 with capacities of 50 and 4 kW, and CHP1 on the Bus22 with a capacity of 100 kW have been determined.For REN2, PV2, WT2, and CHP2 on Bus24 with capacities of 100.5, 51, and 109 kW, respectively, while the optimal installation capacity of ESS2 on Bus23 is optimally selected 8 kW.The optimal capacity of boilers 1 and 2 to meet the heat load demands in the two RENs is determined 144 and 255 kW-heat, respectively.The capacities of two TESs in RENs are optimally set at 249 and 255 kWheat, respectively.As can be seen from the simulation results in the absence of responsive loads in RENs in Figure 5B, the optimal installation capacity of electrical energy resources and storages for WT1, PV1, CHP1, and ESS1 in the REN1 is determined 30, 112.5, 98, and 4 kW, respectively, and for REN2, these are equal to 57, 99, 101, and 5 kW, respectively.From comparing the simulation results in the presence and absence of responsive loads in RENs, it can be concluded that the optimal installation capacity of electrical energy resources and storages will be decreased in the absence of DRs.In the thermal part of RENs 1 and 2, the optimal installation capacity of boilers 1 and 2 are determined 128 and 295 kW-heat, respectively, optimal capacities of TESs 1 and 2 in RENs 1 and 2 are determined 244 and 241 kW-heat, respectively.The simulation results for the investment cost on the optimal amount of installation capacity for all electrical and thermal devices in the presence and absence of responsive loads in RENs are given in Table 9.

WTs
Considering uncertainties in power generation of renewable electrical energy resources, operating capacities of CHP units in the RENs 1 and 2 the presence and absence of responsive loads during the four load levels have been shown in Figure 6.
It can be seen in Figure 6, the optimal installation capacity of controllable electrical energy resources such as CHP units in the RENs in the absence of responsive loads should be increased due to covering the PVs and WTs operation uncertainties therefore, this cause to increase in planning the total cost of regional energy systems.The optimal charge and discharge status of the EES devices 1 and 2 in RENs in the presence and absence of responsive loads during four load levels are shown in Table 10.
As can be seen in Table 10, the power injection and absorption in EES devices are optimally done considering the duration of the presence in each load level in such a way that the stored energy is the same at the beginning and end of the operation period.In the absence of responsive loads, it can be seen the balancing role of energy storage devices between generation and load in the RENs becomes more prominent.Table 11 shows the REN load demands the presence and absence of responsive loads are optimally determined for each load level.
In general, REN1 and REN2 have 15 scenarios with regard to five operation scenarios for WT resources and three operation scenarios for PV resources in each load level, therefore these uncertainties in power generation with renewable resources cause to change in electrical power generation of CHP units and charging and discharging status of EESs and also energy exchange with upstream network.The simulation results for the RENs power exchanges with the global distribution network during the occurrence of various operation scenarios the presence and absence of responsive loads have been shown in Table 12 for four load levels.According to the contract, it is assumed that a negative sign indicates the purchase of energy from the global distribution network and a positive sign indicates the sale of energy to the global distribution network.Simulation results show that RENs buy electrical energy from the upstream DS when the energy price is low and sell the surplus energy to it when the energy price in the power market gets to the maximum value.
Therefore, they will achieve the greatest reduction in their costs by providing the most income due to energy sale to the national grid during the year.Responsive loads participation at low load levels including LL1 and LL2 are in the form of demand while, at medium and peak load levels including LL3 and LL4 are in the form of demand decrement.In the absence of responsive loads in RENs, demand side flexibility is reduced due to removing the shiftable and adjustable loads therefore expensive energy should be purchased from the upstream distribution network at the energy shortage in RENs.This condition leads to increase in operation costs and decrease in incomes from power market during different operating scenarios.If unused synchronized capacity of the CHP unit is defined as a spinning reserve then it can be used with private owners of RENs for balancing process between generation and local loads.Simulation results for the optimal amount of spinning reserve have been shown in Table 13, which are used for balancing propose in Abbreviations: DR, demand response; LL, load level; REN, regional energy network.the presence and absence of responsive loads in the RENs.As can be seen from the simulation results in Table 13, in the presence of responsive loads during the off-peak hours of LL1 and LL2, the load demand is adjusted to make maximum use of the spinning reserve capacity of CHPs, if, more electrical energy is needed during some of the operation scenarios, this requirement is provided through the upstream distribution network due to low prices of energy.| 3359 Considering the optimal amount of spinning reserve on CHP units, the expected load not served for REN1 and REN2 in the absence of responsive loads is equal to zero, while, this reliability index for REN2 in the presence of responsive loads will change to 0.4327 kW.The expected loss cost of understudy 25-bus distribution network in the presence and absence of responsive loads is evaluated at 406.11 and 320.61 kW, respectively.It can be concluded that expected loss and energy not served will be decreased in the absence of responsive load due to decrease in system loading.Table 14 shows the operating capacity of boilers in RENs in the absence of responsive load.According to the heat power generation with CHP units as well as boilers, the simulation results for optimal charge and discharge of TES equipment in RENs for four levels are shown in Table 15.

| CONCLUSION
In this paper, a new model is proposed for coordinated planning of distribution network and RENs.The DS operator view point for improving the network total loss and reliability and REN private owners view point for minimizing the total costs for electrical and thermal equipment investment and operation and exchange with upstream power and gas network have been considered and the genetic algorithm is used to solve the optimization problem.To confirm the efficiency of the proposed model, numerical studies are performed on a 25-bus distribution network with two RENs the presence and absence of responsive loads.The simulation results prove the fact that the flexibility of the demand side in the electrical sector due to the activity of responsive loads cause to increase in installation capacity of energy resources and storages, more incomes due to sale of surplus energy at high prices during peak hours to the distribution network and reducing operation cost in RENs, while naturally in the thermal sector, boilers and CHP units will supply heat load demand.| 3361

ORCID
The price of energy loss and the value of lost load in the distribution network are defined by the symbol π e loss and Voll e RENs , respectively.T P e Net loss , and T P Shed RENs are defined as total DS loss and load shedding, respectively.

F I G U R E 4
Characteristic of convergence curve to the optimal solution for genetic algorithm.(A) In the presence of DRs in RENs and (B) in the absence of DRs in RENs.DR, demand response; REN, regional energy network.

F
I G U R E 5 Optimal location of electrical energy resources and storages in the RENs.(A) In the presence of DRs in RENs and (B) in the absence of DRs in RENs.CHP, combined heat and power; DR, demand response; PV, photovoltaic; REN, regional energy network; WT, wind turbine.

6
Operating capacities of CHP units in the RENs 1 and 2. (A) In the presence of DRs in RENs and (B) in the absence of DRs in RENs.CHP, combined heat and power; DR, demand response; REN, regional energy network. , , DEHGHANI SANIJ ET AL.
models the operating conditions during the surplus generation scenario.
with this assumption can be rewritten by Equation (38).
Average active and reactive load demands in the main feeder.Branches and substation transformer impedance information.Average heat and electrical load demands of RENs.
T A B L E 1 T A B L E 4 Technical information of CHP units in RENs.
T A B L E 10 Optimal charge and discharge status of EESs in RENs at the presence and absence of responsive loads during four load levels.
T A B L E 12 RENs power exchanges with the global distribution network under various operation scenarios in the presence and absence of responsive loads.
T A B L E 13 Optimal amount of spinning reserve for RENs in the presence and absence of responsive loads.
Ahmad Mirzaei http://orcid.org/0000-0001-7864-6715TA B L E 14 Operating capacity of boilers in RENs in the absence and the absence of responsive load.: DR, demand response; LL, load level; REN, regional energy network.T A B L E 15 Power charge and discharge of TES in RENs in the absence and the absence of responsive load.