Demand-Side Participation via Economic Bidding of Responsive Loads and Local Energy Resources

The active participation of demand response (DR) resources into the wholesale market price formation and load dispatch process has the potential to stimulate demand-side flexibility. However, it is challenging for a market entity to utilize the DR resources for practical use. This is because day-ahead wholesale market-clearing prices are uncertain, and DR resources are heterogeneous. Furthermore, DR participation may lead to violations of the distribution system’s operational constraints. In this article, we propose an approach for an aggregator/load-serving entity (LSE) to profitably bid aggregated DR resources into the day-ahead wholesale market. The LSE requires an optimal bidding strategy that reflects the price elasticity of the aggregated retail loads to participate in the wholesale market operations. In the proposed approach, the LSE executes load curtailment and load shifting contracts with DR resources, where DR resources are remunerated for their participation at pre-contracted incentive prices. Then, the LSE aggregates the DR flexibility and optimally bids it in the day-ahead wholesale market. The proposed approach is validated using the IEEE-123-bus test system. It is demonstrated that the LSE can successfully generate economic bids for its participation in the day-ahead market by optimal management of DR resources and without violating the network’s operating constraints.


I. INTRODUCTION
T HE rapidly transforming electric power grid is facing unprecedented challenges due to uncertain demand and supply imbalances resulting from misaligned infrastructure and high aggregate peak time usage. Considering this issue, the power systems community has widely recognized the value of demand response (DR) resources in improving the operational efficiency of the emerging power grid. Despite significant efforts in harnessing DR resources, a vast majority of engagement from proactive customers remains untapped [1]. An important enabler for encouraging demandside participation is to allow DR resources to participate in the wholesale market price-formation and load-dispatch process [2]- [5]. However, it is impractical to expect active market participation from individual customers. This motivates the concept of DR aggregators or profit-seeking load-serving entities (LSEs) who participate on behalf of DR resources. LSEs integrate the retail customers into the wholesale market by bidding aggregated demand-side flexibility as demand bids [6]- [8]. To participate in the wholesale market, LSEs require an optimal bidding strategy that reflects the price elasticity of the aggregated retail loads.

A. LITERATURE REVIEW
Related work in the literature investigates the LSEs bidding in the wholesale market based on two strategies. In the first strategy, the LSEs bid using fixed demand bids that only indicate the quantity of electricity demand regardless of the price. For example, in [9], an approach is proposed for the LSE to determine the optimal fixed demand bids by aggregating DR resources in response to exogenous price signals. In [10], authors proposed an approach for the joint VOLUME 8, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ optimization of energy and reserve where, aggregators submit their bids as fixed demand bids to participate in the dayahead electricity market. Alternatively, several recent works have proposed models to generate economic bids for the LSE by aggregating the economic flexibility of DR resources. Economic bids include both energy and price components, indicating the demand-flexibility as a function of electricity price. For example, in [6], a multi-period stochastic optimization program is developed that leverages the time-shiftable load potentials to reduce the cost of electricity for the LSE. In [11], economic bids are generated by solving stochastic optimization problems while taking into account the uncertainty in day-ahead market prices. In [12], the concept of virtual power plants (VPPs) is introduced, and an approach using fuzzy optimization is proposed to incorporate the uncertainty in the market-clearing prices. Similarly, the economic bidding strategy is investigated for electrical vehicle (EV) aggregators [13]- [15] and different types of distributed energy resource (DER) aggregators [16], [17] in the presence of demand flexibility and uncertainty in the wholesale marketclearing prices.
Regardless of significant works in this domain, there remain critical gaps in the related literature. Specifically, the proposed approaches based on fixed demand bids in [9], [10], do not include offered prices, hence, cannot accurately model the economic flexibility of the demandside resources [11]. This problem is solved in references [6], [11]- [17] by using economic bidding for the LSEs; however, these works do not adequately address the heterogeneity of DR resources, especially concerning their contracts with the LSE (e.g. allowable load curtailment/shifting, incentive prices, etc.) in the DR aggregation and the LSE's bid formation process. This is crucial from the LSE's perspective since the heterogeneity of DR resources' economic and physical attributes significantly affects the LSE's decision-making process. Also, different market parameters (e.g. wholesale market price, retail price, and DR incentive price) are not adequately modeled in the existing literature on the LSE's economic bid formation process, especially in the presence of local energy resources (LERs) capable of providing demand response. Moreover, the distribution system's operational constraints are typically ignored in models for DR aggregation and bid formation. This may lead to unnecessarily large voltage drops/swells in the distribution grid, causing undesirable power quality issues during the DR scheduling.

