energy_demand.profiles package¶
Submodules¶
energy_demand.profiles.generic_shapes module¶
This file contains all functions to generate a flat load profile
-
class
energy_demand.profiles.generic_shapes.
GenericFlatEnduse
(enduse_fuel)[source]¶ Bases:
object
Class for creating generic enduses with flat shapes, i.e. same amount of fuel for every hour in a year.
- Parameters
enduse_fuel (float) – Yearly total fuel
-
energy_demand.profiles.generic_shapes.
flat_shape
(nr_of_days=365)[source]¶ Create completely flat shape for peak and non-peak
- Parameters
nr_of_days (int) – Nr of modelled days
- Returns
shape_peak_dh (array) – Dh shape for peak day
flat_shape_y_dh (array) – Shape non peak dh
flat_shape_yd (array) – Shape yd for non peak
energy_demand.profiles.hdd_cdd module¶
energy_demand.profiles.load_factors module¶
Script containing functions to calculate load factors and also peak shifting methods which are used to implement demand management
-
energy_demand.profiles.load_factors.
calc_lf_d
(fuel_yh, average_fuel_yd, mode_constrained)[source]¶ Calculate the daily load factor for every day in a year by dividing for each day the daily average by the daily peak hour load. The load factor is given in %
- Parameters
fuel_yh (array) – Fuel for every hour in a year
average_fuel_yd (array) – Average load per day
mode_constrained (bool) – Mode information
- Returns
daily_lf (array) – Laod factor calculated for every modelled day [in %]
average_fuel_yd (array) – Average fuel for every day
-
energy_demand.profiles.load_factors.
calc_lf_d_8760
(fuel_yh)[source]¶ Calculate the daily load factor for every day in a year by dividing for each day the daily average by the daily peak hour load. The load factor is given in %
- Parameters
fuel_yh (array) – Fuel for every hour in a year
average_fuel_yd (array) – Average load per day
mode_constrained (bool) – Mode information
- Returns
daily_lf (array) – Laod factor calculated for every modelled day [in %]
average_fuel_yd (array) – Average fuel for every day
-
energy_demand.profiles.load_factors.
calc_lf_season
(seasons, fuel_region_yh, average_fuel_yd)[source]¶ Calculate load factors per fueltype per region. The load factor is calculated based on average yearly load and maximum saisonal peak factor.
- Parameters
seasons (dict) – Seasons containing yeardays for four seasons
fuel_region_yh (array) – Fuels
average_fuel_yd (array) – Average fuels
- Returns
seasons_lfs – Load factors per fueltype and season
- Return type
Note
If not the yearly average is used for calculation, only the load factors within the regions are calculated.
-
energy_demand.profiles.load_factors.
calc_lf_season_8760
(seasons, fuel_region_yh)[source]¶ Calculate load factors per fueltype per region. The load factor is calculated based on average yearly load and maximum saisonal peak factor.
- Parameters
seasons (dict) – Seasons containing yeardays for four seasons
fuel_region_yh (array) – Fuels
- Returns
seasons_lfs – Load factors per fueltype and season
- Return type
Note
If not the yearly average is used for calculation, only the load factors within the regions are calculated.
-
energy_demand.profiles.load_factors.
calc_lf_y
(fuel_yh)[source]¶ Calculate the yearly load factor for every fueltype by dividing the yearly average load by the peak hourly load in a year.
- Parameters
fuel_yh (array (fueltypes, 365, 24) or (fueltypes, 8760)) – Yh fuel
- Returns
load_factor_y – Yearly load factors as percentage (100% = 1)
- Return type
array
Note
Load factor = average load / peak load https://en.wikipedia.org/wiki/Load_factor_(electrical) https://circuitglobe.com/load-factor.html
-
energy_demand.profiles.load_factors.
calc_lf_y_8760
(fuel_yh_8760)[source]¶ Calculate the yearly load factor for every fueltype by dividing the yearly average load by the peak hourly load in a year.
- Parameters
fuel_yh_8760 (array) – Fueltypes, regions, 8760hours
- Returns
load_factor_y – Yearly load factors as percentage (100% = 1)
- Return type
array
Note
Load factor = average load / peak load https://en.wikipedia.org/wiki/Load_factor_(electrical) https://circuitglobe.com/load-factor.html
-
energy_demand.profiles.load_factors.
peak_shaving_max_min
(loadfactor_yd_cy_improved, average_yd, fuel_yh, mode_constrained)[source]¶ Shift demand with help of load factor. All demand above the maximum load is shifted proportionally to all hours having below average demand.
- Parameters
loadfactor_yd_cy_improved (array) – Improved shifted daily load fuel
average_yd (array) – Average load for every day in year
fuel_yh (array) – Fuel for every hour
mode_constrained (bool) – Running mode information
- Returns
shifted_fuel_yh (array) – Shifted fuel
Info
—- –
- Steps:
Calculate new maximum demand for every hour and fueltype
Calculate difference in demand to mean for every day and fueltype
Calculate percentage of demand for every hour with lower demand than average
Calculate total demand above average and shift to yh
Set all hours with more demand than maximum peak to maximum peak demand
energy_demand.profiles.load_profile module¶
Functions related to load profiles
-
class
energy_demand.profiles.load_profile.
LoadProfile
(enduses, unique_identifier, shape_yh, shape_yd, shape_y_dh, model_yeardays)[source]¶ Bases:
object
Load profile container to store differengt shapes
- Parameters
enduses (list) – Enduses assigned to load profile
unique_identifier (string) – Unique identifer for LoadProfile object
shape_y_dh (array) – Shape of every day in a year (sum = 365)
shape_yh (array) – Shape yh (from year to hour) Standard value is average daily amount
shape_peak_dh (array) – Shape (dh), shape of a day for every hour
-
class
energy_demand.profiles.load_profile.
LoadProfileStock
(name)[source]¶ Bases:
object
Collection of load shapes in a list
- Parameters
name (string) – Load profile stock name
-
add_lp
(unique_identifier, technologies, enduses, shape_yd, shape_y_dh, model_yeardays, sectors, shape_yh=False)[source]¶ Add load profile to stock
- Parameters
unique_identifier (str) – Name (unique identifier)
technologies (list) – Technologies for which the profile applies
enduses (list) – Enduses for which the profile applies
shape_y_dh (array) –
shape_yh (array) – Shape yh (from year to hour)
sectors (list, default=False) – Sectors for which the profile applies
-
energy_demand.profiles.load_profile.
abs_to_rel
(absolute_array)[source]¶ Convert absolute numbers in an array to relative
- Parameters
absolute_array (array) – Contains absolute numbers in it
- Returns
relative_array – Contains relative numbers
- Return type
array
Note
If the total sum is zero, return an array with zeros
-
energy_demand.profiles.load_profile.
calc_av_lp
(demand_yh, seasons, model_yeardays_daytype)[source]¶ Calculate average load profile for daytype and season for fuel of a fueltype
- demand_yharray
Energy demand for every day of a single fueltype
- seasons: dict
Seasons and their yeardays
- model_yeardays_daytypedict
Yearday type of every year
- av_loadprofilesdict
season, daytype
- Returns
av_season_daytypes (dict) – Averaged lp
season_daytypes (dict) – Not averaged lp
-
energy_demand.profiles.load_profile.
calc_yh
(shape_yd, shape_y_dh, model_yeardays)[source]¶ Calculate the shape based on yh and y_dh shape
- Parameters
shape_yd (array) – Shape with fuel amount for every day (365)
shape_y_dh (array) – Shape for every day (365, 24), total sum = 365
model_yeardays (array) – Modelled yeardays
- Returns
shape_yh – Shape for every hour in a year (total sum == 1)
- Return type
array
-
energy_demand.profiles.load_profile.
calk_peak_h_dh
(fuel_peak_dh)[source]¶ Ger peak hour in peak day
- Parameters
fuel_peak_dh (array) – Fuel of peak day for every fueltype
- Returns
peak_fueltype_h – Fuel for maximum hour in peak day per fueltype
- Return type
array
-
energy_demand.profiles.load_profile.
calk_peak_h_dh_single_fueltype
(fuel_peak_dh)[source]¶ Ger peak hour in peak day
- Parameters
fuel_peak_dh (array) – Fuel of peak day for every fueltype
- Returns
peak_fueltype_h – Fuel for maximum hour in peak day per fueltype
- Return type
array