Reference

Implementation of the standard load profiles

class demandlib.bdew.elec_slp.ElecSlp(year, seasons=None, holidays=None)[source]

Bases: object

Generate electrical standardized load profiles based on the BDEW method.

Parameters:
  • year (integer) – Year of the demand series.
  • Optional Parameters
  • ——————-
  • seasons (dictionary) – Describing the time ranges for summer, winter and transition periods. The seasons dictionary will update the existing one, so only changed keys have to be defined. Make sure not to create time gaps. The “h0_dyn” will not work with changed seasons, so you have to use your own smoothing curve to create a “h0_dyn” profile.
  • holidays (dictionary or list) – The keys of the dictionary or the items of the list should be datetime objects of the days that are holidays.
all_load_profiles(time_df, holidays=None)[source]
create_bdew_load_profiles(dt_index, slp_types, holidays=None)[source]

Calculates the hourly electricity load profile in MWh/h of a region.

create_dynamic_h0_profile()[source]

Use the dynamisation function of the BDEW to smoothen the seasonal edges. Functions resolution is daily.

F_t = -3,92\cdot10^{-10} \cdot t^4 + 3,2\cdot10^{-7}
\cdot t^3– 7,02\cdot10^{-5}\cdot t^2 + 2,1\cdot10^{-3}
\cdot t + 1,24

With t the day of the year as a decimal number.

Adjustment of accuracy: from -3,92 to -3.916649251

date_time_index
get_profile(ann_el_demand_per_sector)[source]

DEPRECATED: Use get_scaled_power_profiles() instead

Parameters:ann_el_demand_per_sector (dictionary) – Key: sector, value: annual value
Returns:pandas.DataFrame (Table with all profiles)
get_profiles(*args)[source]
Get all or the selected profiles. To select profiles you can pass
the name of the types as strings. The profiles are normalised to 1.

Try print(get_profiles().columns to get all valid types.

Returns:pandas.DataFrame (Table with all or the selected profiles.)

Examples

>>> from demandlib import bdew
>>> e_slp = bdew.ElecSlp(year=2020)
>>> ", ".join(sorted(e_slp.get_profiles().columns))
'g0, g1, g2, g3, g4, g5, g6, h0, h0_dyn, l0, l1, l2'
>>> e_slp.get_profiles("h0", "g0").head()
                           h0        g0
2020-01-01 00:00:00  0.000017  0.000016
2020-01-01 00:15:00  0.000015  0.000015
2020-01-01 00:30:00  0.000014  0.000015
2020-01-01 00:45:00  0.000012  0.000014
2020-01-01 01:00:00  0.000012  0.000013
>>> e_slp.get_profiles("h0", "g0").sum()
h0    1.0
g0    1.0
dtype: float64
get_scaled_power_profiles(ann_el_demand_per_sector, conversion_factor=4)[source]

Get profiles scaled by there annual value. Each value represents the average power of an interval. Therefore, it is not possible to sum up the array. A conversion factor is used to calculate power units from energy units. By default the conversion factor is 4. As the interval of each profile is 15 minutes a conversion factor of 4 will convert energy units like Wh, kWh, MWh etc. to power units like W, kW, MW etc..

Parameters:
  • ann_el_demand_per_sector (dict) – The annual demand in an energy unit for each type.
  • conversion_factor (float) – Factor to convert the energy unit of the annual value to the power unit of each interval.
Returns:

pandas.DataFrame (Table with scaled profiles.)

Examples

>>> from demandlib import bdew
>>> e_slp = bdew.ElecSlp(year=2020)
>>> e_slp.get_scaled_power_profiles({"h0": 3000, "g0": 5000}).head()
                           g0        h0
2020-01-01 00:00:00  0.320338  0.202627
2020-01-01 00:15:00  0.305866  0.182365
2020-01-01 00:30:00  0.291590  0.164500
2020-01-01 00:45:00  0.278682  0.149633
2020-01-01 01:00:00  0.268122  0.138602
>>> cf = 4
>>> spp = e_slp.get_scaled_power_profiles({"h0": 3000, "g0": 5000},
...                                       conversion_factor=cf)
>>> spp.sum()
g0    20000.0
h0    12000.0
dtype: float64
>>> spp.div(cf).sum()
g0    5000.0
h0    3000.0
dtype: float64
get_scaled_profiles(ann_el_demand_per_sector)[source]

Get profiles scaled by there annual value.

Parameters:ann_el_demand_per_sector (dict) – The annual demand in an energy unit for each type.
Returns:pandas.DataFrame (Table with scaled profiles.)

Examples

>>> from demandlib import bdew
>>> e_slp = bdew.ElecSlp(year=2020)
>>> e_slp.get_scaled_profiles({"h0": 3000, "g0": 5000}).head()
                           g0        h0
2020-01-01 00:00:00  0.080084  0.050657
2020-01-01 00:15:00  0.076466  0.045591
2020-01-01 00:30:00  0.072897  0.041125
2020-01-01 00:45:00  0.069671  0.037408
2020-01-01 01:00:00  0.067030  0.034650
>>> e_slp.get_scaled_profiles({"h0": 3000, "g0": 5000}).sum()
g0    5000.0
h0    3000.0
dtype: float64

Implementation of the bdew heat load profiles

class demandlib.bdew.heat_building.HeatBuilding(df_index, **kwargs)[source]

Bases: object

Parameters:

year (int) – year for which the profile is created

Variables:
  • datapath (string) – path to the bdew basic data files (csv)
  • temperature (pandas.Series) – Series containing hourly temperature data
  • annual_heat_demand (float) – annual heat demand of building in kWh
  • building_class (int) – class of building according to bdew classification possible numbers are: 1 - 11
  • shlp_type (string) – type of standardized heat load profile according to bdew possible types are: GMF, GPD, GHD, GWA, GGB, EFH, GKO, MFH, GBD, GBA, GMK, GBH, GGA, GHA
  • wind_class (int) – wind classification for building location (0=not windy or 1=windy)
  • ww_incl (boolean) – decider whether warm water load is included in the heat load profile
get_bdew_profile()[source]

Calculation of the hourly heat demand using the bdew-equations

get_normalized_bdew_profile()[source]

Calculation of the normalized hourly heat demand

get_sf_values(filename='shlp_hour_factors.csv')[source]

Determine the h-values

Parameters:filename (string) – name of file where sigmoid factors are stored
get_sigmoid_parameters(filename='shlp_sigmoid_factors.csv')[source]

Retrieve the sigmoid parameters from csv-files

Parameters:filename (string) – name of file where sigmoid factors are stored
get_temperature_interval()[source]

Appoints the corresponding temperature interval to each temperature in the temperature vector.

get_weekday_parameters(filename='shlp_weekday_factors.csv')[source]

Retrieve the weekday parameter from csv-file

Parameters:filename (string) – name of file where sigmoid factors are stored
weighted_temperature(how='geometric_series')[source]

A new temperature vector is generated containing a multi-day average temperature as needed in the load profile function.

Parameters:how (string) – string which type to return (“geometric_series” or “mean”)

Notes

Equation for the mathematical series of the average temperature [1]:

T=\frac{T_{D}+0.5\cdot T_{D-1}+0.25\cdot T_{D-2}+
        0.125\cdot T_{D-3}}{1+0.5+0.25+0.125}

with T_D = Average temperature on the present day
T_{D-i} = Average temperature on the day - i

References

[1]BDEW, # noqa: E501 BDEW Documentation for heat profiles.

Implementation of the bdew standard load profiles for electric power.

class demandlib.particular_profiles.IndustrialLoadProfile(dt_index, holidays=None)[source]

Bases: object

Generate an industrial heat or electric load profile.

simple_profile(annual_demand, **kwargs)[source]

Create industrial load profile

Parameters:

annual_demand (float) – Total demand.

Other Parameters:
 
  • am (datetime.time) – beginning of workday
  • pm (datetime.time) – end of workday
  • week (list) – list of weekdays
  • weekend (list) – list of weekend days
  • profile_factors (dictionary) – dictionary with scaling factors for night and day of weekdays and weekend days