Skip to content

ahilbers/renewable_test_PSMs

Repository files navigation

Maintenance

Renewable test power system models

Overview

Summary

This repository contains simple test power (energy) system models to use in renewable energy, time series and optimisation analysis, designed specifically for climate scientists who want to get a feel for energy systems. They include generation & transmission expansion planning (GTEP), economic dispatch (ED) and unit commitment (UC) type power system models.

For a video introduction to energy system models, as well as a (slightly outdated) tutorial on this repo, see the video link on the left. For a very quick start, see tutorial without installing.

Note: This is a relatively new version that includes solar power and storage. The version of the models used in papers do not contain solar power. For the versions of the model used in 2020 papers, see the branch 2020_papers.

Rationale

There is considerable research into methods for generation & transmission expansion planning (GTEP), economic dispatch (ED) and unit commitment (UC) models. This includes:

  • Time series aggregation, see e.g. this paper
  • Uncertainty analysis, see e.g. this paper
  • New solution methods.

In most such investigations, a different model is used for each paper. Furthermore, models and the data used are usually not made public. This makes results from different studies hard to compare or reproduce. The closest thing to a standard for such applications are the various IEEE n-bus test systems, but the code, generation technologies and time series data are usually not standardised or provided open-source.

This repository provides a few simple test models to fill this gap. The models can be run “off-the-shelf”, containing pre-determined topologies, technologies and time series data. All that needs to be specified is the subset of time series data to use and a number of switches (e.g. integer or ramping constraints, whether to allow unmet demand) that ensure the model can contain most features seen in more complicated systems. These models are not modelling frameworks like OseMOSYS or PyPSA (which can be used to create arbitrary power system models, but are not models themselves). The models are built and can run in Python using the Calliope package. Documentation and examples can be found below.

Models

drawing

Simple "toy" examples that run fast in most settings but have the features of more complicated examples. There are two base toplogies:

  • The 1_region model has only one region in which supply and demand must be met.
  • The 6_region model has six regions with a transmission topology, and supply and demand must be matched across the model but transmitted between the regions. It is based on a renewable version of the IEEE 6-bus test system.

Models can be run in two modes. In plan mode, both the optimal system design (generation and transmssion capacities) and subsequent operation (generation and transmission levels in each time step) are optimised. In operate mode, system design is user-defined and only the system's operation is optimised. Furthermore, integer and ramping constraints can be easily activated or deactivated depending on the modelling context. See documentation/ for details.

Data

The time series input data consists of hourly demand levels and wind capacity factors for different European countries, forming a subset of the data available here. See documentation/ for details.

How to cite

If you use this repository in your own research, please cite the following paper and dataset:

  • AP Hilbers, DJ Brayshaw, A Gandy (2020). Efficient quantification of the impact of demand and weather uncertainty in power system models. IEEE Transactions on Power Systems. doi:10.1109/TPWRS.2020.3031187.

  • HC Bloomfield, DJ Brayshaw, A Charlton-Perez (2020). MERRA2 derived time series of European country-aggregate electricity demand, wind power generation and solar power generation. University of Reading. Dataset. doi:10.17864/1947.239.

Usage

Tutorial without installing

For a quick introduction to the models, see this link, then open tutorial.ipynb. It is a binder instance of the tutorial (tutorial.ipynb) that you can run in the browser, without having to install any pacakges on your own machine. Thanks to @annefou for setting this up.

Customising and running your own simulations

To use these models in your own code, or customise them, you'll have to install the package (see section below). Then, you can run a sample simulation via

python scripts/main.py

This file is a template run illustrating the models' functionality. You can customise it for your own simulations.

Requirements & installation

The models in this repo are power system optimisation models, so each simulation involves three parts:

  1. Creating an optimisation problem associated with the power system (in python)
  2. Solving the optimisation problem (usually done outside python)
  3. Reading the results back and presenting them in a meaningful way (in python)

Hence, to run a simulation, you'll have to install this package (the python files), as well as a solver that solves the optimisation problem in step 2.

Installing this package