B. CONTRIBUTIONS
In this article, we propose an approach to generate economic bids for LSEs by aggregating DR resources. The proposed approach specifically addresses the aforementioned gaps in the literature, especially with regard to the heterogeneity of DR resources, contracting with LERs capable of providing DR, and the inclusion of distribution system's operating constraints in the LSEs' bidding process. The problem objective is to maximize the expected revenue of the LSE by scheduling DR resources to bid in the wholesale market with uncertain day-ahead market-clearing prices. The problem formulation includes computationally efficient formalism to model new DR resources such as LERs and the distribution system's operating constraints. The resulting problem is formulated as a stochastic linear programming (LP) problem that obtains an optimal schedule for DR resources and the LSE's economic bid portfolio for the day-ahead wholesale market.
This work builds upon our recent article [18]. While the prior work included only flexible loads in the LSE's economic bidding process, in this article, we propose a new model that incorporate LERs at the customer premises such as battery energy storage systems (BESSs) that are owned by the customers and managed by the LSE. Such models for LERs are recently being adopted by the utilities. For example, under the BYOD pilot program [19], customers gave authority over their BESSs to the utility company for a specific time-frame in exchange for an upfront incentive payment in the ongoing bill credits. Note that incorporating LERs requires significant innovations compared to our previously proposed problem structure in [18]. Specifically, compared to single-step optimization [18], new formulations are proposed that appropriately include BESSs charging and discharging over the day via a multi-period optimization framework in a stochastic setup. Furthermore, in this article, we present a comprehensive model for incorporating crucial economic and system-level parameters, including uncertain wholesale price, LSE's retail prices, DR incentive prices, and network operating constraints in the DR aggregation and bid formation process. The main contributions of this work are following: • The proposed approach includes the heterogeneity of DR resources in the LSE's decision-making process for economic bidding. This is important as DR resources, based on their types, can have different load curtailment/shifting options in their contract with the LSE.
• The proposed framework investigates the effects of market parameters on the LSE's bid formation process. Specifically, we evaluate the effects of varying wholesale market prices, retail prices, and DR incentive prices on the LSE's profit.
• The proposed approach incorporates the distribution system's operational constraints (voltage and thermal limits) in the model for DR aggregation and bid formation. The modeling of the system-level constraints is important in order to ensure a secure operation of the distribution system.

C. PAPER ORGANIZATION
The rest of the paper is organized as the following. Section II describes the framework for DR aggregation and bidding. Section III details the mathematical formulation of the problem. Section IV validates the proposed method based on different test cases, and Section V presents concluding remarks.

II. DEMAND RESPONSE AGGREGATION AND BIDDING
This section outlines the proposed framework for DR aggregation and bidding. Specifically, we present a detailed discussion on the problem setup, the formalism for DR contracts with the LSE, and the distribution system's operational model.
• Market Structure: The wholesale market is organized into day-ahead and real-time stages in which the LSE participates. In the day-ahead market, economic bids are submitted for a total of m time-intervals, 24-hours ahead of the time of actual operation [20]. The wholesale market runs economic dispatch and clears the market with locational marginal prices (LMPs). At the real-time stage, the LSE generates a fixed demand bid based on the expected deviations in the real-time demand from the day-ahead contracted values. These bids are settled at the real-time market price, ahead of the time of interest (e.g. 15 minutes ahead).
• Load Serving Entity (LSE): The LSE is modeled as a price-taker entity. This means that the LSE cannot affect the market price by changing its cleared energy or its offering strategy [21], [22]. This is an reasonable assumption for the LSE which serves small or medium sized distribution system [23]. Also, the LSE can only purchase electricity from the wholesale market and cannot sell the unused electricity back to the market. We assume that the LSE is responsible for maintaining the distribution system's operational constraints. This is to ensure that the network operating constraints are not violated during the LSE's bidding process.
• DR Contracts: Each customer participating in DR is subscribed to one LSE. Customers receive monetary incentives in the form of marginal payment for load curtailment and/or participation of their DR-capable LERs (e.g. BESS).
• Available Information: LSEs have the following information available: day-ahead load forecasts, load curtailment contracts, BESSs parameters, and maximum and minimum wholesale market-clearing price (using historical data).
The proposed structure for DR aggregation and bidding is detailed in Fig. 1. The LSE optimally schedules its DR resources and generates economic bids for each interval of the day-ahead market. To do so, the LSE needs to know day-ahead market prices. These market prices are, however, obtained ex-post upon solving the economic dispatch problem by independent system operator (ISO). Thus, at the time of bidding in the wholesale market, the wholesale market-clearing prices are unknown. Due to this dependency, the LSE's day-ahead bidding problem is solved ex-ante, i.e. by using forecasts rather than actual values of wholesale market-clearing prices. This results in a stochastic optimization problem.
Finally, note that in the proposed framework, the LSE settles any deviations in demand from the cleared dayahead market quantities in the real-time market. Let x t RT be the cleared demand in real-time market and π t RT be real-time market-clearing price at time t. Then, assuming

