Optimal allocation of demand response considering transmission system congestion

The increasing penetration of renewable energy sources in the electricity grid brings new operational challenges. This brings up the need for effective means to provide demand response in spite of its distributed nature throughout the grid. Aggregators can be created to manage a set of such demand response resources, but deciding how to allocate an aggregator’s resources is an important problem. One of the aspects that needs more attention is the impact of the transmission system on these decisions. In this paper, we propose a short-term optimization model for allocating demand response(DR) resources as well as generation resources to supply external demand that is offered after the scheduling decision is made. The DR resources will only be available for use after the scheduling decision is made. Finally, our work also considers the impact of congestion in the transmission system when allocating DR. We propose the use of a semidefinite relaxation to provide a good initial point to solve our model with the aim of guaranteeing that we will find an optimal solution. Results from numerical tests with the IEEE 96-RTS and the ACTIVSG500 test grids are reported. We found that DR resources mitigates congestion management, allowing the generators to supply more of the external demand that is offered. Besides that, we observe that using our proposed solution methodology, we were able to obtain optimal solution for both cases studies, which is not the case when solving the original formulation for the ACTIVSG500 grid.

Active and reactive power injection in the "to" point of the branch nm.I p fmnt , I q fmnt Active and reactive power injection in the "from" point of the branch nm.

Vm t m
Voltage magnitude at bus m.

