Package to generate heat and electricity timeseries with demandlib based on LOD2 database
- Date: 02.10.2025
- Project: https://www.enargus.de/pub/bscw.cgi/?op=enargus.eps2&q=HEAT2Q&v=10&id=8909299
Here you can see the overall workflow of generating building specific load profiles for heat and electricity:
The following listed attributes from demandlib have to be specified:
Attributes from demandlib:
| holidays: holidays from workalender python package according to defined
| year: year
| temperature: temperature timeseries from weather data file,
| shlp_type: "bdew_profile" according to mapping in building_class_mapping.csv,
| wind_class: 1,
| annual_heat_demand: "ann_demands_per_type" calculated,
| building_class: 'building_class' from shape file,
| name: "bdew_profile" according to mapping in building_class_mapping.csv,
| ww_incl: True, includes hot water
Heat profiles are created according to the approach described in the corresponding BDEW guideline.
The method was originally established in this PhD Thesis at TU Munich <https://mediatum.ub.tum.de/doc/601557/601557.pdf>.
The approach for generating heat demand profiles is described in section 4.1 (Synthetic load profile approach).
| KW: Kundenwert (customer value). Daily consumption of customer at
| h: h-Wert (h-value) , depending on SLP type and daily mean temperature.
| F: Wochentagsfaktor (week day factor), depending on SLP type and day of the week.
| T: Daily mean temperature 2 meters above the ground (simple mean or "geometric series", which means a weighted sum over the previous days).
| SF: Stundenfaktor (hour factor)
The geometric series approach is meant to account for thermal inertia.
Depending on the profile type, different coefficients A, B, C, D for the sigmoid function are used.
Types of houses:
| EFH: Single family house
| MFH: Multi family house
| GMK: Meetal and automotive
| GHA: Retail and wholesale
| GKO: Local authorities, credit institutions and insurance companies
| GBD: Other operational services
| GGA: Restaurants
| GBH: Accommodation
| GWA: Llaundries, dry cleaning
| GGB: Horticulture
| GBA: Bakery
| GPD: Paper and printing
| GMF: Household-like business enterprises
| GHD: Total load profile Business/Commerce/Services
Building class:
The parameter building_class (German: Baualtersklasse) can assume values in the range 1-11.
The electrical profiles are the standard load profiles from BDEW. All profiles have a resolution of 15 minutes. They are based on measurements in the German electricity sector. There is a dynamic function (h0_dyn) for the houshold (h0) profile that better takes the seasonal variance into account.
With t the day of the year as a decimal number.
The following profile types are available. Be aware that the types in Python code are strings in lowercase.
| G0:, "General trade/business/commerce", "Weighted average of profiles G1-G6"
| G1:, "Business on weekdays 8 a.m. - 6 p.m.", "e.g. offices, doctors' surgeries, workshops, administrative facilities"
| G2:, "Businesses with heavy to predominant consumption in the evening hours", "e.g. sports clubs, fitness studios, evening restaurants"
| G3:, "Continuous business", "e.g. cold stores, pumps, sewage treatment plants"
| G4:, "Shop/barber shop"
| G5:, "Bakery with bakery"
| G6:, "Weekend operation", "e.g. cinemas"
| G7:, "Mobile phone transmitter station", "continuous band load profile"
| L0:, "General farms", "Weighted average of profiles L1 and L2"
| L1:, "Farms with dairy farming/part-time livestock farming",
| L2:, "Other farms",
| H0/H0_dyn:, "Household/dynamic houshold",
- Create and activate enviroment. Example with anaconda:
conda activate bdewles - cd to folder with github clone
pip install -e .
cd "folder/main.py"- Store necessary GIS data to "folder/data/raw" and modify
overwrite_shp.pyaccordingly to adapt the columns of the shapefile - Prepare shp.-file with prepare_for_bdew.py: this scripts adapts the shapefile using the functions in datamgmt to assign building age, building type etc.
python main.py- Parameters can be changed in "datamgmt/Parameters.py"
- Results will be stored in "results".
Needs a csv file that links the GITTER_ID_ item to the census statistics. For an example of the file, see ./data/census/2024-08-12_zensus.csv.
Needs to be a shapefile with columns: ['GML_ID', 'USE_CALC', 'AREA_CALC', 'VOL_CALC', 'HEIGH_MEAS', 'HEIGH_CALC', 'CONSTRUCTI', 'CENS_GRID', 'geometry'] If not, change with the script in ./data/raw-data/overwrite_shp.py.
- Post an issue
- Contact the authors
- Open a detailed pull request and email the authors.
- Lennart Trentmann (lennart.trentmann@tum.de)
- Amedeo Ceruti (amedeo.ceruti@tum.de)
- Benedikt Schweiger (benedikt.schweiger@tum.de)
Acknowledgement: the Heat2Q project partners for their ongoing feedback.
In development until early 2026.