E[x t
RT ] = x t DA , the expected profits from real-time markets are zero when considering the operation of the day-ahead market. Therefore, in this article, we only study economic bidding for the day-ahead market. The real-time bids are fixed demand bids posted to adjust for deviations from day-ahead commitments.

A. CONTRACTS WITH CUSTOMERS
We assume that the LSE has established contracts with its customers participating in the DR program. Based on these contracts, the LSE can curtail customers' load demand and manage their LERs. Contracts are modeled as the following.

1) LOAD CURTAILMENT CONTRACTS
It is assumed that the DR is performed based on direct load control (DLC) in which the LSE is allowed to control some part of customers load during the day in the exchange of monetary incentives [24]. A few examples include heating, ventilation, and cooling (HVAC) systems and/or water heaters where the LSE can control the thermostat's heating and cooling cycles [11], [25], [26].
For each customer k, the demand curtailment contract is comprised of the following parameters: (1) marginal payment received from the LSE for demand curtailment (π k c ), (2) the maximum allowed energy curtailment during a day (E k max ), and (3) the maximum allowed demand curtailed at each discrete time-interval (t) at which the LSE bids on the day-ahead market (R t,k max ). The LSE aims to find the optimal curtailed demand denoted by p t,k z for each customer k for each discrete time-interval t, for a day. This information is used to generate day-ahead economic bids for the LSE.

2) CONTRACT WITH DR-CAPABLE LOCAL ENERGY RESOURCES (LERS)
The LSE can also bid customer-owned DR-capable LERs, such as BESS, assuming the LSE manages them. Specifically, in the proposed framework, we assume that the customer-owned BESSs are available to the LSE for bidding. Other LERs can be easily modeled within the proposed contract framework as detailed in the discussion following this section. The LSE employs BESSs to shift power demand from peak hours to off-peak hours to avoid purchasing expensive electricity from the wholesale market during peakload hours. Customers are remunerated for making their BESSs available for bidding/load-shifting. In what follows, we provide the mathematical model used for a BESS and describe the energy management contract based on the BESS parameters.
In related literature, different models have been proposed for a BESS [25], [27], [28]. These models usually use binary variables to avoid the simultaneous charging and discharging of the BESS. Incorporating these models in the optimization framework leads to an MILP problem. The MILP model becomes computationally expensive as the binary variables grow in number, that is typically the case when modeling numerous small customer-owned BESS within a multistage optimization formulation. Recently, reference [29] proposed a BESS model in which binary variables are relaxed as continuous variables. Using this relaxed model in linear programming (LP) problem preserves the linear structure of the optimization problem. Thus, to reduce the computational complexity, we employ the following relaxed BESS model (1)- (5).
The BESS state-of-charge (SOC) update equation is given in (1) where, SOC t , P t c and P t d are the SOC, charging rate, and discharging rate of the BESS at sampling time t, respectively; ν, η c and η d are energy decay rate, charging efficiency and discharging efficiency, respectively; and Q bat and τ are capacity of the BESS and length of the sampling timeinterval, respectively. Constraint (2) bounds the BESS SOC, where, E + and E − specify bounds on the BESS charging and discharging limits, respectively. Constraints (3) and (4) bound the BESS's maximum charging (c r ) and discharging (d r ) rates, respectively. Constraint (5) is introduced in [29] to relax the binary variables the BESS model. Note that although the BESS formulation allows for simultaneous charging and discharging, it happens only in relatively rare conditions (see [29]); thus when p t c has a value, p t d is zero, and vice versa.
The DR contracts for BESSs are specified by d r and c r . These parameters constrain the volume of each BESS's demand that the LSE can shift at each time-interval. For an accurate schedule of individual customers, the LSE needs to know BESSs parameters. This information can be obtained at the time of contracting with the customer and updated, as needed, based on the manufacture specifications and the aging model for the battery. The customers receive marginal payment for demand-shifting (i.e. discharging their BESSs) at rate π k c , and they pay for charging the BESS at the retail price. The stored energy in the BESS is used to reduce customer's load demand at a later time-interval. Note that without a BESS, the customer would have paid for this demand at the same retail price at a later time-interval. Thus, without the additional marginal payment from the LSE for demandshifting, the customer has no incentive to bid its BESS. However, with the additional incentive from the LSE to shift the demand to the intervals with lower wholesale prices, the customer ends up reducing its electricity bill by bidding its BESS.
Discussion on generalizing the BESS to other LERs and time-shiftable loads: Different types of LERs are proposed in the related literature for providing DR. For example, reference [11] considers combined heat and power (CHP), auxiliary boilers (AB), PV, absorption chiller (AChil) and heat pumps (HPs) as LERs. Since all of these systems can be modeled as a negative load during the steady-state operation, the proposed formulation in this article can be easily extended to include different types of LERs with their operational models and constraints. Similarly, this article can be expanded to include the cycling, and energy quality of service (QoS) constraints of thermostatically controlled loads (TCLs) [30]. Furthermore, the formulation can be easily adapted to include time-shiftable loads such as EVs. They can be formulated same as the BESS model with additional constraints regarding their scheduling time. Thus, the proposed formulation can be generalized to other time-shiftable loads and LERs.

