Commit 39a0a9f2 authored by sp2668's avatar sp2668
Browse files

installation guide

parent c24c64d2
......@@ -4,3 +4,5 @@
*.synctex.gz
**/dconf/
**/.ipynb_checkpoints/
*.lp
*.slides.html
# Installation Guide
Install `miniconda` (or Anaconda). For instructions for your operating system see
https://conda.io/docs/user-guide/install/index.html
Now create a new environment from the provided `requirements.yml` file. For detailed instructions see
https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file
Open a terminal. Creating the environment requires the following set of commands:
Windows:
```
conda env create -f requirements.yml
activate esm-tutorials
conda list
```
maxOS and Linux:
```
conda env create -f requirements.yml
source activate esm-tutorials
conda list
```
Open a jupyter notebook with the following command:
```
jupyter notebook
```
You should now be ready to do the tutorials :)
name: esm-tutorials
channels:
- conda-forge
- defaults
dependencies:
- jupyter
- matplotlib
- nb_conda
- numpy
- pandas
- python
- pip:
- pypsa
......@@ -2,7 +2,11 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# Energy System Modelling - Tutorial I\n",
"\n",
......@@ -12,15 +16,23 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"# Imports"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"execution_count": 1,
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [],
"source": [
"import numpy as np\n",
......@@ -31,7 +43,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"***\n",
"# Introductory Comments"
......@@ -39,7 +55,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"## Getting Help\n",
"\n",
......@@ -50,14 +70,22 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"## Using one-dimensional arrays (Numpy and Pandas)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"**Numpy**"
]
......@@ -65,7 +93,11 @@
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"data": {
......@@ -86,7 +118,11 @@
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"data": {
......@@ -105,7 +141,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"**Pandas**"
]
......@@ -113,7 +153,11 @@
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"data": {
......@@ -137,7 +181,11 @@
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"data": {
......@@ -158,14 +206,22 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"## Using two-dimensional arrays (Numpy and Pandas)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"**Numpy** "
]
......@@ -174,7 +230,10 @@
"cell_type": "code",
"execution_count": 15,
"metadata": {
"scrolled": false
"scrolled": false,
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
......@@ -196,7 +255,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"**Pandas**"
]
......@@ -204,7 +267,11 @@
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"data": {
......@@ -283,7 +350,11 @@
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"outputs": [
{
"data": {
......@@ -307,7 +378,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"***\n",
"# Problem I.1\n",
......@@ -325,7 +400,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"***\n",
"**Read Data**"
......@@ -334,7 +413,11 @@
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"de = pd.read_csv('tutorial_data/de_data.csv', parse_dates=True, index_col=0)\n",
......@@ -345,7 +428,11 @@
{
"cell_type": "code",
"execution_count": 54,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"wind = pd.read_csv('tutorial_data/wind.csv', parse_dates=True, index_col=0)\n",
......@@ -355,7 +442,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"Show the first 5 lines (header) of the German data:"
]
......@@ -363,7 +454,11 @@
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"data": {
......@@ -453,7 +548,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"The wind, solar and load files are just differently organized datasets, its the same data:"
]
......@@ -461,7 +560,11 @@
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"data": {
......@@ -480,7 +583,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"***\n",
"**(a) Check that the wind and solar time series are normalized to ’per-unit of installed capacity’,\n",
......@@ -491,7 +598,11 @@
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"data": {
......@@ -521,7 +632,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"Data set includes four years ranging from `2011-01-01` until `2014-12-31`."
]
......@@ -529,7 +644,11 @@
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
......@@ -635,7 +754,10 @@
"cell_type": "code",
"execution_count": 47,
"metadata": {
"scrolled": true
"scrolled": true,
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
......@@ -658,7 +780,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"There are 35064 time slots: 8760h*4 + 24 (2012 was a leap year!)\n",
"\n",
......@@ -671,7 +797,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"***\n",
"** (c) For all three regions, plot the time series $W (t)$, $S(t)$, $L(t)$ for a winter month (January) and a summer month (July). **"
......@@ -680,7 +810,11 @@
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
......@@ -707,7 +841,11 @@
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
......@@ -733,7 +871,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"Let's also compare the wind between the different regions"
]
......@@ -741,7 +883,11 @@
{
"cell_type": "code",
"execution_count": 59,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"data": {
......@@ -767,7 +913,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"***\n",
"**(d) For all three regions, plot the duration curve for $W(t)$, $S(t)$, $L(t)$.** "
......@@ -776,7 +926,11 @@
{
"cell_type": "code",
"execution_count": 63,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
......@@ -810,14 +964,22 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "skip"
}
},
"source": [
"> **Tip:** Go through the line `de['wind'].sort_values(ascending=False).reset_index(drop=True).plot()` dot by dot and note what happens to the output."
]
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"***\n",
"**(e) For all three regions, plot the probability density function of $W(t)$, $S(t)$, $L(t)$.**"
......@@ -825,7 +987,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"There are two different methods:\n",
"1. [Histograms](https://en.wikipedia.org/wiki/Histogram) and \n",
......@@ -836,7 +1002,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"First, let's look at the wind data:"
]
......@@ -845,7 +1015,10 @@
"cell_type": "code",
"execution_count": 66,
"metadata": {
"scrolled": true
"scrolled": true,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
......@@ -880,7 +1053,10 @@
{
"cell_type": "markdown",
"metadata": {
"scrolled": true
"scrolled": true,
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"Now, let's look at the solar data:"
......@@ -890,7 +1066,10 @@
"cell_type": "code",
"execution_count": 70,
"metadata": {
"scrolled": true
"scrolled": true,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
......@@ -924,7 +1103,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"Somewhat hard to see. Let's look at this in detail by limiting the y-axis shown to (0,2):"
]
......@@ -932,7 +1115,11 @@
{
"cell_type": "code",
"execution_count": 69,
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"data": {
......@@ -968,7 +1155,10 @@
{
"cell_type": "markdown",
"metadata": {
"scrolled": true
"scrolled": true,
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"Finally, let's look at the load profile:"
......@@ -978,7 +1168,10 @@
"cell_type": "code",
"execution_count": 71,
"metadata": {
"scrolled": true
"scrolled": true,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
......@@ -1012,7 +1205,11 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {