Non-Cooperative Game in Block Bidding Markets Considering Demand Response

: With the reform of electricity markets, demand response (DR) plays an important role in providing ﬂexibility to the markets. Block bidding market is a new market mode, which is based on the concept of “the same quality, the same price”. The mechanism has great effects in reducing start-stop related costs. In this paper, we propose a double-sided non-cooperative game model in block bidding markets with a DR program. The model combines the advantages of block bidding and the simplicity of hourly bidding. In the model, one side is the non-cooperative game of supply-side power ﬁrms, and we propose a novel supply function bidding model based on block duration and load capacity to maximize each ﬁrm’s proﬁt. The other side is the demand-side different types of customers, and we propose a DR model that combines hourly-various prices with the block bidding mechanism to maximize each customer’s payoff. The overall market optimization problem is solved by a distributed iterative algorithm, which has great convergence performance. We verify the proposed model on real data, and the results show that the demand load curve becomes ﬂattened with DR, and the total generation costs decrease while the social welfare is signiﬁcantly improved.


Introduction
Electricity market reforms optimize power resources allocation and reduce energy costs by introducing competition to the market [1][2][3]. In the open electricity markets, power supply firms submit bids to compete with each other, and customers participate in demand response (DR) in order to reduce the power purchase costs.
Block bidding is a new market bidding mechanism. The basis of block bidding markets is the concept of "the same quality, the same price" [4]. Figure 1 shows the comparison of hourly bidding mode and block bidding mode. A and B represent two power supply firms. In hourly bidding markets, firms submit bids for each time-slot, and the electricity prices at t 1 , t 2 , and t 3 are, respectively, ρ 1 , ρ 2 , and ρ 3 . However, firm A is running at peak load and firm B is running at base load; their generation costs are quite different. It is unfair for both of them to sell electricity at the same price of ρ 2 in time-slot t 2 . Therefore, block bidding mode is put forward to solve this problem. The new mode allows firms to submit bids for each block, and each block is traded at the same price. Generally, the division of blocks is based on the block duration. That is to say, firm B submits bid for the blue block, and the block should be traded at the same price. When compared with the hourly bidding mode, block bidding mode can help to reduce the start-stop related generation costs [5], and especially effective in countries or regions with large amounts of thermal power generation. DR is a powerful tool for increasing market flexibility and decreasing energy costs. By customers' participation in DR, the market demand curve can achieve peak shaving and valley filling effects [6][7][8].
Power supply firms' competition and customers' DR can be considered as non-cooperative games. In a non-cooperative game, each player optimizes his/her own strategy to maximize his/her utility, when considering that other players' strategies are fixed. The non-cooperative game will eventually converge to a solution, which is known as Nash equilibrium [9]. In recent years, researching DR in competitive electricity markets from the perspective of game theory has become an important topic. On this issue, researches have been carried out on two different focuses.
One focus is the optimal bidding strategy of the power supply side, based on different market mechanisms: block bidding or hourly bidding. Shah et al. [10] studied the Flexi type block bid in Nord Pool and proposed an optimal placing model of block bid execution time based on social welfare maximization. In Nord Pool, a block bid can only be accepted if its price is not higher than the average market price. Zak et al. [11] considered that there is a dilemma in such market rules, because block bids selection as a primal solution cannot be properly exercised without knowing the prices as a dual solution. Therefore, they proposed a model harmonizing such complex "primal-dual" market rules. Ajay et al. [12] proposed a profit maximization model for generators under block bidding rules and let each supplier use a probability distribution function for predicting the bidding prices of rivals. Unlike the complex and single form of block bidding, the hourly bidding mechanism has developed for a long time, and the bidding method is relatively flexible. Kamyab et al. [13] employed a supply function bidding mechanism that was based on an hourly bidding rule to model the utility firms' profit maximization problem. Chai et al. [14] proposed a two-level non-cooperative game model, that each utility firm determines its generation amount and power price at each time-slot, and each customer chooses a firm to buy electricity. However, the existing block clearing rules in [10,11] use the price of hourly markets to settle block orders, which is complex and cannot fully reflect the advantages of block bidding, and the supply-side models do not consider firms' generation costs and profits. Although Ref. [12] takes utility firms' profit into consideration, the prediction model of rivals' block bidding price is rough and lacks demand-side feedback. Researches [13] and [14] are based on the hourly bidding mechanism, and they cannot reflect the relationship between block duration and generation costs, which are not applicable for block bidding markets.
The other focus in competitive electricity markets is the demand-side DR program, which is based on cooperative or non-cooperative game theory. Elghitani et al. [15] proposed a method for residential demand aggregation to minimize the total consumption costs, based on a multi-class demand loads queuing system. Guo et al. [16] proposed an optimal pricing strategy for retailers to maximize its profit and an optimal DR resources scheduling model for minimizing customers' total electricity purchase costs, based on the block trading mode. Sanchez de la Nieta et al. [17] modeled demand-side management as flexible block orders, and the market-clearing algorithm decides the accepted order according to the principle of social welfare maximization. Motalleb et al. [18] modeled the competitive behavior among DR aggregators for selling excess energy in storage devices directly to other aggregators in a power market. Khanna et al. [19] described a price-based DR methodology for the application of complete households incorporating key DR features, such as an electric vehicle and some smart residential appliances. However, most researches are based on cooperative game theory, such as [15][16][17], which rely on an aggregator or a third-party algorithm to optimize customers' load resources. Besides, the widely known block orders in [17] is difficult for small scale residential customers to participate in. As for Refs. [18,19] based on the non-cooperative game theory, Ref. [18] is not applicable for customers without storage devices. Although Ref. [19] allows each customer to optimize its own demand loads through smart residential appliances, the mechanism is based on hourly-various prices.
In this paper, we improve the competitive block bidding market model on the above two focuses. On the optimal bidding strategy of the supply-side, we consider the advantages of block bidding and propose a supply curve bidding mechanism in block bidding markets. On the demand-side, we convert the block electricity price into the hourly price in order to meet the needs of different customers, and then propose a distributed demand-side model that combines block bidding markets into the hourly DR model. The whole electricity market is modeled as a double-sided non-cooperative game, which is composed of the supply-side game and the demand-side game. The main contributions can be summarized, as follows: • A novel supply function bidding model that is based on block duration and load capacity in block bidding markets, which realizes profit maximization of power supply firms and supply-demand balance at each time-slot. • A DR model in block bidding markets with hourly-various prices based on fixed load and shiftable load resources, which maximizes each customers' daily payoff. The model combines the advantages of block bidding markets and hourly bidding markets, and it has great peak shaving effects.

