Incentive Based Demand Response Program for Power System Flexibility Enhancement

This article proposes a DR program characterized by a novel compensation scheme. The proposed scheme recognizes the different characteristics of curtailment, such as the total length of curtailments within a window of time, or the number of separate curtailment events (i.e., curtailment startup), and compensates the end-user accordingly. The proposed compensation scheme features a piece-wise reward function comprised of two intervals. DR participants receive a onetime reward upfront when they enroll in the DR program and accept a set of predefined curtailment aspects. Curtailment aspects in excess of the agreed quantities are rewarded at a linear rate. This design is tailored to appeal to residential DR participants, and aims to secure sufficient flexibility at minimum cost. The parameters of the smart contract are optimized such that the system’s social welfare is maximized. The optimization problem is modeled as a mixed-integer linear program. Consequently, this article updates the unit-commitment (UC) formulation with the commitment aspects of DR units. The proposed extension to the UC problem considers the critical aspects of DR participation, such as: the total length of interruptions within a window, the frequency of interruptions within a time-window irrespective of their length, and the net energy deviation from the original load profile. Deployment of the smart DR contract in the unit dispatch problem requires translating DR participants’ characteristics to their equivalent aspects in conventional thermal generators, such as minimum up time, minimum down-time, start-up and shutdown costs. The obtained results demonstrate significant improvement in social welfare, notable reduction of curtailed renewable energy and reduction in extreme ramping events of conventional generators.

System Parameters P 0 (t) Benchmark load consumption during t The set of settlement windows in a contract C 1 (p) Linear cost parameter for conventional generator ρ(t) Ramping limit up to which ramping cost is zero P max g Maximum power output of unit g P min g Maximum power output of unit g MUT g Minimum up time for unit g MDT g Minimum down time for unit g.
UC Model Continuous Variables P load (t) Active power consumed by load during t ρ g (t) Actual Ramping of unit g between t − 1 and t ρ(t) Ramping in excess ofρ, which incurs a cost R g (t) Reserve provivded by unit g at t R req (t) Total reserve required in the system at t. UC Model Binary Variables u curt (t) Curtailment status during t u rdm (t) Load's energy redemption status during t v curt (t) Startup of curtailment status at t w curt (t) End of curtailment status at t u g (t) Commitment status of generator g at t v g (t) Startup decision of generator g at t w g (t) Shutdown decision of generator g at t.
DR Contract Variables Q P Agreed size of active power curtailment for 1 hour Q u Agreed total period of curtailments Q v Agreed number of independent curtailment events Q (·) Excess curtailment characteristic beyond Q P , Q u , Q v .

Cost Coefficients c Q (·)
Cost term for (·), such as:

