1 Electricity Market Simulator to Assess High Shares of Variable Renewable Energy William Quiroz, Member, IEEE Jose Koc, Member, IEEE Faculty of Electrical and Electronic Engineering National University of Engineering Lima, Peru Faculty of Electrical and Electronic Engineering National University of Engineering Lima, Peru Abstract-- The high shares of renewable energy create challenges in the operation of electrical systems and in market designs, in this sense, the objective of this work is to develop a model that can simulate an electricity market based on bids, which has generation thermal, hydraulic, variable renewables and battery energy storage systems (BESS) where energy and reserves requirements are co-optimized. It is assumed that the firms compete until reaching the Cournot-Nash Equilibrium in pure strategies, which is obtained through the maximization of the Nikaido-Isoda function and a relaxation algorithm for its solution. In this way, with the results of generation, allocation of reserves and prices, it will be possible to evaluate the market power in systems that already have price offers established, as well as the markets based on costs that wish to migrate to one of offers. Potential mitigation of market power through the establishment of bilateral contracts will also be evaluated. The market simulator will be applied to a modification of the IEEE 24-bus reliability test system and the results obtained will be analyzed. the restrictions of the transmission system (markets in the US) or carry out subsequent redispatches through the Transmission System Operator (European markets). Under these schemes, generators must internalize their direct and opportunity costs in their offers, so that the problem of audited cost markets is solved, if there is sufficient competition in the market. However, in the first years in which the electricity markets based on offers were established, in some countries the enthusiasm led to overestimating the advantages of competition, having little regulation in these as indicated by B. Hobbs and S. Oren [1], which gave rise to the exercise of market power. Among the problems identified, it is highlighted that the exercise of market power not only depends on the market share of the companies, but it also depends on the limits in transmission capacity. Thus, in order to analyze the potential exercise of power in the electricity sector, the development of simulators is convenient, as indicated by S. Borenstein, J. Bushnell and C. Knittel [2], since they allow predicting the behavior of the signatures and forecast energy prices. These electricity market simulators can also be used as a tool to evaluate reforms in market designs, carry out market monitoring, examine cases of mergers of business groups or even used by generation firms for market evaluations and their benefits. Although the problems described in the previous paragraph were resolved through regulatory measures, such as promoting bilateral contracts in the case of California [3], the electricity industry is involved in new challenges with decarbonization policies and high penetration of variable renewable energies (promoted through subsidies due to their high investment costs), having an impact on spot prices and the operation of the system, so the potential strategic behavior of these technologies should be studied. Variable renewable plants have a very low or even zero variable cost, thus displacing higher variable cost plants in dispatch. However, the scarcity of solar and wind resources throughout the day causes manageable plants such as hydraulic and thermal generation to continuously change their production level or be started and then stopped in order to achieve the balance of generation demand. Thus, in periods with an abundance of variable renewable generation and low demand, the price of energy has low values, since the marginal cost of production with variable renewable energies, can even reach negative values [4] and [5], but the sudden lack of Index Terms—Game theory, Cournot-Nash, Nikaido-Isoda Function, variable renewable energy, market power, cooptimization, bilateral contracts. I. INTRODUCTION D uring the process of deregulation and liberalization in the electricity industry between the 80's and 90's, two ways of organizing generation supply functions were stablished, based on audited costs and based on bids. The first was established mainly in Latin American markets (which have a high percentage of hydroelectric generation), and its purpose is to emulate a market of perfect competition, for which the electricity system operator carries out an economic dispatch. Despite the efforts made, this type of market can present inefficiencies due to the asymmetry of information between the operator of the electrical system and the generation companies, so it is difficult for the operator to audit all the direct costs of the generators such as the purchase of fuel and expenses associated with maintenance, as well as the opportunity costs in which they can incur, such as inflexibilities in fuel supply contracts due to take or pay clauses. With regard to supply markets, day ahead markets are usually established, so the Power Exchange (PE) or the Independent System Operator (ISO) is in charge of receiving the offers for each market clearing period (generally, one hour) and close the market under the criterion of maximum social benefit, which may consider 979-8-3503-4605-3/22/$31.00 ©2022 IEEE 2 renewable energy leads to a considerable increase in prices. Also, due to the intermittence of the variable renewable energies plants, in many cases there is no time to make redispatches, then greater flexibility in the systems is required to save operation security, which can be achieved through a correct design of complementary services. Additionally, plants, especially variable renewable ones, can be encouraged to invest in BESS for better management of their available energy. The regulatory framework must be technologically neutral and provide adequate incentives in the short and long term, so that variable renewable plants must also be exposed to market signals as other generators. This is how the need arises to produce a simulator that allows measuring the effect of regulatory proposals regarding systems with variable renewable energies. Among the measures recommended by IRENA [4] and CEER [6], it is mentioned the establishment of a nodal price system to face congestions, multiple settlement market that in turn performs a co-optimization of energy and reserves, adapted market settlement periods to make possible for a variable renewable generator to adjust its offers according to changes in weather conditions, no barriers to participation in capacity payments and the promotion of Power Purchase Agreement (PPA) in order to obtain certainty regarding and seeking financing for investment. Various types of simulators have been developed in the literature depending on the purpose and desired scope, in which those based on game theory stand out, however, the applications to hydroelectric systems are smaller (it can be mentioned [7], [8] and [9]) and even less for variable renewable generation, where most of the simulators have been developed to find the optimal offers of a firm (like in [10]). However, only in [8] and [9] the modeling of the transmission network is considered and in none of those mentioned are the reserves markets considered, a simulator for purely thermal systems that includes balancing services was proposed by [11], and uses a non-linear approach. The main contributions of this paper are: 1) to directly apply the Nikaido-Isoda function to find the Nash-Cournot equilibrium in a pool-based market with co-optimization and high shares of variable renewable energy, 2) to analyze the bidding strategy of energy and reserves in a system with thermal, hydro, variable renewable generators as well as BESS and 3) to show the market power mitigating effect of bilateral contracts. The structure of this paper is the following. Section II presents the Nikaido-Isoda function and the relaxation algorithm that will be used for its solution. Then, the mathematical formulation of the electricity market simulator is described in detail in Section III. Section IV show the results for two sensitivities applied to the IEEE 24-bus reliability test system. Finally, Section V presents the conclusions obtained from this paper. II. DEFINITION AND CONCEPTS OF NIKAIDO-ISODA METHODOLOGY The developed simulator will evaluate pure strategic behavior (as it is known in game theory), that would be adopted by companies according to Cournot-Nash competition. In this way, a Cournot-Nash equilibrium would be reached, when no company has incentives to change its strategy unilaterally, since it would be harmed. In the previous section, the importance of the transmission network limits in the behavior of companies has been mentioned, however, this brings a complexity to the model, because the production of the plants jointly is involved, this is known as coupled constraint [12]. Thus, the problem cannot be addressed sequentially, where each company optimizes its benefits separately. To address this problem, an iterative solution strategy was applied in [9, 13] using the function called Nikaido-Isoda. Another form of solution is to treat the problem through complementary programming such as Hobbs [14], however, due to the number of variables and restrictions set out in this simulator, the first mentioned solution strategy was chosen. A. Nikaido-Isoda Function According to game theory, a game with “n” participants can be defined by a “triple”, in the form β¨π, (ππ ), (Φi ), π π πβ©, where π is the set of players π = {1,2, … , π}, ππ is the set of strategies π₯π for player π and Φi : π → β is the payoff function of player π, so it assigns a real number to each element of the cartesian product of the strategy spaces π = π1 π₯ π2 π₯ … π₯ ππ . Then, let π₯ be the strategy profile belonging to π, containing a list of possible individual strategies for each player π, such that π₯ = (π₯1 , π₯2 , … , π₯π ), The set of elements (π¦π |π₯) = (π₯1 , … , π₯π−1 , π¦π , π₯π+1 … , π₯π ) is defined as the vector of strategies where player π decides π¦π , given a fixed set of strategies of the other players. A Nash Equilibrium in pure strategies will be π₯ ∗ = ∗ (π₯1 , π₯2∗ , … , π₯π∗ ) if it is true that, for each player, his payment function is maximized, given the strategies of the rest of the players as fixed, as represented in equation (1). Φπ (π₯ ∗ ) = πππ₯ Φπ (π₯π |π₯ ∗ ) (1) The Nikaido-Isoda function ψ(π₯, π¦) is given by equation (3.10), which allows us to convert the equilibrium problem with one objective function for each player into an optimization problem with a single objective function, where the players jointly optimize their production. n οΉ( x, y) = ο₯ οο¦i ( yi | x) − ο¦i ( x) ο (2) i =1 Each summand of the Nikaido-Isoda function represents the improvement in the profit of player π, when he changes his strategy from π₯π to π¦π and the rest of the players keep their strategy constant. In equilibrium, no player can increase his benefit without harming another, therefore, it will be true that: πππ₯ ψ(π₯ ∗ , π¦) = 0 (3) Finally, the function that returns the best answers of the players in the equilibrium is given by π(π₯): 3 π(π₯) = πππ πππ₯π¦ππ ψ(π₯, π¦) (4) It is worth mentioning that in this problem the payoff function evaluated at Φπ (π₯) is a constant, the Nikaido-Isoda function in (2) can be simplified to: n οΉ( x, y) = ο₯ οο¦i ( yi | x)ο (5) i =1 B. Relaxation Algorithm The algorithm will converge to a Nash equilibrium if the Nikaido-Isoda function of the problem to be solved must be weakly convex-concave [15]. This condition is fulfilled by the so-called smooth functions, which have continuous derivatives in all orders. It should be noted that it is not a prerequisite for the application of this methodology that the equilibrium be unique, there may be various Nash equilibria, and the convergence of the algorithm will occur at the point that is closest to the initial condition. To start the iterative process, an initial point π₯ 0 must be chosen, then it will be updated as a weighted average between the optimal response function π(π₯ π ) and the point π₯ π , according to the following formulation: π₯ π +1 = (1 − πΌπ )π₯ π + απ π(π₯ π ) π = 0,1,2,3, … (6) Where πΌπ is a value between 0 ≤ πΌπ ≤ 1, which can be a constant or an optimized value for each iteration, however, for the nature of the present optimization problem, a constant πΌπ can be used. III. Μ Μ Μ Μ Μ π ) and down (π π Μ Μ Μ Μ Μ π ). Prices are determined in the day ahead (π π· market and a quadratic cost function is assumed for each service. The total profit function of a firm ο¦ is given by equation (7), where π΅πΈ , π΅π π· and π΅π π’ represent the net benefits for selling energy, secondary reserve down and secondary reserve up respectively. Μ Μ Μ Μ Μ π ) + π΅π π (π π Μ Μ Μ Μ Μ π ) Φπ (πΜ π , Μ Μ Μ Μ Μ π π·π , Μ Μ Μ Μ Μ π ππ ) = π΅πΈ (πΜ π ) + π΅π π· (π π· In addition, to represent the strategic behavior of the firms due to the interaction with the transmission network, it is necessary to disaggregate the power injected by a generator or BESS into powers injected at system's purchase nodes [9,14]. Μ Μ Μ Μ Μ π , Μ Μ Μ Μ Μ In this sense, πΜ π = [ππ π»ππ , Μ Μ Μ Μ Μ π ππ , Μ Μ Μ Μ Μ Μ Μ π΅π·ππ , Μ Μ Μ Μ Μ Μ Μ π΅πΆππ ] contains the Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ π ), variable power injected by thermal (πππ ), hydraulic (π»π Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ renewable generators (π ππ ) and BESS (π΅π·ππ for discharge and Μ Μ Μ Μ Μ Μ Μ π΅πΆππ for charge) of a firm at system's purchase nodes. Then Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ π , Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ π , Μ Μ Μ Μ Μ Μ Μ π π·π = [ππ π· π»π π·π ] and Μ Μ Μ Μ Μ π ππ = [ππ π π»π ππ ] contains the Μ Μ Μ Μ Μ Μ Μ π and secondary reserve up and down given by thermal (ππ π Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ Μ ππ π·π ) and hydraulic generators respectively (ππ ππ and Μ Μ Μ Μ Μ Μ Μ ππ π·π ). Then, expressing in the most general way for firms that have various technologies, π΅πΈ is expressed as (8), while π΅π π· and π΅π π have a similar formulation, and would be expressed as π΅π (9), where Μ Μ Μ π π is secondary reserve up or down. NH f NR f T BN ο© ο¦ NT f BE ( Pf ) = ο₯ο₯ οͺο² E n ,t ο§ ο₯ TPi ,fn ,t + ο₯ HPj f, n ,t + ο₯ RPk f, n ,t ο§ i =1 t =1 n =1 οͺ j =1 k =1 ο¨ ο« NB f NB f οΆ οΉ T ο© NT f + ο₯ BDPb ,fn ,t − ο₯ BCPb ,fn ,t ο· οΊ − ο₯ οͺ ο₯ ci (TTPi ,ft ) (8) ο· t =1 οͺ i =1 k =1 k =1 οΈ οΊο» ο« MODELING ELECTRICITY MARKET SIMULATOR The simulator has to be applicable in the different current electricity markets, so it must include thermal, hydraulic and variable renewable generation. Likewise, BESS represents an important equipment to manage the energy of a renewable plant, it also will be included. Finally, the importance of increasing the flexibility of the systems was seen, and in this sense, ancillary services have great relevance, for this reason, the market simulator must characterize a market with cooptimization, where firms can bid energy and reserves, as it was suggested by the international literature described in Section I. Within the reserves, only the secondary frequency reserve will be auctioned, since the primary frequency response is usually established in a mandatory manner for synchronous generators (variable renewables plants are excepted) and can be modeled by subtracting the reserve for primary frequency response assigned from the capacity of the generator. The tertiary frequency response will not be considered in this simulator for practicality; however, it could be modeled as the secondary reserve, it is also worth mentioning that certain markets do not have this service. Finally, the BESS system of the simulator will only be used by the plants to arbitrate energy. A. Pool market without financial contracts The firms will try to maximize their profits, which will be given by the total energy injected (πΜ π ) and secondary reserve up (7) NH f NH f οΉ + ο₯ c j (THPj f,t ) + ο₯ ck (TRPk f,t ) οΊ j =1 k =1 οΊο» NT f NH f T ο© ο¦ οΆ BR ( R f ) = ο₯ οͺο² R t . ο§ ο₯ TRi f,t + ο₯ HR jf,t ο· ο§ ο· t =1 οͺ j =1 ο¨ i =1 οΈ ο« NH f ο¦ NT f οΆοΉ − ο§ ο₯ cR i (TR jf,t ) + ο₯ cR j ( HR jf,t ) ο· οΊ ο§ i =1 ο· j =1 ο¨ οΈ οΊο» Where: π π π b π π‘ n πππ ππ»π : : : : : : : : : ππ π : ππ΅π : π πππ,π,π‘ : π π»ππ,π,π‘ : (9) Index for thermal generators of a firm Index for hydraulic generators of a firm Index for variable renewable generators of a firm Index for BESS of a firm Index for firms Index for each period of time (one hour) Index for nodes of the system Number of thermal generators of firm f Number of hydraulic generators of firm f Number of variable renewable generators of firm f Number of BESS of firm f Power injected for the thermal generator i of the f firm, at node n, in the period t Power injected for the hydraulic generator j of 4 π π ππ,π,π‘ the f firm, at node n, at period t Power injected for the renewable variable generator k of the f firm, at node n, at period t Total power injected for the thermal generator i of the f firm, at period t Total power injected for the hydraulic generator j of the f firm, at period t Total power injected for the renewable variable generator k of the f firm, at period t Discharge Power for the BESS i of the f firm, at node n, at period t Charge Power for the BESS i of the f firm, at node n, at period t Secondary reserve up or down given by thermal generator i at t period Secondary reserve up or down given by hydraulic generator j at t period Price of energy at node n, in the period “t” Price of secondary frequency response up or down at period “t” Cost function for energy Cost function for providing secondary frequency response up or down : f i ,t TTP : THPj f,t : TRPk f,t : π π΅π·ππ,π,π‘ : π π΅πΆππ,π,π‘ : π ππ π,π‘ : π π»π π,π‘ : ρπΈ π,π‘ : ρπ π‘ : π() : cπ () : Then, to find the Cournot-Nash Equilibrium, the NikaidoIsoda function must be constructed from the individual profit functions of each firm, as it is shown in equation (10). The strategy adopted by the firm f will be (π₯Μ π , Μ Μ Μ Μ Μ Μ π₯πππ , Μ Μ Μ Μ Μ Μ ), π₯ππ’π in terms of generation produced and secondary frequency response up and down. ( ) Max οΉ x, P, RD, RU = f (( )( Maxο₯ ο©οͺο¦ Pf , RD f , RU f | x f , xrd f , xru f ο« f =1 ))οΉοΊο» (10) Linear demand functions will be assumed, so prices will have the form of equations (11) and (12). ο²E n,t = An,t − Bn,t .Qnf,t (11) ο²Rt = ARt − BRt .QRtf (12) Where: NH f NR f NB f F ο¦ NT f Qnf,t = ο₯ ο§ ο₯ xtih, n ,t + ο₯ xh hj , n ,t + ο₯ xrkh, n ,t + ο₯ xbdbh, n ,t ο§ h οΉ f ο¨ i =1 j =1 k =1 b =1 NB f NH f NR f οΆ NT f − ο₯ xbcbh, n ,t ο· + ο₯ TPi ,fn ,t + ο₯ HPj f, n ,t + ο₯ RPk f, n ,t ο· i =1 i =1 j =1 k =1 οΈ NB f NB f k =1 k =1 : π : ππ π‘ π π₯π‘π,π,π‘ Energy demand seen by firm f at node n at period t Secondary reserve up or down demand seen by firm f at node n at period t Strategy of power injected for the thermal generator i of the f firm, at node n, in the period t Strategy of power injected for the hydraulic generator j of the f firm, at node n, at period t Strategy of power injected for the renewable variable generator k of the f firm, at node n, at period t Strategy of discharge Power for the BESS i of the f firm, at node n, at period t Strategy of charge Power for the BESS i of the f firm, at node n, at period t Strategy of secondary reserve up or down given by thermal generator i at t period Strategy of secondary reserve up or down given by hydraulic generator j at t period : π π₯βπ,π,π‘ : π π₯ππ,π,π‘ : π π₯πππ,π,π‘ π π₯πππ,π,π‘ π π₯π‘ππ,π‘ : : : π π₯βππ,π‘ : Finally, it is necessary to list the restrictions to the optimization problem formulated in (10). Firstly, the balance between the total power injected by a generator or BESS and the power injected in each node by them is expressed in equations (15-19). The limits on the generation capacity and reserves for each generator are shown from (20-28), it is highlighted that the fact of lending reserves conditions the level of generation, so that the generator incurs opportunity costs. Another point to consider is that hydroelectric plants have limited energy in the optimization horizon as seen in (29). The restrictions associated with the BESS systems are found in (3034), within these the variable called state of charge of the battery (SOC) stands out, which would vary in each period of time depending on the charge or discharge of the BESS, additionally it is observed that there are energy losses in the process of both loading and unloading. At last, the restrictions inherent to considering the transmission system are the nodal balance and the maximum transmission capacity, which is observed in equations (35) and (36), respectively, according with a DC power flow. Then, the Nikaido-Isoda maximization problem to find a Cournot-Nash equilibrium and will be solved by the relaxation algorithm results as shown below. f (( )( Maxο₯ ο©οͺ ο¦ Pf , RD f , RU f | x f , xrd f , xru f ο« f =1 (13) ) )οΉοΊο» Subject to BN TTPi ,ft = ο₯ TPi ,fn,t (15) n =1 + ο₯ BDPb ,fn ,t − ο₯ BCPb ,fn ,t NH f NH f ο¦ NT f οΆ NT f QRf t = ο₯ ο§ο§ ο₯ xtri h,t + ο₯ xhrjh,t ο·ο· + ο₯ TRi f,t + ο₯ HR jf,t h οΉ f ο¨ i =1 j =1 j =1 οΈ i =1 π ππ,π‘ BN THPj f,t = ο₯ HPj f, n,t (16) n =1 F BN (14) TRPk f,t = ο₯ RPk f, n,t (17) n =1 BN β : Index for firms (same as π) TBDPb,ft = ο₯ BDPb,fn,t n =1 (18) 5 BN TBCPb,ft = ο₯ BCPb,fn,t (19) n =1 TTP + TRU f j ,t f min j ,t TTP f j ,t ο£ TTP f max j ,t ο£ TTP + TRD f j ,t (20) f j ,t THP (22) ο£ THP + HRD f j ,t f i ,t (23) f f f TRPmin k ,t ο£ TRPk ,t ο£ TRPmax k ,t f min i ,t ο£ TRD ο£ TRD f min i ,t ο£ TRU ο£ TRU TRD TRU f i ,t (24) f max i ,t f i ,t (25) f max i ,t (26) f min j ,t ο£ HRD ο£ HRD (27) f min i ,t ο£ HRU ο£ HRU (28) HRD HRU f j ,t f max j ,t f i ,t T ο₯THP f j ,t t =1 f max i ,t οt ο£ HE jf (29) SOCbf,t +1 = SOCbf,t + (TBCPb ,ft ο¨cb − TBDPb ,ft ο¨db ) .οt (30) SOCbf,1 = SOCbf,T +1 = SOC0f b (31) f f f SOCmin b,t ο£ SOCb,t ο£ SOCmax b,t (32) f f f TBCPmin b,t ο£ TBCPb,t ο£ TBCPmax b,t (33) f min b,t TBDP NT f ο₯ TP f i , n ,t i =1 ο£ TBDP ο£ TBDP f b ,t f max b,t NH f NR f NB f j =1 k =1 k =1 − ο₯ BCP k =1 f b , n ,t N ο±m ,t − ο±n ,t nοΉm zn − m + Qn ,t + PBase ο₯ N ο±m ,t − ο±n ,t nοΉm zn − m − PLmax m − n ο£ PBase ο₯ : TBCPb,ft : π ππ π·π,π‘ : π : ππ ππ,π‘ π : π»π ππ,π‘ π : SOCbf,t : SOC0f b : ο¨cb : ο¨d b : Qn , t : π»π π·π,π‘ zn − m : PLmax m − n : Impedance of line between nodes n and m Maximum transmission capacity of line between nodes n and m ο£ PLmax m − n B. Inclusion of financial contracts As mentioned, one measure to mitigate market power is to allow bilateral financial contracts to be signed between generation companies and customers. Thus, this regulatory measure must be considered in the simulator as it is present in most electricity markets. To implement this in the simulator, π΅πΈ must be adjusted, so that firm’s energy profits will now be the sum of their net sales in the day ahead market and the sales by financial contracts. NH f NR f T BN ο© ο¦ NT f BE ( Pf ) = ο₯ο₯ οͺο² E n ,t . ο§ ο₯ TPi ,fn ,t + ο₯ HPj f, n ,t + ο₯ RPk f, n ,t ο§ i =1 t =1 n =1 οͺ j =1 k =1 ο¨ ο« NB f NB f οΆοΉ + ο₯ BDPb ,fn ,t − ο₯ BCPb ,fn ,t − CQnf,t ο· οΊ ο· k =1 k =1 οΈ οΊο» NT NH f T ο© f − ο₯ οͺ ο₯ ci (TTPi ,ft ) + ο₯ c j (THPj f,t ) + t =1 οͺ j =1 ο« i =1 NH f οΉ T BN ck (TRPk f,t ) οΊ + ο₯ο₯ CQnf,t ο²C n ,t ο₯ k =1 οΊο» t =1 n =1 (37) Where: (35) =0 (36) Where: TBDPb,ft Angle at node n, at period t (34) + ο₯ HPj f, n ,t + ο₯ RPk f, n ,t + ο₯ BDPb ,fn ,t NB f : (21) f THPj f,t + HRUi f,t ο£ THPmax j ,t f min j ,t ο±n ,t Total discharge power for the BESS i of the f firm, at period t Total charge Power for the BESS i of the f firm, at period t Secondary Reserve Down given by thermal generator i at t period Secondary Reserve Down given by hydraulic generator j at t period Secondary Reserve Up given by thermal generator i at t period Secondary Reserve Up given by hydraulic generator j at t period State of charge of the battery b, of the firm f, at period t Initial state of charge of the battery b, of the firm f Constant of efficiency in the charge of the BESS b Constant of efficiency in the discharged of the BESS b Demand at node n, at period t. It is given by total injected power to this node by all firms CQnf,t : ο²C n ,t : Amount of energy contracted by firm f, in at the node n, at period t Price of financial contract at node n, at period t However, the profits from contracts turns out to be a constant value, so these can be excluded from the objective function since they do not influence the optimization problem. IV. APPLICATION OF ELECTRICITY MARKET SIMULATOR The methodology described will be applied to a modification of the IEEE 24-bus reliability test system based on [16], the participation of hydraulic generation, variable renewable plants and BESS were added. At the same time, the capacity on the transmission lines connecting the node pairs (15,21), (14,16) and (13,23) is reduced to 400 MW, 250 MW and 200 MW, respectively, in order to cause congestions. Within this system, there will be four firms that will compete strategically in a pool type market with co-optimization until the Cournot-Nash equilibrium is reached, the detail of the generators is shown in Table I, where it can be seen that variable renewable generation represents 20% of the total installed capacity and its availability in the day will depend on typical productions according to variations in solar radiation and wind. The maximum capacity of the thermal and hydraulic generators in Table I already considers the margin for primary frequency response, with respect to the variable renewable generators, they have no obligation to provide primary frequency regulation. Additionally, the cost function considered for energy and reserves in the generators will be of the quadratic type. BESS 6 will be installed right next to the renewable power plants, so that it allows them to have a better management of their production, the characteristics of the these can be seen in Table II. The optimization horizon considered is one day, divided into hourly periods. Electricity demand will be considered to be linear in each system bus and it is built based on a typical load diagram. Regarding the demand for reserves, operators may require different levels of reserves throughout the day, based on studies of typical variations in demand and variable renewable generation, then in the present work two linear demand functions will be considered for reserve up and down in one day. TABLE I After clearing the market, it can be seen in Fig. 2 that for each sensitivity there is a differentiation of prices in the nodes due to the activation of congestion in the transmission system. In the case without contracts, only line 14-16 reaches its capacity limit, while in the case with contracts line 14-16 and line 13-23 reach their limit. This is due to the fact that in the case with contracts, a better allocation of resources is observed, increasing the social benefit through a higher level of production. From the same Fig. 2, it can be seen that in the case with contracting, the average of the prices in each node decreases compared to the case without contracts. In this way, the impact of mitigating market power that the promotion of bilateral contracts entails is verified. Generation Plant Information by Firm Energy Information Plant owner Plant name Firm 1 Firm 1 Firm 1 Firm 1 Firm 1 Firm 1 Firm 1 Firm 2 Firm 2 Firm 3 Firm 3 Firm 3 Firm 4 Firm 4 Firm 4 Firm 4 Firm 4 Firm 4 Thermal 1 Thermal 2 Thermal 3 Hydro 1 Hydro 2 Wind 1 Wind 4 Wind 2 Solar 1 Thermal 4 Thermal 5 Wind 3 Thermal 6 Thermal 7 Thermal 8 Thermal 9 Hydro 3 Solar 2 Node 1 2 7 18 21 23 16 5 21 13 15 7 15 16 18 21 22 3 TABLE III Reserves Down/Up Information A RA Maximum B Maximum RB power (MW) [$/MWh2] [$/MWh] power (MW) [$/MWh2] [$/MWh] 152 0.063 13.320 40 0.013 0.799 152 0.022 13.320 40 0.004 0.799 350 0.140 20.700 70 0.028 1.242 400 0.076 0.000 100 0.015 0.000 400 0.085 0.000 100 0.017 0.000 160 0.025 0.000 ------125 0.007 0.000 ------110 0.015 0.000 ------180 0.035 0.000 ------591 0.122 20.930 180 0.024 1.256 60 0.047 26.110 60 0.009 1.567 120 0.002 0.000 ------155 0.026 10.520 30 0.005 0.631 155 0.030 10.520 30 0.006 0.631 310 0.012 10.520 60 0.002 0.631 350 0.095 10.890 40 0.019 0.653 400 0.040 0.000 80 0.008 0.000 160 0.012 0.000 ------- Bilateral Contracts Information Firm Peak Load No Peak Load Peak Load Firm 2 No Peak Load Peak Load Firm 3 No Peak Load Peak Load Firm 4 No Peak Load Firm 1 Firm Firm 1 Firm 2 Firm 3 Firm 4 TABLE II Hours Hours Peak Load No Peak Load Peak Load No Peak Load Peak Load No Peak Load Peak Load No Peak Load Energy selled per hour by Bilateral Contracts at Bus [MWh] Bus 2 Bus 3 Bus 4 Bus 5 Bus 6 Bus 7 Bus 8 Bus 9 40 80 50 80 50 100 50 100 50 30 70 50 30 50 30 50 50 50 Energy selled per hour by Bilateral Contracts at Bus [MWh] Bus 10 Bus 13 Bus 14 Bus 15 Bus 16 Bus 18 Bus 19 Bus 20 150 20 50 200 20 50 Bus 1 50 50 50 70 70 70 60 60 100 100 150 200 40 70 BESS Information by Firm Owner Firm 4 Firm 2 Firm 2 Equipment name Node BESS 1 BESS 2 BESS 3 5 21 3 / , , 40 60 50 20 35 30 0.9 0.9 0.9 0.95 0.95 0.95 Two sensitivities will be analyzed, in the first case all the energy will be sold only in the pool market, while in the second case bilateral contracts will be introduced in each of the firms as shown in Table III, For the analyzed system, peak load hours are considered to be from 4:00 p.m. to 8:00 p.m. Fig. 2. Energy prices and power flow in relevant zones of the system The levels of generation by technology in each sensitivity are observed in Fig. 3 and Fig. 4. It is observed that the demand exceeds 2400 MW in many periods in sensitivity with contracts. The type of technology that mainly changed their production levels is the thermal type, since they will seek to cover their contracts through their available generation. With regard to hydroelectric plants, a slight increase was obtained in peak hour production. Fig. 1. IEEE 24-bus reliability test system medicated On the other hand, variable renewable cannot exercise market by themselves in the proposed case of study, but they 7 can act strategically as a price maker when they have a BESS installed. To demonstrate this, Fig. 5 shows the total production of firm 2, which only produces from variable renewable energies and also this firm has two BESS. This firm stores energy in the hours of lower demand to produce it at the peak, where the price of energy is higher and there is no solar resource. Also, the evolution of the total SOC for the two BESS that this firm has is shown in Fig. 6. It is observed that in the sensitivity with contracts, the SOC tends to remain at a higher level compared to the sensitivity without contracts. Fig. 6. Total SOC of Firm 2’s BESS Fig. 3. Total generation in sensibility without bilateral contracts Regarding the up and down secondary reserve allocation, the same results are obtained for both sensitivities. As mentioned, with regard to the provision of reserves, decisions are given based on the opportunity cost, in this sense, for the simulated case it is obtained that it is mostly the hydroelectric plants that provide service and only a thermal generator, which is one of the most expensive in the system. This is due to the fact that, as part of the strategy of the hydraulic power plants, it is to properly manage their resource, and their operation is most of the time at partial loads, thus these have the necessary margin to provide reserves, for which the firms would prefer to operate as much as possible its thermal units, a case that does not occur with thermal generator 4, this also have margin to offer reserves. It is worth mentioning that in a market of perfect competition, the hydraulic power plants would save the energy of their reservoirs to produce as much as possible during peak hours of the system. In addition to this, in most of the cases, secondary reserves of hydraulic units are slightly lower than the thermal ones. Fig. 4. Total generation in sensibility with bilateral contracts Fig. 6. Total secondary reserve up assigned in both sensibilities Fig. 5. Total generation and consumption of Firm 2 8 [9] [10] [11] [12] [13] Fig. 7. Total secondary reserve down assigned in both sensibilities [14] V. CONCLUSION The simulator developed in this paper is a useful tool for analyzing the strategic behavior of firms in a pool-type electricity market where there is a high amount of variable renewable generation The simulator also considered the market design recommendations given for this condition, which are the nodal price system and co-optimization of energy and reserves, so the generators can submit bids for energy and reserves. Firms were assumed to compete with pure strategies until reaching the Cournot-Nash Equilibrium, and the solution is obtained through the maximization of the Nikaido-Isoda function through a relaxation algorithm. The effectiveness of the methodology for a modified 24 bus IEEE system in terms of convergence was demonstrated, so it can be applied to medium size systems despite the number of constraints and variables involved. Through two sensitivities it was possible to observe the influence of the transmission system on prices, the use of water from hydroelectric plants, the possibility of variable renewable generators to also act strategically in the market through the use of BESS and that reserves market clearing is given by direct and opportunity costs. Likewise, the positive effect of the dissemination of bilateral contracts was also corroborated, leading to a market equilibrium where the social benefit is increased. VI. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] B. F. Hobbs and S. S. Oren, “Three Waves of U.S. Reforms: Following the Path of Wholesale Electricity Market Restructuring,” IEEE Power and Energy Mag., vol. 17, no. 1, pp. 73–81, 2019. S. Borenstein, J. Bushnell, and C. R. Knittel, “Market Power in Electricity Markets: Beyond Concentration Measures,” EJ, vol. 20, no. 4, 1999. J. L. Sweeney, The California electricity crisis. Stanford Calif.: Hoover Institution Press; Stanford Institute for Economic Policy Research, 2002. I. Perez-Arrieaga, T. Gómez, C. Batlle, P. Rodilla, R. Cossent, I. Herrero, I. Usera, P. Mastropietro, S. Vinci, Adapting Market Design to High Shares of Variable Renewable Energy. Abu Dhabi, 2017. P. L. Joskow, “Challenges for wholesale electricity markets with intermittent renewable generation at scale: the US experience,” Oxford Review of Economic Policy, vol. 35, no. 2, pp. 291–331, 2019. Council of European Energy Regulators, Long-Term Generation Investment Signals in a Market with High Shares of Renewables, 2021. J. Villar and H. Rudnick, “Hydrothermal Market Simulator Using Game Theory: Assessment of Market Power,” IEEE Power Eng. Rev., vol. 22, no. 11, p. 57, 2002. J. Hermoza and R. Reta, “Electricity Market Simulator to Assess the Implementation of Free Prices considering the Transmission Network,” [15] [16] in 2018 IEEE PES Transmission & Distribution Conference and Exhibition - Latin America (T&D-LA), Lima, 92018, pp. 1–5. J. P. Molina, J. M. Zolezzi, J. Contreras, H. Rudnick, and M. J. Reveco, “Nash-Cournot Equilibria in Hydrothermal Electricity Markets,” IEEE Trans. Power Syst., vol. 26, no. 3, pp. 1089–1101, 2011. M. Zugno, J. M. Morales, P. Pinson and H. Madsen, "Pool Strategy of a Price-Maker Wind Power Producer," in IEEE Transactions on Power Systems, vol. 28, no. 3, pp. 3440-3450, Aug. 2013 D. Chattopadhyay, “Multicommodity Spatial Cournot Model for Generator Bidding Analysis,” IEEE Trans. Power Syst., vol. 19, no. 1, pp. 267–275, 2004. J. B. Rosen, “Existence and Uniqueness of Equilibrium Points for Concave N-Person Games,” Econometrica, vol. 33, no. 3, p. 520, 1965. J. Contreras, M. Klusch, and J. B. Krawczyk, “Numerical Solutions to Nash–Cournot Equilibria in Coupled Constraint Electricity Markets,” IEEE Trans. Power Syst., vol. 19, no. 1, pp. 195–206, 2004. B. E. Hobbs, “Linear complementarity models of Nash-Cournot competition in bilateral and POOLCO power markets,” IEEE Trans. Power Syst., vol. 16, no. 2, pp. 194–202, 2001. S. Uryas'ev and R. Y. Rubinstein, “On relaxation algorithms in computation of noncooperative equilibria,” IEEE Trans. Automat. Contr., vol. 39, no. 6, pp. 1263–1267, 1994. C. Ordoudis, P. Pinson, J. Morales, and M. Zugno, “An Updated Version of the IEEE RTS 24-Bus System for Electricity Market and Power System Operation Studies”. Technical University of Denmark, 2016. VII. BIOGRAPHIES William Quiroz received the B.Sc. in electrical engineering from National University of Engineering, Lima Peru. Currently he works at the Peruvian System Operator and Power Exchange “COES”. His experience and research interest include economic operation, regulation of electricity markets and optimization modeling. Jose Koc received the B.Sc. in mechanics and electrical engineering from National University of Engineering, Lima Peru and the Master of Engineering in Electric Power Engineering from Rensselaer Polytechnic Institute. Currently he is professor of electrical engineering at National University of Engineering, Lima Peru. His experience includes economic operation, planning and regulation.