-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathesm-lecture-8.tex
1300 lines (857 loc) · 38.1 KB
/
esm-lecture-8.tex
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
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% NB: use pdflatex to compile NOT pdftex. Also make sure youngtab is
% there...
% converting eps graphics to pdf with ps2pdf generates way too much
% whitespace in the resulting pdf, so crop with pdfcrop
% cf. http://www.cora.nwra.com/~stockwel/rgspages/pdftips/pdftips.shtml
\documentclass[10pt,aspectratio=169,dvipsnames]{beamer}
\usetheme[color/block=transparent]{metropolis}
\usepackage[absolute,overlay]{textpos}
\usepackage{booktabs}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage[scale=2]{ccicons}
\usepackage[official]{eurosym}
%use this to add space between rows
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\newcommand{\R}{\mathbb{R}}
\setbeamerfont{alerted text}{series=\bfseries}
\setbeamercolor{alerted text}{fg=Mahogany}
\setbeamercolor{background canvas}{bg=white}
\def\l{\lambda}
\def\m{\mu}
\def\d{\partial}
\def\cL{\mathcal{L}}
\def\co2{CO${}_2$}
\def\bra#1{\left\langle #1\right|}
\def\ket#1{\left| #1\right\rangle}
\newcommand{\braket}[2]{\langle #1 | #2 \rangle}
\newcommand{\norm}[1]{\left\| #1 \right\|}
\def\corr#1{\Big\langle #1 \Big\rangle}
\def\corrs#1{\langle #1 \rangle}
\def\mw{\text{ MW}}
\def\mwh{\text{ MWh}}
\def\emwh{\text{ \euro/MWh}}
\newcommand{\ubar}[1]{\text{\b{$#1$}}}
% for sources http://tex.stackexchange.com/questions/48473/best-way-to-give-sources-of-images-used-in-a-beamer-presentation
\setbeamercolor{framesource}{fg=gray}
\setbeamerfont{framesource}{size=\tiny}
\newcommand{\source}[1]{\begin{textblock*}{5cm}(10.5cm,8.35cm)
\begin{beamercolorbox}[ht=0.5cm,right]{framesource}
\usebeamerfont{framesource}\usebeamercolor[fg]{framesource} Source: {#1}
\end{beamercolorbox}
\end{textblock*}}
\usepackage{hyperref}
\usepackage{tikz}
\usepackage[europeanresistors,americaninductors]{circuitikz}
%\usepackage[pdftex]{graphicx}
\graphicspath{{graphics/}}
\DeclareGraphicsExtensions{.pdf,.jpeg,.png,.jpg,.gif}
\def\goat#1{{\scriptsize\color{green}{[#1]}}}
\let\olditem\item
\renewcommand{\item}{%
\olditem\vspace{5pt}}
\title{Energy System Modelling\\ Summer Semester 2020, Lecture 8}
%\subtitle{---}
\author{
{\bf Dr. Tom Brown}, \href{mailto:[email protected]}{[email protected]}, \url{https://nworbmot.org/}\\
\emph{Karlsruhe Institute of Technology (KIT), Institute for Automation and Applied Informatics (IAI)}
}
\date{}
\titlegraphic{
\vspace{0cm}
\hspace{10cm}
\includegraphics[trim=0 0cm 0 0cm,height=1.8cm,clip=true]{kit.png}
\vspace{5.1cm}
{\footnotesize
Unless otherwise stated, graphics and text are Copyright \copyright Tom Brown, 2020.
Graphics and text for which no other attribution are given are licensed under a
\href{https://creativecommons.org/licenses/by/4.0/}{Creative Commons
Attribution 4.0 International Licence}. \ccby}
}
\begin{document}
\maketitle
\begin{frame}
\frametitle{Table of Contents}
\setbeamertemplate{section in toc}[sections numbered]
\tableofcontents[hideallsubsections]
\end{frame}
\section{Optimisation Revision}
\begin{frame}
\frametitle{Optimisation problem}
We have an \alert{objective function} $f: \R^k \to \R$
\begin{equation*}
\max_{x} f(x)
\end{equation*}
[$x = (x_1, \dots x_k)$] subject to some \alert{constraints} within $\R^k$:
\begin{align*}
g_i(x) & = c_i \hspace{1cm}\leftrightarrow\hspace{1cm} \l_i \hspace{1cm} i = 1,\dots n \\
h_j(x) & \leq d_j \hspace{1cm}\leftrightarrow\hspace{1cm} \m_j \hspace{1cm} j = 1,\dots m
\end{align*}
$\l_i$ and $\m_j$ are the \alert{KKT multipliers} we introduce for
each constraint equation; they measure the change in the objective value of the optimal solution obtained by relaxing the constraints (for this reason they are also called \alert{shadow prices}).
\end{frame}
\begin{frame}
\frametitle{KKT conditions}
The \alert{Karush-Kuhn-Tucker (KKT) conditions} are necessary conditions that an optimal solution $x^*,\m^*,\l^*$ always satisfies (up to some regularity conditions):
\begin{enumerate}
\item \alert{Stationarity}: For $l = 1,\dots k$
\begin{equation*}
\frac{\d \cL}{\d x_l} = \frac{\d f}{\d x_l} - \sum_i \l_i^* \frac{\d g_i}{\d x_l} - \sum_j \m_j^* \frac{\d h_j}{\d x_l} = 0
\end{equation*}
\item \alert{Primal feasibility}:
\begin{align*}
g_i(x^*) & = c_i \\
h_j(x^*) &\leq d_j
\end{align*}
\item \alert{Dual feasibility}: $\m_j^* \geq 0$
\item \alert{Complementary slackness}: $\m_j^* (h_j(x^*) - d_j) = 0$
\end{enumerate}
\end{frame}
\begin{frame}
\frametitle{min/max and signs}
If the problem is a \alert{maximisation} problem (e.g. welfare maximisation), then
\alert{$\m_j^* \geq 0$} since $\m_j = \frac{\d \cL}{\d d_j}$ and if we
increase $d_j$ in the constraint $h_j(x) \leq d_j$, then the
feasible space can only get bigger. Since if $X \subseteq X'$
\begin{equation*}
\max_{x\in X} f(x ) \leq \max_{x\in X'} f(x)
\end{equation*}
then the objective value at the optimum point can only get bigger, and thus $\m_j^* \geq 0$. (If $d_j \to \infty$
then the constraint is no longer binding, if $d_j \to -\infty$ then
the feasible space vanishes.)
If however the problem is a \alert{minimisation} problem (e.g. cost minimisation) then we can use
\begin{equation*}
\min_{x\in X} f(x) = - \max_{x\in X} \left[ -f(x)\right]
\end{equation*}
We can keep our definition of the Lagrangian and almost all the KKT
conditions, but we have a change of sign \alert{$\m_j^* \leq 0$}, since
\begin{equation*}
\min_{x\in X} f(x ) \geq \min_{x\in X'} f(x)
\end{equation*}
The $\l_i^*$ also change sign.
\end{frame}
\section{Welfare maximisation revision}
\begin{frame}{KKT and Welfare Maximisation 1/2}
Apply KKT now to maximisation of total economic welfare:
\begin{align*}
\max_{\{d_b\}, \{g_s\}} f(\{d_b\}, \{g_s\}) = \left[ \sum_b U_b (d_b) - \sum_s C_s (g_s) \right]
\end{align*}
subject to the balance constraint:
\begin{align*}
g(\{d_b\}, \{g_s\}) = \sum_b d_b - \sum_s g_s = 0 \hspace{1cm} \leftrightarrow \hspace{1cm} \l
\end{align*}
and any other constraints (e.g. limits on generator capacity, etc.).
Our optimisation variables are $\{x\} = \{d_b\} \cup \{g_s\}$.
We get from KKT stationarity at the optimal point:
\begin{align*}
0 & = \frac{\d f}{\d d_b} - \sum_b \l^* \frac{\d g}{\d d_b} = U_b'(d_b^*) - \l^* = 0 \\
0 & = \frac{\d f}{\d g_s} - \sum_s \l^* \frac{\d g}{\d g_s} = -C_s'(g_s^*) + \l^* = 0
\end{align*}
\end{frame}
\begin{frame}{KKT and Welfare Maximisation 2/2}
So at the optimal point of maximal total economic welfare we get the
same result as if everyone maximises their own welfare separately based on the price $\l^*$:
\begin{align*}
U_b'(d_b^*) = \l^* \\
C_s'(g_s^*) = \l^*
\end{align*}
This is the CENTRAL result of microeconomics.
If we have further inequality constraints that are binding (e.g. capacity constraints), then
these equations will receive additions with $\m_i^* > 0$.
\end{frame}
\section{Optimise Single Node with Linear Generation Costs and Demand Utility}
\begin{frame}[fragile]
\frametitle{Simplified world: linear generation costs, linear demand utility}
We will now turn to a simpler world: all the generator cost
functions are linear
\begin{align*}
C_s(g_s) = o_s g_s
\end{align*}
and each generator has limited output $0 \leq g_s \leq G_s$. The marginal cost function is a constant $C_s'(g_s) = o_s$.
The quantity $G_s$ and marginal cost $o_s$ define a \alert{supply offer}.
All the consumer utility functions are also linear
\begin{align*}
U_b(d_b) = v_b d_b
\end{align*}
and each consumer has limited consumption $0 \leq d_b \leq D_b$. The marginal utility function is a constant $U_b'(d_b) = v_b$.
The quantity $D_b$ and marginal utility $v_b$ define a \alert{demand bid}.
\end{frame}
\begin{frame}{Supply-demand linear example: generator offers}
Example from Kirschen and Strbac pages 56-58.
The following generators offer into the market for the hour between 0900 and 1000 on 20th April 2016:
\ra{1.1}
\begin{table}[!t]
\begin{tabular}{lrr}
\toprule
Company & Quantity [MW] & Marginal cost [\$/MWh]\\
\midrule
Red & 200 & 12 \\
Red & 50 & 15 \\
Red & 150 & 20 \\
Green & 150 & 16 \\
Green & 50 & 17 \\
Blue & 100 & 13 \\
Blue & 50 & 18 \\
\bottomrule
\end{tabular}
\end{table}
\end{frame}
\begin{frame}{Supply-demand linear example: consumer bids}
The following consumers make bids for the same period:
\ra{1.1}
\begin{table}[!t]
\begin{tabular}{lrr}
\toprule
Company & Quantity [MW] & Marginal utility [\$/MWh]\\
\midrule
Yellow & 50 & 13 \\
Yellow & 100 & 23 \\
Purple & 50 & 11 \\
Purple & 150 & 22 \\
Orange & 50 & 10 \\
Orange & 200 & 25 \\
\bottomrule
\end{tabular}
\end{table}
\end{frame}
\begin{frame}{Supply-demand example: Curve}
If the bids and offers are stacked up in order, the supply and
demand curves meet with a demand of 450~MW at a system marginal
price of $\l^* = 16$~\$/MWh.
\centering
\includegraphics[width=10cm]{supply-bid-example}
\source{Kirschen \& Strbac}
\end{frame}
\begin{frame}{Supply-demand example: Revenue and Expenses}
Dispatch and revenue/expense of each company:
\ra{1.1}
\begin{table}[!t]
\begin{tabular}{l|rr|rr}
\toprule
Company & Production& Consumption & Revenue& Expense\\
& [MWh] & [MWh] & [\$] & [\$] \\
\midrule
Red & 250 & & 4000 & \\
Blue & 100 & & 1600 & \\
Green & 100 & & 1600 & \\
Orange && 200 && 3200 \\
Yellow && 100 && 1600 \\
Purple && 150 && 2400 \\
\midrule
Total & 450 & 450 & 7200 & 7200 \\
\bottomrule
\end{tabular}
\end{table}
\end{frame}
\begin{frame}[fragile]
\frametitle{Simplified world: linear generation costs, single inelastic demand}
For the analysis of the KKT equations, we will simplify even further.
We consider a single demand bid of volume $D$ so that the demand does not respond to price changes (i.e. the demand is \alert{inelastic}) up to a very high marginal utility $v >> o_s\,\, \forall s$, i.e.
\begin{align*}
U(d) = vd
\end{align*}
for $d\leq D$.
$v$ is sometimes called the \alert{Value Of Lost Load (VOLL)}.
\end{frame}
\begin{frame}[fragile]
\frametitle{Simplify representation of consumers and generators}
In this case we get for our welfare maximisation:
\begin{align*}
\max_{d, \{g_s\} }\left[ vd - \sum_s o_s g_s \right]
\end{align*}
subject to:
\begin{align*}
d - \sum_s g_s = 0 \hspace{1cm} & \leftrightarrow \hspace{1cm} \l \\
d \leq D \hspace{1cm} & \leftrightarrow \hspace{1cm} \m \\
g_s \leq G_s \hspace{1cm}& \leftrightarrow\hspace{1cm} \bar{\m}_s \\
- g_s \leq 0 \hspace{1cm}& \leftrightarrow\hspace{1cm} \ubar{\m}_s
\end{align*}
\end{frame}
\begin{frame}{Simplest example: one generator type, inelastic demand}
Suppose all generators have the same marginal cost $o$ and we
represent their total dispatch by $g$ and total capacity by $G$
\begin{align*}
\max_{d, g }\left[ vd - og\right]
\end{align*}
such that:
\begin{align*}
d - g & = 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \l \\
d & \leq D \hspace{1cm} \leftrightarrow \hspace{1cm} \m \\
g & \leq G \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m} \\
- g & \leq 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}
\end{align*}
\end{frame}
\begin{frame}{Simplest example: one generator type, inelastic demand}
If $D < G$ then since $v >> o$, it will be always be welfare-maximising to dispatch to satisfy the load, i.e.
\begin{equation*}
g^* = d^* = D
\end{equation*}
If the demand is non-zero then since $g^* > 0$ by complementarity we
have $\ubar{\m}^* = 0$. Since $D < G$ then $g^* < G$ and
by complementarity we have $\bar{\m}^* = 0$. To compute $\l^*$ we use stationarity:
\begin{align*}
0 & = \frac{\d \cL}{\d g } = \frac{\d f}{\d g} - \sum_i \l_i^* \frac{\d g_i}{\d g} - \sum_j \m_j^* \frac{\d h_j}{\d g} = - o + \l^* - \bar{\m}^* + \ubar{\m}^*
\end{align*}
Thus $\l^* = o$, which is the cost per unit of supplying extra demand. The \alert{generator sets the price}. There is no generator profit and a large consumer surplus.
For the load $\m^*$ can be non-zero because $d^*=D$:
\begin{align*}
0 & = \frac{\d \cL}{\d d} = \frac{\d f}{\d d} - \sum_i \l_i^* \frac{\d g_i}{\d d} - \sum_j \m_j^* \frac{\d h_j}{\d d} = v - \l^* - \m^*
\end{align*}
$\m^* = v - \l^*$ is the marginal benefit of each increase in demand.
\end{frame}
\begin{frame}{Simplest example: one generator type, inelastic demand}
For the case $D < G$:
\includegraphics[width=12cm]{supply-bigger-demand-single.pdf}
\end{frame}
\begin{frame}{Simplest example: one generator type, inelastic demand}
If $D > G$ then the generator will dispatch up to its maximum capacity
\begin{equation*}
g^* = d^* = G
\end{equation*}
For its lower limit we have $\ubar{\m}^* = 0$. From stationarity:
\begin{align*}
0 & = \frac{\d \cL}{\d g } = \frac{\d f}{\d g} - \sum_i \l_i^* \frac{\d g_i}{\d g} - \sum_j \m_j^* \frac{\d h_j}{\d g} = - o + \l^* - \bar{\m}^* + \ubar{\m}^*
\end{align*}
Thus $\l^* = o + \bar{\m}^*$. To find $\l^*$ we have to look at the demand:
\begin{align*}
0 & = \frac{\d \cL}{\d d} = \frac{\d f}{\d d} - \sum_i \l_i^* \frac{\d g_i}{\d d} - \sum_j \m_j^* \frac{\d h_j}{\d d} = v - \l^* - \m^*
\end{align*}
Since $d^* < D$, $\m^* = 0$, $\l^* = v$ and thus $\bar{\m}^* = v-o$, which is the marginal benefit of increasing the generator capacity $G$. The \alert{demand sets the price}. There is no consumer surplus and the generator makes a large profit.
\end{frame}
\begin{frame}{Simplest example: one generator type, inelastic demand}
For the case $D > G$:
\includegraphics[width=12cm]{demand-bigger-supply.pdf}
\end{frame}
\begin{frame}{Next simplest example: several generators, fixed demand}
Suppose we have several generators with dispatch $g_s$ and strictly ordered
operating costs $o_s$ such that $o_s < o_{s+1}$. We now maximise
\begin{align*}
\max_{\{d, g_s\}} \left[ vd - \sum_s o_s g_s \right]
\end{align*}
such that
\begin{align*}
d - \sum_s g_s & = 0 \hspace{1cm} \leftrightarrow \hspace{1cm} \l \\
d & \leq D \hspace{1cm} \leftrightarrow \hspace{1cm} \m \\
g_s & \leq G_s \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m}_s \\
- g_s & \leq 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}_s
\end{align*}
\end{frame}
\begin{frame}{Next simplest example: several generators, fixed demand}
Stationarity gives us for each generator $g_s$:
\begin{align*}
0 = \frac{\d \cL}{\d g_s} = -o_s + \l^* - \bar{\m}^*_s + \ubar{\m}^*_s
\end{align*}
and from complementarity we get
\begin{align*}
\bar{\m}_s(g_s^* - G_s) = 0 \hspace{2cm} \ubar{\m}_sg_s^* = 0
\end{align*}
We can see by inspection that we will dispatch the cheapest
generation first. Suppose that we have enough generation for the
demand, i.e. $D < \sum_s G_s$. [If $D > \sum_s G_s$ we have the same
situation as for a single generator, i.e. $\l^* = v$, so that the demand sets the price.]
Find the generator $m$ on the margin where the supply curve
intersects with the demand $D$, i.e. the $m$ where $\sum_{s=1}^{m-1}
G_s < D < \sum_{s=1}^{m} G_s$.
For $s \leq m-1$ we have $g_s^* = G_s$, $\ubar{\m}^*_s = 0$,
$\bar{\m}^*_s = \l^* - o_s$.
For $s = m$ we have $g_m^* = D - \sum_{s=1}^{m-1} G_s$ to cover
what's left of the demand. Since $0 < g_m^* < G_m$ we have
$\ubar{\m}^*_m = \bar{\m}^*_m = 0$ and thus $\l^* = o_m$.
\end{frame}
\begin{frame}{Next simplest example: several generators, fixed demand}
Specific example of two generators with $G_1 = 300$~MW, $G_2 =
400$~MW, $o_1 = 10$~\euro/MWh, $o_2 = 30$~\euro/MWh and $D = 500$~MW.
In this case $m=2$, $g_1^* = G_1 = 300$~MW, $g_2^* = d - G_1 = 200$~MW,
$\l^* = o_2$, $\ubar{\m}_i = 0$, $\bar{\m}_2 = 0$ and $\bar{\m}_1 =
o_2 - o_1$.
\centering
\includegraphics[width=8cm]{supply-demand-two.pdf}
\end{frame}
\begin{frame}{From welfare maximisation to cost minimisation}
For the case $D > \sum_s G_s$ we can instead imagine that the demand
is rigidly fixed to $D$ and that instead we have a dummy generator
with dispatch $g_d = D-\sum_s G_s$ that represents \alert{load shedding}.
In this case we can substitute $d = D - g_d$ to get
\begin{align*}
\max_{\{g_d, g_s\}} \left[ vD - vg_d - \sum_s o_s g_s \right]
\end{align*}
such that
\begin{align*}
D - g_d - \sum_s g_s & = 0 \hspace{1cm} \leftrightarrow \hspace{1cm} \l \\
g_s & \leq G_s \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m}_s \\
- g_s & \leq 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}_s
\end{align*}
Since $vD$ is a constant, we can use
$\max_{x\in X} \left[ -f(x)\right] = - \min_{x\in X} f(x)$
to recast this as a minimisation of the total generator costs,
absorbing $g_d$ into the set $\{g_s\}$. The constant $vD$ is dropped.
\end{frame}
\begin{frame}{From welfare maximisation to cost minimisation}
We have turned the maximisation of total welfare into \alert{cost minimisation}:
\begin{align*}
\min_{\{g_s\}} \sum_s o_s g_s
\end{align*}
such that:
\begin{align*}
\sum_s g_s - d & = 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \l \\
g_s & \leq G_s \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m}_s \\
- g_s & \leq 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}_s
\end{align*}
The most expensive generator has $o_s = v$ and $G_s = \infty$ and
represents \alert{load shedding}.
We've replaced the symbol $D$ with $d$ for simplicity going forward ($d$ is now a constant).
NB: Because the signs of the KKT multipliers change when we go from
maximisation to minimisation, we've also changed the sign of the
balance constraint to keep the marginal price $\l$ positive.
\end{frame}
\section{Optimise nodes in a network}
\begin{frame}[fragile]
\frametitle{Welfare optimisation for several nodes in a network}
Now let's suppose we have several nodes $i$ with different loads and
different generators, with flows $f_\ell$ in the network lines $\ell$.
Now we have additional optimisation variables $f_\ell$ AND
additional constraints for welfare maximisation:
\begin{align*}
\max_{\{d_{i,b}\},\{g_{i,s}\},\{f_\ell\}}\left[\sum_{i,b} U_{i,b}(d_{i,b}) - \sum_{i,s} C_{i,s} (g_{i,s}) \right]
\end{align*}
such that demand is met either by generation or by the network at each node $i$
\begin{align*}
\sum_{b} d_{i,b} - \sum_{s} g_{i,s} + \sum_\ell K_{i\ell}f_\ell = 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \l_i
\end{align*}
Note there is now a \alert{market price for each node}. As before, generator constraints are satisified
\begin{align*}
g_{i,s} & \leq G_{i,s} \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m}_{i,s} \\
- g_{i,s} & \leq 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}_{i,s}
\end{align*}
\end{frame}
\begin{frame}[fragile]
\frametitle{Linear cost minimisation at several nodes in a network}
For cost minimisation we have a fixed load $d_i$ at each node, and
absorb load-shedding above a value $v$ into a dummy generator.
Now we minimise over $f_\ell$ and $g_{i,s}$ for the case of linear cost functions:
\begin{align*}
\min_{\{g_{i,s}\},\{f_\ell\}} \sum_{i,s} o_{i,s} g_{i,s}
\end{align*}
such that demand is met either by generation or by the network at each node $i$
\begin{align*}
\sum_{s} g_{i,s} - d_i = \sum_\ell K_{i\ell}f_\ell \hspace{1cm}\leftrightarrow\hspace{1cm} \l_i
\end{align*}
and generator constraints are satisified
\begin{align*}
g_{i,s} & \leq G_{i,s} \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m}_{i,s} \\
- g_{i,s} & \leq 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}_{i,s}
\end{align*}
\end{frame}
\begin{frame}[fragile]
\frametitle{Several generators at different nodes in a network}
In addition we have constraints on the line flows.
First, they have to satisfy Kirchoff's Voltage Law around each closed cycle $c$:
\begin{align*}
\sum_{c} C_{\ell c} x_\ell f_\ell = 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \l_c
\end{align*}
and in addition the flows cannot overload the thermal limits, $|f_\ell| \leq F_\ell$
\begin{align*}
f_\ell \leq F_\ell \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m}_\ell \\
- f_\ell \leq F_\ell \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}_\ell
\end{align*}
\end{frame}
\begin{frame}[fragile]
\frametitle{Simplest example: two nodes connected by a single line}
At node 1 we have demand of $d_1 = 100$~MW and a generator with
costs $o_1 = 10$~\euro/MWh and a capacity of $G_1 = 300$~MW.
At node 2 we have demand of $d_2 = 100$~MW and a generator with
costs $o_2 = 20$~\euro/MWh and a capacity of $G_2 = 300$~MW.
What happens if the capacity of the line connecting them is $F = 0$?
What about $F = 50$~MW?
What about $F = \infty$?
\end{frame}
\begin{frame}[fragile]
\frametitle{Simplest example: two nodes connected by a single line}
\centering
\begin{circuitikz}
\draw [ultra thick] (1,13) node[anchor=south]{1} -- (4,13);
\draw(2.5,13) |- +(0,0.5) to [short,i^=$f$] +(5,0.5) |- +(0,-0.5);
\draw [ultra thick] (6,13) node[anchor=south]{2} -- (9,13);
\draw (1.5,13) -- +(0,-0.5) node[sground]{};
\draw (3,12) node[vsourcesinshape, rotate=270](V2){}
(V2.left) -- +(0,0.6);
\draw (1.5,11) node{$d_1$};
\draw (3,11) node{$g_{1}$};
\draw (6.5,13) -- +(0,-0.5) node[sground]{};
\draw (8,12) node[vsourcesinshape, rotate=270](V2){}
(V2.left) -- +(0,0.6);
\draw (6.5,11) node{$d_2$};
\draw (8,11) node{$g_{2}$};
\end{circuitikz}
\centering
\begin{columns}[T]
\begin{column}{5cm}
\centering
$g_1 - d_1 = f \quad \leftrightarrow \quad \l_1$
\hspace{1cm}
$d_1 =$ 100~MW
$G_1 =$ 300~MW
$o_1 = 10$~\euro/MWh
\end{column}
\begin{column}{5cm}
\centering
$g_2 - d_2 = -f \quad \leftrightarrow \quad \l_2$
\hspace{1cm}
$d_2 =$ 100~MW
$G_2 =$ 300~MW
$o_2 = 20$~\euro/MWh
\end{column}
\end{columns}
\end{frame}
\begin{frame}[fragile]
\frametitle{Simplest example: two nodes connected by a single line}
Out optimisation problem has objective function:
\begin{equation*}
\min_{g_1,g_2,f} \left[o_1 g_1 + o_2 g_2 \right]
\end{equation*}
subject to the following constraints:
\begin{align*}
g_1 - d_1 = f \hspace{1cm}\leftrightarrow\hspace{1cm} \l_1 \\
g_2 - d_2 = -f \hspace{1cm}\leftrightarrow\hspace{1cm} \l_2 \\
g_1 \leq G_1 \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m}_1 \\
- g_1 \leq 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}_1 \\
g_2 \leq G_2 \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m}_2 \\
- g_2 \leq 0 \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}_2 \\
f \leq F \hspace{1cm}\leftrightarrow\hspace{1cm} \bar{\m} \\
- f \leq F \hspace{1cm}\leftrightarrow\hspace{1cm} \ubar{\m}
\end{align*}
\end{frame}
\begin{frame}[fragile]
\frametitle{Two nodes: Case $F = 0$ }
For the case $F = 0$ the nodes are like two separated islands, $f^* = 0$.
The generator on each island provides the demand separately, so:
\begin{equation*}
g_1^* = d_1 \hspace{2cm} \textrm{and} \hspace{2cm} g_2^* = d_2
\end{equation*}
Neither generator has any binding constraints, since in each case the demand (100~MW) is less than the generator capacity (300~MW), so
\begin{equation*}
\bar{\m}_1^* = \ubar{\m}_1^* = \bar{\m}_2^* = \ubar{\m}_2^* = 0
\end{equation*}
From stationarity for each site we get
\begin{equation*}
0 = \frac{\d \cL}{\d g_{i}} = o_i - \l_i^* - \bar{\m}_i^* + \ubar{\m}_i^*
\end{equation*}
Thus we have at each site $\l_i^* = o_i$, as if we had optimised the nodes separately.
\end{frame}
\begin{frame}[fragile]
\frametitle{Two nodes: Case $F =$ 50~MW }
For the case $F = $50~MW the cheaper node 1 will export to the more
expensive node 2 as much as the restricted capacity $F$ allows:
\begin{equation*}
f^* = F = 50\textrm{ MW}
\end{equation*}
Generator 1 covers 50~MW of the demand from node 2:
\begin{equation*}
g_1^* = d_1+f^* = 150\textrm{ MW} \hspace{2cm} \textrm{and} \hspace{2cm} g_2^* = d_2 - f^* = 50\textrm{ MW}
\end{equation*}
Neither generator has any binding constraints, so
\begin{equation*}
\bar{\m}_1^* = \ubar{\m}_1^* = \bar{\m}_2^* = \ubar{\m}_2^* = 0
\end{equation*}
and thus we have again different prices at each $\l_i^* = o_i$. For the flow:
\begin{equation*}
0 = \frac{\d \cL}{\d f} = 0 + \l_1^* - \l_2^* - \bar{\m}^* + \ubar{\m}^*
\end{equation*}
Only the upper limit is binding, so we get $\ubar{\m}^* = 0$ and
$\bar{\m}^* = \l_1^* - \l_2^* = o_1 - o_2 = -10 $ \euro/MWh.
$\bar{\m}^*$ is the cost reduction if we expand the transmission capacity $F$ by $\varepsilon$, allowing us to substitute some of the expensive generation at node 2 with cheap generation from node 1.
\end{frame}
\begin{frame}[fragile]
\frametitle{Two nodes: Case $F = \infty$ }
For the case $F = \infty$ we have unrestricted capacity, so it is
like merging the two nodes to one node. Now all the demand is
covered by the cheapest node:
\begin{equation*}
f^* = d_2 = 100\textrm{ MW}
\end{equation*}
Generator 1 covers all the demand:
\begin{equation*}
g_1^* = d_1+d_2 = 200\textrm{ MW} \hspace{2cm} \textrm{and} \hspace{2cm} g_2^* = 0
\end{equation*}
Only generator 2 has a non-zero KKT multiplier, so at node 1 we have
$\l_1^* =o_1$ and at node 2 we have:
\begin{equation*}
\ubar{\m}_2^* = \l_2^* - o_2
\end{equation*}
From KKT for the flow $f$ we have no constraints so $\bar{\m}^* = \ubar{\m}^* = 0$ and from stationarity
\begin{equation*}
0 = \frac{\d \cL}{\d f} = 0 + \l_1^* - \l_2^* - \bar{\m}^* + \ubar{\m}^*
\end{equation*}
i.e. $\l_1^* = \l_2^*$. We have price equalisation, as if it were a single node.
\end{frame}
\begin{frame}{Two node: demand pagements versus generation revenue}
Now let's compare for our examples what each demand pays $\l_i^*d_i$ and what each generator receives as revenue $\l_i^*g_i^*$ from each market.
\ra{1.1}
\begin{table}[!t]
\begin{tabular}{rrrrrrrrr}
\toprule
Case & $\l_1^*$ & $\l_2^*$ & $\l_1^*d_1$ & $\l_2^*d_2$ & $\sum_i \l_i^*d_i$ & $\l_1^*g_1^*$ & $\l_2^*g_2^*$ & $\sum_i \l_i^*g_i^*$ \\
& [\euro/MWh] & [\euro/MWh] & [\euro/h] & [\euro/h] & [\euro/h] & [\euro/h] & [\euro/h] & [\euro/h] \\
\midrule
$F = 0$ & 10 & 20 & 1000 & 2000 & 3000 & 1000 & 2000 & 3000 \\
$F = 50$ & 10 & 20 & 1000 & 2000 & 3000 & 1500 & 1000 & 2500 \\
$F = \infty$ & 10 & 10 & 1000 & 1000 & 2000 & 2000 & 0 & 2000 \\
% $F = 50$ & 3000 & 2500 & 10 & 50 & 500
% $F = \infty$ & 2000 & 2000 & 0 & 100 & 0 \\
\bottomrule
\end{tabular}
\end{table}
NB: In the case with $F=50$, total demand payments are 3000~\euro/h, whereas the generators are only receiving 2500~\euro/h.
Where is the missing money (500~\euro/h) going?
Answer: to the network operator for service of doing arbitrage, buying low and selling high.
\end{frame}
\begin{frame}{Congestion rent}
Due to the congestion of the transmission line, the marginal cost of producing electricity can be different at node 1 and node 2. The competitive price at node 2 is higher than at node 1 -- this corresponds to \alert{locational marginal pricing}, or \alert{nodal pricing}.
Since consumers pay and generators get paid the price in their local market, in case of congestion there is a difference between the total payment of consumers and the total revenue of producers -- this is the \alert{merchandising surplus} or \alert{congestion rent}, collected by the network operator. For each line it is given by the price difference in both regions times the amount of power flow between them:
\begin{align*}
\text{Congestion rent =}\:\Delta \lambda\times f
\end{align*}
\end{frame}
\begin{frame}{Congestion rent: Two node example}
Returning to our two node example:
\ra{1.1}
\begin{table}[!t]
\begin{tabular}{rrrrrr}
\toprule
Case & Demand pays & Generator gets & $\l_2^* - \l_1^*$ & flow $f$ & Cong. rent \\
& [\euro/h] & [\euro/h] & [\euro/MWh] & [MW] & [\euro/h] \\
\midrule
$F = 0$ & 3000 & 3000 & 10 & 0 & 0 \\
$F = 50$ & 3000 & 2500 & 10 & 50 & 500 \\
$F = \infty$ & 2000 & 2000 & 0 & 100 & 0 \\
\bottomrule
\end{tabular}
\end{table}
To get a congestion rent, we need congestion to cause a price
difference between the nodes, as well as a non-zero flow between the
nodes.
\end{frame}
\begin{frame}[fragile]
\frametitle{Congestion rent}
In this example we saw that the sum of what consumers pay does not always equal the sum of generator revenue.
In fact if we take the balance constraint and sum it weighted by the market price at each node we find
\begin{align*}
\sum_i \l_i^* d_i - \sum_i \l_i^* \sum_{s} g^*_{i,s} = -\sum_i \l_i^* \sum_\ell K_{i\ell}f^*_\ell
\end{align*}
The quantity for each $\ell$
\begin{equation*}
-f_\ell^*\sum_i K_{i\ell} \l_i^* = f_\ell (\l_{\textrm{end}}^* - \l_{\textrm{start}}^*)
\end{equation*}
is called the \alert{congestion rent} and is the money the network
operator receives for transferring power from a low price node (start)
to a high price node (end), `buy it low, sell it high'.
It is zero if: a) the flow is zero or b) the price difference is zero.
\end{frame}
\section{The European Market}
\begin{frame}
\frametitle{Existing bidding zones}
\begin{columns}[T]
\begin{column}{5cm}
\includegraphics[width=5.8cm]{european_bidding_zones.png}
\end{column}
\begin{column}{8cm}
\begin{itemize}
\item Bids for German electricity take place in a \alert{giant bidding zone} encompassing both Germany and Luxembourg (Austria was separated from the German bidding zone in October 2018)
\item This means that transmission constraints are only visible to the market at the \alert{borders} to the other national zones
\item Internal transmission constraints are \alert{ignored} - market bids are handled as if they do not exist
\item Only KCL enforced on most borders - KVL much harder
\end{itemize}
\end{column}
\end{columns}
\end{frame}
\begin{frame}