T HE HIGH penetration of variable Renewable Energy
Sources (RES) in modern power systems increases the requirements for operating reserves, load-following reserve in particular [1]. Very fast ramping of thermal units for the provision of operating reserves might incur high costs and increase wear on these units; thus, raising maintenance costs in the long term [1]. Moreover, current energy markets' structures fail to properly compensate thermal units for providing operating reserves. Consequently, these units lack motivation to provide this vital service [1]- [3]. The gradual displacement of thermal units from RES units pushes for deployment of Demand Response (DR) and Energy Storage Systems (ESS) to provide operating reserves.
DR programs use monetary incentives to motivate demand participation in balancing the mismatch between generation and consumption. Ma et al. [4] highlight that traditional DR programs are focused on providing high-energy curtailments to the grid. For example, the role of traditional DR in a contingency event is load-shedding for a long period of time. Similarly, peak shaving has a high energy component. In contrast, DR can provide operating reserve characterized by frequent short events. Therefore, participants who can tolerate frequent, short and small curtailments would prefer this type of DR program as opposed to load shedding and peak shaving programs. DR programs are an active area of research, encompassing different control objectives, different reward schemes, and different sets of actions [5]. The main classification criterion of DR programs is the reward scheme, namely: Incentive-based DR programs (IBDR), and time-based or price based DR programs (TBDR/PBDR) which implement timespecific tariffs. DR programs are also classified according to their objective [5].
Ali et al. [6] demonstrate a centralized cloud-based protocol for regulating interactions between prosumers in an energy district, and a smart grid. The A multi-objective optimization problem aims to: maximize grid revenue, maximize the amount of prosumer energy sold to the smart grid, and minimize prosumer energy cost. The optimization is carried out under different DR program types: real time pricing and day-ahead pricing. The work does not take into account commitment aspects of prosumers. The majority of research on DR programs focuses on optimizing DR bidding, derive the response of DR units to certain incentives under different program designs, and characterization of loads' random behavior. These studies consider only the size of curtailment by consumers. A smaller share of the literature investigates other load characteristics such as the total length of curtailments and the number of curtailments within a time window.
A flat start-up price is paid for each DR activation in a contingency DR program in [7]. Oikonomou et al. [8] propose a queuing system for flexible loads such that smart loads submit consumption requests and wait in queue for approval. A hard cap is placed on waiting time, and smart loads receive a reward proportional to waiting time. The framework may delay the supply to some loads for economic reasons only (i.e., cost savings) rather than for flexibility purposes. The proposed model considers only delaying load, and ignores the possibility of advancing loads in time. The number of delay events per day is not capped. Extreme ramping events and commitment aspects of conventional generators are not studied, either.
Xu et al. [9] study the customers' willingness to give utilities direct control over their loads. The acceptance rate is largely dependent on the size of the offered incentives, how invasive the utility's curtailments are and customers' demographics. Zhang et al. [10] highlight the commitment aspects of responsive loads, and investigate installing an ESS within an industrial plant to reduce the frequency of load interruptions. The ESS smooths the binary response of the industrial load, and enables the industrial plant to provide operating reserve. The frequency of activation and other commitment aspects are highlighted, however, are not explicitly optimized. Furthermore, the industrial process under investigation does not, typically, require an ESS. Different types of reserve have different deployment time frames (i.e., regulation, contingency, flexibility, energy, and capacity), and thus, a load providing this reserve service must meet certain physical requirements such as: response time delay, response length, ramping duration, activation frequency [4]. Some of the load's response characteristics are not hard physical limits, but financial restraints. Such conflicts can be optimized in a cost/benefit analysis. For example, the response time delay of DR units was proposed as a flexibility index recently in [11]. A modified SCOPF formulation is presented in [11] such that a price for response time delay can be extracted from the formulation's dual variables.
Bayat et al. [12] identify time controllability of load as a new characteristic, and classify loads into three types: controllable all day, controllable for certain hours, and noncontrollable. Ma et al. [4] identify three criteria of a load: sheddable, controllable, and acceptable. Acceptability reports the fraction of the load willing to respond to incentives. The Controllability criterion indicates the amount of load equipped with the required means of control and communication for DR. Finally, sheddability indicates the size of load which can be shed considering the load's physical limits. These three criteria fail to represent aspects such the length of curtailment events and how often can the load be interrupted.
IBDR programs were proven successful in the residential sector in [13], [14]. In the first study [13], 1575 residential units agree to a maximum of one curtailment event per day lasting for 45 minutes only, where the HVAC load is reduced to a pre-defined level. A one-time payment is made to all customers at the beginning of the exercise. In practice, the operator may or may not invoke a curtailment event every day. The study finds out that payments of $5 per month or $10 per month to each unit can defer the installation of a new gas power plant for 35 years or 12 years, respectively. However, the study in [13] does not consider making higher payments for longer curtailments per day or more than 1 brief activation per day, either. The study was implemented for the summer season only. Two more enterprises are highlighted in [14]. A one time payment of $25 is made to 75,000 residential units in exchange of reducing their air conditioning load. Similarly, 300,000 consumers agreed to an unlimited number of curtailments in exchange for an annual compensation between $100 and $200.
The successful ventures in [13], [14] provide the following experience about the behavior of small consumers: small per-unit rewards do not appeal to residential consumers. A significant one-time payment made upfront is much more attractive. This also implies that PBDR programs are likely to fail in the residential sector. Moreover, residential consumers are deterred by long-time agreements extending beyond few months or years. Existing operation models apply hard constraints on minimum up time and minimum down time, however, demand units are more concerned with the number of activations and the total length of curtailment events per day. It is also necessary to ensure DR units redeem their energy curtailments in other time periods.
The following gaps in literature can be outlined: • Existing DR programs provide incentives in a pay-peruse basis. Small incremental rewards do not catch the attention of residential customers. Furthermore, residential customers exhibit less fidelity with the promise of postpaid rewards. • DR units are represented as perpetually committed units generating negative power. This representation completely ignores load's physical limits. • DR commitment aspects and physical limitations are not taken in account for the largest part, such as curtailment length, number of curtailment events and curtailment size. • In existing DR models, customer discomfort is considered only through limiting the curtailment size regardless of the length and number of these curtailments within a window of time. • If all these aspects of DR were constrained or associated with a cost, it is necessary to extend the classical UC formulation accordingly. This article proposes a novel smart contract for more versatile and effective DR programs. The proposed contract is a compensation scheme which can be augmented into any of the existing IBDR designs (i.e., direct load control, interruptible load, etc.). Therefore, the proposed contract complements these IBDR designs rather than replaces them. Consumers receive a one-time payment, known as the entry reward at the beginning of a DR agreement. In exchange, the loads agree to curtailment of predefined size, number of activations, and total length during the day. These terms are applicable for the lifetime of the contract. The size of the entry reward is proportional to the agreed quantities. Exceeding the agreed quantities entails additional reward proportional to the excess quantity, at a rate higher than that of the entry-reward. Therefore, curtailment aspects are modeled as piece-wise cost parameters rather than hard constraints.
The smart DR contract can be perceived as a hedging instrument against future's uncertainty, which is a very common practice in the energy market [15]. In order to incorporate the curtailment aspects in power system operations, this article proposes a novel extension to the UC problem formulation. Furthermore, in order to optimize the contract quantities, the problem is modeled mathematically and solved in a case study on the load profile of the IEEE24RTS system.
The remaining of this article is organized as follows. Section II presents the smart DR contract terms. The modified unit commitment (UC) optimization model and the stochastic mathematical program for optimization of the smart contract parameters are laid in Section III. The scenario generation technique used in the Monte-Carlo simulation is presented in Section IV. Section V describes the test system used. Section VI describes the optimization algorithm and computer setup. Results of the case-study are presented and discussed in Section VII. Section VIII concludes this article.

