Energy Technologies MPhil ETA1 masterclass in Energy Systems Modelling.
This repository contains a subset of the Euro-Calliope pre-built model, containing two countries in the European energy system. It is built for use in Calliope v0.7. The model is available on the national spatial resolution and daily temporal resolution, with a subset of technologies available compared to the base Euro-Calliope.
Euro-Calliope models like this can be built manually, which adds more configuration options. To learn how to build Euro-Calliope manually, head over to Euro-Calliope's documentation.
The base Euro-Calliope is a model of the European energy system, with each node representing an administrative unit. It is built on three spatial resolutions: on the continental level as a single node, on the national level with 34 nodes, and on the regional level with 497 nodes. At each spatial node, renewable generation capacities (wind, solar, bioenergy) and balancing capacities (battery, hydrogen) can be invested in to meet electricity demand, and heat pumps or conventional natural gas can be invested in to meet building heat demand. In addition, a fixed amount of hydro electricity and pumped hydro storage is available, based on what already exists today. Once invested in, technologies can satisfy energy demands at each node, where demand is based on historic data. Nodes are connected through electricity transmission lines, which may have unrestricted capacity or be limited based on real data. Using Calliope, the model is solved as a linear optimisation problem with total monetary cost of all capacities and their operation as the minimisation objective.
First, you will need to install software on your device:
- VSCode. This gives you access to an Interactive Development Environment (IDE) in which to edit code and to interact with your device's terminal. On Windows, I recommend you follow the command prompt instructions.
- Miniforge.
This gives you access to
conda
in your device's terminal, with which you can create isolated Python environments to work in. There are other variants of access toconda
(Anaconda, Miniconda, Mambaforge, etc.). I recommendMiniforge
as it defaults to the open-sourceconda-forge
channel, instead of the commercialdefaults
channel.
Note
On Windows, you should download Miniforge3-Windows-x86_64
from the releases.
You may find that on Chrome it says the download is "dangerous" - you can safely bypass this and force the download.
- The Gurobi solver license. This gives you access to a high-performance optimisation solver.
Tip
You can ignore steps 2 and 3 of the instructions (downloading the installer) and go straight to requesting a "named user" license after registering. See our Gurobi license section for details on installing the license.
Note
You can only request and set up the license while connected to the university network (i.e., connected to eduroam and not behind a personal VPN).
With this software installed, you can then set up VSCode to allow access to conda
and git
from the "terminal":
- Set the correct terminal
- Open VSCode.
- Open the
command palette
(Control-Shift-P, shows a bar at the top of the screen). - Search for
Terminal: Select Default Profile
. - Select
Command Prompt
.
- Install the Python Extension. Click on the "Extensions" tab on the left-hand side of VSCode (four squares) and search for the official Microsoft Python extension.
- Set your Python environment
- Open the
command palette
(Control-Shift-P, shows a bar at the top of the screen). - Search for
Python: Select Interpreter
- Select
base
(it should haveminiforge3
in the file path)
- Open the
- Open a new terminal window (
Terminal
top-bar tab ->New Terminal
, it will open at the bottom of the screen). - Run
conda install git
in the terminal.
With VSCode set up, you can "clone" (i.e. copy) this repository to your device:
- In the VSCode terminal, call
git clone https://github.com/brynpickering/ET-masterclass-2024.git <output-directory>\ET-masterclass-2024
.<output-directory>
should be a directory on your device where you want to store cloned GitHub repositories (often something like%USERPROFILE%\Repositories
on Windows or~/Repositories
on Linux/MacOS). - Then you can open that cloned repository (i.e. downloaded folder) in VSCode (
File
top-bar tab ->Open Folder
-> navigate to<output-directory>\ET-masterclass-2024
).
Finally, you can create the isolated Python working environment for this masterclass:
-
In your
<output-directory>\ET-masterclass-2024
VSCode session, open a new terminal. -
Run the following two commands to create your working environment and then to activate it:
conda env create -f environment.yaml conda activate et-masterclass
With the et-masterclass
conda environment activated, you can then call the grbgetkey
command in the terminal to install the Gurobi license that you have requested, e.g.:
grbgetkey ae36ac20-16e6-acd2-f242-4da6e765fa0a
The license key can be found on the Gurobi portal, under the "Licenses" tab and then the "show installation instructions" button.
We recommend you run the models from the terminal.
They will be available on your device after following the preparation steps, and visible in the VSCode Explorer
when you have the <output-directory>\ET-masterclass-2024
folder open in VSCode.
To run a model and save the outputs in the NetCDF format (a storage convention for multi-dimensional data):
calliope run "model-gbr-irl/model.yaml" --save_netcdf "model-gbr-irl.nc"
There is one pre-defined "scenario" in the GBR+IRL model, to add in nuclear as a technology. To introduce this, you can add it to your command line arguments
calliope run "model-gbr-irl/model.yaml" --save_netcdf "model-gbr-irl-with-nuclear.nc" --scenario add_nuclear
Once you have results, you can use calligraph, a tool for visualising Calliope model results that we are currently developing (i.e., expect some rough edges). Once you have run a model, you can call calligraph with the name of the NetCDF file:
calligraph "model-gbr-irl.nc"
This will open a tab in your browser with a data dashboard.
This pre-built model is a very simple example. You can extend / amend it directly by modifying the YAML files. You can also find more complete pre-built models on Zenodo. You may find that even that needs customisation to fit your purpose. Once you've managed to run them, it's a good point in time to learn about model customisation options in Euro-Calliope.
For more information on Euro-Calliope and how to use and modify the models, see Euro-Calliope's documentation.
Euro-Calliope is developed and maintained within the Calliope project.
This work is licensed under a Creative Commons Attribution 4.0 International License.
Contains modified Copernicus Atmosphere Monitoring Service information 2020. Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.
Contains modified data from Renewables.ninja.
Contains modified data from Open Power System Data.
For more details on sources, see the Euro-Calliope GitHub repository.