Commit 379abd90 by Fabian Neumann

### update sheets

parent b9ddcf9e
No preview for this file type
 ... ... @@ -67,18 +67,29 @@ %===================================================================== \begin{document} \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{\Large Energy System Modelling }\\ {SS 2018, Karlsruhe Institute of Technology}\\ {Institute for Automation and Applied Informatics}\\ [1em] \textbf{\textsc{\Large Tutorial I: Time Series Analysis}}\\ \small Will be worked on in the exercise session on Wednesday, 11 July 2018.\$1.5em] \small Will be worked on in the exercise session on Thursday, 6 June 2019.\\[1.5em] \end{center} \vspace{1em} \vspace{-0.8em} \hrulefill \vspace{0.8em} %=============== ====================================================== \paragraph{Problem I.1 \normalsize (data analysis).}~\\ \paragraph{Problem I.1 (programming) -- Data Analysis}~\\ %===================================================================== The following data are made available to you on the course home ... ... @@ -94,16 +105,17 @@ They describe (quasi-real) time series for wind power generation $$W(t)$$, solar \item For all three regions, plot the time series $$W(t)$$, $$S(t)$$, $$L(t)$$ for a winter month (January) and a summer month (July). \item Resample the time series to daily, weekly and monthly data points and visualise them in plots. Can you identify some recurring patterns? \item For all three regions, plot the duration curve for $$W(t)$$, $$S(t)$$, $$L(t)$$. \item For all three regions, plot the probability density function of $$W(t)$$, $$S(t)$$, $$L(t)$$. \item Apply a (Fast) Fourier Transform to the the three time series X \in W(t), S(t), L(t): \item Recurring patterns of time series can also be visualised more rigorously by applying a Fourier Transform. Apply a (Fast) Fourier Transform to the the three time series X \in W(t), S(t), L(t): \begin{equation*} \tilde{X}(\omega) = \int_0^T X(t) e^{\i \omega t} \,\ud t \, . \end{equation*} For all three regions, plot the energy spectrum \left| \tilde{X}(\omega) \right|^2 as a function of \omega. Discuss the relationship of these results with the findings obtained in (b)-(e). findings obtained in (b)-(f). \item Normalize the time series to one, so that $$\expect{W} = \expect{S} = \expect{L} = 1$$. Now, for all three regions, plot the mismatch time series \begin{equation*} ... ... @@ -112,12 +124,15 @@ They describe (quasi-real) time series for wind power generation $$W(t)$$, solar for the same winter and summer months as in (c). Choose $$\alpha \in \{0.0, 0.5, 0.75, 1.0\}$$ with $$\gamma = 1$$, and \gamma \in \{0.5, 0.75, 1.0, 1.25, 1.5\}  with \alpha = 0.75. \item For all three regions, repeat (b)-(f) for the mismatch time series. Which configuration entails the lowest mismatch on average and in extremes? \item For all three regions, repeat (b)-(g) for the mismatch time series. \end{enumerate} \pagebreak %===================================================================== \paragraph{Problem I.2 \normalsize (analytical).}~\\ \paragraph{Problem I.2 (analytical) -- Effect of Seasonality}~\\ %===================================================================== \begin{wrapfigure}[11]{r}{0pt} ... ... @@ -181,10 +196,12 @@ The time series are normalized to \pagebreak %=============== ====================================================== \paragraph{Remarks (Python pointers or where to start).}~\\ \paragraph{Remarks -- Introductions to Python}~\\ %===================================================================== I found the python notebook based notes of Robert Johansson to be a In the tutorials we will repeatedly work with the programming language Python. If you are unfamiliar with the language, you might find the following tutorials useful.\\ The Python notebook based notes of Robert Johansson are a comprehensive kick starter\footnote{\url{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/tree/master/}}. \begin{itemize} \item ... ... @@ -195,14 +212,9 @@ comprehensive kick starter\footnote{\url{http://nbviewer.jupyter.org/github/jrjo brush over it and stop reading early, i.e. if you read the word \verb+classes+ you already know too much). \item \href{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-2-Numpy.ipynb}{Lecture~2} is the most important and closely connected to the exercises. \item You might as well stop now, but if you \emph{are} hooked, I recommend \href{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-3-Scipy.ipynb}{Lecture~3} for more physics and \href{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb}{Lecture~4} for prettier graphs. \end{itemize} Further reference material of help is: \begin{itemize} \item The website-books \url{http://python-course.eu/} (english), \url{http://python-kurs.eu/} (german); especially if you only \emph{very} quickly skim over the \href{https://www.python-course.eu/python3_course.php}{python3 tutorial} and switch over to the \href{http://www.python-course.eu/numerical_programming.php}{numerical python} stuff early; especially of interest might be the \href{http://www.python-course.eu/pandas.php}{pandas} bit in the end, which will make the exercises a breeze at the expense of yet another package to learn. \item the exhaustive (overly so) official python tutorial\footnote{\url{https://docs.python.org/3.6/tutorial/}} available in \href{https://docs.python.org/3.6/tutorial/}{english} and \href{https://py-tutorial-de.readthedocs.org/}{german}; which will NOT introduce you to numpy or scipy. \item You might as well stop now, but if you \emph{are} hooked, have a look at \href{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-3-Scipy.ipynb}{Lecture~3} for more physics and \href{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb}{Lecture~4} for prettier graphs. \end{itemize} Further reference material of help is are the website-books \url{http://python-course.eu/} (english), \url{http://python-kurs.eu/} (german); especially of interest might be the \href{http://www.python-course.eu/pandas.php}{pandas} bit in the end, which will make the exercises a breeze at the expense of yet another package to learn. \end{document} This diff is collapsed. This source diff could not be displayed because it is too large. You can view the blob instead.  ... ... @@ -20,13 +20,14 @@ }, { "cell_type": "code", "execution_count": 10, "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "plt.style.use('bmh')\n", "%matplotlib inline" ] }, ... ... @@ -334,7 +335,7 @@ }, { "cell_type": "code", "execution_count": 18, "execution_count": 2, "metadata": {}, "outputs": [], "source": [ ... ... @@ -345,7 +346,7 @@ }, { "cell_type": "code", "execution_count": 54, "execution_count": 3, "metadata": {}, "outputs": [], "source": [ ... ... @@ -363,10 +364,94 @@ }, { "cell_type": "code", "execution_count": null, "execution_count": 4, "metadata": {}, "outputs": [], "source": [] "outputs": [ { "data": { "text/html": [ " \n", "\n", "\n", " windsolarload time \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " 2011-01-01 00:00:000.5351440.046209.0 2011-01-01 01:00:000.5804560.044236.0 2011-01-01 02:00:000.6036050.042502.0 2011-01-01 03:00:000.6141140.041479.0 2011-01-01 04:00:000.6272570.039923.0 \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "" ], "text/plain": [ " wind solar load\n", "time \n", "2011-01-01 00:00:00 0.535144 0.0 46209.0\n", "2011-01-01 01:00:00 0.580456 0.0 44236.0\n", "2011-01-01 02:00:00 0.603605 0.0 42502.0\n", "2011-01-01 03:00:00 0.614114 0.0 41479.0\n", "2011-01-01 04:00:00 0.627257 0.0 39923.0" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "de.head()" ] }, { "cell_type": "markdown", ... ... @@ -377,10 +462,23 @@ }, { "cell_type": "code", "execution_count": null, "execution_count": 7, "metadata": {}, "outputs": [], "source": [] "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(wind['DE'] == de['wind']).all()" ] }, { "cell_type": "markdown", ... ... @@ -393,10 +491,26 @@ }, { "cell_type": "code", "execution_count": null, "execution_count": 8, "metadata": {}, "outputs": [], "source": [] "outputs": [ { "data": { "text/plain": [ "DE 0.994588\n", "GB 0.999998\n", "EU 0.719222\n", "dtype: float64" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "wind.max()" ] }, { "cell_type": "markdown", ... ... @@ -497,9 +611,7 @@ }, { "cell_type": "markdown", "metadata": { "scrolled": true }, "metadata": {}, "source": [ "Now, let's look at the solar data:" ] ... ... @@ -529,9 +641,7 @@ }, { "cell_type": "markdown", "metadata": { "scrolled": true }, "metadata": {}, "source": [ "Finally, let's look at the load profile:" ] ... ... @@ -611,9 +721,7 @@ }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "metadata": {}, "source": [ "Normalize the time series and calculate mismatch time series:" ] ... ... @@ -641,9 +749,7 @@ }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "metadata": {}, "source": [ "***\n", "**(h) For all three regions, repeat (b)-(f) for the mismatch time series. What changed?**" ... ... @@ -781,5 +887,5 @@ } }, "nbformat": 4, "nbformat_minor": 1 "nbformat_minor": 2 } No preview for this file type  ... ... @@ -70,19 +70,29 @@ %===================================================================== \begin{document} \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{\Large Energy System Modelling }\\ {SS 2018, Karlsruhe Institute of Technology}\\ {Institute for Automation and Applied Informatics}\\ [1em] \textbf{\textsc{\Large Tutorial II: Network Theory and Power Flow}}\\ \small Will be worked on in the exercise session on Friday, 13 July 2018.\\[1.5em] \small Will be worked on in the exercise session on Friday, 7 June 2019.\\[1.5em] \end{center} \vspace{1em} \vspace{-0.5em} \hrulefill \vspace{0.8em} %===================================================================== \paragraph{Problem II.1 \normalsize (network theory basics).}~\\ \paragraph{Problem II.1 (programming) -- network theory basics}~\\ %===================================================================== \begin{wrapfigure}[10]{r}{0pt} ... ... @@ -119,7 +129,7 @@ Consider the simple network shown ins Figure \ref{fig:network}. Calculate in Pyt \pagebreak %===================================================================== \paragraph{Problem II.2 \normalsize (linear power flow).}~\\ \paragraph{Problem II.2 (programming) -- linear power flow}~\\ %===================================================================== ... ...  ... ... @@ -24,7 +24,7 @@ }, { "cell_type": "code", "execution_count": 15, "execution_count": 1, "metadata": { "slideshow": { "slide_type": "skip" ... ... @@ -36,6 +36,7 @@ "import numpy.linalg\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "plt.style.use('bmh')\n", "%matplotlib inline" ] }, ... ... @@ -66,7 +67,7 @@ }, { "cell_type": "code", "execution_count": 16, "execution_count": 2, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -94,7 +95,7 @@ }, { "cell_type": "code", "execution_count": 17, "execution_count": 3, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -108,7 +109,7 @@ }, { "cell_type": "code", "execution_count": 18, "execution_count": 4, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -143,7 +144,7 @@ }, { "cell_type": "code", "execution_count": 19, "execution_count": 5, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -161,7 +162,7 @@ " [ 0., 1., 0., 0., 1., 0.]])" ] }, "execution_count": 19, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ... ... @@ -178,7 +179,7 @@ }, { "cell_type": "code", "execution_count": 20, "execution_count": 6, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -191,7 +192,7 @@ "True" ] }, "execution_count": 20, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ... ... @@ -215,7 +216,7 @@ }, { "cell_type": "code", "execution_count": 21, "execution_count": 7, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -228,7 +229,7 @@ "array([ 1., 4., 3., 2., 4., 2.])" ] }, "execution_count": 21, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ... ... @@ -240,7 +241,7 @@ }, { "cell_type": "code", "execution_count": 22, "execution_count": 8, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -253,7 +254,7 @@ "2.6666666666666665" ] }, "execution_count": 22, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ... ... @@ -277,7 +278,7 @@ }, { "cell_type": "code", "execution_count": 23, "execution_count": 9, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -295,7 +296,7 @@ " [ 0., 0., 0., -1., 0., 0., 0., -1.]])" ] }, "execution_count": 23, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ... ... @@ -325,7 +326,7 @@ }, { "cell_type": "code", "execution_count": 24, "execution_count": 10, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -338,7 +339,7 @@ }, { "cell_type": "code", "execution_count": 25, "execution_count": 11, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -356,7 +357,7 @@ " [ 0., -1., 0., 0., -1., 2.]])" ] }, "execution_count": 25, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ... ... @@ -368,7 +369,7 @@ }, { "cell_type": "code", "execution_count": 26, "execution_count": 12, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -381,7 +382,7 @@ "True" ] }, "execution_count": 26, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ... ... @@ -455,7 +456,7 @@ }, { "cell_type": "code", "execution_count": 27, "execution_count": 13, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -560,7 +561,7 @@ "2017-01-01 04:00:00 -526.15 5695.72 -3924.43 -646.2 -3393.12 2794.18" ] }, "execution_count": 27, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ... ... @@ -610,7 +611,7 @@ }, { "cell_type": "code", "execution_count": 28, "execution_count": 14, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -623,7 +624,7 @@ "array([ 3486.25, -3403.37, -97.5 , -2867.33, 2961.68])" ] }, "execution_count": 28, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ... ... @@ -634,7 +635,7 @@ }, { "cell_type": "code", "execution_count": 29, "execution_count": 15, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -648,7 +649,7 @@ " -1590.03761905, 725.68619048])" ] }, "execution_count": 29, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ... ... @@ -671,7 +672,7 @@ }, { "cell_type": "code", "execution_count": 30, "execution_count": 16, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -685,7 +686,7 @@ " -307.72047619, -712.94095238, -405.22047619, -2315.72380952])" ] }, "execution_count": 30, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ... ... @@ -709,7 +710,7 @@ }, { "cell_type": "code", "execution_count": 31, "execution_count": 17, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -722,7 +723,7 @@ }, { "cell_type": "code", "execution_count": 32, "execution_count": 18, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -735,7 +736,7 @@ "(8, 744)" ] }, "execution_count": 32, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ... ... @@ -746,7 +747,7 @@ }, { "cell_type": "code", "execution_count": 33, "execution_count": 19, "metadata": { "slideshow": { "slide_type": "fragment" ... ... @@ -760,7 +761,7 @@ " 421.1171115 , -277.47351895, -698.59063044, -1698.48293331])" ] }, "execution_count": 33, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ... ... No preview for this file type This diff is collapsed. No preview for this file type  ... ... @@ -101,23 +101,34 @@ %===================================================================== \begin{document} \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{\Large Energy System Modelling }\\ {SS 2018, Karlsruhe Institute of Technology}\\ {Institute for 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] \small Will be worked on in the exercise session on Friday, 14 June 2019.\\[1.5em] \end{center} \vspace{1em} \vspace{-0.5em} \hrulefill \vspace{0.8em} %=============== ====================================================== \paragraph{Problem IV.1 \normalsize (Shadow prices of limits on consumption).}~\\ \paragraph{Problem IV.1 (analytical) -- shadow prices}~\\ %===================================================================== Suppose that the utility for the electricity consumption of an industrial company is given by \[ U(d) = 70d - 3d^2 ~[\textrm{\euro}/\si{\mega\watt\hour}] \quad , \quad d_{min}=2\leq d \leq d_{max}=10, U(d) = 70d - 3d^2 ~[\textrm{\euro}/\si{\mega\watt\hour}] \quad , \quad d\in [d_{min},d_{max}]=[2,10],$ where $d$ is the demand in MW and $d_{min}, d_{max}$ are the minimum and maximum demand. \\ [1em] ... ... @@ -133,10 +144,10 @@ Assume that the company is maximising its net surplus for a given electricity pr \end{enumerate} %=============== ====================================================== \paragraph{Problem IV.2 \normalsize (Economic dispatch in a single bidding zone).}~\\ \paragraph{Problem IV.2 (analytical) -- Economic dispatch in a single bidding zone}~\\ %===================================================================== 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 $K_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 $K_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]. 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-side has utility function $U(d) = 8000d - 5d^2$~[\euro/h] for a consumption rate of $d$~[MW]. \begin{enumerate}[(a)] \item What are the objective function and constraints required for an optimisation problem to maximise short-run social welfare in this market? \item Write down the Karush-Kuhn-Tucker (KKT) conditions for this problem. ... ... @@ -145,7 +156,7 @@ Consider an electricity market with two generator types, one with the cost funct \newpage %=============== ====================================================== \paragraph{Problem IV.3 \normalsize (efficient dispatch in a two-bus power system).}~\\ \paragraph{Problem IV.3 (analytical) -- efficient dispatch in a two-bus power system}~\\ %===================================================================== \begin{figure}[h] ... ... @@ -158,8 +169,8 @@ Consider an electricity market with two generator types, one with the cost funct Consider the two-bus power system shown in Figure \ref{test}, 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.02 G_A \hspace{1cm}\eur/\si{\mega\watt\hour} \\ MC_B & = 15 + 0.03 G_B \hspace{1cm} \eur/\si{\mega\watt\hour} MC_A & = 20 + 0.03 G_A \hspace{1cm}\eur/\si{\mega\watt\hour} \\ MC_B & = 15 + 0.02 G_B \hspace{1cm} \eur/\si{\mega\watt\hour} \end{align*} 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. ... ... @@ -179,10 +190,4 @@ Assume that the demands $D_A$ and $D_B$ are constant and insensitive to price, t \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{enumerate} %=============== ====================================================== % d\paragraph{Problem IV.4 \normalsize (bidding in africa with pypsa).}~\\ %===================================================================== \end{document}
 ... ... @@ -17,8 +17,8 @@ \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{bbm} \usepackage{mathtools} %\usepackage{bbm} % \usepackage{mathtools} % \usepackage{epsfig}