-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
460 lines (414 loc) · 15 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Game-Theoretical Models for Energy Markets</title>
<link rel="stylesheet" href="dist/reset.css">
<link rel="stylesheet" href="dist/reveal.css">
<link rel="stylesheet" href="dist/theme/white.css">
<!-- Theme used for syntax highlighted code -->
<link rel="stylesheet" href="plugin/highlight/monokai.css">
<link rel="stylesheet" href="my.css">
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<div style="position: absolute; top: -10%;
right: 0; border:10px;">
<img src="./imgs/tuda_logo.svg" height="100" >
</div>
<br>
<br>
<hTitle>Game-Theoretical Models for Energy Markets</hTitle>
<hNameBox> Júlia Barbosa</hNameBox>
<p class = "small-text">
<img src="imgs/QR.svg" height="150" >
<br>
Follow the presentation
</p>
</section>
<section>
<section>
<hTitle>What is Game Theory? </hTile>
<hText>
„Game theory is the study of multiperson decision problems.“
</hText>
<p class="small-text">
Gibbons, R. (1992). A Primer in Game Theory
</p>
</section>
<section>
<div class = "r-stack">
<img class="fragment" src="imgs/GameTransition/game1.svg" height="500" class="center-image" >
<img class="fragment" src="imgs/GameTransition/game2.svg" height="500" class="center-image" >
<img class="fragment" src="imgs/GameTransition/game3.svg" height="500" class="center-image" >
<img class="fragment" src="imgs/GameTransition/game4.svg" height="500" class="center-image" >
</div>
<p class = "fragment small-text" >
Normal-Form Representation:
\[ \mathcal{G} = \{N,S = S_1 \times ... \times S_N, U:S \rightarrow \mathbb{R}^N\}
\]
</p>
</section>
<section>
<div class="fragment" style="font-size: 25pt;">
<mark> Do the players play without observing the other player's moves?</mark>
<table class= "fragment" width="80%">
<tr>
<td>
Yes → <b>Static</b>
</td>
<td>
No → <b>Dynamic</b>
</td>
</tr>
</table>
</div>
<br>
<div class="fragment" style="font-size: 25pt;">
<mark>Is each players payoff function known by every other player?</mark>
<table class="fragment">
<tr>
<td>
Yes → <b>Complete</b> Information
</td>
<td>
No → <b>Incomplete</b> Information
</td>
</table>
</div>
<br>
<div class="fragment" style="font-size: 25pt;">
<mark> Do the players know the full history of the game at each move? </mark>
<table class="fragment">
<tr>
<td>
Yes → <b>Perfect</b> Information
</td>
<td>
No → <b>Imperfect</b> Information
</td>
</table>
</div>
</section>
</section>
<section>
<section>
<h7>Illustrative Example</h7>
<hTitle>The Peace War Game*</hTitle>
<div class="r-stack">
<img src="imgs/peaceWar/s0.svg" height="300">
<img class="fragment fade-in-then-out" src="imgs/peaceWar/s2.svg" height="300">
<img class="fragment fade-in-then-out" src="imgs/peaceWar/s3.svg" height="300">
<img class="fragment fade-in-then-out" src="imgs/peaceWar/s4.svg" height="300">
<img class="fragment fade-in-then-out" src="imgs/peaceWar/s5.svg" height="300">
<div class ="fragment fade-in-then-out" style="background-color: white; border: 1pt solid black;">
What if B plays first and A observes B's move before playing?
</div>
<img class="fragment fade-in-then-out" src="imgs/peaceWar/s0.svg" height="300">
<img class="fragment fade-in-then-out" src="imgs/peaceWar/s6.svg" height="300">
</div>
<p style="font-size: 20pt;">
If players are rational, what is the most likely game outcome?
</p>
<p class="fragment">
<mark>It depends on the game conditions!</mark>
</p>
<div class="small-text l">
*Modified
</div>
</section>
<section>
<h3> <mark> Nash-Equilibrium (NE) </mark></h3>
<br>
Steady state where no player can benefit by <b>unilaterally</b> changing its strategy.
</section>
</section>
<section>
<section>
<hTitle style="border: 0pt solid;margin: 10pt">Market Equilibrium and Perfect Markets</hTitle>
<div style="font-size: 20pt; margin: 5pt;">
Consumers and producers are price-takers
</div>
<img src="imgs/MarketEQ.svg" height="300" style="border: 0pt solid; margin: 0pt;">
<div class=" small-text" style="margin: 0pt;border: 0pt solid;">
<b>Social Welfare</b> = Consumer Utility(CS) - Production Cost (PC)
<br>
</div>
<div style="font-size: 20pt; margin: 20pt;">
<b>Equilibrium Problems:</b> quantity and price are variables.
</div>
</section>
</section>
<section>
<section>
<h7>Example 1: Nash Equilibrium</h7>
<hTitle>Cournout Competition in Local Energy Markets</hTitle>
<div class="r-stack">
<img class="fragment" src="imgs/cornout/producers1.svg" height="300">
<img class="fragment" src="imgs/cornout/consumers.svg" height="300">
</div>
</section>
<section>
<div class="column">
Each producer wants to maximize their profit:
<br>
<p style="font-size: 15pt;text-align: center;">
\[\begin{aligned}
\max_{x_p} &\left(\pi - k^m_p\right) x_p \\
\text{s.t.}&\\
& \sum_{p' \in P}x_{p'} = D \\
& \pi = a(D_0 - D)\\
& c_p - x_p \geq 0
\end{aligned}\]
</p>
</div>
<div class="column fragment">
The KKT-Conditions constitute a Mixed Complementarity Problem (MCP):
<br>
<p style="font-size: 15pt; text-align: center;">
\[\begin{aligned}
0 = \pi - aD - k_p^m -\alpha_p &\perp x_p \text{ free} \; \; \forall p\\
0 \leq c_p- x_p &\perp \alpha_p \geq 0 \; \; \forall p\\
0 = \pi - a(D_0 -D) &\perp \pi \text{ free}\\
0 = \sum_{p' \in P} x_{p'} - D &\perp D \text{ free} \\
\end{aligned} \]
</p>
</div>
<div class="small-text fragment">
Implementation in Julia available <a href="https://github.com/JP-Barbosa/GT4EM/blob/main/src/ex1.jl">
here</a>.
</div>
</section>
</section>
<section>
<section>
<h7>Example 2: Generalized Nash Equilibria</h7>
<hTitle>Cornout Competition with CO\(_2\) Emission Constraint</hTitle>
<div class="r-stack">
<img class="fragment" src="imgs/cornout/complete_2.svg" height="300">
</div>
</section>
<section>
The formulation is now:
<div class="r-stack">
<p class= " fragment fade-in-then-out" style="font-size: 15pt; text-align: center;">
\[\begin{aligned}
0 = \pi - aD - k_p^m &\perp x_p \text{ free} \; \; \forall p\\
0 \leq c_p- x_p &\perp \alpha_p \geq 0 \; \; \forall p \\
0 \leq M - \sum_{p'} x_{p'}e_{p'} & \perp \phi_p \geq 0 \; \; \forall p\\
0 = \pi - a(D_0 -D) &\perp \pi \text{ free} \\
0 = \sum_{p' \in P} x_{p'} - D &\perp D \text{ free} \\
\\
\end{aligned} \]
</p>
<p class="fragment fade-in-then-out" style="font-size: 15pt; border: 2pt solid black; background-color: white; margin: 2pt;">
\[
0 \leq M - \sum_{p'} x_{p'}e_{p'} \perp \phi_p \geq 0 \; \; \forall p\\
\]
The strategy set of each player depends on the strategies of the other players. (GNE)
<br>
This system is non-square !!!
<br>
<br>
<mark>
If a trading system is implemented, the prices of the permits are the same for all producers, i.e,
</mark>
<br>
\[ \phi_p = \phi \; \; \forall p \]
The system is now square and has an unique NE.
</p>
<p class= "fragment" style="font-size: 15pt; text-align: center;">
\[\begin{aligned}
0 = \pi - aD - k_p^m &\perp x_p \text{ free} \; \; \forall p\\
0 \leq c_p- x_p &\perp \alpha_p \geq 0 \; \; \forall p \\
0 \leq M - \sum_{p'} x_{p'}e_{p'} & \perp \phi \geq 0 \; \; \forall p\\
0 = \pi - a(D_0 -D) &\perp \pi \text{ free} \\
0 = \sum_{p' \in P} x_{p'} - D &\perp D \text{ free} \\
\\
\end{aligned} \]
</p>
</div>
<div class="small-text fragment">
Implementation in Julia available <a href="https://github.com/JP-Barbosa/GT4EM/blob/main/src/ex2.jl">
here</a>.
</section>
</section>
<section>
<section>
<h7>Example 3: Dynamic Game with a Single Leader </h7>
<hTitle>Stackelberg Competition</hTitle>
<div class="r-stack">
<img class="fragment" src="imgs/cornout/leader.svg" height="300">
<img class="fragment" src="imgs/cornout/producers2.svg" height="300">
<img class="fragment" src="imgs/cornout/consumers.svg" height="300">
</div>
<p class="small-text">
Leader plays first, followers observe and then play a cornout-competition game.
</p>
</section>
<section>
The problem can be formulated as:
<div class="r-stack">
<p class= " fragment" style="font-size: 15pt; text-align: center;">
\[\begin{aligned}
&\max_{x_l} \pi x_l - k_l^m x_l \\
& \text{s.t.} \\
&c_l - x_l \geq 0 \\
&\text{NE Problem from Example 1}
\end{aligned} \]
</p>
</div>
<p class ="fragment" style="font-size: 20pt;text-align: left;">
Note that the NE problem is now a constraint of the leader problem.
<br>
<br>
This is a bilevel problem, where the lower level is a NEP.
<br>
<br>
Complementarity conditions can be replaced by a non-linear transformation.
</p>
<div class="small-text fragment">
Implementation in Julia available <a href="https://github.com/JP-Barbosa/GT4EM/blob/main/src/ex3.jl">
here</a>.
</div>
</section>
</section>
<section>
<section>
<h7>Example 4: EPEC Power Market Model
</h7>
<hTitle>Strategic quantity decisions by Generators</hTitle>
<div class="r-stack">
<img class="fragment" src="./imgs/cornout/ex4_prod.svg" height="300">
<img class="fragment" src="imgs/cornout/ex4_tso.svg" height="300">
<img class="fragment" src="imgs/cornout/ex4_demand.svg" height="300">
</div>
<p class="small-text fragment">
Two producers A and B (leaders) maximize their profits from energy sales.
<br>
TSO (follower) maximizes profit from energy arbitrage between nodes.
</p>
<p class="small-text">
Adapted from Complementarity Modeling in Energy Markets, by Gabriel A., Conejo A., Fuller J., Hobbs B. and Ruiz C. (2013)
</p>
</section>
<section>
Formulation of follower problem:
<p class="fragment" style="font-size: 15pt; text-align: center;">
\[\begin{aligned}
&\max_{s_n} \sum_{n \in N} \phi_n s_n \\
& \text{s.t.} \\
& s_1 - C \leq 0\\
& - s_1 - C \leq 0 \\
\end{aligned} \]
</p>
MPEC Formulation of leader at node \(n\) Problem:
<p class="fragment" style="font-size: 15pt; text-align: center;">
\[\begin{aligned}
&\max_{x_{n}} \pi_{n} x_{n} \\
& \text{s.t.} \\
& x_{n} - c_{n} \leq 0 \\
& x_{n} - s_{n} = D_{n} \; \; \forall n \in N \\
& \pi_n = a_n(D_{0,n} - D_n) \; \; \forall n \in N \\
& \text{Follower Problem KKT Conditions} \\
\end{aligned} \]
</p>
<mark class ="fragment" style="font-size: 25pt; border: 1pt solid black">
Note that we have two MPEC problems, one for each leader → EPEC.
</mark>
</section>
<section>
<h6>
How solve a EPEC?
</h63>
<h5>The most common strategy is <mark>Diagonalization</mark></h5>
<p class="fragment l">
1. Define a initial set of strategies for the leaders
</p>
<p class="fragment l">
2. While not convergence and not max iterations
</p>
<p class="fragment l">
3. For each leader \(l\):
<br>
i. Solver the Leader \(l\) MPEC problem, given the strategies of the other leaders
<br>
ii. Reset the strategies of the leader \(l\) with the new strategies
</p>
<p class="fragment l">
4. Check convergence
</p>
<p class="fragment l">
5. If interation limit reached → algotithm failed
<p class="fragment l">
6. If not converged, go to 2, else finished
</p>
<p class="small-text fragment">
Implementation in Julia available <a href="https://github.com/JP-Barbosa/GT4EM/blob/main/src/ex4.jl">
here</a>.
</p>
</section>
</section>
<section>
<hTitle>Summary</hTitle>
<div>
<ul style="font-size: 18pt;">
<li class="fragment">Game theoretical fomulations allow to model imperfect markets.</li>
<li class="fragment">Given convex objetive functions and constraint qualifications, multiple interdependent optmization problems can be replaced by their KKT-Conditions. </li>
<li class="fragment">GNE problems can lead to non-square models, real world assumptions may help to eliminate variables.</li>
<li class="fragment">MPECs can be solved with non-linear transformations of complementarity constraints.</li>
<li class="fragment">EPECs can be solved used diagonalization. </li>
</ul>
</div>
</section>
<section>
<div style="position: absolute; top: -10%;
right: 0; border:10px;">
<img src="./imgs/tuda_logo.svg" height="100" >
</div>
<hTitle>Thank you!</hTitle>
<p> Julia examples:
<br>
<a href="https://github.com/JP-Barbosa/GT4EM">
https://github.com/JP-Barbosa/GT4EM
</a>
</p>
<p>This presentation
<br>
<a href="https://jp-barbosa.github.io/RevealGT4EM/">
https://jp-barbosa.github.io/RevealGT4EM/
</a>
</p>
<img src="imgs/QR.svg" height="150">
<p>Questions, comments or ideas?
<br>
<a href="mailto:mail@juliabarbosa.net">
mail@juliabarbosa.net</a>
</p>
</div>
</section>
</div>
</div>
<script src="dist/reveal.js"></script>
<script src="plugin/notes/notes.js"></script>
<script src="plugin/markdown/markdown.js"></script>
<script src="plugin/highlight/highlight.js"></script>
<script src="plugin/math/math.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
// Learn about plugins: https://revealjs.com/plugins/
plugins: [RevealMarkdown, RevealHighlight, RevealNotes, RevealMath.KaTeX],
animate: {
autoplay: true,
}
});
</script>
</body>
</html>