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)]
\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
$\left| \tilde{\Delta}(\omega)\right|^2$ as a function of
$\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
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.
\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
$\left| \tilde{\Delta}(\omega)\right|^2$ as a function of
$\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
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.
\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.
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.
\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{http://www.python-course.eu/course.php}{python2 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/2/tutorial/}} available in \href{https://docs.python.org/2/tutorial/}{english} and \href{https://py-tutorial-de.readthedocs.org/de/python-3.3/index.html}{german}; which will NOT introduce you to numpy or scipy.
\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{http://www.python-course.eu/course.php}{python2 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/2/tutorial/}} available in \href{https://docs.python.org/2/tutorial/}{english} and \href{https://py-tutorial-de.readthedocs.org/de/python-3.3/index.html}{german}; which will NOT introduce you to numpy or scipy.
\foreach\from/\to in {n0/n1,n1/n2,n1/n4,n1/n5,n2/n4,n2/n3,n3/n4,n4/n5}
\draw (\from) -- (\to);
\end{tikzpicture}
\caption{Simple Network}
\label{fig:network}
\end{wrapfigure}
Consider the simple network shown ins Figure \ref{fig:network}. Calculate in Python or by hand:
\begin{enumerate}[(a)]
\item Compile the \textit{nodes list} and the \textit{edge list}.\\~\\
\textbf{Remark:} While graph-theoretically both lists are unordered sets, let's agree on an ordering now which can serve as basis for the matrices in the following exercises: we sort everything in ascending numerical order, i.e.\ node 1 before node 2 and edge (1,2) before (1,4) before (2,3).
\item Determine the \textit{order} and the \textit{size} of the network.
\item Compute the\textit{ adjacency matrix}$A$ and check that it is symmetric.
\item Find the \textit{degree}$k_n$ of each node $n$ and compute the \textit{average degree} of the network.
\item Determine the \textit{incidence matrix}$K$ by assuming the links are always directed from smaller-numbered node to larger-numbered node, i.e.\ from node 2 to node 3, instead of from 3 to 2.
\item Compute the \textit{Laplacian}$L$ of the network using $k_n$ and $A$. Remember that the Laplacian can also be computed as $L=KK^T$ and check that the two definitions agree.
\item Find the \textit{diameter} of the network by looking at Figure \ref{fig:network}.
\item Compile the \textit{nodes list} and the \textit{edge list}.\\~\\
\textbf{Remark:} While graph-theoretically both lists are unordered sets, let's agree on an ordering now which can serve as basis for the matrices in the following exercises: we sort everything in ascending numerical order, i.e.\ node 1 before node 2 and edge (1,2) before (1,4) before (2,3).
\item Determine the \textit{order} and the \textit{size} of the network.
\item Compute the\textit{ adjacency matrix}$A$ and check that it is symmetric.
\item Find the \textit{degree}$k_n$ of each node $n$ and compute the \textit{average degree} of the network.
\item Determine the \textit{incidence matrix}$K$ by assuming the links are always directed from smaller-numbered node to larger-numbered node, i.e.\ from node 2 to node 3, instead of from 3 to 2.
\item Compute the \textit{Laplacian}$L$ of the network using $k_n$ and $A$. Remember that the Laplacian can also be computed as $L=KK^T$ and check that the two definitions agree.
\item Find the \textit{diameter} of the network by looking at Figure \ref{fig:network}.
\end{enumerate}
...
...
@@ -128,32 +128,32 @@ If you map the nodes to countries like \texttt{0=DK, 1=DE, 2=CH, 3=IT, 4=AT,5=CZ
is the weighted Laplacian. For simplicity, we assume identity reactance on all links $x_l =1$.
\begin{enumerate}[(a)]
\item Compute the \textit{voltage angles }$\theta_j$ and \textit{flows}$f_l$ for the first hour in the dataset with the convention of $\theta_0=0$; i.e.\ the slack bus is at node 0.\\~\\
\textbf{Remark:} Linear equation systems are solved efficiently using \texttt{numpy.linalg.solve}.
\item Determine the average flow on each link for 01-2017 and draw it as a directed network.
\item Compute the \textit{voltage angles }$\theta_j$ and \textit{flows}$f_l$ for the first hour in the dataset with the convention of $\theta_0=0$; i.e.\ the slack bus is at node 0.\\~\\
\textbf{Remark:} Linear equation systems are solved efficiently using \texttt{numpy.linalg.solve}.
\item Determine the average flow on each link for 01-2017 and draw it as a directed network.
\caption{Diurnal and synoptic variations of wind and solar power generation
\(G_{N,w}(t)\)
\autoref{figref:w} and \(G_{S,s}(t)\)
\autoref{figref:s}, and a constant load (all in per-unit) \(L(t)\)
\autoref{figref:l}.}
\label{fig:variations}
\end{wrapfigure}
Imagine a two-node Germany. The South can install solar panels with a capacity factor $Cf_s$ to cover its load $L_S$, while the North uses wind turbines that have a capacity factor $Cf_w$
...
...
@@ -125,61 +125,61 @@ to feed their load $L_N$. Figure \ref{fig:variations} shows approximations to th
For now, assume the stores are lossless. Losses will be considered in III.2.
\begin{enumerate}[(a)]
% (a)
\item How much wind capacity $G_{N,w}$ must be installed in the North and solar capacity $G_{S,s}$ in the South?
% (b)
\item What is the amount of store and dispatch power capacity $G_{s,store}=\max(-g_s(t))$ and $G_{s,dispatch}=\max g_s(t)$ the storages must have in the North and in the South?
% (c)
\item What is the amount of energy capacity one needs in the North and in the South?
\item Should they choose hydrogen or battery storages? And how much would it cost them with the prices in Table 1? Is the South or the North paying more for their energy?
\item What do you imagine would change if you considered the storage losses given in Table 1 in your results (a)-(d)? Support your statement with a graphical illustration.
% (a)
\item How much wind capacity $G_{N,w}$ must be installed in the North and solar capacity $G_{S,s}$ in the South?
% (b)
\item What is the amount of store and dispatch power capacity $G_{s,store}=\max(-g_s(t))$ and $G_{s,dispatch}=\max g_s(t)$ the storages must have in the North and in the South?
% (c)
\item What is the amount of energy capacity one needs in the North and in the South?
\item Should they choose hydrogen or battery storages? And how much would it cost them with the prices in Table 1? Is the South or the North paying more for their energy?
\item What do you imagine would change if you considered the storage losses given in Table 1 in your results (a)-(d)? Support your statement with a graphical illustration.
\end{enumerate}
Now we lift the restriction against transmission and allow them to bridge their 500 km separation with a transmission line.
Now we lift the restriction against transmission and allow them to bridge their 500 km separation with a transmission line.
\begin{enumerate}[(e)]
% (e)
\item Estimate the cost-optimal technology mix by assuming wind energy in the North is only stored in the North and solar energy in the South is likewise only stored in the South! What would happen if you dropped that assumption?
% (e)
\item Estimate the cost-optimal technology mix by assuming wind energy in the North is only stored in the North and solar energy in the South is likewise only stored in the South! What would happen if you dropped that assumption?
\end{enumerate}
\begin{table}[]
\centering
\label{tab:prices}
\begin{tabular}{@{}lrrrr@{}}
\toprule
&\eur per kW &\eur per kWh &$\eta_{store}$&$\eta_{dispatch}$\\\midrule
Battery & 300 & 200 & 0.9 & 0.9 \\
Hydrogen & 750 & 10 & 0.75 & 0.58 \\
Solar & 600 &&&\\
Wind & 1200 &&&\\
Transmission line (500 km) & 200 &&&\\\bottomrule
\end{tabular}
\caption{Investment costs of renewable energy infrastructure.}
\centering
\label{tab:prices}
\begin{tabular}{@{}lrrrr@{}}
\toprule
&\eur per kW &\eur per kWh &$\eta_{store}$&$\eta_{dispatch}$\\\midrule
Battery & 300 & 200& 0.9 & 0.9 \\
Hydrogen & 750 & 10& 0.75 & 0.58 \\
Solar & 600 &&&\\
Wind & 1200 &&&\\
Transmission line (500 km) & 200 &&&\\\bottomrule
\end{tabular}
\caption{Investment costs of renewable energy infrastructure.}
@@ -189,11 +189,11 @@ For now, assume the stores are lossless. Losses will be considered in III.2.
Python for Power System Analysis (PyPSA) is a free software toolbox for optimising modern power systems that include features such as variable wind and solar generation, storage units, etc\.. Use the toolbox to extend on your findings in Problem III.1.
\begin{enumerate}[(a)]
\item Build a network in PyPSA with the two buses North and South and attach the load at each bus and attach the wind and solar generators with availability according to $G_{N,w}(t)= Cf_w(1+A_w\sin\omega_w t)$ and $G_{S,s}(t)= Cf_s(1+A_s\sin\omega_s t)$ for a year (you have to call \texttt{set\_snapshots} for the year) and with \texttt{p\_nom\_extendable} set to True. As help you should have a look at the minimal LOPF example\footnote{\url{https://www.pypsa.org/examples/minimal_example_lopf.html}}, understand what the components documentation\footnote{\url{https://pypsa.org/doc/components.html}} of PyPSA gives you and that you can find the underlying objective function and constraints in the LOPF documentation\footnote{\url{https://pypsa.org/doc/optimal_power_flow.html\#linear-optimal-power-flow}}.
\item Attach extendable storages at the North and the South! The storages have to be modelled as an \texttt{H2-bus} (a bus with \texttt{carrier='H2'}) linked to the \texttt{AC-bus} North with a \texttt{Link} where \texttt{p\_nom\_extendable=True} with the \texttt{capital\_cost} of the power capacity and an also extendable \texttt{Store} with the \texttt{capital\_cost} of the energy capacity, for instance. The losses can be set on the links as \texttt{efficiency}.
\item Run an investment optimization by calling the \texttt{lopf} function.
\item How do your results \texttt{objective} and \texttt{{generators,stores,links}.p\_nom\_opt} compare with the results of III.1(d)?
\item Now lift the restriction against transmission and allow North and South to bridge their 500 km separation with a transmission line. How does the cost optimal technology mix change compared to III.1(f)?
\item Replace the approximated availability time-series of the wind and the solar generators with the ones from \texttt{availability.csv} computed from reanalysis weather data available on the course homepage\footnote{\url{https://nworbmot.org/courses/complex_renewable_energy_networks/}} and re-run the LOPF. Compare the results! Explain the differences by looking at the cumulative variations relative to the mean of the availability time-series!
\item Build a network in PyPSA with the two buses North and South and attach the load at each bus and attach the wind and solar generators with availability according to $G_{N,w}(t)= Cf_w(1+A_w\sin\omega_w t)$ and $G_{S,s}(t)= Cf_s(1+A_s\sin\omega_s t)$ for a year (you have to call \texttt{set\_snapshots} for the year) and with \texttt{p\_nom\_extendable} set to True. As help you should have a look at the minimal LOPF example\footnote{\url{https://www.pypsa.org/examples/minimal_example_lopf.html}}, understand what the components documentation\footnote{\url{https://pypsa.org/doc/components.html}} of PyPSA gives you and that you can find the underlying objective function and constraints in the LOPF documentation\footnote{\url{https://pypsa.org/doc/optimal_power_flow.html\#linear-optimal-power-flow}}.
\item Attach extendable storages at the North and the South! The storages have to be modelled as an \texttt{H2-bus} (a bus with \texttt{carrier='H2'}) linked to the \texttt{AC-bus} North with a \texttt{Link} where \texttt{p\_nom\_extendable=True} with the \texttt{capital\_cost} of the power capacity and an also extendable \texttt{Store} with the \texttt{capital\_cost} of the energy capacity, for instance. The losses can be set on the links as \texttt{efficiency}.
\item Run an investment optimization by calling the \texttt{lopf} function.
\item How do your results \texttt{objective} and \texttt{{generators,stores,links}.p\_nom\_opt} compare with the results of III.1(d)?
\item Now lift the restriction against transmission and allow North and South to bridge their 500 km separation with a transmission line. How does the cost optimal technology mix change compared to III.1(f)?
\item Replace the approximated availability time-series of the wind and the solar generators with the ones from \texttt{availability.csv} computed from reanalysis weather data available on the course homepage\footnote{\url{https://nworbmot.org/courses/complex_renewable_energy_networks/}} and re-run the LOPF. Compare the results! Explain the differences by looking at the cumulative variations relative to the mean of the availability time-series!
\caption{Diurnal and synoptic variations of wind and solar power generation
\(G_{N,w}(t)\)
\autoref{figref:w} and \(G_{S,s}(t)\)
\autoref{figref:s}, and a constant load (all in per-unit) \(L(t)\)
\autoref{figref:l}.}
\label{fig:variations}
\end{wrapfigure}
Imagine a two-node Germany. The South can install solar panels with a capacity factor $Cf_s$ to cover its load $L_S$, while the North uses wind turbines that have a capacity factor $Cf_w$
to feed their load $L_N$. Figure \ref{fig:variations} shows approximations to the daily and synoptic variations of per-unit wind and solar power generation \(G_{N,w}(t)\) and \(G_{S,s}(t)\) and a constant load \(L_{N/S}(t)\):