•
A distributed market architecture and distributed iterative algorithm in block bidding markets, which can guarantee the double-sided non-cooperative game converge to the Nash equilibrium within limited iteration and time.
The rest of this paper is organized, as follows. The mathematical model of the double-sided non-cooperative game in block bidding markets is introduced in Section 2. Solution approach of the distributed iterative algorithm is presented in Section 3. The simulation results and analysis of the proposed model effects are shown in Section 4. Section 5 describes the conclusion and future works.

Mathematical Model
In this section, we propose a double-sided non-cooperative game model, which composed of a block-based supply-side game and a time-based demand-side game. The architecture of the market model is illustrated first. The detailed mathematical models of the supply-side and demand-side game follows.  Figure 2. The system is applied in the day-ahead block bidding markets. Firms and customers are interacted by the trading center. The trading center is non-profit and responsible for collecting demand and supply bid curves. The center also informs necessary market information to firms and customers. Transmission loss is not taken into consideration in this paper.

Trading Center for Block Bidding Markets
In block bidding markets, the demand load curve needs to be divided into several continuous blocks and traded at block-based prices. Therefore, the trading center is responsible for collecting customers' demand curves and dividing the total load curve into blocks in order to inform each firm.
Assume the total power demands of each time-slot is D t , define D D D = (D 1 , D 2 , · · · , D t , · · · , D T ) ∈ R 1×T be the demand load curve vector. Let B = {1, 2, . . . , b, . . . , B} denote the set of divided blocks, where b represents a block. Define d b , h b be the power demand and duration for each block. Figure 3 shows the schematic diagram of block division in block bidding markets. According to this figure, we can notice that there is a mapping from the demand load curve to the divided blocks. The mapping is defined as: Then, We define two rules for grouping blocks: • Duration-based rule. We group blocks based on their duration, and let B h denote the set of blocks with duration h. Let H = {1, 2, . . . , h, . . . , H} denote the set of blocks' duration. Subsequently, the block set B can be described as B = h∈H B h .
• Time-slot-based rule. We group load blocks based on their running time-slots, and let B t denote the set of blocks running at t time-slot. Afterwards, B can be described as B = t∈T B t .
In the double-sided game of block bidding markets, each firm submits bid for each block. However, it is difficult for residential and corporate customers to purchase electricity in blocks. On one hand, the power consumption of individual customers is not large and the electricity use time is scattered. On the other hand, it is not easy and efficient for residential or corporate customers to divide their load curves by themselves. We allow customers to trade in a traditional hourly mode in order to facilitate all types of customers to adjust their load curve. Accordingly, the trading center is responsible for transforming the block-based prices into time-based prices to inform customers. The block-based price is calculated by firms' bids and customers' demands. Let γ b be the block-based price of block b, and γ t be the time-based price of time-slot t. Subsequently, γ t can be expressed as the power weighted average price of blocks in B t : In a word, the trading center divides load curve into blocks and informs block information to each firm. Meanwhile, the trading center also calculates time-based prices to inform each customer. By the trading center, the block-based supply-side game and the time-based demand-side game are connected, reaching the balance of supply and demand.

