solution04.tex 13.6 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
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
\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}
\usepackage{bbm}
\usepackage{mathtools}
% \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}

\begin{center}
	\textbf{\Large Energy System Modelling }\\
	{SS 2018, Karlsruhe Institute of Technology}\\
	{Institute of Automation and Applied Informatics}\\ [1em]
	\textbf{\textsc{\Large Tutorial IV: Electricity Markets}}\\
	\small Will be worked on in the exercise session on Tuesday, 17 July 2018.\\[1.5em]
\end{center}

\vspace{1em}

%=============== ======================================================
\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
\[
U(q) = 70q - 3q^2 [\textrm{\euro}/h] \quad , \quad q_{min}=2\leq q \leq q_{max}=10,
\]
where $q$ is the demand in MW and $q_{min}, q_{max}$ are the minimum and maximum demand. \\
[1em]
Assume that the company is maximising its net surplus for a given electricity price $\pi$, i.e. it maximises $\max_{q} \left[U(q) -
\pi q\right]$.
\begin{enumerate}[(a)]
	\begin{shaded} \item If the price is $\pi = 5$~\euro/MWh, what is the optimal
	demand $q^*$?  What is the value of the KKT multiplier $\mu_{max}$
	for the constraint $q \leq q_{max}=10$ at this optimal solution?
	What is the value of $\mu_{min}$ for $q \geq q_{min} = 2$?\end{shaded}
	We convert the exercise to an optimisation problem with objective
	\begin{equation}
	\max_q U(q) - \pi q
	\end{equation}
	with constraints
	\begin{align}
		q & \leq q_{max} \hspace{1cm}\leftrightarrow\hspace{1cm} \m_{max} \\
		-q & \leq -q_{min} \hspace{1cm}\leftrightarrow\hspace{1cm} \m_{min}
	\end{align}
	
	From stationarity we get:
	\begin{align}
	0 & =   \frac{\d}{\d q} \left(U(q) - \pi q\right) - \m_{max} \frac{\d}{\d q} (q-q_{max})- \m_{min} \frac{\d}{\d q} (-q+q_{min}) \\
	& =  U'(q) - \pi - \m_{max} + \m_{min} \label{eq:2stat}
	\end{align}
	
	The marginal utility curve is $U'(q) = 70 - 6q$ [\euro/MWh]. At
	$\pi = 5$, the demand would be determined by $5=70-6q$, i.e. $q =
	65/6 = 10.8333$, which is above the consumption limit
	$q_{max} = 10$. Therefore the optimal demand is $q^* = 10$, the upper limit is binding $\mu_{max}
	\geq 0$ and the lower limit is non-binding $\mu_{min} = 0$.
	
	To determine the value of $\mu_{max}$ we use \eqref{eq:2stat} to get
	$\m_{max} = U'(q^*) - \pi = U'(10) - 5 = 5$.
	
	\begin{shaded}
	\item Suppose now the electricity price is $\pi = 60$~\euro/MWh. What are
		the optimal demand $q^*$, $\mu_{max}$ and $\mu_{min}$ now?
	\end{shaded}

At $\pi = 60$, the demand would be determined by $60=70-6q$, i.e. $q = 10/6 = 1.667$, which is below the consumption limit $q_{min} = 2$. Therefore the optimal demand is $q^* = 2$, the upper limit is non-binding $\mu_{max}
= 0$ and the lower limit is binding $\mu_{min} \geq 0$.

To determine the value of $\mu_{min}$ we use \eqref{eq:2stat} to get
$\m_{min} =  \pi - U'(q^*) = 60 - U'(2) = 2$.
\end{enumerate}

%=============== ======================================================
\paragraph{Problem IV.2 \normalsize (Economic dispatch in a single bidding zone).}~\\
%=====================================================================