B. DISTRIBUTION SYSTEM OPERATIONAL CONSTRAINTS
This section details a linearized AC power flow model for the radial distribution system. This model is obtained by approximating the nonlinear three-phase power flow equations for the radial distribution system [31]. Specifically, the nonlinearity due to mutual coupling among the three-phases and the power losses are approximated (refer to [31] for details).
Power Flow Equations: We represent the radial distribution system as a directed graph G = (N , E) where N and E denote set of nodes and edges, respectively. The two adjacent nodes i and j are connected together forming an edge (i, j) where the node i is the parent node for the node j. For a node i in the system, three-phase of the node is denoted by ρ i ∈ {a, b, c}. The complex voltage and apparent power of the load at node i ∈ N for a phase ρ are denoted by V  (6)- (8). Note that (6) and (7) refers to active and reactive power balance equations where, k : j → k denotes a child node k for a parent node j, and (8) represents linearized three-phase voltage drop equation.
where, the variables are active power flow, P ρρ ij , reactive power flow, Q ρρ ij , and the square of the voltage magnitude, v ρ i . As specified before, in this article, we employ the linearized power flow model, detailed in (6)-(8), to model distribution system's operating constraints. Although this model approximates loses, our prior work has thoroughly validated that the power flow solutions obtained using the linear AC power flow equations in (6)-(8) are close those from actual non-linear three-phase power flow model [32], [33].
Operational Constraints: The network operating constraints with regard to nodal voltages and lines thermal limits are specified next. The nodal voltages for distribution system should be within the allowable ANSI voltage limits, i.e. 0.95 − 1.05 pu [34]. The associated operating constrains is specified in (9).
The branch capacity for a line is defined as the maximum permissible kVA capacity calculated based on its ampacity. Thus, the loading of a line should not exceed its maximum permissible capacity, (S ρρ ij ) max , as defined below: To avoid the resulting nonlinearity in the optimal power flow formulation, the quadratic constraints in (10) are approximated as linear constraints using a polygon based linearization method proposed in [35]. Specifically, for each line (i, j) the linear constraints can be formulated as: where, the radius of the hexagon, R pp ij , is obtained using:

III. PROBLEM FORMULATION
In this section, first, we introduce the structure of the economic demand bids for the LSE obtained by aggregating the contracted DR resources. Next, the problem formulation for generating economic demand bids is detailed with considering uncertainty in day-ahead wholesale market-clearing prices and distribution system operating constraints.

A. ECONOMIC DEMAND BID FOR LSES
For a total of m time-intervals, 24-hours ahead of the actual operation, = π 1 min , π 2 min , . . . , π m min π 1 max , π 2 max , . . . , π m max is defined; where ∀t ∈ {1, 2, .., m}, minimum and maximum day-ahead wholesale market-clearing price profiles are given as π t min and π t max , respectively. The LSE's economic demand bids for the day-ahead market are defined based on . For each time-interval, the LSE submits economic bids (see Fig. 2), quantified using the following two price-volume pair where d t min and d t max are the minimum and the maximum power demand of the LSE, respectively; the economic bid-function is obtained via the linear interpolation of the two points (see Fig. 2). As can be seen, when the wholesale market-clearing price is minimum (maximum), the LSE demands maximum (minimum) power. At each time-interval, the generated economic demand bid function represents the aggregated flexibility of the retail customers managed by the LSE, and it shows the flexibility of the LSE (resulting from its DR resources) to purchase electricity at different wholesale market prices. Note that the economic demand bids also define an associated scheduling plan for DR resources at each time-interval.
After the day-ahead wholesale market is cleared, the economic demand bid function at each time-interval t is used to determine the cleared demand (and associated schedule for DR resources) based on the market clearing price as the following: where, π t DA and x t DA are the day-ahead wholesale marketclearing price and cleared demand for the time t, respectively.

