Commit 379abd90 authored by Fabian Neumann's avatar Fabian Neumann

update sheets

parent b9ddcf9e
No preview for this file type
...@@ -67,18 +67,29 @@ ...@@ -67,18 +67,29 @@
%===================================================================== %=====================================================================
\begin{document} \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} \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}}\\ \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} \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 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 ...@@ -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)\), \item For all three regions, plot the time series \(W(t)\),
\(S(t)\), \(S(t)\),
\(L(t)\) for a winter month (January) and a summer month (July). \(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 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 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*} \begin{equation*}
\tilde{X}(\omega) = \int_0^T X(t) e^{\i \omega t} \,\ud t \, . \tilde{X}(\omega) = \int_0^T X(t) e^{\i \omega t} \,\ud t \, .
\end{equation*} \end{equation*}
For all three regions, plot the energy spectrum For all three regions, plot the energy spectrum
$\left| \tilde{X}(\omega) \right|^2$ as a function of $\left| \tilde{X}(\omega) \right|^2$ as a function of
$\omega$. Discuss the relationship of these results with the $\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\). \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 Now, for all three regions, plot the mismatch time series
\begin{equation*} \begin{equation*}
...@@ -112,12 +124,15 @@ They describe (quasi-real) time series for wind power generation \(W(t)\), solar ...@@ -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 for the same winter and summer months as in (c). Choose
\(\alpha \in \{0.0, 0.5, 0.75, 1.0\}\) with \(\gamma = 1\), \(\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$. 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} \end{enumerate}
\pagebreak \pagebreak
%===================================================================== %=====================================================================
\paragraph{Problem I.2 \normalsize (analytical).}~\\ \paragraph{Problem I.2 (analytical) -- Effect of Seasonality}~\\
%===================================================================== %=====================================================================
\begin{wrapfigure}[11]{r}{0pt} \begin{wrapfigure}[11]{r}{0pt}
...@@ -181,10 +196,12 @@ The time series are normalized to ...@@ -181,10 +196,12 @@ The time series are normalized to
\pagebreak \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/}}. comprehensive kick starter\footnote{\url{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/tree/master/}}.
\begin{itemize} \begin{itemize}
\item \item
...@@ -195,14 +212,9 @@ comprehensive kick starter\footnote{\url{http://nbviewer.jupyter.org/github/jrjo ...@@ -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 brush over it and stop reading early, i.e. if you read the word
\verb+classes+ you already know too much). \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 \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. \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:
\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.
\end{itemize} \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} \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 @@ ...@@ -20,13 +20,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 1,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"import numpy as np\n", "import numpy as np\n",
"import pandas as pd\n", "import pandas as pd\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"plt.style.use('bmh')\n",
"%matplotlib inline" "%matplotlib inline"
] ]
}, },
...@@ -334,7 +335,7 @@ ...@@ -334,7 +335,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 18, "execution_count": 2,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -345,7 +346,7 @@ ...@@ -345,7 +346,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 54, "execution_count": 3,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -363,10 +364,94 @@ ...@@ -363,10 +364,94 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
"source": [] {
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>wind</th>\n",
" <th>solar</th>\n",
" <th>load</th>\n",
" </tr>\n",
" <tr>\n",
" <th>time</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2011-01-01 00:00:00</th>\n",
" <td>0.535144</td>\n",
" <td>0.0</td>\n",
" <td>46209.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2011-01-01 01:00:00</th>\n",
" <td>0.580456</td>\n",
" <td>0.0</td>\n",
" <td>44236.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2011-01-01 02:00:00</th>\n",
" <td>0.603605</td>\n",
" <td>0.0</td>\n",
" <td>42502.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2011-01-01 03:00:00</th>\n",
" <td>0.614114</td>\n",
" <td>0.0</td>\n",
" <td>41479.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2011-01-01 04:00:00</th>\n",
" <td>0.627257</td>\n",
" <td>0.0</td>\n",
" <td>39923.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"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", "cell_type": "markdown",
...@@ -377,10 +462,23 @@ ...@@ -377,10 +462,23 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 7,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
"source": [] {
"data": {
"text/plain": [
"True"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(wind['DE'] == de['wind']).all()"
]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
...@@ -393,10 +491,26 @@ ...@@ -393,10 +491,26 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 8,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
"source": [] {
"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", "cell_type": "markdown",
...@@ -497,9 +611,7 @@ ...@@ -497,9 +611,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"scrolled": true
},
"source": [ "source": [
"Now, let's look at the solar data:" "Now, let's look at the solar data:"
] ]
...@@ -529,9 +641,7 @@ ...@@ -529,9 +641,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"scrolled": true
},
"source": [ "source": [
"Finally, let's look at the load profile:" "Finally, let's look at the load profile:"
] ]
...@@ -611,9 +721,7 @@ ...@@ -611,9 +721,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": true
},
"source": [ "source": [
"Normalize the time series and calculate mismatch time series:" "Normalize the time series and calculate mismatch time series:"
] ]
...@@ -641,9 +749,7 @@ ...@@ -641,9 +749,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": true
},
"source": [ "source": [
"***\n", "***\n",
"**(h) For all three regions, repeat (b)-(f) for the mismatch time series. What changed?**" "**(h) For all three regions, repeat (b)-(f) for the mismatch time series. What changed?**"
...@@ -781,5 +887,5 @@ ...@@ -781,5 +887,5 @@
} }
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 1 "nbformat_minor": 2
} }
No preview for this file type
...@@ -70,19 +70,29 @@ ...@@ -70,19 +70,29 @@
%===================================================================== %=====================================================================
\begin{document} \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} \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}}\\ \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} \end{center}
\vspace{-0.5em}
\vspace{1em} \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} \begin{wrapfigure}[10]{r}{0pt}
...@@ -119,7 +129,7 @@ Consider the simple network shown ins Figure \ref{fig:network}. Calculate in Pyt ...@@ -119,7 +129,7 @@ Consider the simple network shown ins Figure \ref{fig:network}. Calculate in Pyt
\pagebreak \pagebreak
%===================================================================== %=====================================================================
\paragraph{Problem II.2 \normalsize (linear power flow).}~\\ \paragraph{Problem II.2 (programming) -- linear power flow}~\\
%===================================================================== %=====================================================================
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 1,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "skip" "slide_type": "skip"
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
"import numpy.linalg\n", "import numpy.linalg\n",
"import pandas as pd\n", "import pandas as pd\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"plt.style.use('bmh')\n",
"%matplotlib inline" "%matplotlib inline"
] ]
}, },
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 16, "execution_count": 2,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -94,7 +95,7 @@ ...@@ -94,7 +95,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 17, "execution_count": 3,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -108,7 +109,7 @@ ...@@ -108,7 +109,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 18, "execution_count": 4,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -143,7 +144,7 @@ ...@@ -143,7 +144,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 19, "execution_count": 5,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -161,7 +162,7 @@ ...@@ -161,7 +162,7 @@
" [ 0., 1., 0., 0., 1., 0.]])" " [ 0., 1., 0., 0., 1., 0.]])"
] ]
}, },
"execution_count": 19, "execution_count": 5,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -178,7 +179,7 @@ ...@@ -178,7 +179,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 20, "execution_count": 6,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -191,7 +192,7 @@ ...@@ -191,7 +192,7 @@
"True" "True"
] ]
}, },
"execution_count": 20, "execution_count": 6,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -215,7 +216,7 @@ ...@@ -215,7 +216,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 21, "execution_count": 7,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -228,7 +229,7 @@ ...@@ -228,7 +229,7 @@
"array([ 1., 4., 3., 2., 4., 2.])" "array([ 1., 4., 3., 2., 4., 2.])"
] ]
}, },
"execution_count": 21, "execution_count": 7,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -240,7 +241,7 @@ ...@@ -240,7 +241,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 22, "execution_count": 8,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -253,7 +254,7 @@ ...@@ -253,7 +254,7 @@
"2.6666666666666665" "2.6666666666666665"
] ]
}, },
"execution_count": 22, "execution_count": 8,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -277,7 +278,7 @@ ...@@ -277,7 +278,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 23, "execution_count": 9,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -295,7 +296,7 @@ ...@@ -295,7 +296,7 @@
" [ 0., 0., 0., -1., 0., 0., 0., -1.]])" " [ 0., 0., 0., -1., 0., 0., 0., -1.]])"
] ]
}, },
"execution_count": 23, "execution_count": 9,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -325,7 +326,7 @@ ...@@ -325,7 +326,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 24, "execution_count": 10,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -338,7 +339,7 @@ ...@@ -338,7 +339,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 25, "execution_count": 11,
"metadata": { "metadata": {
"slideshow": { "slideshow": {
"slide_type": "fragment" "slide_type": "fragment"
...@@ -356,7 +357,7 @@