Introduction
Recently, there has been a significant technological evolution of the equipments available to use in the power grid as well as an expressive concern regarding energy generation environmental impacts.Therefore, there is an increasing participation of renewable energy in the energy mix, both through centralized and distributed generation (Paliwal et al. 2014;Carreiro et al. 2017).The growing use of new technologies has incentived the development of demand response (DR) programs that make it possible to use residential demand to mitigate the variability in renewable generation, and to delay the need for system capacity expansion (Albadi and El-Saadany 2008).These developments lead to new operational challenges, including the management of DR as well as distributed generation (DG) resources, and to new opportunities for companies dedicated to this purpose.
In the context of integrating both DR and DG adequately into the grid, an entity called aggregator was conceived.The main idea is that interacting with individual residential DR or small DG sources is extremely challenging for the Independent System Operator (ISO), and that most of the customers have little to no market power when bidding their DR or DG resource individually (Carreiro et al. 2017).Thus, there is a need for aggregators as intermediaries between the ISO and the distributed resources to efficiently allocate these resources and ensure the viability of DR service providers (Carreiro et al. 2017).
This leads to the challenge of designing aggregators adequately.There is an extensive literature on this, as seen in Campaigne andOren (2016), Dall'Anese et al. (2018), Faria et al. (2016).There has also been research on the integration of distributed resources without aggregators (Arasteh et al. 2013;Ikeda et al. 2012;Selvakumar et al. 2017;Magnago et al. 2015;Abdollahi et al. 2012).In Arasteh et al. (2013), the authors develop a model that aims to both maximize the profits of DR providers and to minimize the operating costs of the ISO.A model to maximize the profits of the electricity utility considering both the change of prices due to DR and the renewable energy generation and demand forecast errors, was developed in Ikeda et al. (2012).Similarly, in Selvakumar et al. (2017), the authors develop a model that aims to maximize generator profits considering both DR and the unit commitment (UC) problem.The DR price depends on the willingness of the consumer to join a DR program.In Magnago et al. (2015), an integrated DR and UC model is developed with the goal of minimizing operating costs and maximizing DR use.It considers a DR model in which the DR resource can be bought by placing bids with each bid having a certain quantity of demand allocated to it.The authors of Abdollahi et al. (2012) develop a model to minimize the operating costs, DR use costs, and emissions which integrates both UC and DR.There has been research on managing an aggregator's bilateral contracts portfolio (Gilbert et al. 2015).
In addition, DR can also have the objective of managing the transmission system congestion.In Yousefi et al. (2012), the authors propose a model that integrate both flexible alternating current transmission system (FACTS) devices and DR to the power grid operation to manage congestion at a minimum cost.In Singh and Kumar (2017), a model for congestion management with DR taking into consideration load uncertainty is developed.Similarly, in Tabandeh et al. (2015), congestion management is done taking into consideration transmission lines and generating units outages, and load uncertainty.Finally, in Dehnavi and Abdi (2016), the authors tackle the problem of determining the optimal DR resources location for congestion management.
Some authors have proposed models for an integrated operation of aggregators and the grid, such as (Ortega-Vazquez et al. 2013;Parvania et al. 2014;Duan et al. 2019;Talari et al. 2017Talari et al. , 2018;;Zhang et al. 2018Zhang et al. , 2016)).In Ortega-Vazquez et al. (2013), the authors propose a day-ahead scheduling model that aims to have a coordinated operation of the system between the ISO and the aggregators of electrical vehicles (EVs).The idea is to minimize both the generators operating costs and the aggregated EV demand mobilization costs, considering the effect of the EVs on the load-supply balance, and guaranteeing that the EVs will have the energy required for their daily needs.
In Parvania et al. (2014), a hierarchical DR bidding framework is developed in which the DR aggregators procure DR from individual costumers and offer it to the ISO.The authors integrate the model developed for the DR with a DC optimal power flow (DCOPF) model such that the ISO can operate the grid centrally by choosing which DR aggregators offers it will accept so as to minimize operational costs.
In Duan et al. (2019), a day-ahead AC optimal power flow (ACOPF) model that considers the offer of DR resources through aggregators is proposed.In this model, the aggregators submit DR bids to the ISO so that it can decide how to operate the grid at minimum cost by taking into consideration both DR and generation.The DR bidding function is modeled as a piecewise linear cost function, where each load curtailment segment has a specific price.
In Talari et al. (2017), the authors propose a model that integrates DR aggregators in the grid operation aiming to minimize operating costs for the ISO and maximize profits for the aggregators in the day-ahead market.Furthermore, they consider the interactions between the aggregators and individual customers, as well as wind energy generation with its uncertainty.Thus, they model the problem as a stochastic bi-level programming problem in which they use the KKT conditions of the lower level program to transform it into a single-level problem.Subsequently in Talari et al. (2018), they propose a model that also considers real-time grid operation for taking advantage of possible customers to offer DR in this time frame.For that end, they propose a two-stage stochastic programming problem in which the first stage is the day-ahead planning, and the second stage is the real-time planning.
In Zhang et al. (2018), the authors propose a day-ahead grid operation model for optimizing the allocation of DR and DG by the distribution system operator (DSO) considering the generation made available by the ISO.In the proposed model, the aggregators submit their generation, consumption and DR usage schedule to the DSO.Then the DSO and the generators companies send their generation schedule to the ISO.The ISO decides their dispatch taking into consideration the bids submitted by both the DSO and the generators, and, with the knowledge of the ISO's decisions, the DSO dispatches the DR resources and the wind plants in accordance with the aggregators' planning.
Although (Parvania et al. 2014;Talari et al. 2017Talari et al. , 2018;;Zhang et al. 2018Zhang et al. , 2016) have proposed models that integrate the operation of the grid and of the aggregators in a coordinated fashion, they use a DCOPF model.However, a DCOPF model does not represent the transmission system adequately, since it does not consider, for example, transmission losses, which can lead to optimistic dispatch decisions.Another option is using an ACOPF model, which adequately represents the transmission system, such as in Duan et al. (2019).The issue is that it is too costly to solve such problems because of their non-convexity.
We are interested here in the impact of the transmission system on the integration of aggregators in the grid operation.For this purpose we consider the need to meet external demand, representing changes in demand that appear after determining the operational schedule.This demand can be met by either available generation or by allocating DR resources from the aggregators.In this work, it is the aggregators' responsibility to choose which DR business model they will implement; we are only interested on the financial impact of using DR.Our contribution is an optimization model that maximizes the profits from meeting the unexpected demands.Specifically, we consider a short-term scheduling problem with DR resources and integrating the transmission system using an AC power flow model in which we consider a regulated electricity market.The integration of features such as the transmission system topology and the location of the generators, the DR resources, and the demand contracts allows the model to provide more accurate information.We also consider that a generator can choose how much of the external demand it will supply, thus making supplying this demand a decision variable (instead of a parameter).
Although there are uncertainties related to the wind and photovoltaic generation, the extra demand, and the energy prices, the additional complexity of considering them can lead to an intractable problem for larger grids.Not considering uncertainties is our model can lead to more optimistic solutions, with can incur is revenue losses.Nonetheless, a deterministic model is a critical step towards a possible future stochastic model.
In our model, we also do not consider the impacts of not supplying the extra demand from the demand requester's perspective due to the amount of complexity that it would add to our model.
In summary, our main contributions are: • The consideration of external demand on day-ahead operation.Such demand is not known ahead of time, it is offered only after the scheduling decision made, and can be opportunistically supplied by the generators by either generating more energy or using DR resources.Furthermore, the generators can choose how much of this demand will be supplied.A typical example would be the possibility that some energy markets have of exporting their energy production to other power grids.• The use of AC power flow leads to a non-convex optimization model that has been shown to be NP-hard (Lavaei and Low 2011) and generally incurs a significant computational cost to solve; thus we cannot guarantee that we will find the 25 Page 6 of 22 global optimal solution.We propose the use of an ACOPF relaxation, turning the problem into a tractable problem and giving us a solution closer to the global optimum.This solution will be, in turn, used as the starting solution for the original problem, transforming it into a tractable problem.The proximity of the solution given by the relaxation can be seen by analyzing its optimality gap.
This paper is organized in the following way.In Sect.2, we present our approach with the full non-convex ACOPF system model.In Sect.3, we present the relaxation used as part of our method to solve the model proposed in Sect. 2. In Sect.4, we report the computational results for two case studies.Section 5 summarizes the outcomes of our work.
In the objective function, (1), our aim is to minimize the cost of the extra generation and DR that may be necessary to meet the external demand while maximizing the revenue generated by supplying the external demand.
• Active power balance constraint: • Reactive power balance constraint: (1) In (2), we observe the addition of ED t m on the demand side of the constraint.Unlike D t m , ED t m is a variable, meaning that the generator can decide how much of the external demand to supply.This decision is directly connected to how profitable it is to supply this extra demand.There is also the addition of DR t m and ΔD t m to represent the DR and the shift of the demand due to DR.Otherwise, (2) is a standard power balance constraint, guaranteeing that the generation summed to the eventual energy transmitted or received through transmission lines is equal to the demand.The reactive power balance constraint (3) has the additional term ΔQ t m that adjusts reactive power demand according to the decision to supply a certain amount of the external demand.
• Transmission constraints: The transmission constraints (4-7) are the rectangular ACOPF formulation using complex numbers.
• Thermal plants bounds: The bounds on generation, transmission, demand response and extra demand are enforced in (8-12).
• Demand Shift Constraints: The demand shift constraint is defined in (13); it guarantees that any demand that is shifted will be supplied in another time step.It should also be noted that we cannot decompose the problem in hourly problems precisely because of this constraint, that spans over 24 h.Finally, one can observe that we have defined an ACOPF problem with additional variables DR t m for provided DR, ED t m for external demand, ΔQ t m for reactive power demand adjustment, and ΔD t m for demand shift caused by the use of DR.