Supply-Side Game
For power firms, especially those that mainly rely on thermal power, the generating cost is closely related to the running duration of units. Generally, a power station that runs longer can reduce more costs that are related to start and stop. If a unit can minimize the number of start-stops, then the average power generation cost will be greatly reduced. Therefore, in the non-cooperative supply-side game, we use the duration-based rule to group blocks and assume each firm submits a supply bid curve for each group. We assume each firm has no capacity limits and can provide energy that meets power demands with any h duration in set H according to the needs of customers.
Let N = {1, 2, . . . , i, . . . , N} denote the set of firms, where i represents a firm. Let q i,b denote the supply amount of firm i for block b. Suppose the cost C i,b of each firm for each block is a strictly convex function of the supply amount q i,b : where c i,h and a i,h are positive coefficients that are determined by the block duration h. Due to the fact that longer load duration within a day can get lower unit power generation costs, we set coefficients c i,h and a i,h be smaller values when the block duration h is longer. The marginal cost MC i,b can be expressed as: Based on the concept of "the same quality, the same price" in block bidding markets, firms do not need to submit bids for each block, but only submit bids that are based on different load duration. Define β i,h and α i,h be the slope and intercept of the supply bid curve for h duration blocks, where β i,h > 0. It is assumed that the supply bid curve for each firm is an affine function of the block-based price γ b : In this paper, we assume each firm submit β i,h of supply curve as strategic bids, and set α i,h as pre-chosen values. The method is known as β-parameterization method in linear Supply Function Equilibrium (SFE) model [20]. Pre-chosen values of α i,h can be set to the intercept a i,h of marginal cost function or any other values.
Subsequently, when there is negligible transmission loss, the following supply-demand balance equation for block b should be satisfied: By substituting the supply bid function (6) into (7), we can obtain the expression of the block-based electricity price γ b . It is the transaction price of power supply firms and the trading center, which can be expressed as: Define π i be the profit of firm i, and then it can be described as: By substituting (6) and (8) into the profit function (9), the optimization problem for each firm in Nash equilibrium can be expressed as: subject to: In this mechanism, firms can obtain the optimal supply bids for load blocks of each duration, based on characteristics of generating costs. When compared with the hourly bidding mode, the operating strategy of units for each firm can be easily obtained, since the running time and output of units are given directly.