II. CONTRACT SETTING
Small upfront payments promote DR programs in the residential sector as mentioned in the previous section. the following smart DR contract terms are set: • The contract terms are agreed between the system operator and the DR agent. • The DR must abide to curtailment requests by the system operator. • The period of the contract is 13 weeks, starting at the beginning of a season (winter, spring, summer and fall). The contract extends for 1 season, equivalent to 91 days, inclusive. • The services provided by the DR-agent to the system operator are remunerated according to a piece-wise function of two intervals: 1) Flat Interval (Base Quantities): The DR agent receives a non-refundable one-time payment at the beginning of the contract lifetime, referred to as the Entry Reward. In exchange, the system operator is allowed to invoke curtailments upto and including a predetermined limit, without further compensation. The DR agent will not reimburse the system operator for any unclaimed services. More specifically, the system operator can invoke the following services, without discretion of the DR agent: -A curtailment of size Q P in one hour.
-Curtailments of total length of Q u within a window of time. -A number of separate curtailment events (starting of an interruption) of Q v within a window of time. 2) Linear Interval (Excess-Reward): If the system operator deems it necessary, s/he can request additional services in excess of the agreed base quantities, such as: -Curtailment size Q P on top of the agreed quantity Q P . -Total period of curtailment Q u in addition to the agreed total period Q u . -More interruptions Q v in addition to the agreed number Q v . Then, an ad-hoc payment is made by the operator to the DR-agent, which is directly proportional to the excess amount of services: operator compensates the DR agent for the excess amount Q v − Q v , and no compensation is made pertaining to Q u . The rate of additional reward is agreed upon at the beginning of the contract. Different rates C P , C u , C v may apply for the different parameters The piece-wise reward function is described by (1), and visualized by Fig. 1.
The first interval of C (·) represents the unit price in the Entry Reward C (·) , at the beginning of the contract. • The curtailment allowances (Q P , Q u , Q v ) apply for a fixed period of time, known as the Settlement Window. In this article, a settlement window is chosen to be 48 hours long. • The settlement window is static, such that the start and end of the window are defined by a certain day and hour. The settlement window does NOT move with the current operation hour. If a settlement window is marked by Monday 00:00 and Tuesday 23:59, all periods between these two points belong to this settlement window only. Settlement windows are mutually exclusive. • The DR agent shall be allowed to redeem whatever amount of energy curtailed upon request from the operator at period t, at a later or earlier time within the same settlement window. The DR program's goal is to shift loads and reshape the load profile, rather than reduce the total energy consumption. • The actual curtailment characteristics (Q P , Q u , Q v ) are evaluated at the end of the settlement window. • Upon completion of a settlement window, a new settlement window commences, and the count of (Q P , Q u , Q v ) resets to zero. No amounts or allowances shall be carried over between any two settlement windows. • If, in any case, the system operator prevents the DR agent from redeeming the curtailed amount of power by the end of the settlement window, the system operator pays a separate reward/penalty to the DR agent, directly proportional to the remaining amount of unserved load. This amount shall be referred to as the Deficit Ransom. • Due to different load patterns among different seasons of the year, a contract's lifetime is limited to 1 season only, equivalent to 13 weeks or 91 days.
Salient differences in RES pattern and load profiles between weekend and weekdays necessitate that different terms Q P , Q u , Q v are chosen for weekdays and weekends. A different contract is signed for weekdays, and a different contract is signed for weekends. 1) Choosing a settlement windows T = 48hours, the weekdays contract implies the following settlement windows per week: Monday 00:00 → Tuesday 23:59, inclusive Wednesday 00:00 → Thursday 23:59, inclusive A third settlement window for the weekday contract comprises the last day from a week with the first day of the following week, and so on. Consequently, 1 season, 91 days, or 13 weeks, comprises 32.5 settlement windows of type weekday. 2) For a settlement window T = 48hours, the "weekend" contract implies that there is one settlement window per week, of type weekend: Saturday 00:00 → Sunday 23:59, inclusive Consequently, 1 season, equivalent to 91 days, or 13 weeks, comprises 13 settlement windows of type weekend. The operator designs the flat-reward interval such that it accommodates the biggest part of uncertainty introduced by RES and system failures. The entry reward represents a hedge payment made by the operator against these uncertainties. In contrast, the linear cost term (pay-per-unit) represents an optional reserve source for rare events or unexpected extreme conditions. The unit price C (·) in this range should be higher than the unit price C (·) of a service in the flat region. In other words, it is sensible to select C (·) ≤ C (·) , otherwise, it is in the operator's best interest to request a zero base quantity Q, without any entry reward, and operate always in the pay-per-unit range.

