solution04.tex 14.4 KB
Newer Older
sp2668's avatar
sp2668 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
\documentclass[11pt,a4paper,fleqn]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[colorlinks=true, citecolor=blue, linkcolor=blue, filecolor=blue,urlcolor=blue]{hyperref}
\hypersetup{
     colorlinks   = true,
     citecolor    = gray
}
\usepackage{wrapfig}

\usepackage{caption}
\captionsetup{format=plain, indent=5pt, font=footnotesize, labelfont=bf}

\setkomafont{disposition}{\scshape\bfseries}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
Fabian Neumann's avatar
Fabian Neumann committed
20
21
%\usepackage{bbm}
% \usepackage{mathtools}
sp2668's avatar
sp2668 committed
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
% \usepackage{epsfig}
% \usepackage{grffile}
%\usepackage{times}
%\usepackage{babel}
\usepackage{tikz}
\usepackage{paralist}
\usepackage{color}
\usepackage[top=3cm, bottom=2.5cm, left=2.5cm, right=3cm]{geometry}
%\setlength{\mathindent}{1ex}

% PGF
\usepackage{pgfplots}
\usepackage{pgf}
\usepackage{siunitx}
\usepackage{xfrac}
\usepackage{calculator}
\usepackage{calculus}
\usepackage{eurosym}
\usepackage{booktabs}
%\sisetup{per-mode=fraction,%
%	fraction-function=\sfrac}