Demand-Side Game
In the demand-side game, customers obtain time-based prices that are informed by the trading center, and adjust electricity use time according to different prices within a day. Assume that, for each customer, there are two types of load resources: fixed loads and shiftable loads. Fixed loads are critical loads that can not be shifted to other time. Shiftable loads have a fixed load duration and a fixed power demand, and they can be scheduled to other time within a customer-defined time frame. Figure 4 is a typical example of the shiftable loads scheduling. The shiftable load has a time duration of 3 h, and the given time frame is [6,10]. For this situation, there are ( 5 3 ) = 10 scheduling solutions in total. Here, randomly lists several scheduling possibilities in this figure. The height of rectangle represents the power demand of the shiftable load. In a word, the shiftable load can be scheduled within [6,10], with 3 h time duration and a fixed power demand.
Let M = {1, 2, . . . , j, . . . , M} denote the set of customers, where j represents a customer. Define d j,t as the demand of customer j at time-slot t. Let d F j,t and d S j,t be the demand of fixed loads and shiftable loads for customer j at time-slot t, respectively. Subsequently, the total power demands D t of all customers can be expressed as: where Suppose that each customer has a strictly convex satisfaction function W j,t (d j,t ), which uses money to quantify customers' satisfaction with electricity use: where v j,t and w j,t are the positive coefficients of the satisfaction function.  Afterwards, the daily payoff u j of each customer can be expressed as the total satisfaction degree minus his/her own daily expenses: Because the demand of fixed loads d F j,t are known parameters, the strategic variables for the demand-side game are d S j,t . By substituting (12), (13), the time-based price (3), and the block-based price (8) into the payoff function (15), the optimization problem of each customer in equilibrium can be described as: where subject to: d Smax where d Smax j,t is the maximum limit of shiftable loads' demand of customer j at time-slot t, (18) limits d S j,t in a reasonable range; K j = {1, 2, . . . , k, . . . , K j } denotes the set of shiftable loads of customer j and k represents a shiftable load, P S j,k and l j,k are the power demand and load duration of shiftable load k, (19) limits the total power demands of shiftable loads to a fixed value within one day; Sign(·) is the signum function, t min j,k and t max j,k are the minimum and maximum limits of running time-slots of shiftable load k, (20) constrains d Smax j,t to be the sum of power demands of those shiftable loads, where the time range covers time-slot t.
According to Figure 4, the specific operating time-slots should be calculated for shiftable loads. From the optimal solution obtained by (16)-(20), we define the positioning model of shiftable loads, as follows.
subject to: where d S * j,t is the optimal shiftable loads' demand at each time-slot obtained by (16)- (20). Decision variable x j,k,t is a logical variable of shiftable loads, where values 1 when shiftable load k is running at time-slot t, and 0 on the opposite.
The positioning model obtains an integer solution x j,k,t , which makes the actual shiftable loads' demand at each time-slot closest to d S * j,t . Equation (22) limits the sum of running time-slots of shiftable load k to the load duration; (23) constrains the shiftable loads' operating time-slots in the time range; (24) indicates the decision variable x j,k,t is a 0-1 integer variable.

Solution Approach
The interaction diagram of the trading center, each firm, and each customer can be shown in Figure 5. We propose a distributed iterative approach for solving the double-sided non-cooperative game. The method will converge to the Nash equilibrium of supply-side and demand-side. We explain why the optimization problem of each firm and each customer can eventually converge to Nash equilibrium in the Appendix A.
For each firm, iteration can be achieved by the gradient ascent method. It is on the contrary to the gradient descent, which is a first-order iterative optimization algorithm for obtaining the local maximum of a function [21]. By deriving π i with respect to β i,h , we can obtain: where Subsequently, the iterative expression can be described as: ∀h ∈ H, ∀i ∈ N (27) where m denotes the iteration number and η 1 is the step size.
For the demand-side game, the gradient can not be directly calculated due to the nonlinear mapping from the demand load curve to the divided load blocks in (17). Therefore, the gradient is estimated by the finite forward difference. We apply the active set algorithm [22] to solve the demand-side game model and [23,24] demonstrate how the algorithm converges to a local optimal solution that satisfies the constraints. The algorithm finds active constraints on decision variables in each generation, and establishes a direction of search at each iteration by processing the finite-difference. The iterative expression can be described as: where η 2 denote the iterative step size of the demand-side game, FD j denote the forward difference of customer j, and [·] A means to handle the finite-difference through the active set algorithm. The block division method in (1) and (2) for the trading center in block bidding markets can refer to the Load Division Method in [16]. This method is based on the principle of bottom-up, and the load blocks are divided in order from a long duration to short. It can be noted that, for each firm, the block-based price γ b and the sum of firms' bids ∑ i∈N β i,h should be informed by the trading center. For each customer, we assume the same block division method is applied in (17). The trading center should inform the time-based price γ t and the sum of customers' demands ∑ j∈M (d S j,t + d F j,t ) in each iteration. The other necessary variables, such as ∑ i∈N β i,h b α i,h b and ∑ i∈N β i,h b in (16), can be calculated by (3) and (8).
The overall distributed iterative algorithm is described in Algorithm 1, where ε denotes the convergence accuracy.