B. OPTIMAL ECONOMIC BID CURVE FOR THE LSE
The optimal bidding problem for the LSE into dayahead wholesale market is modeled as a single-stage, multi-period optimization and scheduling problem for DR VOLUME 8, 2021 curtailment/shifting. The objective is to obtain economic demand bids for each time-interval and the associated DR scheduling decisions, 24-hours ahead of the time of operation, that maximizes the revenue for the LSE while maintaining the distribution system's operating constraints. The problem is formulated as the following: (14) Subject to: The maximization of the LSE's expected revenue is given by (14) where the first term is the expected cost of selling energy to retail customers, the second term is the expected cost of purchasing electricity in the day-ahead market, and the third term is the expected incentive cost that the LSE pays to those customers participating in the DR program. In (14), E[.] shows the expected value and π R is the retail electricity rate, m and K denote total number of time-intervals and total number of customers, respectively. The decision variables are defined at each time-intervals of the day; they are: the dayahead wholesale market clearing power, x t DA ; the schedule for load curtailment for each customer, p t,k z ; and the BESS discharging plan for each customer, p t,k d . Constraint (15) states that the cleared demand in the day-ahead market should be greater than or equal to the summation of the real power demand of all distribution system phases where subscript i is the substation bus. Constraints (16) and (17) bound the total load curtailment during the day and for each time-interval, respectively. Constraint (18) states that the net load demand of the customer k at the time t is due to its rated power demand and shifting/curtailing of the load, where, p t,k rated is the rated load demand. This constraint connects the scheduling of each customer to the distribution system power flow model in (6). Constraint (19) is introduced so that the SOC of the BESS at the end of the day to be the same as the initial SOC of the BESS at the beginning of the day (i.e. E 0 ). This constraint prevents the LSE from unnecessarily charging the BESS in order to sell excess energy to its customers.

C. REFORMULATING THE OBJECTIVE FUNCTION
The uncertainty in the day-ahead market clearing price, DA , makes (14) a stochastic optimization problem. Here, DA represents the vector of day-ahead market clearing prices, π t DA , at each time-interval t ∈ {1, 2, .., m}. To solve (14), we approximate the objective function by its sample-average estimate derived from simulating multiple random samples of the associated stochastic variable (π t DA in this case). This transforms the stochastic problem into a deterministic optimization problem. The resulting deterministic optimization problem is solved for the different random samples along the stochastic space of variables to obtain the optimal solution (see [36] for details).
Specifically, we assume that the is known i.e. for each time-interval t, the minimum and maximum probable values for wholesale market-clearing prices, π t min and π t max , are known. Note that this is a valid assumption, as depending on the degree of conservativeness to approach the problem, the price components, π t min and π t max , can be obtained from the historical wholesale price data with some range of uncertainty. We consider n s realizations of DA denoted by s DA for s ∈ {1, 2, .., n s }. The components of each realization of the wholesale price profile, s DA , is a vector with its elements designated by π t,s DA for t ∈ {1, 2, .., m}. Note that the random samples generated for the day-ahead market clearing price, π t,s DA , is bounded by π t min , and π t max (20). π t min π t,s DA π t max (20) The objective function (14) and the associated stochastic optimization problem is reformulated to include n s realizations, s DA , as the following. Here, on solving (21), based on π t,s DA and (13), the corresponding day-ahead cleared demand, denoted by x t,s DA , is obtained for each time-interval as a function of b t . Note that (21) is a deterministic optimization problem. Solving (21) with its constraints for different s DA results in different cost functions and different sets of problem variables x t,s DA , p t,k z and p t,k d . Then, those values of s that provide minimum and maximum values for the cost function are selected, and corresponding x t,s DA and π t,s DA are used to obtain the economic bid designated using (π t min , d t max ) and (π t max , d t min ). This is also shown in Fig. 2.

