DOI: 10.5281/zenodo.10820928
title: Interannual Electricity Demand Calculator

description: Interannual Electricity Demand Calculator

Large parts of this code were originally developed by Lieke van der Most (University of Groningen) in the EU renewable energy modelling framework and release under MIT license. The original version of the code can be found here and is referenced below as [1]. This model has been validated against historical electricity demand data reported on the ENTSO-E transparancy platform.

We have made the following adjustments to the original version:



generate hourly instead of daily electricity consumption profiles

use snakemake for workflow management

trim repository to demand-related code and data

adjust code to accept cutouts from atlite for weather data


Purpose

Variations in weather conditions affect electricity demand patterns. This workflow generates country-level electricity consumption time series based on weather data using analysis by Lieke van der Most correlating historical electricity demand to temperature. This workflow first calculates a daily electricity demand based on the regression model developed in [1]. Subsequently, cumulative daily electricity demands are disaggregated using a hourly profile sampled from a random historical day (that is the same weekday) from the Open Power System Database. The resulting output/demand_hourly.csv file is compatible with the open-source electricity system model PyPSA-Eur.

Holidays are treated like weekend days. Data on national holidays across Europe are obtained using another repository by Aleksander Grochowicz and others that similarly computes artificial electricity demand time series: github.com/aleks-g/multidecade-data. The holidays are stored at input_files/noworkday.csv.

Installation and Usage

Clone the Repository

Download the demand_calculator repository using git.

/some/other/path % cd /some/path/without/spaces
/some/path/without/spaces % git clone https://github.com/martacki/demand_calculator.git

Install Dependencies with conda/mamba

Use conda or mamba to install the required packages listed in environment.yaml.

The environment can be installed and activated using

.../demand_calculator % conda env create -f environment.yaml
.../demand_calculator % conda activate demand

Retrieve Input Data

The only required additional input files are ERA5 cutouts which can be recycled from the PyPSA-Eur weather data deposit on Zenodo. Place the file europe-2013-era5.nc in the following location (and rename!):

./input_files/cutouts/europe-era5-2013.nc

Cutouts for other weather years than 2013 can be built using the build_cutout rule from the PyPSA-Eur repository.

Run the Workflow

This repository uses snakemake for workflow management. To run the complete workflow, execute:

.../demand_calculator % snakemake -jall all

After successfully running the workflow, the output files will be located in output/energy_demand named demand_hourly_{yr}.csv.

The years to compute can be modified directly in the Snakefile.

License

The file demand_hourly.csv is released under CC-BY-4.0 license.

The file src.zip is released under MIT license.

Changelog

2024-03-15: Extended date range from 1941 to 2023.