energy_demand package

Subpackages

Submodules

energy_demand.enduse_func module

Enduse

Contains the Enduse Class. This is the most important class where the change in enduse specific energy demand is simulated depending on scenaric assumptions.

class energy_demand.enduse_func.Enduse(region_name, scenario_data, assumptions, non_regional_lp_stock, base_yr, curr_yr, enduse, sector, fuel, tech_stock, heating_factor_y, cooling_factor_y, service_switches, fuel_tech_p_by, tech_increased_service, tech_decreased_service, tech_constant_service, sig_param_tech, enduse_overall_change, regional_lp_stock, criterias, fueltypes_nr, fueltypes, model_yeardays_nrs, dw_stock=False, reg_scen_drivers=None, flat_profile_crit=False)[source]

Bases: object

Enduse Class for all endueses in each SubModel

For every region and sector, a different instance is generated. In this class, first the change in energy demand is calculated on a annual temporal scale. Calculations are performed in a cascade (e.g. first reducing climate change induced savings, then substracting further behavioral savings etc.). After annual calculations, the demand is converted to hourly demand.

Also within this function, the fuel inputs are converted to energy service (short: service) and converted back to fuels (e.g. electricit).

Parameters:
  • region_name (str) – Region name
  • scenario_data (dict) – Scenario data
  • assumptions (dict) – Assumptions
  • non_regional_lp_stock (dict) – Load profile stock
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
  • enduse (str) – Enduse name
  • sector (str) – Sector name
  • fuel (array) – Yearly fuel data for different fueltypes
  • tech_stock (object) – Technology stock of region
  • heating_factor_y (array) – Distribution of fuel within year to days (yd) (directly correlates with HDD)
  • cooling_factor_y (array) – Distribution of fuel within year to days (yd) (directly correlates with CDD)
  • service_switches (list) – Service switches
  • fuel_tech_p_by (dict) – Fuel tech assumtions in base year
  • tech_increased_service (dict) – Technologies per enduse with increased service due to scenarios
  • tech_decreased_service (dict) – Technologies per enduse with decreased service due to scenarios
  • tech_constant_service (dict) – Technologies per enduse with constat service
  • sig_param_tech (dict) – Sigmoid parameters
  • enduse_overall_change (dict) – Assumptions related to overal change in endyear
  • regional_lp_stock (object) – Load profile stock
  • dw_stock (object,default=False) – Dwelling stock
  • reg_scen_drivers (bool,default=None) – Scenario drivers per enduse
  • flat_profile_crit (bool,default=False) – Criteria of enduse has a flat shape or not

Note

  • Load profiles are assigned independently of the fueltype, i.e. the same profiles are assumed to hold true across different fueltypes
  • self.fuel_new_y is always overwritten in the cascade of calculations

Warning

Not all enduses have technologies assigned. Load peaks are derived from techstock in case technologies are defined. Otherwise enduse load profiles are used.

enduse_techs = None

for tech in assumptions[‘heating_technologies’] – self.techs_fuel_yh[tech] = np.zeros((fueltypes_nr, model_yeardays_nrs, 24), dtype=float) self.techs_fuel_peak_h[tech] = np.zeros((fueltypes_nr, model_yeardays_nrs, 24), dtype=float) self.techs_fuel_peak_dh[tech] = np.zeros((fueltypes_nr, model_yeardays_nrs, 24), dtype=float)

energy_demand.enduse_func.apply_climate_change(enduse, fuel_new_y, cooling_factor_y, heating_factor_y, enduse_space_heating, enduse_space_cooling)[source]

Change fuel demand for heat and cooling service depending on changes in HDD and CDD within a region (e.g. climate change induced)

enduse : str
Enduse
fuel_new_y : array
Yearly fuel per fueltype
cooling_factor_y : array
Distribution of fuel within year to days (yd)
heating_factor_y : array
Distribution of fuel within year to days (yd)
enduse_space_heating : list
Enduses defined as space heating
enduse_space_cooling : list
Enduses defined as space cooling
Returns:fuel_new_y – Changed yearly fuel per fueltype
Return type:array

Note

  • cooling_factor_y and heating_factor_y are based on the sum
    over the year. Therefore it is assumed that fuel correlates directly with HDD or CDD.