Methodology
The optimization problem presented in Sect. 2 is non-convex because of constraints (4), ( 5) and ( 6).The key difficulty are the terms of the form Vm t m Vm t n .The non-convexity makes it challenging to solve the problem to global optimality in a reasonable amount of time.
For this reason, we use a semidefinite relaxation (SDR) of this problem.SDR relaxations are convex optimization problems for which there are efficient algorithms to compute a global optimal solution.We then use the solution of the relaxation as the starting solution for a nonlinear optimization solver to solve the formulation in Sect. 2.
Specifically, we use the Tight and Cheap Relaxation (TCR) introduced in Bingane et al. ( 2018), which can be solved in practice in reasonable time.Thus, we define VM t = Vm t (Vm t ) H and reformulate the transmission constraints, (4), ( 5) and ( 7), in the following way: This transformation eliminates the nonlinear elements of the constraints at the cost of introducing the new nonlinear constraint VM t = Vm t (Vm t ) H .One option is to relax it as a positive semidefinite constraint VM t ⪰ 0 .This is the standard SDR, as first proposed in Bai et al. (2008).However, this relaxation is known to be computationally too costly to solve for power grids with hundreds or thousands of buses.For this reason, we use the relaxation TCR proposed in Bingane et al. (2018) that further relaxes the constraint VM t ⪰ 0 as follows: The resulting optimization problem can be solved in reasonable time even for largescale grids.
In summary, our problem is solved in two steps because the scheduling is decided well in advance and the unexpected demand is only informed shortly before the execution of the planned schedule.As such, we need to first determine the schedule, and, afterwards, we will determine how to supply this unexpected demand.
In the first step, we solve the scheduling problem, since we will decide how much extra demand will be supplied after the grid's operation is determined.We will label this step's models as ACOPF and as TCR-ACOPF.The former is formed by (1-10) and the latter is formed by (1-3), (8-10), (14-19).In both cases, the variables ΔQ t m , ED t m , DR t m and ΔD t m are not considered.In the second step, we solve our proposed model by using the generation values given by the solution of the first step as the lower bounds for the generation.We also define the extra demand that will be available to be supplied and the DR resources available to be used.We will label this step's models as ACOPF-model, which is formed by (1-13), and as TCR-model, which is formed by (1-3, 8, 9, 14-19).
We summarize the solution algorithm in the following way: -Use the optimal solution of TCR-ACOPF as the initial solution for the ACOPF problem and solve it.
• Second Step -Extra demand supply and DR use -Use the generation values of the first step's solution as the generation lower bounds to the TCR-Proposed Model problem and solve it.-Use the optimal solution of TCR-Proposed Model as the initial solution for the Proposed Model problem and solve it (Fig. 1).

