A MIQP Approach Based on Demand Response in Distribution Networks to Improve the Multi-Objective Function in the Presence of Renewable Energy Resources and Batteries to the Subway Systems

The increasing expansion of devices such as electric vehicle charging stations, renewable energy resources, and electric subways, will cause an imbalance between load and production in the distribution network, which will lead to an increase in power losses, a decrease or increase in voltage and ultimately impose more costs on the independent system operator (ISO). In this paper, we have presented a mixed integer quadratic programming (MIQP) optimization model to improve the distribution network performance in the presence of these devices. The proposed model is a mixed integer model including demand side management modeling, energy storage system, battery to subway (B2S) system, optimal control of on-load tap changer (OLTC), step voltage regulator (SVR), fossil generation resources, renewable energy and capacitors, and shunt reactors. The considered multi-objective function is a scenario-based stochastic model, which accurately models the uncertainties in renewable energy resources. Paying attention to the nature of the proposed model will guarantee globally optimal solutions. The proposed model runs on the standard network of 33 buses, and the simulation results guarantee the optimal and accurate performance of the proposed model. The simulation results demonstrate that the outage of three distributed generation units from the network causes an average increase of 55% in energy losses, and the outage of three renewable units leads to an increase in emissions of about 40%. Another point received from the results illustrated that with the implementation of the proposed model under any load level of the network, as well as the outage of fossil and renewable distributed generation (DG) resources, no load shedding will occur in the network during the 24 hours. Finally, due to the short execution run time, the proposed model can be used for real and online grids.


DR
Demand response. MO Multi-objective. CVR Conservation voltage reduction. D-FACTS Distributed flexible AC transmission system. V2G Vehicles to the grid.

I. INTRODUCTION
In today's electricity distribution networks, it faces serious challenges to maintain voltage and reduce losses due to the presence of various large-scale electrical devices such as electric vehicle charging stations, electric subways, and renewable energy resources. The existence of an efficient and optimal mathematical optimization model that can improve the voltage and system losses along with other network indicators by considering these tools is one of the main challenges of researchers in distribution system operation studies. So far, various methods and models have been presented for the optimal operation of distribution systems, each of which has shortcomings that are discussed in the next section.