III. OPTIMIZATION PROBLEM FORMULATION
Power system operations are scheduled in the real world over two stages. The day ahead stage optimizes the commitment of units and neglects contingencies. The hour-ahead stage solves a security-constrained optimal power flow (SCOPF) problem incorporating contingencies. To analyze the impact of the smart DR contract on the system, the system operations are optimized in the day-ahead time frame only, without contingencies.

A. Detailed Incentive-Based DR Model
When the smart DR contract is ratified, it is necessary to modify the unit-commitment problem model to incorporate the new soft limits ( Q P , Q u , Q v ) and their cost parameters. Constraints (2)- (14) are augmented into the classical UC model, and the UC model is solved for every wind-load scenario κ. The scenario index κ is dropped for better readability. Equation (2) decomposes the actual load consumption P load during t into its benchmark level P 0 load (t), the curtailment margin P curt (t) and redemption P rdm (t) of power curtailed at other periods. Equations (3) -(5) define u curt (t) and u rdm (t) as binary variables that indicate the status of the load during t, whether the load is curtailing power, redeeming energy or neither. Constraints in the form of If-Then conditions, such as (3)-(6), can be linearized using the big-M method. This linearization is illustrated in the Appendix. Due to the cost imposed on excess curtailment u curt , the optimization solver will avoid setting u curt unnecessarily to 1 when there is no curtailment.
The start of a curtailment event is indicated by the binary variable v curt (t) in (6). Curtailment occurring on the very first period u curt (1) = 1 is treated as a special case where v curt (1) = 1, represented by (7). The actual total curtailment hours Q u in any settlement period is the sum of u curt (t) over all hours for that settlement period (8). The actual total number of curtailment events Q v is defined, similarly, in (8). Curtailment aspects in excess of the agreed parameters ( (10) and (12). A cap ofQ u curt /2 is placed on u curt to prevent huge excess quantities. A similar rule is applied for v curt . Energy balance over the settlement window is maintained by a high penalty on P deficit , which is defined in (14).
The soft limit on curtailment size Q P can be defined in two ways; either as a fraction of the benchmark load P 0 load as in (15), or, as a fixed margin as in (16). In this article, the benchmark model in (15) is adopted. The load's redemption level P rdm (t) should also be defined in the agreement as either a percentage of benchmark load (i.e., option 1) or as a fixed margin (i.e., Option 2). The benchmark load P 0 load at some hours is 0MW. In case the redemption limit is defined as a percentage of P 0 load (t), the load would not be able to consume any energy at such hours for the purpose of redeeming curtailed energy. It is important to enable the load to consume energy at such hours in order to flatten the consumption profile. Therefore, a flexible redemption limit must be defined as the maximum between a fixed margin (i.e., in MW) and a percentage of benchmark load. This is implemented by (17).

B. Modified UC Model
The classical UC model maximizes social welfare, defined in (18) as the difference between demand's socio-economic benefit and all generators' costs. Generators' costs comprise: the cost of generating electric power P g , the cost of startup v g and shutdown w g , the cost of reserve offering R, and the cost of ramping ρ g . The standard constraints of a classical UC model are demonstrated as follows: the power balance constraint in (19), the generation capacity constraint in (20), the definition of the ramping rate in (21), the ramping limits in (22), a unit's status in (23), and finally, the MUT and MDT constraints in (24) and (25), respectively, [16].
The reserve available from each unit is described by (26). The total available reserve in the system must meet the reserve requirement R req , dictated by (27). The available reserve is required to be large enough to replace the largest online unit g as specified by (28). This criterion assumes that the failure of the largest online unit is the worst N − 1 contingency scenario. In addition, to incorporate the effect of steep ramping on conventional generators, a cost premium applies on ramping within the range [75% − 100%] of the maximum ramping capability ρ max , as described by (29) and (30).
if w g (t) = 1 ⇒ u g (τ ) = 0, ∀τ ∈ {t, . . . , t + MDT} (25) The payments for excess quantities Q (·) ensuing the smart DR contract must be included in the augmented UC objective function for each scenario κ. These payments are perceived as the OpEx of the contract, represented by (31). The gross social welfare SW κ UC,new for scenario κ is described in (32). The value of the entry reward does not appear in the UC of a single settlement window because it is paid only once at the beginning of the season.
For the DR enterprise with the proposed smart contract to be deemed successful, the improvement margin in the SW of all the settlement-windows of the season must be large enough to outweigh the entry reward. In other words: where E is the expectation (i.e., weighted average) across a set of scenarios κ ∈ K.

C. Optimizing Smart Contract Parameters
High base quantities Q and high entry rewards lead to a surplus of reserve, unnecessary payments from the system operator and sub-optimal operation of the system. On the other hand, entry rewards are essential to promote the DR program, as discussed earlier. Therefore, it is necessary to optimize base-quantities of the smart contract for a given system setup. Such optimization must incorporate the stochasticity of RES output and load. This requirement can be satisfied using a Monte-Carlo simulation.
The entry reward is represented as a polynomial function of the terms ( Q P , Q u , Q v ), as shown in (33). Attempting to optimize both cost C Q and quantities Q simultaneously leads to a trivial solution of: C Q = 0, Q = ∞. Therefore, the rates C Q are treated as fixed coefficients in the objective function. In practice, an educated choice of C Q requires analysis of the market conditions including market players and the demand's elasticity with respect to u curt , v curt in addition to the traditional P load elasticity. In this article, the entry reward represents the Capital Cost of this DR agreement, as given by (33). The entry reward is deducted from the gross SW to calculate the net social welfare SW * for a full season, as given by (34).
. . , K} is the index of load-wind scenarios, E k is the statistical expectation operator over different loadwind scenarios κ, and ψ is the set of settlement windows in a contract. | · | is the size of a set. In the weekdays contract, contains 26 settlement windows. In the weekends contract, contains 13 settlement windows. The size | | balances between the contract's entry reward and the operation cost. The smart contract's quantities Q (·) can be optimized by solving the stochastic problem in (35), subject to (2) -(33). CapEx contract and SW * are functions of the quantities ( Q P , Q u , Q v ), however, the variables are omitted for better readability.