energy_demand.enduse_func.apply_heat_recovery(enduse, strategy_variables, enduse_overall_change, service, crit_dict, base_yr, curr_yr)[source]

Reduce heating demand according to assumption on heat reuse

Parameters:
  • enduse (str) – Enduse
  • strategy_variables (dict) – Strategy variables
  • enduse_overall_change (dict) – Sigmoid diffusion info
  • service (dict or array) – Service of current year
  • crit_dict (str) – Criteria to run function differently
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
Returns:

service_reduced – Reduced service after assumption on reuse

Return type:

dict or array

Note

A standard sigmoid diffusion is assumed from base year to end year

energy_demand.enduse_func.apply_scenario_drivers(enduse, fuel_y, dw_stock, region_name, gva, population, reg_scen_drivers, base_yr, curr_yr)[source]

The fuel data for every end use are multiplied with respective scenario drivers. If no dwelling specific scenario driver is found, the identical fuel is returned.

Parameters:
  • enduse (str) – Enduse
  • fuel_y (array) – Yearly fuel per fueltype
  • dw_stock (object) – Dwelling stock
  • region_name (str) – Region name
  • gva (dict) – GVA
  • population (dict) – Population
  • reg_scen_drivers (dict) – Scenario drivers per enduse
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
Returns:

fuel_y – Changed yearly fuel per fueltype

Return type:

array

energy_demand.enduse_func.apply_smart_metering(enduse, fuel_y, sm_assump, sm_assump_strategy, base_yr, curr_yr)[source]

Calculate fuel savings depending on smart meter penetration

Parameters:
  • enduse (str) – Enduse
  • fuel_y (array) – Yearly fuel per fueltype
  • sm_assump (dict) – smart meter assumptions
  • sm_assump_strategy (dict) – Base simulation parameters
  • curr_yr (base_yr,) – years
Returns:

fuel_y – New fuel per year

Return type:

array

Note

  • The smart meter penetration is assumed with a sigmoid diffusion.
  • In the assumptions the maximum penetration and also the
    generally fuel savings for each enduse can be defined.
energy_demand.enduse_func.apply_specific_change(enduse, fuel_y, enduse_overall_change, enduse_overall_change_strategy, base_yr, curr_yr)[source]

Calculates fuel based on assumed overall enduse specific fuel consumption changes.

The changes are assumed across all fueltypes. Because for enduses where no technologies are defined, a linear diffusion is suggested to best represent multiple sigmoid efficiency improvements of individual technologies.

Either a sigmoid standard diffusion or linear diffusion can be implemented. Linear is suggested.

Parameters:
  • enduse (str) – Enduse
  • fuel_y (array) – Yearly fuel per fueltype
  • enduse_overall_change (dict) – Info about how the enduse is overall changed (e.g. diff method)
  • enduse_overall_change_strategy (dict) – Change in overall enduse for every enduse (percent ey)
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
Returns:

fuel_y – Yearly new fuels

Return type:

array

energy_demand.enduse_func.assign_lp_no_techs(enduse, sector, load_profiles, fuel_new_y)[source]

Assign load profiles for an enduse which has no technologies defined.

Parameters:
  • enduse (str) – Enduse
  • sector (str) – Enduse
  • load_profiles (obj) – Load profiles
  • fuel_new_y (array) – Fuels
Returns:

  • fuel_yh
  • fuel_peak_dh
  • fuel_peak_h

energy_demand.enduse_func.calc_fuel_tech_y(enduse, tech_stock, fuel_tech_y, fueltypes_nr, fueltypes, mode_constrained)[source]

Calculate yearly fuel per technology (no load profile assigned).

Parameters:
  • enduse (str) – Enduse
  • tech_stock (object) – Technology stock
  • fuel_tech_y (dict) – Fuel per technology per year
  • lookups (dict) – look-up
  • fueltype (dict) – Integer of fueltypes
  • mode_constrained (bool) – Running mode
Returns:

fuel_y – Fuel per year per fueltype

Return type:

array

Note

This function can be run in two different modes