Consider an electricity market with two generator types, one with variable cost $c = 20\emwh$, capacity $K = 300\mw$ and a dispatch rate of $Q_1$~[MW] and another with variable cost $c=50\emwh$, capacity $K=400\mw$ and a dispatch rate of $Q_2$~[MW]. The demand has utility function $U(Q) = 8000Q - 5Q^2$~[\euro/h] for a consumption rate of $Q$~[MW].
\begin{enumerate}[(a)]
	\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}
	
	The optimisation problem has objective function:
	\begin{equation*}
	\max_{Q,Q_1,Q_2}\left[ U(Q) - C_1(Q_1) - C_2(Q_2) \right] =     \max_{Q,Q_1,Q_2} \left[8000Q-5Q^2 - c_2Q_1 - c_2Q_2 \right]
	\end{equation*}
	with constraints:
	\begin{align*}
	Q - Q_1 - Q_2 & = 0 \leftrightarrow \l \\
	Q_1 & \leq K_1 \leftrightarrow \bar{\m}_1 \\
	Q_2 & \leq K_2 \leftrightarrow \bar{\m}_2 \\
	-Q_1 & \leq 0 \leftrightarrow \ubar{\m}_1 \\
	-Q_2 & \leq 0 \leftrightarrow \ubar{\m}_2
	\end{align*}
	
	\begin{shaded}\item Write down the Karush-Kuhn-Tucker (KKT) conditions for this problem.\end{shaded}
	
	Stationarity gives for $Q$:
	\begin{equation*}
	\frac{\d U}{\d Q} - \l  = 8000 - 10Q - \l = 0
	\end{equation*}
	Stationarity for $Q_1$ gives:
	\begin{equation*}
	-\frac{\d C_1}{\d Q_1} + \l - \m_1  =  -c_1+ \l - \bar{\m}_1 + \ubar{\m_1} = 0
	\end{equation*}
	Stationarity for $Q_2$ gives:
	\begin{equation*}
	-\frac{\d C_2}{\d Q_2} + \l - \m_2  =  -c_2+ \l - \bar{\m}_2 + \ubar{\m_2} = 0
	\end{equation*}
	Primal feasibility is just the constraints above. Dual feasibility is $\bar{\m}_i,\ubar{\m}_i \geq 0$ and complementary slackness is $\bar{\m}_i(Q_i-K) = 0$ and $\ubar{\m}_i Q_i = 0$ for $i=1,2$.
	
	\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}
	The marginal utility at the full output of the generators, $K_1
	+ K_2 = $ 700~MW is $U'(700) = 8000 - 10\cdot700 = 1000$ \euro/MWh,
	which is higher than the costs $c_i$, so we'll find optimal rates
	$Q_1^* = K_1$ and $Q_2^* = K_2$ and $Q^* = K_1+K_2$. This means $\l
	= U'(K_1+K_2) = 1000$ \euro/MWh, which is the market price. Because
	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 =
	\l - c_i$, which is the increase in social welfare if Generator $i$
	could increase its capacity by a marginal amount.
\end{enumerate}

%%=============== ======================================================
%\paragraph{Problem II.3 \normalsize (Revenue, profit and consumer surplus).}~\\
%%=====================================================================
%
%Consider the example of bids and offers in an electricity market from
%slides 28 to 31 from Lecture 2 on 18.04.2016 (taken from the book
%Kirschen and Strbac pages 56-58).
%
%\begin{enumerate}[(a)]
%	\item Compute the revenue and profit of each generating company and the net
%	surplus of each consuming company.
%	\item If consumer company ``Orange'' withdraws its offers from the market, how do the market price and the profits/surpluses of generators and consumers change?
%\end{enumerate}

%=============== ======================================================
\paragraph{Problem IV.3 \normalsize (efficient dispatch in a two-bus power system).}~\\
%=====================================================================

\begin{figure}[h]
	\centering
	\includegraphics[width=14cm]{two-bus}
	\label{fig:two-bus}
	\caption{A simple two-bus power system.}
\end{figure}

