sheet01.tex 9.27 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
\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{palatino}
\usepackage{mathpazo}
\setlength\parindent{0pt}

%\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}
\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}

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

\begin{center}
sp2668's avatar
sp2668 committed
71 72
 \textbf{\Large Energy System Modelling }\\
 {SS 2018, Karlsruhe Institute of Technology}\\
sp2668's avatar
sp2668 committed
73
 {Institute for Automation and Applied Informatics}\\ [1em]
sp2668's avatar
sp2668 committed
74 75
 \textbf{\textsc{\Large Tutorial I: Time Series Analysis}}\\
 \small Will be worked on in the exercise session on Wednesday, 11 July 2018.\\[1.5em]
sp2668's avatar
sp2668 committed
76 77 78 79 80 81 82 83 84
\end{center}

\vspace{1em}

%=============== ======================================================
\paragraph{Problem I.1 \normalsize (data analysis).}~\\
%=====================================================================

The following data are made available to you on the course home
sp2668's avatar
sp2668 committed
85
page\footnote{\url{https://nworbmot.org/courses/esm-2018/}}:
sp2668's avatar
sp2668 committed
86 87 88 89 90 91
\begin{verbatim}
  de_data.csv, gb_data.csv, eu_data.csv, (wind.csv, solar.csv, load.csv).
\end{verbatim}
They describe (quasi-real) time series for wind power generation \(W(t)\), solar power generation \(S(t)\) and load \(L(t)\) in Great Britain (GB), Germany (DE) and Europe (EU). The time step is \(1\e{h}\) and the time series are several years long.

\begin{enumerate}[(a)]
sp2668's avatar
sp2668 committed
92 93 94 95 96 97 98 99 100 101 102 103
 \item Check that the wind and solar time series are normalized to 'per-unit of installed \mbox{capacity}', and that the load time series is normalized to MW.
 \item For all three regions, calculate the maximum, mean, and variance of the time series.
 \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 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)$:
       \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
sp2668's avatar
sp2668 committed
104
       $\left| \tilde{X}(\omega) \right|^2$ as a function of
sp2668's avatar
sp2668 committed
105 106 107 108 109 110 111 112 113 114 115
       $\omega$. Discuss the relationship of these results with the
       findings obtained in (b)-(e).
 \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*}
        \Delta(t) = \gamma \alpha W(t) + \gamma (1 - \alpha) S(t) - L(t)
       \end{equation*}
       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.
sp2668's avatar
sp2668 committed
116 117 118 119 120 121 122 123
\end{enumerate}

\pagebreak
%=====================================================================
\paragraph{Problem I.2 \normalsize (analytical).}~\\
%=====================================================================

\begin{wrapfigure}[11]{r}{0pt}
sp2668's avatar
sp2668 committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
 \begin{tikzpicture}
  \begin{axis}[
    domain=0:1, no markers, samples=200
    % xlabel = $x$, ylabel = $f(x)$
   ]
   \addplot+[dashed] {1 + 0.4 * cos(deg(2*pi*x))}; \label{figref:w}
   \addplot+[densely dotted] {1 - 0.75 * cos(deg(2*pi*x))}; \label{figref:s}
   \addplot+[solid] {1 + 0.1 * cos(deg(2*pi*x))}; \label{figref:l}
   \addplot+[dotted] {1}; \label{figref:1}
  \end{axis}
 \end{tikzpicture}
 \caption{Seasonal variations of wind and solar power generation
  \(W(t)\)
  \autoref{figref:w} and \(S(t)\)
  \autoref{figref:s}, and load \(L(t)\)
  \autoref{figref:l} around the mean \(1\) \ref{figref:1}.}
 \label{fig:seasonalvariations}
sp2668's avatar
sp2668 committed
141 142 143 144 145 146
\end{wrapfigure}

Figure \ref{fig:seasonalvariations} shows approximations to the
seasonal variations of wind and solar power generation \(W(t)\)
and \(S(t)\) and load \(L(t)\):
\begin{align*}
sp2668's avatar
sp2668 committed
147 148 149
 W(t) & = 1 + A_W \cos \omega t \\
 S(t) & = 1 - A_S \cos \omega t \\
 L(t) & = 1 + A_L \cos \omega t
sp2668's avatar
sp2668 committed
150 151 152 153 154 155
\end{align*}

The time series are normalized to
\(\expect{W} = \expect{S} = \expect{L} := \frac{1}{T} \int_0^T L(t)
\ud t = 1\), and the constants have the values
\begin{align*}
sp2668's avatar
sp2668 committed
156 157
 \omega & = \frac{2\pi}{T} & T   & = 1 \e{year}               \\
 A_W    & = 0.4            & A_S & = 0.75       & A_L & = 0.1
sp2668's avatar
sp2668 committed
158 159 160 161
\end{align*}

~\\
\begin{enumerate}[(a)]
sp2668's avatar
sp2668 committed
162 163
 \item What is the seasonal optimal mix \(\alpha\), which minimizes
       \begin{equation*}
sp2668's avatar
sp2668 committed
164
        \expect{\left[ \alpha W(t) + (1-\alpha) S(t) - L(t) \right]^2} = \frac1T \int_0^T \left[ \alpha W(t) + (1-\alpha) S(t) - L(t) \right]^2 \,\mathrm d t
sp2668's avatar
sp2668 committed
165 166 167 168 169 170 171 172 173 174
        ,
       \end{equation*}
 \item How does the optimal mix change if we replace \(A_L \to -A_L\)?
 \item Now assume that there is a seasonal shift in the wind signal
       \begin{equation*}
        W(t) = 1 + A_W \cos \left( \omega t - \phi \right)
        .
       \end{equation*}
       Express the optimal mix \(\alpha\) as a function of \(\phi\).
 \item A constant conventional power source \(C(t) = 1 - \gamma\) is now introduced. The mismatch then becomes
sp2668's avatar
sp2668 committed
175
       \begin{equation*}
sp2668's avatar
sp2668 committed
176 177
        \Delta(t) = \gamma \left[ \alpha W(t) + (1-\alpha) S(t) \right] + C(t) - L(t)
        .
sp2668's avatar
sp2668 committed
178
       \end{equation*}
sp2668's avatar
sp2668 committed
179
       Analogously to (a), find the optimal mix \(\alpha\) as a function of \(0 \leq \gamma \leq 1\), which minimizes \(\expect{\Delta^2}\).
sp2668's avatar
sp2668 committed
180 181 182 183 184 185 186 187 188 189
\end{enumerate}

\pagebreak
%=============== ======================================================
\paragraph{Remarks (Python pointers or where to start).}~\\
%=====================================================================

I found the python notebook based notes of Robert Johansson to be a
comprehensive kick starter\footnote{\url{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/tree/master/}}.
\begin{itemize}
sp2668's avatar
sp2668 committed
190 191 192 193 194 195 196 197 198
 \item
       \href{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-0-Scientific-Computing-with-Python.ipynb}{Lecture~0} covers installation and getting ready.
 \item
       \href{http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-1-Introduction-to-Python-Programming.ipynb}{Lecture~1}
       zooms through most basic general python control structures (only
       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.
sp2668's avatar
sp2668 committed
199 200 201 202
\end{itemize}

Further reference material of help is:
\begin{itemize}
203 204
 \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.
sp2668's avatar
sp2668 committed
205 206 207 208
\end{itemize}


\end{document}