energy_demand.enduse_func.calc_fuel_tech_yh(enduse, sector, enduse_techs, enduse_fuel_tech, tech_stock, load_profiles, fueltypes_nr, fueltypes, model_yeardays_nrs, mode_constrained)[source]

Iterate fuels for each technology and assign shape yd and yh shape

Parameters:
  • enduse_fuel_tech (dict) – Fuel per technology in enduse
  • tech_stock (object) – Technologies
  • load_profiles (object) – Load profiles
  • fueltypes_nr (dict) – Nr of fueltypes
  • fueltypes (dict) – Fueltypes lookup
  • mode_constrained (bool) – Mode criteria
  • model_yeardays_nrs (int) – Number of modelled yeardays
Returns:

fuels_yh – Fueltype storing hourly fuel for every fueltype (fueltype, model_yeardays_nrs, 24)

Return type:

array

energy_demand.enduse_func.calc_lf_improvement(param_name, base_yr, curr_yr, loadfactor_yd_cy, lf_improvement_ey, yr_until_changed)[source]

Calculate load factor improvement depending on linear diffusion over time.

Parameters:
  • param_name (str) – Parameter name
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
  • loadfactor_yd_cy (float) – Yd Load factor of current year
  • lf_improvement_ey (dict) – Load factor improvement until end year
  • yr_until_changed (int) – Year until fully changed
Returns:

  • lf_improved_cy (str) – Improved load factor of current year
  • peak_shift_crit (bool) – True: Peak is shifted, False: Peak isn’t shifed

energy_demand.enduse_func.calc_peak_tech_dh(enduse, sector, enduse_techs, enduse_fuel_tech, fuel_yh, tech_stock, load_profile, fueltypes_nr, fueltypes, mode_constrained)[source]

Calculate peak demand for every fueltype and technology

Parameters:
  • enduse (str) – Enduse
  • sector (str) – Sector
  • enduse_techs (list) – Enduse technologies
  • enduse_fuel_tech (array) – Fuel per enduse and technology
  • fuel_yh (array) – Fuel per hours
  • tech_stock (data) – Technology stock
  • load_profile (object) – Load profile
  • fueltypes_nr (int) – Number of fueltypes
  • mode_constrained (bool) – Constrained mode criteria
Returns:

fuels_peak_dh – Peak values for peak day for every fueltype

Return type:

array

Note

  • This function gets the hourly values of the peak day for every fueltype.
    The daily fuel is converted to dh for each technology.
  • For some technology types (heat_pump a)
    the dh peak day profile is not read in from technology stock but from shape_yh of peak day.
energy_demand.enduse_func.calc_service_switch(tot_service_yh_cy, service_tech_by_p, tech_increase_service, tech_decrease_service, tech_constant_service, sig_param_tech, curr_yr)[source]

Apply change in service depending on defined service switches.

tot_service_yh_cy : array
Hourly service of all technologies
service_tech_by_p : dict
Fraction of service per technology
tech_increase_service : dict
Technologies with increased service
tech_decrease_service : dict
Technologies with decreased service
tech_constant_service : dict
Technologies with constant service
sig_param_tech : dict
Sigmoid diffusion parameters
curr_yr : int
Current year
Returns:
  • service_tech_yh_cy (dict) – Service per technology in current year after switch for every hour in a year
  • TODO

Note

The service which is fulfilled by new technologies is substracted of the replaced technologies proportionally to the base year distribution of these technologies

energy_demand.enduse_func.convert_service_to_p(tot_service_y, service_fueltype_tech)[source]

Calculate fraction of service for every technology of total service

Parameters:
  • tot_service_y (float) – Total yearly service
  • service_fueltype_tech (dict) – Service per technology and fueltype
Returns:

service_tech_p – All tecnology services are provided as a fraction of total service

Return type:

dict

Note

Iterate over values in dict and apply calculations

energy_demand.enduse_func.demand_management(enduse, base_yr, curr_yr, strategy_variables, fuel_yh, fuel_peak_dh, enduse_techs, sector, fuel_tech_y, tech_stock, load_profiles, fueltypes, fueltypes_nr, mode_constrained)[source]

Demand management. This function shifts peak per of this enduse depending on peak shifting factors

