Skip to content
/ urbs Public
forked from tum-ens/urbs

A linear optimisation model for distributed energy systems

License

Notifications You must be signed in to change notification settings

ojdo/urbs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

urbs - 1node example

This branch contains a small example study with one site, custom run and comparison script and even dares to slightly modify the urbs.plot function to automatically skip the empty plots for demand side management (DSM). It also demonstrates how to write a custom scenario generator function, a feat that is enabled by Python's capability to hand functions around just like ordinary objects.

Reproduction steps

Recreating the environment

As this version of the model is outdated (state early 2017), it can be run with its main dependencies pinned to the same point in time. To install the dependencies as specified in file environment.yml, you can use the following steps:

conda env create -f environment.yml
conda activate urbs-2017

To verify that the environment is active, either run the above within Anaconda Prompt, which displays the active environment to the left of your prompt:

# Windows
(urbs-2017) C:\Users\ojdo\src\urbs>
# Linux
(urbs-2017) /home/ojdo/src/urbs$

or instead run command conda env list, which marks the active environment with an asterisk (*):

# conda environments:
base                     C:\ProgramData\Anaconda3
urbs-2017             *  C:\Users\ojdo\.conda\envs\urbs-2017

Running the optimization

File run1node.py is the main entry point, which contains user settings like solver and how many timesteps (some days for debugging, weeks or a whole year for the actual study) should be included in the optimization. Results (spreadsheets and timeseries plots) are generated within a timestamped subdirectory within result.

Running the comparison script

File comp.py can be run after a successful optimization run to generate a condensed cross-scenario comparison spreadsheet + plot. It automatically analyses the newest subfolder within result, or a target directory can be specified.

Both files are meant as a demonstration and basis for one's own optimization and analyses scripts.

Result plots

Comparison

Bar chart of total system cost, electricity generation shares and storage use for all ten scenarios s01 to s10.

Scenario s01

Timeseries plot of month June for electricity generation in scenario s01: diesel generator covers main load, only slightly supported by photovoltaics during the day.

Scenario s05

Timeseries plot of month June for electricity generation in scenario s05: photovoltaics covers over half the load, using battery as support during morning/evening hours. Diesel as night backup.

About

A linear optimisation model for distributed energy systems

Resources

License

Stars

Watchers

Forks

Languages

  • Python 100.0%