Algorithm 1 Distributed iterative algorithm of the double-sided non-cooperative game.
Require: The initial demand load curve D D D(0); The initial strategic variables β i,h (0) and d S j,t (0); Parameters of the profit function (9) and the payoff function (15); Ensure: The optimal strategy for each firm and each customer; the block-based and time-based electricity prices. 1: Initialize m = 0, ε = 10 −3 2: repeat 3: The trading center informs γ b (m) and ∑ i∈N β i,h (m) to each firm, and informs γ t (m) and to each customer; 4: for each firm i from 1 to N do 5: for each customer j from 1 to M do end for 10: The trading center calculates D t (m + 1) by (12)-(13); divides load blocks and obtains B(m + 1), d b (m + 1) and h b (m + 1); calculates γ b (m + 1) by (8); calculates γ t (m + 1) by (3); 11: 13: Each customer solves the shiftable loads' positioning problem (21)- (24) to obtain x * j,k,t ; 14: return the optimal solution β * i,h , x * j,k,t , and the electricity price γ * t , γ * b ;

Simulation and Analysis
In this section, we demonstrate the effectiveness of the proposed model and algorithm through two simulations. Firstly, we simulate a system of three firms and 10 customers to show the effectiveness of the proposed model on peak shaving, expenditure reducing, costs reducing, and welfare improving. Secondly, we analyze the convergence process of Algorithm 1 and simulate the algorithm for different number of firms and customers to show the applicability of the algorithm on large systems.
In the simulation of the double-sided non-cooperative game in block bidding markets, we divide a trading day into 24 time-slots, and each time-slot represents an hour. As illustrated in Section 2.2, the positive coefficients c i,h and a i,h of cost functions for each firm are smaller when the block duration h is longer. Table 1 defines the ranges of c i,h and a i,h . The coefficients ω j,t of customers' satisfaction functions is randomly selected in range [10,13], and v j,t is set to 0.5. The supply-side step size η 1 is set to 0.001. The demand-side finite-difference step size δ is set to 0.2, and the iterative step size η 2 is dynamically set by the active set algorithm. The convergence accuracy ε is set to 10 −3 . The pre-chosen values of α i,h are set to the intercept a i,h of the marginal cost. Customers' demand load data are generated from real data in [25]. Shiftable load resources are collected from [26] and listed in Table 2. The daily fixed load demands for each customer is about 67 kW·h to 124 kW·h. For each customer, there are about 4-10 shiftable loads, the power demands of shiftable loads are about 15-20% of their daily total demands. Without a loss of generality, shiftable loads' time frame t min j,κ , t max j,κ are set to [1,24]. Simulation is realized on MATLAB platform. Demand-side active-set algorithm is executed by fmincon [27], and positioning problem (21)-(24) is solved by Yalmip [28] and Cplex [29]. The data of fixed loads and shiftable loads and the programs of this system are attached in [30].

