An open-source python-based flexibility model to quantify and price the flexibility of household devices.
The increasing share of renewable energy requires alternative methods to provide power system ancillary services to ensure a stable operation of the electricity grids. Recent research has inclined their interests towards the aggregation of small-scale system flexibility potentials to accommodate grid variations. The advancements towards local flexibility markets (LFMs) allow prosumers participation in solving grid congestion problems. In order to allow prosumers to interact with the LFMs and submit their bids, a flexibility model is required. This research proposes an open-source flexibility estimation model that quantifies all possible flexibilities from the available prosumer devices and prices them.
Within this open-source model, flexibility is defined as the deviation of a device operation from its optimal schedule. Flexibility can be both negative and positive. Negative flexibility refers to the delay of grid feed-in or the consumption of non-scheduled energy. Positive flexibility is the delay of grid energy consumption or the non-scheduled grid feed-in.
OpenTUMFlex...
- uses mixed-integer linear programming (MILP) to obtain cost-optimal operational schedules for household devices.
- calculates the flexibility potential and flexibility prices based on price, weather, generation and load forecasts of household devices.
- supports the following devices: PV, battery storage systems (BSS), electric vehicles (EV), heat pumps (HP), combined heat and power (CHP) units.
- outputs flexibility offers for each household device in formats that can be used in flexibility markets (e.g. comax by Tennet or ALF by FfE e.V.)
The easiest way to create the environment and install all required packages is via Ana- or Miniconda.
-
Install Anaconda or Miniconda
-
Create the virtual environment: open an "Anaconda Prompt" -> type
conda env create -f environment_v1.0.yml
-
Activate environment
a. In the command prompt type
conda activate OpenTUMFlex
b. In an IDE like PyCharm go to
File->Settings->Project->Python Interpreter->Show all->Add->Conda Environment->Existing environment->Select folder->OK
After the environment has been successfully installed and activated, you can clone the repository to a directory of your choice. You can use version control tools such as GitHub Desktop, Sourcetree, GitKraken or pure Git. The link for pure Git is:
git clone https://github.com/tum-ewk/OpenTUMFlex.git
Run the example.py file to test if the OpenTUMFlex model is correctly installed. If the installation was succesful, you will see the following results:
A scenario-based approach is incorporated in the OpenTUMFlex design. Here, a scenario refers to the device configurations installed in a household. For example, a scenario can refer to just a household with PV, BSS and EV.
-
Change your scenario Once you have successfully installed OpenTUMFlex, you can choose to change your scenario by replacing the desired name in line 12 in example.py. To give an idea, we have already created 10 sample scenarios inside scenario.py.
For example the following scenarios portray the devices installed at the prosumers premises
scenario_hp
: Heat storage, boiler and HPscenario_simple_house
: PV, BSS, heat storage and boilerscenario_apartment
: PV, BSS, heat storage, boiler, CHP, HP and EV
Change the arguments to enable/disable each plot:
show_opt_res
: plot the optimization results (energy balance and device SoCs)save_opt_res
: save the optimization results in a spreedsheetshow_flex_res
: plot the flexibility results of all available devices individually (power, energy and price)show_aggregated_flex
: plot the cumulative flexibility power and price of all the available devices
-
Create your own scenario:
- Refer our documentation.
-
Analysis Toolbox:
OpenTUMFlex can be used to optimize and calculate a household flexibility potential and price it. Copyright (C) 2020 TUM-EWK
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.