Parameters:
  • enduse (str) – Enduse
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
  • strategy_variables (dict) – Assumptions of strategy variables
  • fuel_yh (array) – Fuel per hours
  • fuel_peak_dh (array) – Fuel per peak dh
  • enduse_techs (list) – Enduse specfic technologies
  • sector (str) – Sector
  • fuel_tech_y (dict) – Annual fuel per technology
  • tech_stock (obj) – Technology stock
  • load_profiles (obj) – Load profiles
  • fueltypes_nr (int) – Number of fueltypes
  • mode_constrained (bool) – Running mode
Returns:

  • fuel_yh (array) – Fuel of yh
  • fuel_peak_h (array) – Fuel of peak hour
  • fuel_peak_dh (array) – Fuel of peak day

energy_demand.enduse_func.fuel_to_service(enduse, fuel_new_y, enduse_techs, fuel_tech_p_by, tech_stock, fueltypes, mode_constrained)[source]

Converts fuel to energy service (1), calcualates contribution service fraction (2)

Parameters:
  • enduse (str) – Enduse
  • fuel_new_y (array) – Fuel per fueltype
  • enduse_techs (dict) – Technologies of enduse
  • fuel_tech_p_by (dict) – Fuel composition of base year for every fueltype for each enduse (assumtions for national scale)
  • tech_stock (object) – Technology stock of region
  • fueltypes (dict) – Fueltype look-up
  • mode_constrained (bool) – Criteria about mode
Returns:

  • tot_service_yh (array) – Absolute total yh energy service per technology and fueltype
  • service_tech (dict) – Absolute energy service for every technology
  • service_tech_p (dict) – Fraction of energy service for every technology (sums up to one in total (not specified by fueltype))
  • service_fueltype_tech_p (dict) – Fraction of energy service per fueltype and technology (within every fueltype sums up to one)
  • service_fueltype_p (dict) – Fraction of service per fueltype (within every fueltype sums up to one)

Note

(1) Calculate energy service of each technology based on assumptions about base year fuel shares of an enduse (fuel_tech_p_by).

(2) The fraction of an invidual technology to which it contributes to total energy service (e.g. how much of total heat service is provided by boiler technology).

  • Efficiency changes of technologis are considered.
  • Energy service = fuel * efficiency
  • This function can be run in two modes, depending on mode_constrained criteria
  • The base year efficiency is taken because the actual service can only be calculated with base year. Otherwise, the service would increase e.g. if technologies would become more efficient. Efficiencies are only considered if converting back to fuel However, the self.fuel_new_y is taken because the actual service was reduced e.g. due to smart meters or temperatur changes
energy_demand.enduse_func.get_crit_switch(enduse, switches, base_yr, curr_yr, mode_constrained)[source]

Test whether there is a switch (service or fuel)

Parameters:
  • switches (dict) – All switches
  • sim_param (float) – Base Arguments
  • mode_constrained (bool) – Mode criteria

Note

If base year, no switches are implemented

energy_demand.enduse_func.get_enduse_configuration(mode_constrained, enduse, enduse_space_heating, base_yr, curr_yr, service_switches)[source]

Get enduse specific configuration

Parameters:
  • mode_constrained (bool) – Constrained mode criteria
  • enduse (str) – Enduse
  • enduse_space_heating (list) – All endueses classified as space heating
  • curr_yr (base_yr,) – Base, current, year
  • service_switches (list) – Service switches
energy_demand.enduse_func.get_enduse_tech(fuel_tech_p_by)[source]

Get all defined technologies of an enduse

Parameters:fuel_tech_p_by (dict) – Percentage of fuel per enduse per technology
Returns:enduse_techs – All technologies
Return type:list

Note

All technologies are read out, including those which are potentiall defined in fuel or service switches.

If for an enduse a dummy technology is defined, the technologies of an enduse are set to an empty list.

Warning

For every enduse technologes must either be defined for no fueltype or for all fueltypes

energy_demand.enduse_func.get_lp_stock(enduse, non_regional_lp_stock, regional_lp_stock)[source]

Defines the load profile stock depending on enduse. (Get regional or non-regional load profile data)

Parameters:
  • enduse (str) – Enduse
  • non_regional_lp_stock (object) – Non regional dependent load profiles
  • regional_lp_stock (object) – Regional dependent load profiles
Returns:

load_profiles – Load profile

Return type:

object

Note

Because for some enduses the load profiles depend on the region they are stored in the WeatherRegion Class. One such example is heating. If the enduse is not dependent on the region, the same load profile can be used for all regions

If the enduse depends on regional factors, regional_lp_stock is returned. Otherwise, non-regional load profiles which can be applied for all regions is used (non_regional_lp_stock)

energy_demand.enduse_func.get_peak_day(fuel_yh)[source]

Iterate yh and get day with highes fuel (across all fueltypes). The day with most fuel across all fueltypes is considered to be the peak day. Over the simulation period, the peak day may change date in a year. If no fuel is provided, the program is crashed

Parameters:fuel_yh (array) – Fuel for every yh (fueltypes, yh)
Returns:peak_day_nr – Day with most fuel or service across all fueltypes
Return type:int
energy_demand.enduse_func.get_running_mode(enduse, mode_constrained, enduse_space_heating)[source]

Checks which mode needs to be run for an enduse.

Parameters:
  • mode_constrained (bool) – Criteria of running mode
  • enduse_space_heating (dict) – All heating enduses across all models
Returns:

bool – The return value

Return type:

bool

Note

If ‘crit_mode’ == True, then overall heat is provided to the supply model not specified for technologies. Otherwise, heat demand is supplied per technology

energy_demand.enduse_func.get_service_diffusion(sig_param_tech, curr_yr)[source]

Calculate energy service fraction of technologies with increased service for current year based on sigmoid diffusion

Parameters:
  • sig_param_tech (dict) – Sigmoid diffusion parameters per technology
  • curr_yr (dict) – Current year
Returns:

service_tech – Share of service per technology of current year

Return type:

dict

energy_demand.enduse_func.service_to_fuel(enduse, service_tech, tech_stock, fueltypes_nr, fueltypes, mode_constrained)[source]

Convert yearly energy service to yearly fuel demand. For every technology the service is taken and converted to fuel based on efficiency of current year

enduse : str
Enduse
service_tech : dict
Service per fueltype and technology
tech_stock : object
Technological stock
lookups : dict
look-up
mode_constrained : bool
Mode running criteria
Returns:
  • fuel_new_y (array) – Fuel per fueltype
  • fuel_per_tech (dict) – Fuel per technology

Note

  • The attribute ‘fuel_new_y’ is updated
  • Fuel = Energy service / efficiency

energy_demand.main module

Energy Demand Model

Contains the function energy_demand_model which is used to run the energy demand model

Development checklist: https://nismod.github.io/docs/development-checklist.html https://nismod.github.io/docs/ https://nismod.github.io/docs/smif-prerequisites.html#sector-modeller # Implement that e.g. 2015 - 2030 one technology and 2030 - 2050 another technology # backcasting # Industry INFO about efficiencies & technologies: Define strategy variables # Cooling?

# Potentiall load other annual profiles? DISTRICT HEATING TECHS TODO: Improve industry related demand –> define strategies TODO: Related ed to houses & householdsize TODO: Define efficencies of all techs TODO: Base year fuel assignements TODO: ET_module TODO :TEST IF IN SUMMER COOLING CAN BE ADDED FOR ELECTRICITY TODO: COOLING?

energy_demand.main.energy_demand_model(data, fuel_in=0, fuel_in_elec=0)[source]

Main function of energy demand model to calculate yearly demand

Parameters:data (dict) – Data container
Returns:
  • result_dict (dict) – A nested dictionary containing all data for energy supply model with timesteps for every hour in a year. [fueltype : region : timestep]
  • modelrun_obj (dict) – Object of a yearly model run

Note

This function is executed in the wrapper

energy_demand.model module

Energy Demand Model

The function EnergyDemandModel executes all the submodels of the energy demand model

class energy_demand.model.EnergyDemandModel(regions, data)[source]

Bases: object

Energy Model of a simulation yearly run. Main function of energy demand model. All submodels are executed here and all aggregation functions of the results

Parameters:
  • regions (list) – Region names
  • data (dict) – Main data container