IV. WIND POWER MODEL AND WIND SCENARIOS
Hourly wind-speed data for 19 years for a location in southern France (43.3891N, 4.8026E) are acquired from [17]. The data are divided into three subsets: {Winter, Summer, Spring&Fall}. Each day is divided into 8 periods of 3 hours each { < 0, 1, 2 > , < 3, 4, 5 > , . . . , < 21, 22, 23 > }. The approach of aggregating and fitting the data of every 3 hours to the same model is proposed in [18] and adopted in [19]. The wind-speed data for each period (3-hours) are grouped together and treated as one population. falls. 5) Count one instance of the state corresponding to this segment. 6) Once a segment (bin) has been selected, it is still necessary to choose a point within the segment (between the boundaries). Possible options are: • Take the center value of the segment • Take the lower boundary of the segment (conservative estimate). • Take a random value between the two boundaries. This article adopts the third option. The points in the original dataset are assumed to be uniformly distributed within  the segment. A uniform random number generator is used to produce a random value between the two boundaries.
The procedure is also illustrated in Fig. 2. If the range of wind speed values is divided into 6 bins, a random value of 0.58 lies within the boundaries of segment 4, and hence, one instance of segment 4 is counted. Table I depicts the probability distribution table of only one out of 24 sets. This distribution represents the epoch: < 0, 1, 2 > of the Winter season. The wind-speed data is divided to 12 bins (i.e., segments) of width 1m/s. Outliers in the wind-speed data are grouped together in the first bin. This bin has the lowest probability among other bins. It is also clear that the bins (i.e., segments) do not have equal probabilities. Table I also highlights the advantage of the KDE over the Rayleigh and Weibull distributions which are the common models for fitting wind speed data.
The wind turbine has cut-in V in , rated V rated , and cut-out V out speeds of 2, 12.8, and 18 m/s, respectively. The power generated by a wind turbine can be represented as a fraction of its rated output as in (36), where V a is actual wind-speed.
V. TEST SYSTEM The test system consists of 3 conventional generators and a wind-turbine. The generator data are provided in Table II. The system's total generation capacity is 900MW. Generic load data can be acquired from the IEEE24-RTS standard test system [21], where the load value is given for every hour of the year as a percentage of the peak load. The generation capacity in [21] is 3, 405MW, and the load profile has a peak of 2,850MW. Therefore, the load profile of the IEEE24-RTS system must be scaled down to a peak of 600MW. The load  [21] outlines different patterns of load for weekends vs. weekdays. The load profile for weekdays is divided into 26 settlement windows, of 48 hours each. The load profile for weekends is divided into 13 settlement windows, of 48 hours each. MATPOWER-MOST package [16] is used for modeling and optimizing the system. 1 The value C 1 (p) for the load (i.e., third row) in Table II represents the load elasticity. To reproduce the effect of fixed tariff on residential units consumption and simulate a pure IBDR program, without loss of generality, a fixed elasticity value is used in this article. The cost of ramping is set to be 4% of the cost of power C 1 (P) of each generator. As mentioned earlier, a cost premium applies on steep ramping within the range [75%−100%] of the maximum ramping capability ρ max . The price premium is equal to 16% of the cost of power C 1 (P), as described in (37) -(39). In addition, Generators 1 and 2 offer reserve for a price of 20% of their linear generation cost term, as implemented in [15].
The hourly wind-speed is the only random variable in the Monte-Carlo simulation. For each season, 39 wind scenarios are generated. Each of the 39 scenarios is paired with one of the load scenarios (26 scenarios for weekdays, 13 scenarios for weekends). Therefore, a total of 35 × 26 = 910 load-wind scenarios are generated for weekdays, and 35 × 13 = 455 load-wind scenarios are generated for weekends. Each loadwind scenario represents a settlement window, with a length of 48 hours. The wind-speed data for the fall season and spring season are generated from the same distribution model {Fall&Spring}. However, different load data are available from [21] for each season. Therefore, separate wind-speed scenarios are generated and paired with different load profiles for each season. In order to analyze the role of DR with higher RES penetration, the optimization problem is solved for two RES penetration levels: {35%, 50%} of the peak load level 600MW. The Monte-Carlo optimization problem is run 16 times under different conditions: 4 seasons, 2 day types, and 2 RES penetration levels.
The cost coefficients for the objective function of each contract are given in Table III. The cost of excess quantities C Q is expressed as a multiple of the entry reward factor C Q .  For objective comparison between instances, the same set of parameters is used for all seasons and penetration levels among all weekday contracts. Another set of parameters is applied for all weekend contracts. In practice, the system operator may choose a different set of parameters for each season and each penetration level based on market analysis. Furthermore, the penalty on P deficit is set deliberately large, at $10,000/MW, to effectively prevent any deficit.