Case Study
In this subsection, we simulate and analyze two cases. Without DR case is the solution without customers' DR, but only firms' optimal bidding. With DR case is the optimal solution of Algorithm 1. Figure 6 shows the aggregate fixed and total demand load curves with and without DR. From the aggregate load curve during 14:00-22:00, we can notice that the proposed model with DR can greatly achieve peak shaving. The peak load without DR is 69.05 kW, and decreases to 50.99 kW with DR. Many loads at peak hours are moved to valley periods by customers, and the overall load curve is significantly flattened. The 24-h load power without DR is 27.78 kW, and becomes to 39.48 kW with DR. Moreover, in time-slots with similar prices, shiftable loads for each customer are shifted to time-slots with higher ω j,t .  Figure 7 show the daily payoff for customers 1-10 with and without the DR program. By participating in DR, customers' payoff increases a lot. The daily payoff of each customer with DR is around 4.77 times of its value without DR. Customers' different payoff are due to their different satisfaction functions. Moreover, the daily bill of customers decreases with DR. Figure 8 shows the bill of customers 1-10. Each customer's daily bill with DR is around 65% of its value without DR. In other words, customers can save approximately 35% of electricity expenses by participating in DR. In the supply-side game, Figure 9 shows firms' daily costs. With the DR program, the costs of each firm can obtain an average decrease of about 35.24%. This is because the total load curve becomes flatter, and the 24-h load capacity increases a lot. Longer duration load blocks can help to reduce start-stop expenses and obtain lower generation costs. Meanwhile, by the optimal bidding of power firms, their daily revenue is also maximized.  Figure 10 shows the market time-based electricity price. It can be seen that the overall trend of electricity prices is similar to the aggregate load curve shown in Figure 6. The daily electricity prices become flatten with DR, and the price variance decreases from 14.1708 to 0.4012. Furthermore, the average price without DR is 7.8906 $/(kW·h) and it decreases to 5.7913 $/(kW·h) with the DR program. Therefore, the proposed model has a positive significance for reducing the market electricity prices. We assess the market performance with and without DR by comparing total customer expenditure, generation costs, and social welfare. The results are listed in Table 3, where social welfare is calculated by the following equation: According to Table 3, customers' participation of DR can improve the social welfare, while greatly reducing the electricity expenditure and generation costs. Although the maximization of social welfare is not considered in the mathematical model, the results show the positive effect of the proposed model on society. This is a win-win situation for all parties. Each firm and each customer only care about their own utility, but brings about a 10% increase in social welfare.

Convergence Characteristics and Model Scale
The convergence ability of an algorithm is a key factor for measuring its performance, and determines whether the model can be applied to a larger system. Therefore, we analyze the convergence characteristics of Algorithm 1 in this subsection. Figure 11 shows the convergence process of firms' bids on the 24-h load block. It can be seen that the bids start from the same initial values and converge to the Nash equilibrium. Firms have different optimal bids, because they have different generation cost functions. The algorithm converges in 71 iterations with about 77 s. The convergence time is closely related to the step size setting. In order to better reflect the computational complexity of the proposed algorithm, we simulate the algorithm for different number of firms and customers, and present the relationship between the convergence time and the system scale in Figure 12. It can be seen that, as the number of customers increases, the solution time increases linearly. For a system of 150 customers, the solution time is within 5000 s. Each firm and each customer should optimize their own strategy, but we use FOR-loop to solve the distributed algorithm in simulation, as expressed in Algorithm 1. Therefore, the actual distributed solution time will be much shorter than the results that are shown in Figure 12.

Energy Policy Discussion
In the Nash equilibrium of the double-sided non-cooperative game, each firm obtains the optimal slope β i,h of supply curve for each block duration, which corresponds to the power supply q i,b for each block. Table 4 shows part of the obtained optimal operation strategy of Firm 1. It can be noted from Table 4 that the power supply, running duration, running time-slots, and electricity prices are all settled down by the Nash equilibrium. Therefore, firms do not need to solve further optimization problems in order to obtain the operating strategy for generation units. Instead, they can easily arrange units' operation, for example, let a unit running from one to 24 time-slots at 13.3622 kW. In addition, the price is closely related to the power generation cost of each block, so it can well reflect the core idea of "the same quality, the same price".
After obtaining the Nash equilibrium solution, each customer in the non-cooperative game solves the shiftable loads' positioning problem (21)- (24) to obtain the exact operating time-slots of shiftable loads. Figure 13 shows the positioning results of shiftable loads. From Figure 13, it can be noted that the positioned curve will not deviate much from the Nash equilibrium solution, and the error is within the allowable range. By executing the payoff maximization problem and the positioning problem, each customer can obtain their own strategy. Table 5 shows part of the obtained optimal strategy of Customer 1. As can be seen, each shiftable load of this customer is arranged with specific running time-slots, satisfying the running duration constraints. Most shiftable loads are scheduled to time-slot 2 and 24. This is because the power of fixed loads during these two time-slots are lower, and the satisfaction coefficient ω j,t is relatively higher. However, letting each customer manually execute the decision according to the table is not easy. Therefore, the strategy puts a high demand on smart meters and smart homes. With the popularity of intelligent household appliances, customers can easily obtain the maximum payoff while getting rid of switching appliances.