IV. RESULTS AND DISCUSSIONS
In this section, we conduct a set of experiments to validate the applicability of the proposed framework for DR aggregation and bidding in the wholesale market. Simulations are performed using the three-phase unbalanced IEEE-123 bus test system (see Fig. 3). Load nodes in the system are considered as customers with the ability to participate in the  DR program as described in the Section III. The rated load demand profile for each customer for a day is obtained using OpenDSS at hourly intervals which specifies the value of p t,k Rated . The customers supplied by the feeder are categorized into 3 groups based on different types of demand response resources. The first group consists of 32 customers having only the option for load curtailment. Customers in this group are further divided into four sub-groups (with 4 customers in each sub-group) based on the maximum allowable volume of load curtailment per day (E k max ). Specifically, customers in each sub-group take one of values for E k max from the set {4,5,6,7} (MW). The second group has 31 customers with the ability to only shift the load using BESSs; they do not provide the option for load curtailment, i.e. E k max = 0. The third group has 31 customers having both options for load shifting and curtailment, where all customers in this group have E k max = 7 MW. Fig. 4 shows the minimum and maximum realizations of the wholesale market price (i.e. π t min and π t max ). The parameters for BESSs used in the simulations are listed in Table 1. Other parameters for BESSs are as the following: E 0 = E − = 0.1, E + = 1, ν = 0, τ = 1 hr and η c = η d = 1. Note that in different experiments, we use the following general parameters unless otherwise stated: Type II for all BESSs, R t,k max = 1 MWh, m = 24, π R = 60 $/MWh and π k c = 10 $/MWh. For the simulations in this article, we solve the optimization problem (21) for two realizations of wholesale price profiles (n s = 2): minimum and maximum price profiles. For both realizations, we obtain a day-ahead demand bid (i.e. x t,s DA ) and a schedule for DR resources curtailment/shifting (i.e p t,k z , p t,k c and p t,k d ). It should be noted that solving the optimization for only maximum and minimum price profile realizations is sufficient to generate the economic demand bid curve for the LSE. As can be seen in Fig. 2, economic-bids in-between the maximum and minimum price-points are represented via a linear interpolation. Thus, the optimal demand bids corresponding to maximum and minimum price profiles (i.e. d t min and d t max ) are used to obtain the slope for the economic demand bid curve (see Fig. 2).

A. VALIDATION OF THE PROPOSED FRAMEWORK
This section validates different aspects of the proposed approach via simulations on the selected test system. The problem objective is to maximize the LSE's revenue by optimally utilizing DR resources in the proposed LSE's bid formation process while considering the operational constraints of the distribution system.

1) COMPARISON WITH FIXED BIDS
We compare the proposed approach of economic bidding using DR contracts with the widely accepted approach used in the relevant works that employs fixed demand-bids [9], [12]. Fig. 5 shows the amount of power purchased in the day-ahead market by the LSE based on minimum (π t min and s = 1) and maximum (π t max and s = 2) realizations of the day-ahead wholesale market-clearing price profile and for the cases with and without utilizing DR resources. Specifically, this figure represents the amount of purchased electricity by the LSE based on different bidding strategies (economic vs. fixed bids) that can be used by the LSE to bid in the dayahead wholesale market. Note that generation of economic bids is contingent upon the ability of the LSE to shift/curtail demand of customers. However, in the absence of contracts VOLUME 8, 2021 with customers for DR, the LSE should satisfy the total rated demand of customers in the distribution system (indicated with the legend ''Rated'' in Fig. 5) regardless of the wholesale market price, which is equal to K k=1 p t,k Rated at each time t in the formulation. Thus, when not utilizing DR resources, the LSE ends up submitting fixed demand-bids in the dayahead market. As an example, Figs. 6a and 6b show the LSE's demand bids generated at 12:00 and at 14:00 hours, respectively. Note that at 12:00, the values of load curtailment are different for the different price realizations (i.e. s = {1, 2}). This leads to an economic bid representing the LSE's price-demand flexibility. However, at the time-intervals when demand, x t,s DA , is equal for different price realizations, e.g. at 14:00, the LSE ends up submitting a fixed demand bid to the wholesale market (see Fig. 6b).
It is also shown, when DR contracts are in place, the LSE reduces and shifts the customers' demand to off-peak timeintervals by utilizing DR resources for economic benefits. This is regardless of the realization of the wholesale price profile (maximum/minimum). Specifically, when using DR contracts, 2.52 MW and 3.93 MW of load demand based on minimum and maximum realizations of the day-ahead wholesale market-clearing price profile are curtailed, respectively. Similarly, for both cases, the demand is shifted from 13:00-16:00 to 02:00-05:00. The revenue of the LSE for these cases are 3216.5$ and 3792.6$ for minimum and maximum realizations of the day-ahead wholesale price, respectively. However, in the absence of DR contracts with customers, the costs of providing electricity for the LSE are increased to 3513.4$ and 4220$ for minimum and maximum realizations of the prices, respectively. Note that the cost of electricity for each of these cases is calculated as the product of the power demand profile and the corresponding wholesale price profile. Therefore, the cost of providing electricity for the LSE is less when the DR contracts are utilized for bidding into the wholesale market.