A key package used in this repo is Calliope, an open-source energy modelling framework. At the time of writing, the newest version of Calliope is 0.6.10, which works with python 3.11 and may also work with other versions.

With python 3.11 as the default, you can install this package via:

pip install -e .

If there are issues, you can also install Calliope via the instructions in the official project website.

Installing a solver

We recommend using CBC, which is open source and free-to-use. If you have homebrew on mac, you can install it via

brew install coin-or-tools/coinor/cbc

If not, see install instructions for your system on the project website.

Gurobi is a faster solver, but it requires a license. A free academic license is available. Another (untested) open-source option is HiGHS. To change the solver used, change the value of run.solver in models/1_region/model.yaml or models/6_region/model.yaml, e.g. to gurobi.

Testing model functionality and results

Every time a model is run, a long list of consistency checks are applied to outputs, checking things like demand being met and total costs matching sum of install and generation costs. If any of these fail, warnings are raised. To see these checks, see psm/consistency_checks.py

This repo also contains some unit tests, located in the test directory. You can run all unit tests by calling pytest from a command line.

Troubleshooting

  • If you get errors like no executable named cbc, the solver cbc isn't found. You need to add it to the path of searched executables. If you installed it via brew on a mac, the following might help:
PATH="/usr/local/opt/cbc/bin:$PATH"
export PATH

where you should change the /usr/local/opt/cbc to the location that cbc was installed in (this is shown in the terminal when installing it). You can add this snippet of text to e.g. your .zshrc file, or the equivalent file for your virtual environment (e.g. .venv/bin/activate).

Use in papers

Specific (modified) version of these models have been used in papers, as well as a PhD thesis:

  • AP Hilbers, DJ Brayshaw, A Gandy (2020). Efficient quantification of the impact of demand and weather uncertainty in power system models. IEEE Transactions on Power Systems. doi:10.1109/TPWRS.2020.3031187.

  • AP Hilbers, DJ Brayshaw, A Gandy (2020). Importance subsampling for power system planning under multi-year demand and weather uncertainty. In proceedings of the 16th International Conference on Probabilistic Methods Applied to Power Systems (PMAPS 2020). doi:10.1109/PMAPS47429.2020.9183591

  • AP Hilbers, DJ Brayshaw, A Gandy (2023). Reducing climate risk in energy system planning: a posteriori time series aggregation for models with storage. Applied Energy, 334, 120624. doi:10.1016/j.apenergy.2022.120624

  • AP Hilbers (2023). Subsampling for renewable electricity system optimisation. Imperial College London. link

Contact

Adriaan Hilbers. Department of Mathematics, Imperial College London. a.hilbers17@imperial.ac.uk.

Acknowledgements

Models are constructed in the modelling framework Calliope, created by Stefan Pfenninger and Bryn Pickering. See callio.pe or the following paper for details:

  • S Pfenninger, B Pickering (2018). Calliope: a multi-scale energy systems modelling framework. Journal of Open Source Software, 3(29), 825, doi:10.21105/joss.00825.

The demand and wind time series is a subset of columns from the following dataset:

  • HC Bloomfield, DJ Brayshaw, A Charlton-Perez (2020). MERRA2 derived time series of European country-aggregate electricity demand, wind power generation and solar power generation. University of Reading. Dataset. doi:10.17864/1947.239

Details about the creation of this data can be found in the following paper:

  • HC Bloomfield, DJ Brayshaw, A Charlton-Perez (2019). Characterising the winter meteorological drivers of the European electricity system using Targeted Circulation Types. Meteorological Applications. ISSN 1469-8080. doi:10.1002/met.1858.

The 6_region model topology is based on the IEEE 6-bus test system, used in many previous studies. The renewable-ready topology, including the links and locations of demand & supply technologies, is based on a renewable 6-bus model, introduced in the following paper:

  • S Kamalinia, M Shahidehpour (2010). Generation expansion planning in wind-thermal power systems. IET Generation, Transmission & Distribution, 4(8), 940-951. doi:10.1049/iet-gtd.2009.0695

About

Test power (energy) system models for time series & renewable energy analysis, with a tutorial

Resources

License

Stars

Watchers

Forks

Packages

No packages published