As seen previously, the integration of renewable energy is cheaper at a large geographical scale and its variability requires a good temporal resolution. Therefore the computational power needed for the optimization of the whole energy system could be too high for servers or super computer.

\\

\\

In this tutorial, we will first compare 2 basic clustering solutions to reduce the grid model size. Then we will observe the impact of clustering on the lowest installed capacity required to feed the demand.

the file \textit{base.nc} contains a good representation of the European grid, with the various high voltage AC lines and the DC links.

\\

\\

You could load this file in PyPSA and plot it, the colors of the lines represent the voltage type and level, the width of the lines are proportional to their transmission capacity.

\\

\\

\textbf{Task:} Calculate the order and the size of this graph (you will need to include AC lines and DC links).

\\

\\

To cluster this network, we will use a simplify version of this grid, by considering all AC lines to have the same voltage. It will also group very close buses. Import the simplified version (\textit{elec\char`_s.nc}).\textbf{Task:} Calculate the resulting size and order.

Sklearn is a library which allows to cluster data. Due to its simplicity and to the limited goal of this tutorial, we will cluster the simplified network by grouping the buses according to their geographical locations.

\\

\\

\textbf{Task:}Perform various clustering of the simplified network by changing clustering algorithms (Kmeans, SpectralClustering, …) and the number of clusters k.\\

{\url{http://scikit-learn.org/stable/modules/clustering.html}}

\\

\\

\textbf{Task:}Use the \textit{plot\char`_clusters} function of tutorial.py to observe the outcome of the clustering.

\\

\\

\textbf{Questions:}

Are the buses adequately clustered?\\

Which algorithm is giving the best outcome?\\

What are the limits of using geographically based data clustering on the electrical grid?

The file \textit{elec\char`_s.nc} provides solar and wind energy hourly profile per bus for year 2013 and an hourly load profile per bus. The Run of River Hydropower is also fixed.

\\

\\

We will now use the functions :\\

\textit{tutorial.find\char`_kmeans\char`_busmap} and \textit{pypsa.networkclustering.get\char`_clustering\char`_from\char`_busmap}\\

to cluster the European Grid according to the Kmeans algorithm with weighted values (corresponding here to the maximum load at the bus). These functions aggregate the bus data (load, renewable potential...) to the cluster node and group lines from the initial network to form the edges of the clustered graph.\\

Our clustered network is still missing some installed capacities for renewable at each bus to be able to run a simulation such as a Linear Optimal Power Flow (LOPF): LOPF could say if our installed capacity of renewable could supply the loads according to the available line transfer capacity.

\\

\\

In order to give a capacity of solar, onshore wind and\char`/or offshore wind to each bus in a simple way, I created a small function \textit{P\char`_nom\char`_re} attributing an installed capacity proportional to load at each bus (the proportionality coefficients for solar w\char`_s, onshore wind w\char`_on and offshore wind w\char`_of could be changed independently). The goal here is not to simulate a real or ideal energy system, but to be more familiar with the tools and to observe if different clustering sizes or clustering groups are having an impact on results.

\\

\\

\textbf{Task:}For a graph with a small number of cluster (10-25), determine minimum proportionality coefficients w\char`_s, w\char`_on and w\char`_of to have a successful LOPF at a specific day and hour (observe the message \textit{INFO:pypsa.opf:Optimization successful} or \textit{ERROR:pypsa.opf:Optimisation failed}).

\\

\\

\textbf{Questions:}If you try the same coefficients with a higher number of cluster (100-200), is the LOPF still successful. If not, could you find an explanation?