energy_demand.model.aggr_fuel_aggr(input_array, attribute_to_get, sector_models, sum_crit, model_yearhours_nrs, model_yeardays_nrs)[source]

Collect hourly data from all regions and sum across all fuel types and enduses

Parameters:
  • input_array (array) – Array to sum results
  • attribute_to_get (str) – Attribue to sumarise
  • sum_crit (bool) – Criteria to sum or not
  • model_yearhours_nrs (int) – Number of modelled hours in a year
  • model_yeardays_nrs (int) – Number of modelled yeardays
Returns:

input_array – Summarised array

Return type:

array

energy_demand.model.aggr_fuel_regions_fueltype(aggregation_array, fueltypes_nr, fueltypes, array_region_nr, model_yearhours_nrs, model_yeardays_nrs, submodels)[source]

Aggregate fuels for every fueltype, region and timestep (unconstrained mode).

Parameters:
  • aggregation_array (array) – Array to aggregate ed
  • fueltypes_nr (dict) – Number of fueltypes
  • fueltypes (dict) – Fueltypes
  • array_region_nr (int) – Array nr position of region
  • model_yearhours_nrs (int) – Modelled houry in a year (max 8760)
  • model_yeardays_nrs (int) – Number of modelled yeardays (max 365)
  • submodels (list) – List with submodels
Returns:

  • aggregation_array (array) – Aggregated fuels per fueltype, region, yearhours
  • fuel_region (dict) – Aggregated fuel per fueltype, yeardays, hours

energy_demand.model.aggregate_final_results(aggr_results, reg_array_nr, all_submodels, mode_constrained, fueltypes, fueltypes_nr, model_yearhours_nrs, model_yeardays_nrs, seasons, enduse_space_heating, technologies, beyond_supply_outputs=True)[source]

Aggregate results for a single region

Parameters:
  • aggr_results (dict) – Contains alls results to aggregate (key of this will be made self.attributes)
  • reg_array_nr (int) – Region array number
  • all_submodels (list) – Submodel objects
  • mode_constrained (bool) – Mode of how to run the model
  • fueltypes (dict) – Fueltypes lookup
  • fueltypes_nr (int) – Number of fueltypes
  • model_yearhours_nrs (int) – Number of modelled hours in a year
  • model_yeardays_nrs (int) – Number of modelled days in a year
  • seasons (dict) – Seasons
  • enduse_space_heating (list) – All heating enduses
  • technologies (dict) – Technologies
  • beyond_supply_outputs (bool) – Criteria whether additional results are aggregated for plotting purposes going beyond the SMIF framework
Returns:

aggr_results – Contains all aggregated results

Return type:

dict

energy_demand.model.averaged_season_hourly(averaged_h, fuel_region_yh, reg_array_nr, fueltypes, seasons)[source]

Calculate averaged hourly values for each season

Parameters:
  • averaged_h (dict) – Averaged hours per season (season, fueltype, array_nr_reg, 24)
  • fuel_region_yh (array) – Fuel of region (fueltype, yearday)
  • reg_array_nr (int) – Integer of region
  • fueltypes (dict) – Fueltype lookup
  • ed_fueltype_regs_yh (array) – (fueltypes_nr, reg_nrs, yearhours_nrs)
Returns:

averaged_h – Averaged hourly value per season {season: array(fuetlype, region, 24)}

Return type:

dict

energy_demand.model.create_dwelling_stock(regions, curr_yr, data)[source]

Create dwelling stock based on NEWCASTLE data

energy_demand.model.create_virtual_dwelling_stocks(regions, curr_yr, data)[source]

Create virtual dwelling stocks for residential and service sector

energy_demand.model.fuel_aggr(attribute_to_get, sector_models, sum_crit, model_yearhours_nrs, fueltypes_nr, model_yeardays_nrs)[source]

Collect hourly data from all regions and sum across all fuel types and enduses

Parameters:
  • input_array (array) – Array to sum results
  • attribute_to_get (str) – Attribue to sumarise
  • sum_crit (str) – Criteria
  • model_yearhours_nrs (int) – Number of modelled hours in a year
  • model_yeardays_nrs (int) – Number of modelled yeardays
  • region_name (str, default=False) – Name of region