Results
In this section, we report results for two case studies to demonstrate the capabilities of our proposed approach.The first case study uses the IEEE 96 RTS from (Grigg et al. 1999), and the second uses the ACTIVSG500 system from the MATPOWER dataset (Birchfield et al. 2016).The datasets for both case studies are available at https:// doi.org/ 10. 7488/ ds/ 3514.The computations were carried out in MATLAB using CVX 2.1 (Grant andBoyd 2014, 2008) and the solver MOSEK 8.1.0.60 to solve TCR, and using YALMIP (Löfberg 2004) and the solver SNOPT 7.2.8 (Gill et al. 2018(Gill et al. , 2005) ) to solve the ACOPF formulation of the problem.
When analyzing the results in regards to the time of solution, we do not make a comparison with other works, since, to the best of our knowledge, we are solving a problem that has not been approached before.
Finally, to analyze the impact of the availability of DR resources when supplying extra demand, we also solve our model without considering DR.

IEEE 96 RTS
For this case we have a 73 bus-system that can be divided into 3 zones with the same number of buses, except for the last zone, which has one more.We consider a one-week time horizon with 168 hly time steps.We took the data for this case study from (Grigg et al. 1999) but made small changes to the generators' installed capacity, node demands, load profile, and operating costs with the objective of having cases of transmission system congestion.Furthermore, the load profile data for the period was taken from (Bu et al. 2019) taking into consideration the number of nodes in our case study.
We also made some changes to the demand and load profile of some nodes.Specifically, in our study nodes 317, 318 and 321 have 160 MW, 403 MW and 220 MW as their demand, respectively.Concerning the load profile, there was a value subtracted from all nodes for some time steps, see Table 1.
Regarding the generators, we increased the installed capacity by 16% for all nodes except those shown in Table 2.This increase guarantees that we will be able to supply all of the demand, even if there are cases of transmission congestion.In this table, we have the generation data for the plants that have had their installed capacities modified.We also note that in some of the nodes we added wind or solar energy generation, since the IEEE-96 RTS test grid does not have renewable energy generating units.The generation capacity and type of plant added on each of these nodes can be found in Table 3.Besides that, in Fig. 2, we can see the demand curve for this case study.Also, DR can be activated in all nodes with active demand greater than 0 in zones 1 and 2, and the nodes 314, 318 and 321, being limited to a maximum of 10% of the demand with a cost of $25.55 per MWh. Finally,nodes 106,112,119,120,319,and 320 will offer the possibility of supplying extra demand up to a maximum of 18% of the demand.Node 317 offers this possibility as well, but up to a maximum of 200 MW.All of them offer a revenue of $85.55 per MWh.
First, we compare the performance of solving the original problem with the performance of our proposed solution method.For the former, it took 36 h and two minutes, and, for the latter, it took 24 h and 36 min, representing a 31.71%improve- ment on the execution time.We also observe an optimization gap of 4.13% when comparing the solution given by the TCR-Model to the original model.
Besides that, we also make a comparative analysis of the base case study with three other case studies.In the first one, we solve the problem without considering DR resources.In the other two cases, we consider the ED revenue to be $63.33 and $18.33 per MWh for the purpose of analysing how the value of revenue impacts the model solution.The results are reported in Table 4.
Analyzing Table 4, we observe that there is a 21% reduction in the revenue when DR resources are not available.We also observe that the energy generation through thermal plants is lower when considering DR.We further note that a lower ED revenue per MWh does not necessarily have a significant impact in the solution of the problem.However, below a certain value for ED revenue, it is possible to see a substantial impact on the solution, with a pronounced decrease in the DR allocation as well as in the ED supplied.
Afterwards, we analyze the results for DR resources use and the extra generation in this instance of the problem, which can be seen in Fig. 3.It is possible to see that both thermal generation and DR resources were used to supply the extra demand available in a profitable way.However, we also see that the DR resources were not the least expensive resource in all cases because there is plenty of DR resources that were not used to supply the exports demand.In other words, sometimes it was either more profitable to supply this demand with thermal generation or to not supply it at all.This can be explained, in part, by the fact that when using DR resources, we shift the load that the consumers choose not to consume.In other words, in other time periods, there is an increase of the demand to be supplied, meaning that we need to generate more energy in these time periods, which can be seen in Fig. 3.As a consequence, the cost of supplying energy with DR is the cost of using DR plus the cost of the generation for the demand that has been shifted.When we observe the results for the extra demand, we notice that at some time steps the generators decide not to supply all of the possible extra demand.Analyzing the results for node 317 specifically in Fig. 6, we can establish that it is mostly because of not supplying all of the demand at this node.This is probably because all of the resources available in zone 3 are being used, including DR, and because the congestion in the transmission line 223-318 means that no DR resources from the other 2 zones can be used to supply this Also, either there is no generator with capacity of generating more energy to completely supply the demand of this node or it is too expensive to do so, thus not being profitable.
We also analyze the usage of DR at nodes 314, 318 and 321 and the supplying of extra demand for nodes 317, 319, 320, since the transmission line between nodes 223 and 318 is used close to its maximum capacity in peak demand times.We can see in Fig. 5 that there is a strong use of DR resources at nodes 314 and 318, which is coherent with the supplying of extra demand at nodes 317, 319 and 320, observable in Fig. 6.This corroborates what we see in Fig. 4, namely that DR is the only way that allows us to supply most of the extra demand available at these nodes, because the only transmission line that connects these nodes to the other zones is congested and there is limited extra generation capacity in Finally, it is possible to infer that the extra generation we see in Fig. 3 is a consequence of the fact that it is cheaper to supply demand at nodes 106, 112, 119 and 120 with the available generation capacity than by using DR resources.This means that, in this case study, DR resources have the best cost-benefit when there is transmission line congestion that impedes energy being supplied by generators.When there is little or no congestion, generating more energy may have a better cost-benefit than using DR.

