draf
Analysis and decision support framework for local multi-energy hubs focusing on demand response.
https://github.com/DrafProject/draf
Category: Energy Systems
Sub Category: Load and Demand Forecasting
Keywords
decarbonization decision-support demand-response energy-system-modeling flexibility-modeling optimization
Last synced: about 20 hours ago
JSON representation
Repository metadata
Demand Response Analysis Framework (DRAF)
- Host: GitHub
- URL: https://github.com/DrafProject/draf
- Owner: DrafProject
- License: lgpl-3.0
- Created: 2021-07-22T11:34:54.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-26T09:14:11.000Z (8 months ago)
- Last Synced: 2025-04-17T21:21:01.535Z (11 days ago)
- Topics: decarbonization, decision-support, demand-response, energy-system-modeling, flexibility-modeling, optimization
- Language: Python
- Homepage:
- Size: 3.22 MB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 1
- Releases: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
README.md
demand response analysis framework (draf
) is an analysis and decision support framework for local multi-energy hubs focusing on demand response.
It uses the power of (mixed integer) linear programming optimization, pandas
, Plotly
, Matplotlib
, elmada
, GSEE
, Jupyter
and more to help users along the energy system analysis process.
The software is described and demonstrated in the open-access draf demo paper.
draf
runs on Windows, macOS, and Linux.
A draf
-version supporting time series aggregation is provided in the dev-TSA branch.
Features
- Time series analysis tools:
DemandAnalyzer
- Analyze energy demand profilesPeakLoadAnalyzer
- Analyze peak loads or run simple battery simulation
- Easily parameterizable component templates:
- battery energy storage (
BES
), battery electric vehicle (BEV
), combined heat and power (CHP
), heat-only boiler (HOB
), heat pump (HP
), power-to-heat (P2H
), photovoltaic (PV
), wind turbine (WT
), thermal energy storage (TES
), fuel cell (FC
), electrolyzer (Elc
), hydrogen storage (H2S
), production process (PP
), product storage (PS
), direct air capture (DAC
), and more. - Sensible naming conventions for parameters and variables, see section Naming conventions.
- battery energy storage (
- Parameter preparation tools:
- Scenario generation tools: Easily build individual scenarios or sensitivity analyses
- Multi-objective mathematical optimization with support of different model languages and solvers:
Pyomo
- A free and open-source modeling language in Python that supports multiple solvers.GurobiPy
- The Python interface to Gurobi, the fastest MILP solver (see Mittelmann benchmark).
- Plotting tools: Convenient plotting of heatmaps, Sankeys, tables, pareto plots, etc. using
Plotly
,Matplotlib
, andseaborn
.- Support of meta data such as
unit
,doc
,src
, anddims
- Automatic unit conversion
- Support of meta data such as
- Export tools:
CaseStudy
objects including all parameters, meta data, and results can be saved to files.- Data can be exported to xarray format.
Quick start
-
Open a terminal in the directory where you want to place
draf
in. -
Clone
draf
:git clone https://github.com/DrafProject/draf cd draf
-
Create and activate the
draf
conda environment (conda env create
will create a conda environment based on environment.yml which will install the newest versions of the required packages including the full editable local version ofdraf
.):conda env create conda activate draf
-
(OPTIONAL) If the draf environment caused issues, you could install an older but more specific conda environment, e.g.:
conda env create --file environments/environment_py39all_mac.yml --force conda activate draf39
-
(OPTIONAL) To use Gurobi (fast optimization), install a valid Gurobi license (its free for academics).
-
Open Jupyter notebook:
jupyter notebook
-
Check if the imports work:
import draf import elmada
-
(OPTIONAL) To use the latest electricity prices and carbon emission factors from
elmada
, request an ENTSO-E API key and set it to elmada:# You have to run this Python code only once (it writes to a permanent file): import elmada elmada.set_api_keys(entsoe="YOUR_ENTSOE_KEY")
-
Start modeling. Have a look at the examples.
Start with theminimal
if you want to write your own component.
Start with thePV
example if you want to import existing components.
For more advanced modeling look at the draf_demo_case_studies.
Consider the DRAF CHEAT SHEET
Structure
A CaseStudy
object can contain several Scenario
instances:
Naming conventions
All parameter and variable names must satisfy the structure <Type>_<Component>_<Descriptor>_<Dims>
.
E.g. in P_EG_buy_T
, P
is the entity type (here: electrical power), EG
the component (here: Electricity Grid), buy
the descriptor and T
the dimension (here: time).
Dimensions are denoted with individual capital letters, so <Dims>
is TE
if the entity has the dimensions T
and E
.
See conventions.py for examples of types, components, and descriptors.
Contributing
Contributions in any form are welcome!
Please contact Markus Fleschutz.
Citing
If you use draf
for academic work please cite the draf demo paper:
@article{Fleschutz2022,
author = {Markus Fleschutz and Markus Bohlayer and Marco Braun and Michael D. Murphy},
title = {Demand Response Analysis Framework ({DRAF}): An Open-Source Multi-Objective Decision Support Tool for Decarbonizing Local Multi-Energy Systems},
publisher = {{MDPI} {AG}},
journal = {Sustainability}
year = {2022},
volume = {14},
number = {13},
pages = {8025},
url = {https://doi.org/10.3390/su14138025},
doi = {10.3390/su14138025},
}
draf
Publications using - Fleschutz et al. (2023): Impact of Landing Interruptions on the Optimal Design and Operation of Green Hydrogen Hubs
- Fleschutz et al. (2023): From prosumer to flexumer: Case study on the value of flexibility in decarbonizing the multi-energy system of a manufacturing company (open access)
- Fleschutz et al. (2022): Industrial grid fees vs. demand response: A case study of a multi-use battery in a German chemical plant
- Fleschutz et al. (2022): Demand Response Analysis Framework (DRAF): An Open-Source Multi-Objective Decision Support Tool for Decarbonizing Local Multi-Energy Systems (open access)
- Fleschutz et al. (2021): The effect of price-based demand response on carbon emissions in European electricity markets: The importance of adequate carbon prices (open access)
- Fleschutz et al. (2017): Electricity Cost Reduction Potential of Industrial Processes using Real Time Pricing in a Production Planning Problem (open access)
License and status
Copyright (c) 2017-2024 Markus Fleschutz
License: LGPL v3
The development of draf
was initiated by Markus Fleschutz in 2017 and continued in a cooperative PhD between the MeSSO Research Group of the Munster Technological University, Ireland and the Energy System Analysis Research Group of the Karlsruhe University of Applied Sciences, Germany.
This project was supported by the MTU Rísam PhD Scholarship scheme and by the Federal Ministry for Economic Affairs and Climate Action (BMWK) on the basis of a decision by the German Bundestag.
Thank you Dr. Markus Bohlayer, Dr. Ing. Adrian Bürger, Andre Leippi, Dr. Ing. Marco Braun, and Dr. Michael D. Murphy for your valuable feedback.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
GitHub Events
Total
- Watch event: 3
- Fork event: 1
Last Year
- Watch event: 3
- Fork event: 1
Committers metadata
Last synced: 6 days ago
Total Commits: 187
Total Committers: 2
Avg Commits per committer: 93.5
Development Distribution Score (DDS): 0.005
Commits in past year: 3
Committers in past year: 2
Avg Commits per committer in past year: 1.5
Development Distribution Score (DDS) in past year: 0.333
Name | Commits | |
---|---|---|
flma0001 | m****z@h****e | 186 |
Markus Fleschutz | m****t@e****m | 1 |
Committer domains:
- entelios.com: 1
- hs-karlsruhe.de: 1
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 6
Total pull requests: 1
Average time to close issues: about 1 month
Average time to close pull requests: 1 minute
Total issue authors: 2
Total pull request authors: 1
Average comments per issue: 2.0
Average comments per pull request: 0.0
Merged pull request: 1
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- yamidibarra (3)
- mfleschutz (3)
Top Pull Request Authors
- mfleschutz (1)
Top Issue Labels
- enhancement (1)
Top Pull Request Labels
Dependencies
- appdirs *
- elmada *
- geopy *
- gurobipy *
- holidays *
- matplotlib *
- numpy *
- pandas *
- pyomo >=5.7
- ray *
- seaborn *
- tabulate *
- tqdm *
- ephem
- geopy
- glpk
- ipython
- ipywidgets
- jupyter
- matplotlib
- numpy
- numpy-financial
- pandas
- pip
- plotly
- pvlib-python >=0.6.3
- pyomo
- python 3.9.*
- seaborn
Score: 3.5263605246161616