A. BACKGROUND REVIEW
Many papers have been presented today for the optimal operation of the distribution system, and each of them has shortcomings in terms of the type of model and the devices used to optimize the system, which will be discussed further. In the taxonomy tables (1) and (2), a comparison has been made between this paper and similar references. In this table, according to the type of modeling, the use of capacitor (SC) and shunt reactor (ShR), on-load tap changer transformer (OLTC), step voltage regulator (SVR), battery to the subway system (B2S), distributed generation (DG), electric vehicle (EV) charging stations, renewable energy resources (RDG), stochastic model, demand response management (DR), energy storage system (ESS) and multi-objective function (MO) are compared. In [1], stochastic programming is presented to increase the flexibility of the distribution system by considering renewable and fossil energy resources along with batteries. In [2], an operating model for the distribution systems using the demand response program and system reorganization to reduce peak load costs is presented. In [3], the authors have presented a stochastic operation model to reduce losses and the number of OLTC tap changes, considering renewable energy resources in the active distribution system. In [4], a non-linear model for optimizing the distribution system using distributed generation resources and reconfiguration to reduce losses and improve voltage has been presented. In [5], an optimal strategy based on a nonlinear model is proposed for voltage control of the distribution system in the presence of battery, SVR, and SC. In [6], the authors presented a robust two-stage model for the optimal operation of the distribution system considering electric vehicles to reduce load shedding. In [7], a method using OLTC transformers has been presented to prevent overvoltage caused by distributed generation resources in distribution systems. In [8], using OLTC transformers and shunt capacitors, the authors presented a method to reduce the conservation voltage reduction (CVR) factor considering the high penetration of PV resources in the distribution network. In [9], a multi-level model has been proposed for the simultaneous operation of the transmission and distribution network, taking into account DG and wind resources. In [10], the authors presented an optimal control strategy for voltage maintenance in unbalanced distribution networks. In [11], using an evolutionary algorithm and metadata, a method for optimizing distribution systems to increase the profit and flexibility of the network in the presence of renewable energy resources and batteries is presented. In [12], the authors presented an algorithm for optimal utilization of the energy storage system in distribution networks to reduce the network peak. In [13], the authors presented a model for connecting electric vehicles to the grid (V2G) and electric vehicles to the subway (V2S) to reduce the energy cost of the entire system. In [14], a model for battery and PV connection to subway station (B2S) is presented with the aim of stability of distribution network load distribution. In [15], an energy hub portal is presented to integrate distributed renewable generation resources, electric vehicles, and the subway to reduce the network peak.
In [16], an evolutionary algorithm for optimizing the power quality of microgrids by considering distributed flexible AC transmission system (D-FACTS) devices is presented. In [17], the authors presented a hybrid model including a step voltage regulator, capacitor, and battery to reduce the voltage and current harmonics of the distribution network. In [18], a multi-objective optimization approach has been proposed to prevent voltage decrease and increase in microgrids using FACTS devices. In [19], the authors presented the problem of demand-side management to optimize the distribution system to reduce the cost of load congestion. In [20], a method based on game theory to optimize distribution systems to reduce losses and energy costs by considering distributed production resources and demand-side management is presented. In [21], a non-deterministic model is presented to model renewable energy sources and electric vehicles to maintain the optimal voltage of distribution networks using the evolutionary particle swarm optimization algorithm. In [22], the authors presented a model based on energy storage and reactive power compensating systems to maintain voltage stability in the presence of wind farms. In [23], to prevent the reduction of voltage fluctuations in the presence of high penetration of PV resources in the distribution network, the authors have also suggested the use of OLTC and battery. In [24], an innovative method for locating distributed active and reactive generation sources to reduce power losses and improve the voltage profile in various distribution networks is presented.
As seen by reviewing previous literature and according to tables (1) and (2), the model presented in this paper is complete compared to previous papers, which can optimize the indicators considered in the objective function as compared to previous studies. Table (2) demonstrates a comparison between the optimization indicators considered in this paper compared to similar papers.

B. RESEARCH MOTIVATION
Due to the high penetration of smart devices such as electric vehicles, energy storage systems, demand response programs, battery-to-subway, renewable energy resources, and distributed generation along with D-FACTS devices, coordination between these devices becomes complicated, which causes more complexity in the optimal operation of distribution networks. On the other hand, the possibility of the outages of renewable resources and DG makes the challenges of the distribution network double. Therefore, the main motivation of this paper is to present a complete and efficient model for modeling all the devices in the distribution network by considering a multi-objective function and guaranteeing the achievement of globally optimal solutions in the shortest execution run time, which can be used for real and online systems.

C. CONTRIBUTION
The challenge that today's distribution networks face compared to other power sectors is the existence of various devices such as electric vehicles, electric subways, renewable resources, DG resources, batteries, D-FACTS devices such as capacitors and shunt reactors, OLTC transformers, regulators step voltage and the presence of smart loads in this network, if considered in a complete and integrated model, the performance of the network will be more accurate and optimal. In summary, the main contributions of this paper can be divided as follows: • Providing an integrated optimization model including demand side management problem modeling, optimal battery charging and discharging, optimal utilization of distributed generation resources, optimal utilization of capacitor and shunt reactor, OLTC and SVR tap adjustment, battery to subway system modeling considering the uncertainty of renewable energy resources and electric vehicles.
• Presenting a mixed integer quadratic programming model and solving it by the powerful Gurobi solver, which in addition to high speed in solving the problem, globally optimal solutions are also guaranteed. Figure (1) illustrates the methodology of the proposed approach. In this figure, the input data of the problem, the type of model and its solution, and finally the outputs of the proposed problem are shown.

D. PAPER ORGANIZATION
In the next part, the proposed modeling is presented and then the considered optimization algorithm is explained. In the third part, the considered standard systems are introduced and the simulation results are analyzed, and the conclusion of the paper will be presented in the final part.

II. THE PROPOSED OPTIMIZATION MODEL
In this section, the proposed optimization model including the multi-objective function and the constraints related to the problem is presented.