ACTIVSG500
In this case study, we have a 500 bus-system, and we consider a day-ahead time horizon divided in 24 hly time steps.We took the data for this case study from (Birchfield et al. 2016) but made small changes to the generators' installed capacity, node demands, load profile, and operating costs in order to properly test our model.Furthermore, the load profile data for the period was taken from [35] taking into  consideration the number of nodes in our case study.We also made some changes to the demand and load profile of some nodes, as shown in Table 5 and Fig. 7.In addition to that, we have lowered the demand by 5% for all of the previously unchanged nodes.
Regarding generation, at some of the nodes we added wind (WP) or solar energy generation (SP), since the ACTIVSG 500 test grid does not have renewable energy generating units.The generation capacity and type of plant added at each of these nodes can be seen in Table 6.It should be also noted that the linear coefficients of the generation costs were multiplied by ten and that for plants with no operating cost, we added a $50 per MWh operating cost.Finally, we raised the installed capac- ity of all generators by 17% , this increase guarantees that we will be able to supply all of the demand, even if there are cases of transmission congestion.
We also changed the transportation for some of the transmission lines, which can be seen in Table 7.In addition to that, we have removed lines 181-97, 460-340, 221-447 and 214-403 for this case study.
Besides that, DR can be activated at every node with active demand greater than 0 that has no external demand offer, being limited to a maximum of 10% of the demand with a cost of $54 per MWh.Finally,nodes 34,75,94,341,182,448,404, , 311, 100, 38, 252, 266, 370, 381, 492 and 485 will offer the possibility of supplying extra demand up to a maximum of 18% of the demand offering a revenue of $180 per MWh.At the same time, some other nodes offer a fixed demand export possibility, which can be seen in Table 8.First, we compare the performance of our solution method with the performance of solving the original problem.For the former, it took 10 h and 59 min, while for the latter we were not able to find a feasible solution.We also observe an optimization gap of 28.05% when comparing the solution given by the TCR- Model to the original model.
Besides that, we also make a comparative analysis of the base case study with three other case studies.In the first one, we solve the problem without considering DR resources.In the other two cases, we consider the ED revenue to be respectively $130 and $40 per MWh, for the purpose of analysing how the value of revenue impacts the solution.The results are reported in Table 9.
In Table 9, we observe there is a 60% reduction in the revenue when DR resources are not available.We also observe that the energy generation through thermal plants is lower when considering DR.We further observe that a lower ED revenue does not necessary have a significant impact in the solution of the problem.However, when the revenue for supplying ED is below a certain threshold, a noticeable impact in the solution is clear.
Afterwards, we analyze the results for DR resources use and the extra generation in this instance of the problem, which can be seen in Fig. 8.We see that both thermal generation and DR resources were used to supply the extra demand available in a profitable way.However, although there is much more DR available than extra generation, the external demand is supplied by both sources of energy.In other words, for the nodes that are not connected to congested transmission lines, the use of the remaining generation capacity available can be more advantageous to supply the external demand.
Finally, analyzing the results for the external demand, we can observe that it was not profitable to supply it completely.Considering that there were still DR resources available to supply this demand, it is possible that there is either some transmission line congestion that cannot be further mitigated or that it is too expensive to use DR and supply the consequent shifted demand (Fig. 9).

