energy_demand package

Subpackages

Submodules

energy_demand.enduse_func module

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(submodel, region, scenario_data, assumptions, load_profiles, base_yr, curr_yr, enduse, sector, fuel, tech_stock, heating_factor_y, cooling_factor_y, fuel_fueltype_tech_p_by, sig_param_tech, enduse_overall_change, criterias, strategy_variables, 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:
  • submodel (str) – Submodel
  • region (str) – Region name
  • scenario_data (dict) – Scenario data
  • assumptions (dict) – Assumptions
  • load_profiles (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)
  • fuel_fueltype_tech_p_by (dict) – Fuel tech assumtions in base year
  • 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_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.

fuel_y = None

if enduse == ‘rs_water_heating’ – logging.info(self.enduse_techs) logging.info(flat_profile_crit) prnt(“:”)

energy_demand.enduse_func.apply_air_leakage(enduse, strategy_variables, enduse_overall_change, service, service_techs, base_yr, curr_yr)[source]

Reduce heating demand according to assumption on improvements in air leaking

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 – Service after assumptions on air leaking improvements

Return type:

dict or array

Note

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

energy_demand.enduse_func.apply_climate_change(enduse, fuel_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)

Parameters:
  • enduse (str) – Enduse
  • fuel_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_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_cooling(enduse, fuel_y, strategy_variables, cooled_floorarea_p_by, other_enduse_mode_info, base_yr, curr_yr)[source]

Apply changes for cooling enduses depending on assumption of how much of the floor area in percent is cooled

It is aassumption a linear correlation between the percentage of cooled floor space (area) and energy demand.

Parameters:
  • enduse (str) – Enduse
  • fuel_y (array) – Annual fuel demand
  • strategy_variables (dict) – Strategy variables
  • cooled_floorarea_p_by (dict) – Assumption about cooling floor area in base year
  • other_enduse_mode_info (dict) – diffusion parameters
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
Returns:

fuel_y – Fuel array (either changed fuel depending on cooling percentage) of identical array

Return type:

array

energy_demand.enduse_func.apply_heat_recovery(enduse, strategy_variables, enduse_overall_change, service, service_techs, 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(submodel, enduse, sector, fuel_y, dw_stock, region, gva, population, industry_gva, 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 (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, strategy_variables, 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
  • strategy_variables (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, strategy_variables, 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)
  • strategy_variables (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_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_y (array) – Fuels
Returns:

fuel_yh – Fuel yh

Return type:

array (fueltype, 365, 24)

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

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

Parameters:
  • fuel_tech_y (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(lf_improvement_ey, base_yr, curr_yr, loadfactor_yd_cy, yr_until_changed)[source]

Calculate load factor improvement depending on linear diffusion over time.

Parameters:
  • lf_improvement_ey (dict) – Load factor improvement until end year
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
  • loadfactor_yd_cy (float) – Yd Load factor of current 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_service_switch(enduse, s_tech_y_cy, all_technologies, sig_param_tech, curr_yr, base_yr, sector, crit_switch_happening)[source]

Apply change in service depending on defined service switches.

The service which is fulfilled by new technologies as defined in the service switches is substracted of the replaced technologies proportionally to the base year distribution of these technologies.

Parameters:
  • tot_s_yh_cy (array) – Hourly service of all technologies
  • all_technologies (dict) – Technologies to iterate
  • sig_param_tech (dict) – Sigmoid diffusion parameters
  • curr_yr (int) – Current year
Returns:

switched_s_tech_y_cy – Service per technology in current year after switch in a year

Return type:

dict

energy_demand.enduse_func.convert_service_to_p(tot_s_y, s_fueltype_tech)[source]

Calculate fraction of service for every technology of total service

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

s_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, enduse_techs, sector, tech_stock, load_profiles, mode_constrained)[source]

Demand management. This function shifts peak per of this enduse depending on peak shifting factors. So far only inter day load shifting

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
  • enduse_techs (list) – Enduse specfic technologies
  • sector (str) – Sector
  • tech_stock (obj) – Technology stock
  • load_profiles (obj) – Load profiles
  • mode_constrained (bool) – Running mode If mode_constrained, always only one technology imported
Returns:

fuel_yh – Fuel of yh

Return type:

array

energy_demand.enduse_func.fuel_to_service(enduse, fuel_y, fuel_fueltype_tech_p_by, tech_stock, fueltypes, mode_constrained)[source]

Converts fuel to energy service. Calculate energy service of each technology based on assumptions about base year fuel shares of an enduse (fuel_fueltype_tech_p_by).

Parameters:
  • enduse (str) – Enduse
  • fuel_y (array) – Fuel per fueltype
  • fuel_fueltype_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_s_y (array) – Total annual energy service per technology
  • s_tech_y (dict) – Total annual energy service per technology

Note

  • Efficiency changes of technologis are considered.
  • Energy service = fuel * efficiency
  • This function can be run in two modes, depending on mode_constrained
  • The base year efficiency is taken because the actual service can only be calculated with base year. Efficiencies are only considered if converting back to fuel The ‘self.fuel_y’ is taken because the actual service was reduced e.g. due to smart meters or temperatur changes
energy_demand.enduse_func.get_enduse_configuration(mode_constrained, enduse, enduse_space_heating)[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
energy_demand.enduse_func.get_enduse_techs(fuel_fueltype_tech_p_by)[source]

Get all defined technologies of an enduse

Parameters:fuel_fueltype_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 potentially 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_peak_day(fuel_yh)[source]

Iterate an array with entries and get entry nr with hightest value

Parameters:fuel_yh (array (hours)) – Fuel for every day
Returns:peak_day_nr – Day with most fuel or service
Return type:int
energy_demand.enduse_func.get_peak_day_all_fueltypes(fuel_yh)[source]

Iterate yh and get day containing the hour with the largest demand (across all fueltypes).

Parameters:fuel_yh (array (fueltype, 365, 24)) – 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_peak_day_single_fueltype(fuel_yh)[source]

Iterate yh and get day with highes fuel for a single fueltype The day with most fuel is considered to be the peak day. Over the simulation period, the peak day may change date in a year.

Parameters:fuel_yh (array (365, 24)) – Fuel for every yh (yh)
Returns:peak_day_nr – Day with most fuel or service
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:

s_tech_p – Share of service per technology of current year

Return type:

dict

energy_demand.enduse_func.hot_cold_process(base_yr, curr_yr, strategy_variables, other_enduse_mode_info, assumptions)[source]

Calculate factor based on the fraction of hot and cold rolling processes in steel manufacturing. The fraction of either process is calculated based on the scenario input of the future share of cold rollling processes. A sigmoid diffusion towards this fucture defined fraction is implemented.

Parameters:
  • base_yr (int) – Base year
  • curr_yr (int) – Current year
  • strategy_variables (dict) – Strategy variables
  • other_enduse_mode_info (dict) – Sigmoid diffusion parameters
  • assumptions (dict) – Assumptions including efficiencies of either process and the base year share
Returns:

factor – Factor to change energy demand

Return type:

float

energy_demand.enduse_func.industry_enduse_changes(enduse, sector, base_yr, curr_yr, strategy_variables, fuels, other_enduse_mode_info, assumptions)[source]

This function changes the demand if the enduse is a an industrial enduse depending on assumed industry related scenario paramters

Parameters:
  • enduse (str) – Enduse
  • sector (str) – Sector
  • curr_yr (int) – Current year
  • strategy_variables (dict) – All strategy variables
  • fuels (array) – Annual fuels
Returns:

  • fuels (np.array) – Changed fuels depending on scenario
  • Info
  • —-
  • OLD MODEL TODO

energy_demand.enduse_func.round_down(num, divisor)[source]

Round down

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

Parameters:
  • enduse (str) – Enduse
  • service_tech (dict) – Service per fueltype and technology
  • tech_stock (object) – Technological stock
  • fueltypes_nr (int) – Number of fueltypes
  • fueltypes (dict) – Fueltypes
  • mode_constrained (bool) – Mode running criteria
Returns:

  • fuel_y (array) – Fuel per fueltype
  • fuel_per_tech (dict) – Fuel per technology

Note

  • Fuel = Energy service / efficiency

energy_demand.main module

Contains the function energy_demand_model used for running the energy demand model

SMIF test Information about the integration framework: http://smif.readthedocs.io/

Tools Profiling: https://jiffyclub.github.io/snakeviz/ python -m cProfile -o program.prof my_program.py snakeviz program.prof

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

MEthod to derive GVA/POP SERVICE FLOOR AREAS

1. Step Get correlation between regional GVA and (regional floor area/reg pop) of every sector of base year – Get this correlation for every region and build national correlation

2. Step Calculate future regional floor area demand based on GVA and pop projection info: fuels_yh is made multidmensional according to fueltype TODO: REMOVEP EAK FACTORS TODO: DISAGGREGATE SERVICE SECTOR HEATING DEMANDS WITH FLOOR AREA FOR SECTORS TODO: BECUASE OF HYBRID SUM SWITCHES += TODO: remove tech_list TODO: Write all metadata of model run restuls to txt TODO: Related ed to houses & householdsize TODO: data loading, load multiple years for real elec data TODO: PEAK SHAPE vs PEAK FROM LOAD PROFILES TODO: WHAT ABOU NON_RESIDENTIAL FLOOR AREA: FOR WHAT? TODO: Spatial diffusion: Cap largest 5% of values and set to 1 TODO: CONTROL ALL PEAK RESULTS TODO: REMOVE model_yeardays_nrs TODO :CHECK LOAD PRIFILE TECH TYPE NAMES TODO: shape_peak_yd_factor TODO: REMOVE ALL PEAK RELATED STUFF TODO: SMOOTH LINE https://stackoverflow.com/questions/25825946/generating-smooth-line-graph-using-matplotlib?lq=1

energy_demand.main.energy_demand_model(data, assumptions, 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

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

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

Bases: object

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
  • assumptions (obj) – Assumptions and calculations based on assumptions
energy_demand.model.aggr_fuel_regions_fueltype(aggregation_array, fueltypes_nr, fueltypes, array_region_nr, model_yearhours_nrs, model_yeardays_nrs, submodels, technologies)[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(sector_models, sum_crit, model_yearhours_nrs, model_yeardays_nrs, attribute_non_technology, attribute_technologies, technologies, input_array)[source]

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

Parameters:
  • sector_models (list) – Sector models
  • sum_crit (str) – Criteria
  • model_yearhours_nrs (int) – Number of modelled hours in a year
  • fueltypes_nr (int) – Number of fueltypes
  • attribute_to_get (str) – Attribue to sumarise
  • model_yeardays_nrs (int) – Number of modelled yeardays
  • attribute_non_technology (str) – Attribute
  • attribute_technologies (str) – Attribute ‘techs_fuel_yh’
  • technologies (dict) – Technologies
  • input_array (array) – Input array to aggregate fuel
Returns:

input_array – Summarised array

Return type:

array

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, weather_region, scenario_data, assumptions, 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, weather_region, scenario_data, rs_dw_stock, assumptions, 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, weather_region, scenario_data, ss_dw_stock, assumptions, 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, assumptions, weather_regions)[source]

Run submodels for a single region

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, sector_models, technologies, model_yearhours_nrs, model_yeardays_nrs, fueltypes_nr)[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