%\newcommand{\eur}[1]{\EUR{#1}\si{\per\kilo\meter}}
\pgfplotsset{
  compat=newest,
  every axis/.append style={small, minor tick num=3}
}

%\usepackage[backend=biber,style=alphabetic,url=false,doi=false]{biblatex}
%\addbibresource{sheet01_biber.bib}
% \addbibresource{/home/coroa/papers/refs.bib}

\newcommand{\id}{\mathbbm{1}}
\newcommand{\NN}{{\mathbbm{N}}}
\newcommand{\ZZ}{{\mathbbm{Z}}}
\newcommand{\RR}{{\mathbbm{R}}}
\newcommand{\CC}{{\mathbbm{C}}}
\renewcommand{\vec}[1]{{\boldsymbol{#1}}}

\renewcommand{\i}{\mathrm{i}}

\newcommand{\expect}[1]{\langle\,#1\,\rangle}
\newcommand{\e}[1]{\ensuremath{\,\mathrm{#1}}}

\renewcommand{\O}{\mc{O}}
\newcommand{\veps}{\varepsilon}
\newcommand{\ud}[1]{\textup{d}#1\,}

\newcommand{\unclear}[1]{\color{green}#1}
\newcommand{\problem}[1]{\color{red}#1}
\newcommand{\rd}[1]{\num[round-mode=places,round-precision=1]{#1}}

%\DeclareSIUnit{\euro}{\EUR}
\DeclareSIUnit{\dollar}{\$}
\newcommand{\eur}{\text{\EUR{}}}

\usepackage{palatino}
\usepackage{mathpazo}
\setlength\parindent{0pt}
\usepackage{xcolor}
\usepackage{framed}
\definecolor{shadecolor}{rgb}{.9,.9,.9}

\def\cap{\text{Cap}}
\def\floor{\text{Floor}}
\def\l{\lambda}
\def\m{\mu}
\def\d{\partial}
\def\cL{\mathcal{L}}
\def\co2{CO${}_2$}

\def\mw{\text{ MW}}
\def\mwh{\text{ MWh}}
\def\gw{\text{ GW}}
\def\gwh{\text{ GWh}}
\def\emwh{\text{ \euro/MWh}}
\def\bemwh{\text{ [\euro/MWh]}}
\newcommand{\ubar}[1]{\text{\b{$#1$}}}

%=====================================================================
%=====================================================================
\begin{document}

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
\begin{flushright}
  \textbf{Energy System Modelling }\\
  {\small Karlsruhe Institute of Technology}\\
  {\small Institute for Automation and Applied Informatics}\\
  {\small Summer Term 2019}\\
 \end{flushright}
 
  
  \vspace{-0.5em}
  \hrulefill
  \vspace{0.3em}
 
 \begin{center}
  \textbf{\textsc{\Large Solutions IV: Electricity Markets}}\\
  \small Will be worked on in the exercise session on Friday, 14 June 2019.\\[1.5em]
 \end{center}
 

 \vspace{-0.5em}
 \hrulefill
 \vspace{0.8em}
 
sp2668's avatar
sp2668 committed
127
128
129
130
131
132
133

%=============== ======================================================
\paragraph{Solution IV.1 \normalsize (Shadow prices of limits on consumption).}~\\
%=====================================================================

Suppose that the utility for the electricity consumption of an industrial company is given by
\[
sp2668's avatar
sp2668 committed
134
U(d) = 70d - 3d^2 [\textrm{\euro}/\si{\mega\watt\hour}] \quad , \quad d_{min}=2\leq d \leq d_{max}=10,
sp2668's avatar
sp2668 committed
135
\]
136
where $d$ is the demand in MW and $d_{min}, d_{max}$ are the minimum and maximum demand. \\
sp2668's avatar
sp2668 committed
137
[1em]
138
139
Assume that the company is maximising its net surplus for a given electricity price $\pi$, i.e. it maximises $\max_{d} \left[U(d) -
\pi d\right]$.
sp2668's avatar
sp2668 committed
140
\begin{enumerate}[(a)]
sp2668's avatar
sp2668 committed
141
 \begin{shaded} \item If the price is $\pi = 5$~\euro/MWh, what is the optimal
142
143
144
  demand $d^*$?  What is the value of the KKT multiplier $\mu_{max}$
  for the constraint $d \leq d_{max}=10$ at this optimal solution?
  What is the value of $\mu_{min}$ for $d \geq d_{min} = 2$?\end{shaded}
sp2668's avatar
sp2668 committed
145
146
 We convert the exercise to an optimisation problem with objective
 \begin{equation}
147
  \max_d U(d) - \pi d
sp2668's avatar
sp2668 committed
148
149
150
 \end{equation}
 with constraints
 \begin{align}
151
152
  d  & \leq d_{max} \hspace{1cm}\leftrightarrow\hspace{1cm} \m_{max}  \\
  -d & \leq -d_{min} \hspace{1cm}\leftrightarrow\hspace{1cm} \m_{min}
sp2668's avatar
sp2668 committed
153
154
155
156
 \end{align}

 From stationarity we get:
 \begin{align}
157
158
  0 & =   \frac{\d}{\d d} \left(U(d) - \pi d\right) - \m_{max} \frac{\d}{\d d} (d-d_{max})- \m_{min} \frac{\d}{\d d} (-d+d_{min}) \\
    & =  U'(d) - \pi - \m_{max} + \m_{min} \label{eq:2stat}
sp2668's avatar
sp2668 committed
159
160
 \end{align}

161
162
 Note that it does not matter whether you pull in the constant of the right-hand side of the respective constraint.

163
 The marginal utility curve is $U'(d) = 70 - 6d$ [\euro/MWh]. At
164
 $\pi = 5$ and if the demand were unconstrained, the demand would be determined by $5=70-6d$, i.e. $d =
sp2668's avatar
sp2668 committed
165
  65/6 = 10.8333$, which is above the consumption limit
166
167
 $d_{max} = 10$. Therefore the optimal demand is $d^* = 10$, the upper limit is binding such that $\mu_{max}
  \geq 0$ and the lower limit is non-binding such that $\mu_{min} = 0$.
sp2668's avatar
sp2668 committed
168
169

 To determine the value of $\mu_{max}$ we use \eqref{eq:2stat} to get
170
 $\m_{max} = U'(d^*) - \pi + \mu_{min} = U'(10) - 5 + 0= 5$.
sp2668's avatar
sp2668 committed
171
172
173

 \begin{shaded}
  \item Suppose now the electricity price is $\pi = 60$~\euro/MWh. What are
174
  the optimal demand $d^*$, $\mu_{max}$ and $\mu_{min}$ now?
sp2668's avatar
sp2668 committed
175
176
 \end{shaded}

177
178
 At $\pi = 60$, the demand would be determined by $60=70-6d$, i.e. $d = 10/6 = 1.667$, which is below the consumption limit $d_{min} = 2$. Therefore the optimal demand is $d^* = 2$, the upper limit is non-binding such that $\mu_{max}
  = 0$ and the lower limit is binding such that $\mu_{min} \geq 0$.
sp2668's avatar
sp2668 committed
179
180

 To determine the value of $\mu_{min}$ we use \eqref{eq:2stat} to get
181
 $\m_{min} =  \pi - U'(d^*) + \mu_{max} = 60 - U'(2) + 0 = 2$.
sp2668's avatar
sp2668 committed
182
183
184
\end{enumerate}

%=============== ======================================================
sp2668's avatar
sp2668 committed
185
\paragraph{Solution IV.2 \normalsize (Economic dispatch in a single bidding zone).}~\\
sp2668's avatar
sp2668 committed
186
187
%=====================================================================

188
Consider an electricity market with two generator types, one with the cost function $C_1(g_1)=c_1g_1$ with variable cost $c_1 = 20\emwh$, capacity $G_1 = 300\mw$ and a dispatch rate of $g_1$~[MW], and another with the cost function $C_2(g_2)=c_2g_2$ with variable cost $c_2=50\emwh$, capacity $G_2=400\mw$ and a dispatch rate of $g_2$~[MW]. The demand has utility function $U(d) = 8000d - 5d^2$~[\euro/h] for a consumption rate of $d$~[MW].
sp2668's avatar
sp2668 committed
189
\begin{enumerate}[(a)]
sp2668's avatar
sp2668 committed
190
191
 \begin{shaded}\item What are the objective function and constraints required for an optimisation problem to maximise short-run social welfare in this market?\end{shaded}

192
 The optimisation problem has the objective function:
sp2668's avatar
sp2668 committed
193
 \begin{equation*}
194
  \max_{d,g_1,g_2}\left[ U(d) - C_1(g_1) - C_2(g_2) \right] =     \max_{d,g_1,g_2} \left[8000d-5d^2 - c_1g_1 - c_2g_2 \right]
sp2668's avatar
sp2668 committed
195
196
197
 \end{equation*}
 with constraints:
 \begin{align*}
198
199
200
201
202
  d - g_1 - g_2 & = 0 \leftrightarrow \l              \\
  g_1           & \leq G_1 \leftrightarrow \bar{\m}_1 \\
  g_2           & \leq G_2 \leftrightarrow \bar{\m}_2 \\
  -g_1          & \leq 0 \leftrightarrow \ubar{\m}_1  \\
  -g_2          & \leq 0 \leftrightarrow \ubar{\m}_2
sp2668's avatar
sp2668 committed
203
204
205
206
 \end{align*}

 \begin{shaded}\item Write down the Karush-Kuhn-Tucker (KKT) conditions for this problem.\end{shaded}

207
 Stationarity gives for $d$:
sp2668's avatar
sp2668 committed
208
 \begin{equation*}
209
  \frac{\d U}{\d d} - \l  = 8000 - 10d - \l = 0
sp2668's avatar
sp2668 committed
210
 \end{equation*}
211
 Stationarity for $g_1$ gives:
sp2668's avatar
sp2668 committed
212
 \begin{equation*}
213
  -\frac{\d C_1}{\d g_1} + \l - \m_1  =  -c_1+ \l - \bar{\m}_1 + \ubar{\m_1} = 0
sp2668's avatar
sp2668 committed
214
 \end{equation*}
215
 Stationarity for $g_2$ gives:
sp2668's avatar
sp2668 committed
216
 \begin{equation*}
217
  -\frac{\d C_2}{\d g_2} + \l - \m_2  =  -c_2+ \l - \bar{\m}_2 + \ubar{\m_2} = 0
sp2668's avatar
sp2668 committed
218
 \end{equation*}
219
 Primal feasibility is just the generator limits above in (a). Dual feasibility is $\bar{\m}_i,\ubar{\m}_i \geq 0$ and complementary slackness is $\bar{\m}_i(G_i-K) = 0$ and $\ubar{\m}_i G_i = 0$ for $i=1,2$.
sp2668's avatar
sp2668 committed
220
221

 \begin{shaded}\item Determine the optimal rate of production of the generators and the value of all KKT multipliers. What is the interpretation of the respective KKT multipliers?\end{shaded}
222
223
 The marginal utility at the full output of the generators, $G_1
  + G_2 = $ 700~MW is $U'(700) = 8000 - 10\cdot700 = 1000$ \euro/MWh,
sp2668's avatar
sp2668 committed
224
 which is higher than the costs $c_i$, so we'll find optimal rates
225
226
 $g_1^* = G_1$ and $g_2^* = G_2$ and $d^* = G_1+G_2$. This means $\l
  = U'(G_1+G_2) = 1000$ \euro/MWh, which is the market price. Because
sp2668's avatar
sp2668 committed
227
228
229
230
 the lower constraints on the generator output are not binding, from
 complementary slackness we have $\ubar{\m}_i = 0$. The upper
 constraints are binding, so $\bar{\m}_i \geq 0$.
 From stationarity $\bar{\m}_i =
231
  \l - c_i + \ubar{\m}_i$, which is the increase in social welfare if Generator $i$
sp2668's avatar
sp2668 committed
232
 could increase its capacity by a marginal amount.
233
234
235
236

 $$\bar{\m}_1=1000-20=980 \text{\euro/MWh}$$
 $$\bar{\m}_2=1000-50=950 \text{\euro/MWh}$$

sp2668's avatar
sp2668 committed
237
238
239
\end{enumerate}

%=============== ======================================================
sp2668's avatar
sp2668 committed
240
\paragraph{Solution IV.3 \normalsize (efficient dispatch in a two-bus power system).}~\\
sp2668's avatar
sp2668 committed
241
242
243
%=====================================================================

\begin{figure}[h]
sp2668's avatar
sp2668 committed
244
245
246
247
 \centering
 \includegraphics[width=14cm]{two-bus}
 \caption{A simple two-bus power system.}
 \label{twobus}
sp2668's avatar
sp2668 committed
248
249
\end{figure}

250
Consider the two-bus power system shown in Figure \ref{twobus}, where the two nodes represent two markets, each with different total demand $D_i$, and one generator at each node producing $G_i$. At node A the demand is $D_A = 2000 \si{\mega\watt}$, whereas at node B the demand is $D_B = 1000 \si{\mega\watt}$. Furthermore, there is a transmission line with a capacity denoted by $F_{AB}$. The marginal cost of production of the generators connected to buses A and B are given respectively by the following expressions:
sp2668's avatar
sp2668 committed
251
\begin{align*}
252
253
 MC_A & = 20 + 0.02 P_A \hspace{1cm}\eur/\si{\mega\watt\hour}  \\
 MC_B & = 15 + 0.03 P_B \hspace{1cm} \eur/\si{\mega\watt\hour}
sp2668's avatar
sp2668 committed
254
255
\end{align*}

sp2668's avatar
sp2668 committed
256
Assume that the demands $D_A$ and $D_B$ are constant and insensitive to price, that energy is sold at its marginal cost of production and that there are no limits on the output of the generators.
sp2668's avatar
sp2668 committed
257
258

\begin{enumerate}[(a)]
sp2668's avatar
sp2668 committed
259
 \begin{shaded}\item Calculate the price of electricity at each bus, the production
260
261
262
263
  of each generator, and the flow on the line for the following cases. You may also calculate the values of any KKT multiplier as a bonus.\end{shaded}

The price of electricity is the value of the dual variable at the nodal balance equation.

sp2668's avatar
sp2668 committed
264
 Use the following nomenclature: price $\lambda_{A/B}$, generation $G_{A/B}$, flow $F_{AB}$.
sp2668's avatar
sp2668 committed
265
266
 \begin{enumerate}[(i)]
  \begin{shaded}\item The line between buses A and B is disconnected.\end{shaded}
267
268
269

  Where to start: $P_A=D_A$ and $P_B=D_B$ and substitute into $MC_i$.

sp2668's avatar
sp2668 committed
270
271
  $\l_A= 80\emwh$, $\l_B=35\emwh$,

272
  $G_{A}=2000$ MW, $P_B=1000$ MW, $F_{AB}=0$
sp2668's avatar
sp2668 committed
273
274

  \begin{shaded}\item The line between buses A and B is in service and has an unlimited capacity.\end{shaded}
275
276
277
278
  
  Where to start:
  No restriction in transmission, so prices must be the same for the two nodes: $\l_A = \l_B$, therefore, $MC_A = MC_B$.
  Also: $P_A+P_B = D_A+D_B$.
sp2668's avatar
sp2668 committed
279

280
281
282
    $\l_A= 53\emwh$, $\l_B=53\emwh$,

  $G_{A}=1100\mw$, $P_B=1900$ MW, $F_{AB}=-900\mw$
sp2668's avatar
sp2668 committed
283
284

  \begin{shaded}\item The line between buses A and B is in service and has an unlimited capacity, but the maximum output of Generator B is 1500~MW.\end{shaded}
285
286
287
288
289
  
  Where to start:
  $P_B=1500$ MW since it is now constrained but would have been higher in the unconstrained case (ii). 
  Also, since there are no transmission constraints: $\l_A = \l_B$.
  Also: $P_A+P_B = D_A+D_B$.
sp2668's avatar
sp2668 committed
290

291
292
293
    $\l_A= 65\emwh$, $\l_B=65\emwh$,

  $G_{A}=1500\mw$, $P_B=1500$ MW, $F_{AB}=-500\mw$
sp2668's avatar
sp2668 committed
294
295

  \begin{shaded}\item The   line between buses A and B is in service and has an unlimited capacity, but the maximum output of Generator A is 900~MW. The output of Generator B is unlimited.\end{shaded}
296
297
298
299
300
301
302
  
  Where to start: 
  $P_A=900$ MW since it is now constrained but would have been higher in the unconstrained case (ii). 
  Also, since there are no transmission constraints: $\l_A = \l_B$.
  Also: $P_A+P_B = D_A+D_B$.

    $\l_A= 57\emwh$, $\l_B=57\emwh$,
sp2668's avatar
sp2668 committed
303

304
  $G_{A}=900\mw$, $P_B=2100$ MW, $F_{AB}=-1100\mw$
sp2668's avatar
sp2668 committed
305
306

  \begin{shaded}\item The line between buses A and B is in service but its capacity is limited to 600~MW. The output of the generators is unlimited.\end{shaded}
307
308
309
310
311
312
  
    Where to start:
    $F_{AB} = - 600$ MW since we would want even more transmission, if it were not constrained.
    Also, $P_A+F_{AB}=2000$ MW.

    $\l_A= 62\emwh$, $\l_B=47\emwh$,
sp2668's avatar
sp2668 committed
313

314
  $G_{A}=1400\mw$, $P_B=1600$ MW, $F_{AB}=-600\mw$
sp2668's avatar
sp2668 committed
315
316
 \end{enumerate}
 \begin{shaded}\item Calculate the generator revenues, generator profits, consumer payments and consumer net surplus for all the cases considered in the above problem. Who benefits from the line connecting these two buses?\end{shaded}
317
 Generator revenues $R_{i}$, generator costs $C_{i}$, generator profits $P_{i}$, consumer payments $E_{i}$. Find the generator profits by subtracting the costs from the revenue. Costs are given by integrating the marginal cost, i.e. $C_A = 20P_A + 0.015P_A^2$ and $C_B = 15P_B + 0.01P_B^2$. The generator at $B$ and the consumers at $A$ benefit from the line (price increases at $B$, decreases at $B$).
sp2668's avatar
sp2668 committed
318
319
 \begin{table}[!h]
  \centering
sp2668's avatar
sp2668 committed
320
  \begin{tabular}{lrrrrr}
sp2668's avatar
sp2668 committed
321
   \toprule
sp2668's avatar
sp2668 committed
322
   Case          & (i)      & (ii)     & (iii)    & (iv)     & (v)      \\
sp2668's avatar
sp2668 committed
323
   \midrule
sp2668's avatar
sp2668 committed
324
325
326
327
   $E_A$ (\euro) & 160,000 & 106,000 & 130,000 & 114,000 & 124,000 \\
   $R_A$ (\euro) & 160,000 & 58,300  & 97,500  & 51,300  & 86,800  \\
   $C_A$ (\euro) & 100,000 & 40,150  & 63,750  & 30,150  & 57,400  \\
   $P_A$ (\euro) & 60,000  & 18,150  & 33,750  & 21,150  & 29,400  \\
sp2668's avatar
sp2668 committed
328
   \midrule
sp2668's avatar
sp2668 committed
329
330
331
332
   $E_B$ (\euro) & 35,000  & 53,000  & 65,000  & 57,000  & 47,000  \\
   $R_B$ (\euro) & 35,000  & 100,700 & 97,500  & 119,700 & 75,200  \\
   $C_B$ (\euro) & 25,000  & 64,600  & 45,000  & 75,600  & 49,600  \\
   $P_B$ (\euro) & 10,000  & 36,100  & 52,500  & 44,100  & 25,600  \\
sp2668's avatar
sp2668 committed
333
334
335
336
337
338
339
   \bottomrule
  \end{tabular}
 \end{table}

 \begin{shaded}\item Calculate the congestion surplus for case (v). For what values of the flow on the line between buses A and B is the congestion surplus equal to zero?\end{shaded}
 Congestion surplus is 9000 \euro:
 \begin{equation*}
sp2668's avatar
sp2668 committed
340
  \left(E_A + E_B\right) - (R_A + R_B) = |F_{AB}|\times (\l_A - \l_B)
sp2668's avatar
sp2668 committed
341
 \end{equation*}
sp2668's avatar
sp2668 committed
342
 Congestion surplus is equal to zero when the flow $F_{AB}=0$, or when it is equal to the unconstrained value $F_{AB}=-900\mw$ (then $\l_A = \l_B$).
sp2668's avatar
sp2668 committed
343
344
345
346
\end{enumerate}


\end{document}