A. OBJECTIVE FUNCTION
In this paper, a multi-objective function is considered to optimize the distribution system for today. Equation (1) represents the proposed multi-objective function. Here, the considered objectives are, in the order of reducing line losses, reducing the cost of buying energy from the substation, reducing the cost of active and reactive load shedding in the demand side management program, reducing the cost of load shedding, reducing the cost of DG unit emissions, reducing the grid voltage deviation, reducing the cost of power outages of charging stations for electric vehicles and finally reducing the power outages of renewable energy resources. In this paper, the power of renewable energy resources and the charging power of electric vehicle charging stations are considered randomly and in a scenario-based approach.
According to equation (1) are equal to the cost of buying real and reactive power from the above distribution substation, respectively, while p s t and q s t are equal to the active and reactive power purchased from the substation, respectively. α p and α q are equal to the coefficient of active and reactive load cut penalty in the demand side management program, respectively. Here d p n,t and D p n,t are equal to the initial active load and changed active load in the demand side management program, similarly d q n,t and D q n,t is equal to the initial reactive load and the modified reactive load in the demand side management program. o p n,t and o q n,t are equal to active and reactive network load shedding, respectively, and c r n is equal to load shedding cost. c e n and p DG n,t are equal to the emission cost of DG production units and the power of this source, respectively. The voltage deviation is also shown by n,t . Here, σ s is equal to the probability of each scenario. c ev n and c re n are equal to the cost of disconnection of electric vehicle charging stations and renewable energy resources, respectively, similarlyp ev n,t,s and p ev n,t are equal to the actual charging power of electric vehicle charging stations based on the scenario and the used charging power, as well aŝ p re n,t,s and p re n,t are equal to the real power of renewable energy resources in each scenario and renewable energy resources can be operated, respectively.

B. LIMITATIONS OF POWER BALANCE AND OPERATION IN THE NETWORK
Equations (2) and (3) show the constraints related to the balance of active and reactive power in the distribution network, respectively. In this regard p dis n,t and p ch n,t are the discharge and charge power of the battery, respectively, and η DG is equal to the power factor of distributed generation resources. Also, q sc n,t and q ShR n,t indicate the reactive power of the capacitor and shunt reactor, respectively.
Equations (4) and (5) are the limits of active and reactive power usage from the station in each hour, respectively, wherê p s andq s are equal to the maximum active and reactive power of the substation that can be used in each hour. In the same way, relationship (6) and (7) demonstrates the maximum operation of active and reactive power of the substation in the entire time, respectively. In these relations,p s and q s indicate the maximum active and reactive power of the substation that can be used in the entire time considered, respectively. Equations (8) and (9) (10) indicates the limitation of the use of DG production, where p DG n is equal to the maximum active power of these resources, where ι n indicates the active status of these resources. Equation (11) indicates the limit of using renewable resources, and κ n also shows the active status of these resources. Finally, equation (12) demonstrates the limitation of the charging power of electric vehicle stations.
0 ≤ p DG n,t ≤ p DG n ι n ∀n ∈ N , t ∈ T 0 ≤ p re n,t ≤p re n,t,s κ n ∀n ∈ N , t ∈ T , s ∈ S 0 ≤ p ev n,t ≤p ev n,t,s ∀n ∈ N , t ∈ T , s ∈ S

C. DEMAND SIDE MANAGEMENT AND LOAD SHEDDING CONSTRAINTS
Equations (13) and (14) indicate the maximum amount of active and reactive load of the network after the demand side management program, respectively, these relationships guarantee that the total network loads after the demand side management program are less than or equal to the total be the initial loads of the network. Equations (15) and (16) also demonstrate the changes in active and reactive load respectively after the demand side management program. Here, ε is equal to the percentage of load changes considered in the demand-side management problem. Equations (17) and (18) illustrate the limitation of active and reactive load shedding, respectively.

D. VOLTAGE LIMITATIONS
Equation (19) demonstrates the definition of voltage in the distribution network. In this relation, v i,t is equal to the square voltage of the network bus, and r b and x b are the resistance and reactance of the network lines, respectively. Equation (20) shows the limitation of nodal voltage, where v n and v n are considered as maximum and minimum voltage respectively. Equation (21) represents the voltage in the reference bus of the distribution network and equation (22) defines the voltage deviation of the network bus, which is modeled linearly.