Consider the two-bus power system shown in Figure \ref{fig:two-bus}, where the two nodes represent two markets, each with different total demand, and one generator at each node. 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:
\begin{align*}
MC_A & = 20 + 0.03 P_A \hspace{1cm}\eur/\si{\mega\watt\hour} \\
MC_B & = 15 + 0.02 P_B \hspace{1cm} \eur/\si{\mega\watt\hour}
\end{align*}

Assume that the demand $D_*$ is 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.

\begin{enumerate}[(a)]
	\begin{shaded}\item Calculate the price of electricity at each bus, the production
	of each generator, the flow on the line, and the value of any KKT
	multipliers for the following cases:\end{shaded}
	Use the following nomenclature: price $\lambda_i$, production $Q^{S}_i$, flow $F$.
	\begin{enumerate}[(i)]
		\begin{shaded}\item The line between buses A and B is disconnected.\end{shaded}
		 $\l_A= 80\emwh$, $\l_B=35\emwh$, 
		 
		 $Q_{A}^S=2000$ MW, $Q_B^S=1000$ MW, $F=0$
		 
		\begin{shaded}\item The line between buses A and B is in service and has an unlimited capacity.\end{shaded}
		$\l_A= 53\emwh$, $\l_B=53\emwh$, 
		
		$Q_{A}^S=1100\mw$, $Q_B^S=1900$ MW, $F=-900\mw$

		\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}
		$\l_A= 65\emwh$, $\l_B=65\emwh$, 
		
		$Q_{A}^S=1500\mw$, $Q_B^S=1500$ MW, $F=-500\mw$

		\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}
				$\l_A= 57\emwh$, $\l_B=57\emwh$, 
				
				$Q_{A}^S=900\mw$, $Q_B^S=2100$ MW, $F=-1100\mw$
		
		\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}
		$\l_A= 62\emwh$, $\l_B=47\emwh$, 
		
		$Q_{A}^S=1400\mw$, $Q_B^S=1600$ MW, $F=-600\mw$
	\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}
	Generator revenues $R_{i}$, generator costs $C_{i}$, generator profits $P_{i}$, consumer payments $E_{i}$. Find the generator profits by substracting the costs from the revenue. Costs are given by integrating the marginal cost, i.e. $C_A = 20Q + 0.015Q^2$ and $C_B = 15Q + 0.01Q^2$. The generator at $B$ and the consumers at $A$ benefit from the line (price increases at $B$, decreases at $B$).
	\begin{table}[!h]
		\centering
		\begin{tabular}{lccccc}
			\toprule
			Case & i & ii & iii & iv & v\\
			\midrule
			$E_A$ (\euro) & 160000 & 106000 & 130000 & 114000 & 124000 \\
			\midrule
			$E_B$ (\euro) & 35000 & 53000 & 65000 & 57000 & 47000\\
			\midrule
			$R_A$ (\euro) & 160000 & 58300 & 97500 & 51300 & 86800 \\
			\midrule
			$R_B$ (\euro) & 35000 & 100700 & 97500 & 119700 & 75200\\
			\midrule
			$C_A$ (\euro) & 100000 & 40150 & 63750 & 30150 & 57400 \\
			\midrule
			$C_B$ (\euro) & 25000 & 64600 & 45000 & 75600 & 49600\\
			\midrule
			$P_A$ (\euro) & 60000 & 18150 & 33750 & 21150 & 29400 \\
			\midrule
			$P_B$ (\euro) & 10000 & 36100 & 52500 & 44100 & 25600\\
			\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*}
	\left(E_A + E_B\right) - (R_A + R_B) = |F|\times (\l_A - \l_B)
	\end{equation*}
	Congestion surplus is equal to zero when the flow $F=0$, or when it is equal to the unconstrained value $F=-900\mw$ (then $\l_A = \l_B$).
\end{enumerate}

%=============== ======================================================
\paragraph{Problem IV.4 \normalsize (bidding in africa with pypsa).}~\\
%=====================================================================



\end{document}