Returns:

input_array – Summarised array

Return type:

array

energy_demand.model.fuel_regions_fueltype(fueltypes_nr, model_yearhours_nrs, model_yeardays_nrs, submodels)[source]

Aggregate fuels for every fueltype, region and timestep (unconstrained mode).

Parameters:
  • fueltypes_nr (dict) – Number of fueltypes
  • model_yearhours_nrs (int) – Modelled houry in a year (max 8760)
  • model_yeardays_nrs (int) – Number of modelled yeardays
  • submodels (list) – List with submodels
Returns:

fuel_region – Aggregated fuel per (fueltype, yeardays, hours) TODO

Return type:

dict

energy_demand.model.get_fuels_yh(enduse_object, attribute_to_get, model_yearhours_nrs, model_yeardays_nrs)[source]

Get yh load profile and assign yh shape for enduses with flat load profiles

Parameters:
  • enduse_object (dict) – Object of submodel run
  • attribute_to_get (str) – Attribute to read out
  • model_yearhours_nrs (int) – Number of modelled hours in a year
  • model_yeardays_nrs (int) – Number of modelled yeardays
Returns:

fuels – Fuels with flat load profile

Return type:

array

Note

  • For enduses where ‘flat_profile_crit’ in Enduse Class is True a flat load profile is generated. Otherwise, the yh as calculated for each enduse is used
  • Flat shape
energy_demand.model.industry_submodel(region, scenario_data, non_regional_lp_stock, assumptions, sim_param, lookups, criterias, enduses, sectors)[source]

Industry subsector model

A flat load profile is assumed except for is_space_heating

Parameters:
  • region (int) – Region
  • data (dict) – Data containter
  • enduses (list) – Enduses of industry submodel
  • sectors (list) – Sectors of industry submodel
Returns:

submodules – Submodule objects

Return type:

list

energy_demand.model.initialise_result_container(fueltypes_nr, sectors, reg_nrs, model_yearhours_nrs, model_yeardays_nrs, heating_technologies)[source]

Create container with empty dict or arrays as values in a dict. This is used to aggregate the region calculation results

Parameters:
  • fueltypes_nr (int) – Number of fueltypes
  • sectors (list) – Sectors
  • reg_nrs (int) – Number of regions
  • model_yearhours_nrs (int) – Number of yearhours
  • model_yeardays_nrs (int) – Number of yeardays
  • heating_technologies (list) – Heating technologies
Returns:

result_container – Contained with all empty correctly formated values for aggregation

Return type:

dict

energy_demand.model.residential_submodel(region, scenario_data, rs_dw_stock, non_regional_lp_stock, assumptions, sim_param, lookups, criterias, enduses, sectors=False)[source]

Create the residential submodules (per enduse and region) and add them to list data[‘lookups’] :param data: Data container :type data: dict :param enduses: All residential enduses :type enduses: list :param sectors: Sectors :type sectors: list, default=False

Returns:submodule_list – List with submodules
Return type:list
energy_demand.model.service_submodel(region, scenario_data, ss_dw_stock, non_regional_lp_stock, assumptions, sim_param, lookups, criterias, enduses, sectors)[source]

Create the service submodules per enduse, sector and region and add to list

Parameters:
  • data (dict) – Data container
  • enduses (list) – All residential enduses
  • sectors (list) – Service sectors
Returns:

submodels – List with submodels

Return type:

list

energy_demand.model.simulate_region(region, data, weather_regions)[source]

Run submodels for a single region, return aggregate results

Parameters:
  • region (str) – Region name
  • data (dict) – Data container
  • weather_regions (oject) – Weather regions
Returns:

XX_submodels – SubModel result object

Return type:

obj

energy_demand.model.sum_enduse_all_regions(input_dict, attribute_to_get, sector_models, model_yearhours_nrs, model_yeardays_nrs)[source]

Summarise an enduse attribute across all regions

Parameters:
  • attribute_to_get (string) – Enduse attribute to summarise
  • sector_models (List) – List with sector models
Returns:

enduse_dict – Summarise enduses across all regions

Return type:

dict

energy_demand.read_and_plot_results module

Module contents

Energy Demand