VI. CASE STUDY
The stochastic optimization problem in (35) comprises 455 or 910 wind-load scenarios. In order to utilize MATLAB's parallel computing toolbox and available high-end computing hardware, the problem is decomposed to a bilevel optimization model, illustrated in Fig. 3. In the upper optimization problem (blue dotted box), the contract characteristics ( Q P , Q u , Q v ) are optimized to maximize SW * in (35). The candidate solution of the upper problem ( Q P , Q u , Q v ) is passed to the lower optimization level (red dashed box) whereQ (·) are treated as fixed parameters. The UC problem is solved in the lower level for each of the 910 or 455 scenarios. The decision variables of the UC problem are the generators' commitment decisions u g , v g , w g , the power dispatch P g for conventional generators and the wind-turbine, the power consumption of the demand P load , the actual curtailment characteristics Q P , Q u , Q v , and the excess curtailment quantities Q P , Q u , Q v . Additional decision variables are used in the UC problem such as u rdm , P rdm , P deficit .
The UC problems are solved on different processors simultaneously, and the results are consolidated to evaluate SW * in (34). With this decomposition, the upper level optimization can be solved using any heuristic algorithm, while the MILP solver of the CPLEX suite is used to solve the lower optimization (i.e., UC) problem. Using a high-performance computing node with 24 cores, the evaluation time for a single candidate solution with all wind-load scenarios, is 30 seconds for the weekend case, and 70 seconds for the weekday case. The full optimization problem takes between 18 and 24 hours.
The upper optimization problem has only 3 decision variables: Q P , Q u , Q v . We choose to represent the base curtailment power Q P as an integer value percentage of the base load P 0 load , as described by (15). Therefore, the search space of the decision variables is finite, as shown in (40). The search space can be reduced further by realizing that u curt ≥ v curt and implementing (41). A grid search is carried out first and the best values are used as the initial population for a more rigorous heuristic optimization session using the genetic algorithm (GA).