E. ENERGY STORAGE SYSTEM
Relationships (23) to (27) indicate the battery in the distribution network. Equations (23) and (24) are equal to the condition of battery discharge and charge power operation, respectively, where β n and z n,t indicate battery capacity and battery status, respectively. Equation (25) represents the energy available in the battery, where e n,t represents the state of energy and η ch and η dis equal to the charging and discharging efficiency of the battery, respectively. Equation (26) demonstrates the limitation of using the energy in the VOLUME 11, 2023 battery, and equation (27) guarantees that there is no initial energy in the battery in the first hour. 0 ≤ p dis n,t ≤ β n 1 − z n,t ∀n ∈ N , t ∈ T (23) 0 ≤ p ch n,t ≤ β n z n,t ∀n ∈ N , t ∈ T (24) e n,t+1 = e n,t +η ch p ch n,t+1 − η dis p dis n,t+1 ∀n ∈ N , t ∈ T (25) 0 ≤ e n,t ≤ β n ∀n ∈ N , t ∈ T (26) e n,t = 0, p dis n,t = 0 ∀n ∈ N , t = 1 (27)

F. CAPACITOR AND SHUNT REACTOR MODELING
Equations (28) and (29) respectively indicate the limitation of using a capacitor and shunt reactor. In this regard, q sc n and q ShR n are the maximum usable reactive power of the shunt capacitor and reactor, respectively, and ϕ n,t indicates the active state of the shunt capacitor, if equal with 1, otherwise, it is zero and indicates the active state of shunt reactive.

H. BATTERY TO SUBWAY (B2s) MODELING
Equation (36) shows the batteries installed next to the subway station, which, in addition to charging and discharging, also have the task of supplying the power needed by the subway.
Here, the required power of the subway is represented by p sub n,t . Equation (37) guarantees that the required power of the subway is equal to the load of the metro. Here l sub n,t represents the subway load. e n,t+1 = e n,t + η ch p ch n,t+1 − η dis p dis n,t+1 − p sub In the next section, the results of the simulation written using the Julia programming language and solved with the Gurobi solver are presented.

III. SIMULATION RESULTS
In this section, the scenarios considered for the analysis of the proposed model will be introduced and the results of the simulation and verification of the correctness of the proposed model will be presented. For this purpose, IEEE 33-bus network has been selected for analysis. Figure (2) illustrates the diagram of the 33-bus network along with the modeled equipment. Table (3) demonstrates the data of the proposed network in the presence of modeled devices. To check the proposed model in each loading condition, three different scenarios of light load, normal load, and peak load have been considered. The efficiency of the batteries is 90% and the load change percentage is 10%. The OLTC is located between the substation and bus 1 of the network, and the step voltage regulator is also installed in line 18 which connects bus 2 to bus 19.