Conclusion
In this paper, we proposed a model that maximizes the profit of supplying external demand using an ACOPF model with DR resources available through aggregators.We used the semidefinite relaxation TCR to obtain a reliable starting point to solve our problem as well as making it tractable and solvable in a reasonable amount of time.Our results shows that we were able to have an improvement on the execution time of 31.71% for the base case of the first case study and, in the base case of the second study, our approach allowed us to find the optimal solution of our problem.We can also see that the optimization gap is 4.13% for the base case of the first case study and 28.05% for the base case of the second study, which shows that the relaxa- tion give us a very good starting solution for our problem.We further showed that by allowing the generators to decide how much of the external demand should be supplied, the outcome may be that supplying all of this demand is either not profitable or not possible due to prices and transmission constraints.We also observed that DR acts, in some cases, as a transmission congestion manager by mitigating it and allowing more demand to be met.There are several avenues to explore in future research.First, the uncertainty linked to the renewable energy generation, which has an impact in decisions of DR allocation.This impact can be significant if there is a high penetration of renewable energy in the power grid.We also have the potential effects of the different types of distributed resources, which can impact on the decision of allocating DR and supplying external demand.

Fig. 3
Fig. 3 Extra and DR resources use over time

Fig. 4
Fig. 4 Extra demand supplied over time

Fig. 8 Fig. 9
Fig. 8 Extra generation and DR resources use over time Susceptance in the branch connecting bus n to bus m.Y mnAdmittance in the branch connecting bus n to bus m.Shunt susceptance and shunt conductance on the bus m, respectively Tn mnTurns ratio in the branch connecting bus n to bus m. f DR Percentage of the reduced demand that will be shifted to other periods of time.Demand exports that will be supplied by the generators at bus e.
m Lower and upper bounds for voltage magnitude at bus m. d Upper bound for demand response in bus m.ΔQ t m Upper limit for reactive demand power adjustment at bus m S t mn Upper bound for the branch connecting bus n to bus m transmission capacity.Th m Set of thermal plants connected to the bus m.Ω m Set of transmission lines connected to bus m.Φ Set of nodes that have an external demand offer.Ψ Set of nodes that have demand response capabilities.

Table 4
Summary of results for the different case studies for the IEEE 96 RTS grid

Table 9
Summary of results for the different case studies for the ACTIVSG500 grid