2) EFFECTS OF PRICE UNCERTAINTY ON LOAD CURTAILMENT
We discuss the effects of price uncertainty on the load curtailment schedules for the individual customers. This can be seen in Fig. 5 where different load curtailment schedules for customers result in different load demand profiles at the peak hours. Note that the LSE utilizes available BESSs for both maximum and minimum price profile cases. This is more evident in Fig. 7 where schedules for load curtailment are shown based on customers types (i.e. different E k max ) and are compared for the minimum (s = 1) and maximum (s = 2) wholesale price profiles. Note that load curtailment schedules of individual customers at each time-interval is determined by solving (21). For example, between time-intervals 13:00-17:00, to maximize the LSE's revenue, the high value of wholesale market price leads to the load curtailment for all customer types for both minimum and maximum price profile realizations. Thus, x t,s DA for s = 1 and s = 2 are same between time-intervals 13:00-17:00 (see Fig. 5). However, different load curtailments patterns are observed outside of this time-interval based on the price realization and category of customers. Specifically, for the maximum realization of the wholesale market price (s = 2), load curtailment for different groups of customers varies based on their E k max and π t,s DA where the maximum load curtailment happens for the customers with E k max = 7 MWh between time-intervals 11:00-18:00. Also note that for the cases when the LSE schedules customers' load based on the minimum realization of the day-ahead wholesale market price, the load curtailment is not scheduled outside of time-intervals 13:00-17:00. This is true even for the customers with available resources that can be curtailed (i.e. customers with higher E k max ). This is because, outside of the time-window 13:00-17:00, the day-ahead wholesale market price (for minimum realization of price profile, i.e. s = 1) is less compared to the retail price of the electricity and thus the load curtailment is not beneficial for the LSE. Note that the load curtailment is zero for all other times that are not specified in Fig.7.

3) DISTRIBUTION SYSTEM CONSTRAINTS
In this section, we demonstrate how the proposed approach incorporates the operational constraints of the distribution systems into the DR aggregation and bid formation process. The minimum nodal voltages for all nodes and phases during the day for both price profiles are shown in Fig. 8. It can be observed from the figure that, the nodal voltages are

B. EFFECTS OF SYSTEM PARAMETERS ON ECONOMIC DEMAND-BIDS
In this section, we investigate the effects of varying BESS type, retail price (π R ), and DR incentive price (π k c ) on the cost savings of the LSE. In each experiment, we vary one of the parameters while keeping others fixed.

1) EFFECTS OF CHANGING BESSS PARAMETERS
This section shows the effects of increasing the capacity and charging/discharging rate of customers' BESSs on LSE's revenue, and optimal volume of the load curtailment. Specifically, all BESSs are set to one of the particular type from Table 1, and the value of objective function (21), and volume of curtailed demand are compared for different realizations of day-ahead wholesale market prices. For both realizations of prices, Fig. 9 shows that increasing the size of customers' BESSs leads to a higher revenue for the LSE. That is, on increasing total capacity of available BESSs in the distribution system, the LSE can purchase additional electricity at a low price during off-peak hours to be used during peak hours when the prices are higher. Also, for all cases, the revenue of the LSE is higher for the minimum realization of the price profile compared to the maximum realization of the wholesale market price. This is because, on decreasing the day ahead wholesale market price, the second term of (21) is decreased, and due to the negative sign of this term, the total value of (21) is increased.
Next, Table 2 shows the volume of load curtailment for different types of BESSs and for different realizations of the day-ahead wholesale market price. Similar to Section IV-A, it is observed that the total amount of load curtailed is lower when wholesale prices are lower (i.e. corresponding to minimum price profile realization, s = 1) and vice-versa. That is, a lower value of load curtailment motivates the LSE to sell more electricity to its customers as it is economical to purchase more from the wholesale market (due to the lower prices corresponding to s = 1) and sell it to customers at the retail price.

2) EFFECTS OF CHANGING THE RETAIL PRICE
This section shows the effects of changing the retail electricity price (i.e. π R ) on the LSE's revenue, and the optimal volume of load curtailment. Fig. 10 shows that on increasing the retail price, the revenue of the LSE increases. Also, Table 3 shows that an increase in the retail price leads to a lower volume of load curtailment. This is because, the LSE gains more revenue by selling more expensive power to its retail customers. In fact, when the retail price is higher than the wholesale market price (i.e. π R > π t,s DA ), a decrease in load curtailment leads to a more economic bidding scenario for the LSE.

