Introducing notations first Inputs: All offers in the market are formulated in terms of a quantity P and a price λ On the supply side ( N G supply offers): set of offers: L G = { G j , j = 1 , . . . , N G } maximum quantity for offer G j : P G j price for offer G j : λ G j On the demand side ( N D demand offers): set of offers: L D = { D i , i = 1 , . . . , N D } maximum quantity for offer D i : P D i price for offer D i : λ D i Decision variables: Generation schedule: y G = � ⊤ , 0 ≤ y G � y G j , . . . , y G ≤ P G j j N G Consumption schedule: y D = � ⊤ , 0 ≤ y D � y D 1 , . . . , y D ≤ P D N D i i 2/15
Our example auction setup Supply: (for a total of 1435 MWh) P G λ G Company Supply/Demand id (MWh) j ( e /MWh) j � RT R Supply G 1 120 0 WeTrustInWind Supply G 2 50 0 BlueHydro Supply G 3 200 15 � RT R Supply G 4 400 30 KøbenhavnCHP Supply G 5 60 32.5 KøbenhavnCHP Supply G 6 50 34 KøbenhavnCHP Supply G 7 60 36 DirtyPower Supply G 8 100 37.5 DirtyPower Supply G 9 70 39 DirtyPower Supply 50 40 G 10 � RT R Supply 70 60 G 11 � RT R Supply 45 70 G 12 SafePeak Supply 50 100 G 13 SafePeak Supply 60 150 G 14 SafePeak Supply 50 200 G 15 3/15
Our example auction setup Demand: (for a total of 1065 MWh) P D λ D Company Supply/Demand id (MWh) i ( e /MWh) i CleanRetail Demand D 1 250 200 El4You Demand D 2 300 110 EVcharge Demand D 3 120 100 QualiWatt Demand D 4 80 90 IntelliWatt Demand D 5 40 85 El4You Demand D 6 70 75 CleanRetail Demand D 7 60 65 IntelliWatt Demand D 8 45 40 QualiWatt Demand 30 38 D 9 IntelliWatt Demand 35 31 D 10 CleanRetail Demand 25 24 D 11 El4You Demand 10 16 D 12 That is a lot of offers to match... Could an optimization problem readily give us the solution? 4/15
Centralized social welfare optimization The social welfare maximization problem can be written as N D N G � � λ D i y D λ G j y G max (1a) i − j y G , y D i =1 j =1 N G N D � � y G y D subject to = 0 (1b) j − i j =1 i =1 0 ≤ y D ≤ P D i , i = 1 , . . . , N D (1c) i 0 ≤ y G ≤ P G j , j = 1 , . . . , N G (1d) j And equivalently as a minimization problem by minimizing the opposite objective function, i.e. N G N D � λ G j y G � λ D i y D min (2a) j − i y G , y D j =1 i =1 subject to (1b)-(1d) (2b) 5/15
It is a simple linear program! One recognize a so-called Linear Program ( LP , here in a compact form): c ⊤ y min (3a) y subject to Ay ≤ b (3b) A eq y = b eq (3c) y ≥ 0 (3d) LP problems can be readily solved in Matlab , for instance with the function linprog, R , with the library/function lp solve, and also obviously with GAMS , Gurobi , etc. However, for e.g. R and Matlab, you need to know how to build relevant vectors and matrices And, the solution will only give you the energy schedules in terms of supply and demand 6/15
Vector and matrices in the objective function The vector y of optimization variables c of weights in the objective function are constructed as y G λ G 1 1 y G λ G 2 2 . . . . . . y G λ G N G N G , y ∈ R ( N G + N D ) , c ∈ R ( N G + N D ) y = c = y D − λ D 1 1 y D − λ D 2 2 . . . . . . y D − λ D N D N D 7/15
Vector and matrices defining constraints For the equality constraint (balance of generation and consumption): A eq = [1 . . . 1 − 1 . . . − 1] , A eq ∈ R ( N G + N D ) , b eq = 0 For the inequality constraint (i.e., generation and consumption levels within limits): P G 1 P G 2 1 . . ... . 0 P G N G 1 A = , b = , 1 P D ... 1 P D 0 2 . 1 . . P D N D with A ∈ R ( N G + N D ) × ( N G + N D ) and b ∈ R ( N G + N D ) Do not forget the non-negativity constraints for the elements of y ... 8/15
Getting the complete market-clearing By complete market-clearing is meant obtaining the schedule for all supply and demand offers, as well as the price at which the market is cleared, i.e., the so-called market-clearing or system price (in, e.g., Nord Pool) 9/15
Getting the complete market-clearing By complete market-clearing is meant obtaining the schedule for all supply and demand offers, as well as the price at which the market is cleared, i.e., the so-called market-clearing or system price (in, e.g., Nord Pool) The system price is obtained through the dual of the LP previously defined, i.e., − b ⊤ ν max λ , ν A ⊤ eq λ − A ⊤ ν ≤ c subject to ν ≥ 0 This is also an LP: it can be solved with Matlab, R, GAMS, etc. λ and ν are sets of Lagrange multipliers associated to all equality and inequality constraints: λ = λ S ν = [ ν G . . . ν G ν D . . . ν D N D ] ⊤ 1 1 N G [Note: basics of optimization for application in electricity markets are given in: JM Morales, A Conejo, H Madsen, P Pinson, M Zugno (2014). Integration Renewables in Electricity Markets: Operational Problems . Springer (link)] 9/15
More specifically for the market-clearing problem Only one equality constraint, i.e., � � y D y G = 0 i − j i j for which the associated Lagrange multiplier λ S represents the system price. 10/15
More specifically for the market-clearing problem Only one equality constraint, i.e., � � y D y G = 0 i − j i j for which the associated Lagrange multiplier λ S represents the system price. And N D + N G inequality constraints: 0 ≤ y D ≤ P D 0 ≤ y G ≤ P G i , i = 1 , . . . , N D , j , j = 1 , . . . , N G i j for which the associated Lagrange multipliers ν D and ν G represents the unitary benefits for the various i j demand and supply offers if the market is cleared at λ S . 10/15
More specifically for the market-clearing problem Only one equality constraint, i.e., � � y D y G = 0 i − j i j for which the associated Lagrange multiplier λ S represents the system price. And N D + N G inequality constraints: 0 ≤ y D ≤ P D 0 ≤ y G ≤ P G i , i = 1 , . . . , N D , j , j = 1 , . . . , N G i j for which the associated Lagrange multipliers ν D and ν G represents the unitary benefits for the various i j demand and supply offers if the market is cleared at λ S . The dual of the market clearing LP is also an LP which writes � � ν G j P G ν D i P D max − j − i λ S , { ν D i } , { ν G j } j i λ S − ν G j ≤ λ G subject to j , j = 1 , . . . , N G − λ S − ν D ≤ − λ D i , i = 1 , . . . , N D i ν G ν D j ≥ 0 , j = 1 , . . . , N G , ≥ 0 , i = 1 , . . . , N D i [To retrieve the dual LP, follow: Lahaie S (2008). How to take the dual of a Linear Program. (link)] 10/15
Let’s also write it as a compact linear program! As for the primal LP allowing to obtain the dispatch for market participants on both supply and demand side, we write here the dual LP in a compact form: c ⊤ ˜ max ˜ y ˜ y ˜ y ≤ ˜ subject to A ˜ b ˜ y ≥ 0 The next 2 slides describe how to build the assemble the relevant vectors and matrices in the above LP... Then, it can be solved with Matlab , R , GAMS , etc. And, the solution will give you the equilibrium price, as well as the unit benefits for each and every market participant [NB: Most optimization functions and tools readily give you the solution of dual problems when solving the primal ones! E.g., see documentation of linprog in Matlab] 11/15
Vector and matrices in the objective function The vector y of optimization variables c of weights in the objective function are constructed as ν G − P G 1 1 ν G − P G 2 2 . . . . . . ν G − P G N G N G y ∈ R ( N G + N D +1) c ∈ R ( N G + N D +1) y = ˜ , ˜ c = ˜ , ˜ ν D − P D 1 1 ν D − P D 2 2 . . . . . . ν D − P D N D N D λ S 0 12/15
Vector and matrices defining constraints No equality constraint! For the inequality constraint: λ G 1 λ G 2 − 1 1 . . . ... . . 0 . λ G N G − 1 1 ˜ ˜ A = , b = , − 1 − 1 − λ D . ... 1 . − λ D 0 . 2 . − 1 − 1 . . − λ D N D A ∈ R ( N G + N D ) × ( N G + N D ) and ˜ with ˜ b ∈ R ( N G + N D ) 13/15
Recommend
More recommend