Code for the master thesis Pumped Storage Hydroelectricity for a Sustainable Electricity Transition, by Teodor Elmfeldt
Code is written using Python 3.7.2
- with the numerical package NumPy,
- tables using pandas,
- regression using Statsmodels and
- plotting with Seaborn
- built upon Matplotlib. Measuring data from SMHI was collected using smhi-open-data.
To install, run
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
The functions in earnings_plots.py and stats_plots.py are often run indepedently to generate and save the requested plots.
To run the code, there is need for supplemental data.
Price data from Nordpool is needed, in the format of sundsek22.sdv, placed in the folder data/nordpool. Note that a ø needs to be manually removed from each file. This data is not available for open distribution, but is made available by Nordpool for academic purposes.
Electricity usage data from Svk can come from this source: https://www.svk.se/om-kraftsystemet/kraftsystemdata/elstatistik/, the used tables are 'Förbrukning och tillförsel per timme (i normaltid)' placed in data/svk and reformatted to .csv
FCR prices are from https://mimer.svk.se/ProductionConsumption/ProductionIndex and placed in the folder data/fcr as csv file
APIs are used to download relevant data, format it, and cache it, at runtime.
- operations_model.py contains the models used for simulation
- earnings_plots.py provides code for generating the plots regarding income from PSH operations
- stats_plots.py provides code for generating the plots regarding market conditions and other electricity statistics
- loader.py loads all dataframes from raw data