3) EFFECTS OF VARYING THE INCENTIVE PRICE
This section shows the effects of varying the customer incentive prices for their participation in the DR program, π k c , on the LSE's revenue, and the optimal volume of load curtailment. Fig. 11 shows that an increase in the incentive price leads to a reduction in the LSE's revenue, regardless of the realization of the wholesale market price profiles. Table 4 shows the volumes of load curtailment for the customers based on different realizations of the day-ahead market prices VOLUME 8, 2021  and incentive prices. It is observed that on increasing the incentive price, a lower amount of load is curtailed. That is, an increase in π k c results in a higher value for the third term of the objective function in (21). Due to the negative sign of this term, K k=1 p t,k,s z should decrease to maximize objective function (21). This leads to a reduction in demand curtailment for both realizations of the wholesale market prices.

C. DISCUSSION ON BESS'S DEMAND-SHIFTING CAPABILITY
The scheduling of BESSs is affected by the pattern of the wholesale market price profile rather than the specific values of the maximum and minimum price realizations. Given that both realizations of the wholesale market prices have a similar daily pattern (see Fig. 4), all BESSs are charged and discharged at respective peaks and off-peaks for both price realizations. Thus, the variations in scheduled SOC for a day are the same for all cases regardless of the BESS type and the realization of the wholesale market price profile. The resulting SOC profiles for the day for all BESS types and for both price scenarios are shown as Pattern A in Fig. 12. Thus, the LSE finds it economical to schedule BESSs based on their maximum demand-shifting capability, regardless of their size and the realization of the wholesale market priceprofile. Therefore, BESSs scheduling patterns (during the day) are the same as long as the trend for the price profile during the day does not change.
Next, we observe the effect of not constraining the BESS SOC at the end of the day to its value at the beginning of the day (E 0 ). To simulate this case, we remove the constraint (19) from the optimization formulation. The resulting profile for BESSs SOC is shown in Fig. 12 referred to as Pattern B. In this case, the LSE ends up charging BESSs towards the end of the day to increase their revenue by selling additional energy to customers that is not needed by them. Thus, this constraint is important when scheduling BESSs.

V. CONCLUSION
Harnessing the demand-side flexibility of a large number of demand response (DR) resources calls for novel mechanisms for their aggregation and bidding into the wholesale market while holistically considering the associated economic and engineering concerns. This article presented an approach for load-serving entities (LSEs) to profitably aggregate DR resources and bid into the wholesale market while incorporating the uncertainty in wholesale market clearing price and considering operational constraints of the distribution systems.
The applicability of the proposed approach was demonstrated by simulating different case studies on IEEE-123 bus distribution test system. The results show that the proposed framework is able to capture the demand-side flexibility, and provides optimal economic bids for the LSE by scheduling DR resources. Furthermore, it is shown that the load curtailment is only optimal for the LSE if the retail electricity rate is less than the wholesale market clearing price. On increasing the retail electricity rates and DR incentive prices, a reduction in total load curtailment is observed. However, if the wholesale market prices increase, a higher value for demandside curtailment is realized. The impacts of different parameters on the battery energy storage systems (BESSs) schedule including wholesale market-clearing price, retail price, and incentive price are also evaluated. A similar pattern for demand-shifting is observed when scheduling local energy resources (LERs), aka BESSs. Thus, it can be concluded that the charging and discharging patterns of BESSs only depend upon the pattern of the day-ahead price profile.
The major assumption in this work is that a contractual agreement exists between the LSE and the customers participating in the DR program. Designing amenable load curtailment or load shifting contracts with customers is an important problem that needs further work. One of the directions for the future work is to design contracts between the LSE and the residential customers where the LSE offers critical peak rebates (CPRs) to the contracted customers. The proposed approach needs incorporating the crucial elements of principal-agent theory in the contract design process [37]. These contracts should be designed to maximize the LSE's (principal's) profit while incorporating important constraints relating to customer's (agent's) private information and behavior. Also, in this work, the LSE is considered to be a price-taker entity assuming that it serves a small/mediumsized distribution system. In the case LSE serves a large distribution system or several distribution systems supplied by the grid, it should be modeled as a price-maker entity. A similar study to this work can be proposed for investigating the bidding problem of the large-sized LSE with the price-maker assumption. Additional research is needed to fully understand the impacts that the LSEs, as a price-maker entity, can have on the wholesale market, with appropriate consideration of possible market manipulations, for example, by strategic bidding. Professor with the School of Electrical Engineering and Computer Science, Washington State University (WSU), Pullman, WA, USA. Her research focus is on the analysis, operation, and planning of the modern power distribution systems for enhanced service quality and grid resilience. At WSU, her laboratory focuses on developing new planning and operational tools for the current and future power distribution systems that help in effective integration of distributed energy resources and responsive loads.