A. OPERATION UNDER NORMAL CONDITIONS
In this case, it is assumed that all resources of power generation in the network are also working properly. Table (4) shows the results related to light load, normal, and peak load level of the network. As can be seen, in the light load mode, indicators such as losses and voltage are at their best. Power losses in light load, normal and peak mode are 4.36, 5.2, and 6.67 MVA for one day, respectively. It can also be seen that there was no load interruption in any of the modes. The objective function in the light load mode is almost half of the peak load mode. In light load mode, energy purchase is equal to 1.5 MVA and in peak load mode it is equal to 1.54 MVA. In the same way, the used capacity of DG resources for a light load, normal, and peak load mode is equal to 13, 23.7, and 38 MVA. The voltage deviation in light load mode is the best possible and equal to 0.022 p.u. The simulation results in the operating mode under different loading conditions show the exact performance of the proposed model. Figure (3) shows a comparison between the load in the initial state and the changed load after managing the demand side in the normal load level. It can be seen that the blue bar graph shows the initial load and the orange bar graph shows the modified load. In these changes, it is clear that the peak load in the 18th, 19th and 20th hours after managing the demand side has decreased a lot compared to the initial load. Figure (4) demonstrates the energy purchase of the distribution network from the upstream network in the station.  It can be seen that there was no need to purchase energy in hours 1, 10, 11, 17, and 18 due to the presence of scattered production sources, renewable energy resources, and electric energy storage batteries. As can be seen, hours 17 and 18, which are the peak load of the network and have the highest energy prices, have not purchased electricity during these hours after optimizing the network.  between approximately 0.9859 p.u and 0.994 p.u. It can be seen that the voltage changes during the considered 24 hours are between 0.02 per unit, which shows the lowest voltage deviation, which can be attributed to the D-FACTS devices modeled in the network. In the same way, the voltage changes of each bus of the 33-bus distribution network for 24 hours are shown in the form of a box in the box plot. It can be seen that the voltage changes in each bus per hour are within the permissible range. It is noteworthy from the box plot that the voltage changes of each bus per hour were close to 1 p.u (according to the boxes on a box plot). Figure (6) also demonstrates the state of optimal charging and discharging of the batteries in the network at a normal   load level. In this figure, the negative axis indicates charging and the positive y-axis indicates battery discharge. It can be seen that the battery is charged in the early hours of the day and discharged during peak hours. According to the minimization of the multi-objective function of the problem, the charge and discharge energy storage systems are optimized.    (7) illustrates the charging status of electric vehicles for 24 hours. The charging status of electric vehicles has nothing to do with the network and only shows the behavior of electric vehicle owners for charging. It can be seen that the most charging of electric vehicles from the network is related to peak hours.

B. OPERATION CONSIDERING THE OCCURRENCE OF FAILURE
To better examine the performance of the optimization model in the condition of resource failure, several other modes have been considered. For this purpose, according to the relations (10) to (11) and the binary variables considered for the network lines and the active state of the power generation resources, we also analyze the behavior of the network according to the proposed model with restrictions on these variables. In this situation, we assume that the load of the network is normal. As seen in the table (3), there are 4 distributed generation units and 6 wind and PV renewable energy units in the network.   losses and voltage deviation has increased. It has also been shown that with the outage of 3 DG units, there will be a load cut in the network of about 150 KW. On the other hand, with the increase in the output of DG, the amount of emission has also decreased. In the same way, the objective function of the problem in the case of 1 output unit has changed from 326 to 1082 for 3 DG output units.
Table (6) illustrates the results of the outage of renewable units in the network. Here, the outage mode of 1 unit and 3 units of renewable energy is considered. It can be seen that, like the outage of DG units, with the increase in the number of outages of renewable units, the losses have also increased. Also, the objective function of the problem has reached from 3275 to 9176 with the increase in the number of renewable units. It can be seen that with the increase in the number of renewable units, the production of DG has also increased from 26.7 to 32.5 MW. Tables (5) and (6) show that the proposed model has worked well in the conditions of the outage of production units.

IV. CONCLUSION
In this paper, a mixed integer quadratic programming model for the optimization of smart distribution networks considering a set of distributed generation resources, renewable energy resources, energy storage systems, electric vehicles, battery-to-subway systems, D-FACTS devices like capacitor and shunt reactor, OLTC, SVR and demand side management were proposed. A stochastic multi-objective function including optimization of voltage, losses, energy purchase cost, emissions, and load shedding was also considered. The standard network of 33-bus was chosen to analyze the proposed model. Two modes of normal operation and operation with the outage of productive resources were also considered, and in both modes, the superiority and precise performance of the proposed model were determined. Finally, the conclusions obtained from the paper can be divided as follows: • The D-FACTS devices considered along with the battery, B2S, and demand side management have been able to minimize the voltage deviation and keep the energy purchase from the upstream network at the same value in all load conditions.
• Under any conditions, such as the outage of renewable and fossil resources, as well as the load condition of the network, no load shedding occurs in the network.
• The outage of fossil-DG resources cause increased energy losses and the outage of renewable resources causes increased pollution.
• Due to the short execution run time and the guarantee of optimal global solutions, the proposed model can be used in real and online networks.
To continue this paper, the following suggestions can be made: 1-Considering the natural gas network in the proposed optimization model to ensure accurate performance of distributed gas-fired generation units.
2-Modeling the transmission network and electricity market to increase the profitability of the distribution network and sell excess energy to the upstream network.