VII. RESULTS & ANALYSIS
The main results for the 16 design instances are listed in Table IV. It is clear that higher wind penetration leads to larger and more frequent curtailment events. This indicates that wind volatility has a drastic effect on the system's costs. Flexibility provided by the DR units alleviates this stress, bringing along significant cost savings to the system. In fact, the improvement in gross SW is between 1.5% to 5% at low wind penetration level, and between 3% and 6.6% at high wind penetration level. Improvement in net SW (SW * ) is also positive, which proves the success of the DR adopting the smart contract.
The smart DR contract reduces the RES spillage from 3.18% to 0.47% in the case of E/35/Sp, which is a six fold reduction. Similarly, the smart DR contract reduces RES spillage from 12% to 5.63% in the case of E/50/W, which is a 6% in RES spillage. In general, RES spillage is reduced to below 1% in all cases of low wind penetration level, and below 5% in all instances of high penetration level. Furthermore, only 3.22% of wind energy is spilled in case E/35/F, compared to a 8.91% spillage in E/50/F. In general, higher RES penetration level is accompanied by higher RES spillage due to the lack of operating reserve.
Assuming a single residential unit has a peak load of 150KW, the peak load of 600MW corresponds to 4,000 residential units. Dividing the total entry reward paid by 4,000 units yields the payment made to each household for the full season, which is divided further by 3 months, and reported in the last column /Hh/mo. For example, $11.13 and $4.64 are paid per household per month in fall at 35% wind penetration level, for the weekday and weekend contracts, respectively. Therefore, each household is paid $15.77 in total per month.
Key differences between the weekday and weekend contracts are attributed to the significant difference in load size. The load size on weekends of any season is approximately 40MW smaller than the weekdays' load for the same season. Wind speed patterns are independent of the day type. With a smaller peak load, the effective penetration rate of wind in weekends is higher than that of weekdays. This can be observed in the percentage of spilled wind power between weekends and weekdays in Table IV. Despite the higher effective wind penetration rate, the weekend contracts enclose smaller curtailment sizes Q P , but more frequent curtailment startups Q v compared to the weekday contracts. This indicates a problem of extreme wind volatility. At the same time, the weekend contracts yield bigger improvement in SW and reduction in RES spillage. Therefore, weekend contracts represent a better business opportunity for DR aggregators.
For a better understanding of the impact of DR on system operation, the cost breakdown for one scenario in the (D/35/Wi) group is analyzed. Costs before and after the DR contract are illustrated in Fig. 4. The cost savings can be attributed to three changes, in order of size: 1) Shorter commitment u and fewer switching events {v, w} of thermal generators. The most expensive unit, Gen#3, is switched off throughout the full settlement window after applying the DR contract. 2) smaller and fewer ramping events of both types, standard ρ ± and steepρ ± , of thermal generators, 3) Reduced RES spillage, and lower reliance on the thermal generators P g .
Furthermore, a small increase in reserve cost R of Gen#1 is observed. This is because Gen#3 is switched off, and its generation share Pg is divided among remaining units. Therefore, the largest power of any unit is larger, and a larger reserve is required. This increase in reserve cost R is justified in light of the large reduction in commitment costs {u, v, w}. In real world applications, thermal generators have piecewise or quadratic cost functions. The smart DR contract would facilitate operating conventional generators more economically, bringing more cost savings to the system. Furthermore, higher utilization of available RES energy decreases any carbon tax payments, and hence, would increases the SW even further.
The smart DR contract helps the system avoid steep ramping of conventional generators. The sum of magnitudes of steep ramping events over all weather and load scenarios is reported for each generator and each instance in Table VI. The table  compares   for Gen#3. Either a significant reduction or total elimination of excess ramping events can be observed for almost all cases. The improvement in Gen#1 and Gen#2 steep ramping up in case D/50/Fa outweighs the small deterioration for Gen#3.
To highlight the advantage of the smart contract design, and the importance of calibrating the DR's curtailment aspects, two test cases are carried out and compared with the results of the proposed smart contract. Each test case was carried out for all the 16 design scenarios (4 seasons × 2 wind penetration levels × 2 Contract type).
Case 1: An IBDR design proposed in the literature by [13] is adopted. According to this design, only one curtailment event of size up to 15% of the benchmark load is allowed per day. This is equivalent to Q u = Q u = 2 curtailments in a settlement period of 48 hours. The same quantities apply for all 16 instances (i.e., all seasons, wind penetration levels, day types). No extra quantities are allowed (i.e., Q (·) = 0). DR participants receive a one time fixed reward according to Table III with n P = n u = n v = 1. The CapEx contract amounts to $56,800 per season, which corresponds to $4.73 per household per month.
Case 2: The theoretical DR models is adopted such that curtailment is unlimited, and services are compensated on a per-use basis (i.e., Q (·) = 0, Q (·) = Q (·) ). Consequently, no entry reward is paid C Q (·) = 0, CapEx contract = 0. The pay-peruse reward's rate C Q (·) for each aspect is 150% of the entry reward for the same aspect as mentioned in Table III. For example, C Q u = 150% × 2750.
The results for both cases are reported in Table VI. In the first case, improvements in SW and RES spillage are marginal. A slightly higher entry reward may even cause worse values of net SW (SW * ). In the second case, the system operator abuses the leniency of the load and requests load curtailment for up to 12 hours a day. The fact that Q u Q v implies that each curtailment extends for several hours, causing severe customer discomfort. If the system operator forbids such long curtailments, thermal generators may have to be committed longer; and thus, the reward paid for such short curtailment does not break even with the profit from these curtailments. Furthermore, the improvement in RES spillage is modest in comparison with the cost improvements (i.e., The DR-agent represents a supplier of flexibility, and the system operator plays the role of demand of flexibility. At higher cost of flexibility (higher C), the system operator buys a smaller quantity. It is worth mentioning a higher set of cost parameters (i.e., C P = 1500, C u = 7000, C v = 2000) may put the system in a worse situation and lead to lower total profit. A set of low cost parameters leads to very high values of ( Q P , Q u , Q v ), and thus, customer discomfort besides being unattractive. Surveys of customers consumption behaviors, and analysis of customers' comfort and flexibility are of paramount importance. It is worth mentioning that prosumers (i.e., consumers who own distributed generation units on their premises) have an advantage over passive consumers. Presently, prosumers inject power at the distribution level at their convenience, at predetermined fixed rates. Alternatively, a special smart contract can be designed for these prosumers to benefit both parties: the utility and the prosumer.

VIII. CONCLUSION
Classical UC formulations incorporate only the typical commitment constraints and costs of thermal units such as start-up, shutdown and minimum up and down times. This article proposes a novel smart DR contract that incorporates the commitment costs and constraints of DR units, such as total number of curtailment events within a window, total length of all curtailment events, and the curtailed energy size. Consequently, the classical UC formulation is extended to incorporate these characteristics. A one-time payment at the beginning of the contract term (1 season) is made to a DR participant in exchange for their consent to accept curtailment aspects. If the system operator exceeds the agreed quantities, additional rewards are paid to the DR participant. This article optimizes the parameters of the DR contract such that the system's social welfare is maximized. Simulations in a typical system for different parameters and conditions covering a whole year prove the effectiveness of the proposed method. The proposed scheme complements existing IBDR designs rather than replaces them.

APPENDIX
Mathematical optimization suites (i.e., CPLEX) require using the generic form of an optimization problem. The generic form of a linear problem is: If an optimization problem has n variables and m constraints, x ∈ R n is the vector of decision variables and has length n. c ∈ R n is the vector of coefficients of decision variables in the optimization problem. A ∈ R m×n is a matrix with m rows and n columns containing the coefficients of the decision variables in every constraint. b ∈ R m is a vector describing the RHS of every inequality constraint. An equality constraint can be represented by two inequalities: Therefore, "If-Then" constraints and min{0, (·)} must be translated into linear equations. Equations. Due to the high cost associated withû curt , the optimization solver will avoid settingû curt = 1 unnecessarily. However, this cannot be guaranteed. Furthermore, (6) becomes: , v curt (t), w curt (t) ∈ {0, 1} (A.9) The max operator in (10) and (12) can be rewritten as: The absolute | · | operator in (14) is not linear. However, P deficit can be defined as a variable with an undetermined signal and (14) can be easily replaced by two linear constraints. Moreover, the penalty on P deficit is the sum of a penalty on its two components: C P deficit × (P + deficit + P − deficit ).
Let P deficit = t∈T P 0 load (t) − t∈T P load (t) (A.12) − ∞ ≤ P deficit ≤ ∞ (A.13) P deficit = P + deficit − P − deficit (A.14) Due to the high penalty on P ± deficit , the two variables will not assume non-zero values unnecessarily. A constraint to prevent the two variables having non-zero values simultaneously is shown below. However, this constraint is not linear. 16) dictates that the commitment status u g (t) must be 1 (i.e., ON) if there has been a start-up (i.e., v g (τ ) = 1) in any one of the past MUT hours, and vice versa in (A. 17).