Conclusions
This paper studies the non-cooperative game behavior of multiple firms and multiple customers in competitive block bidding markets. Under the block market rules, the demand load should be divided into continuous blocks and traded at block prices. We propose a distributed market architecture, and the trading center is responsible for converting block-based prices to hourly-various prices. The supply-side game is based on supply function bidding for each block, and it realizes each firm's profit maximization. The demand-side game considers fixed loads and shiftable loads, and it achieves each customer's payoff maximization. The positioning model for each customer is used to determine the actual operating time-slots of shiftable loads. We propose a distributed iterative algorithm that is based on gradient ascent and active set to solve the double-sided optimization problem. The proposed model is applied on an actual case and is simulated based on real data. Simulation results show that the proposed model with DR can greatly achieve peak shaving, and the overall load curve is flattened. Customers' electricity expenditure and firms' generation costs both reduce a lot, and the social welfare is significantly improved meanwhile. Besides, the model has a positive significance for reducing the market prices. The distributed algorithm can converge to Nash equilibrium in large systems within acceptable iteration and time. In the Nash equilibrium, each firm can easily arrange units' operation without solving further optimization problems, and each customer can obtain the specific running time-slots of shiftable loads.
In the future, we will model both block bids and hourly bids in electricity markets. In addition, we will compare the effects of the two mechanisms on peak shaving, energy cost-reducing, and social welfare improving with real scenarios and data.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

Abbreviations
The following abbreviation is used in this manuscript:

Appendix A
In the appendix we explain why the optimization problem of each firm and each customer can eventually converge to Nash equilibrium.
In the supply-side non-cooperative game, each firm maximizes its own profit π i , considering other firms' strategies are fixed. Nash equilibrium is a stable strategy that no firm can increase its profit by deviating from this strategy. Define β β β −i,h = (β 1,h , β 2,h , · · · , β i−1,h , β i+1,h , · · · , β N,h ) be the strategic bids of other firms except i, and let β β β h = (β i,h , β β β −i,h ) be the strategy vector of all firms. The definition of supply-side Nash equilibrium is as follows.
Theorem A1. A Nash equilibrium of the supply-side non-cooperative game is given by a point β β β * h = (β * i,h , β β β * −i,h ), where β β β * h > 0, such that: Therefore, the optimization problem for each firm is to maximize their own profit by adjusting β i,h , considering other firms' strategies β β β −i,h are fixed. Consequently, each firm's optimization problem (10) is equivalent to the definition of supply-side Nash equilibrium. In other words, the optimization problem of each firm can eventually converge to the Nash equilibrium.
In the demand-side game, each customer maximizes his/her own daily payoff u j , considering other customers' demands are fixed. Define d d d S −j,t = (d S 1,t , d S 2,t , · · · , d S j−1,t , d S j+1,t , · · · , d S M,t ) be the strategic variables of other customers except customer j, let d d d S t = (d S j,t , d d d S −j,t ) denote the strategic vector of the demand-side game. Similar to the supply-side game, Nash equilibrium in the demand-side game is defined as follows.
Theorem A2. A Nash equilibrium of the demand-side non-cooperative game is given by a point d d d S * t = (d S * j,t , d d d S * −j,t ), where d d d S * t is in the strategy set, such that: Therefore, each customer adjust d S j,t to maximize their own daily payoff, considering other customers' demands d d d S −j,t are fixed. Consequently, the optimization problem (16) of each customer is also equivalent to the defination of demand-side Nash equilibrium.
Since the gradient can not be directly calculated in (16), forward difference of each customer j is calculated by: where δ is the finite-difference step size. By substituting (A3) into the iterative expression (28), the demand-side game calculation formula is: By calculating d S j,t (m) iteratively, the optimization problem of each customer can eventually converge to the Nash equilibrium.