Skip to content

Commit

Permalink
before will
Browse files Browse the repository at this point in the history
  • Loading branch information
eggimasv authored and eggimasv committed Mar 20, 2017
1 parent 04b98d2 commit 798bf92
Show file tree
Hide file tree
Showing 22 changed files with 158,095 additions and 158,002 deletions.
Binary file modified data/residential_model/ECUK_Tables_2016 (1).xlsx
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fuel_id,light
0,100
1,100
2,1002
2,1159
3,100
4,100
5,100
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REGION_NR,2015
0,3000000
1,5300000
2,53000000
REGION_NR,2015
0,3000000
1,5300000
2,53000000
4 changes: 0 additions & 4 deletions data/scenario_and_base_data/base_data_fuel.csv

This file was deleted.

199 changes: 66 additions & 133 deletions energy_demand/assumptions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
""" This file contains all assumptions of the energy demand model"""

import numpy as np

import energy_demand.main_functions as mf

def load_assumptions(data):
Expand Down Expand Up @@ -55,13 +53,15 @@ def load_assumptions(data):
'micro_CHP_thermal': 0.5
}

assump_dict['eff_by'] = eff_by # Add dictionaries to assumptions

## Efficiencies residential, end year
eff_ey = {
'boiler_A' : 0.9,
'boiler_B' : 0.5,
'new_tech_A': 0.1,
'tech_A' : 0.5,
'tech_B' : 0.5,
'tech_B' : 0.9,
'tech_C': 0.0,
'tech_D' : 0.5,
'tech_E' : 0.5,
Expand All @@ -78,34 +78,41 @@ def load_assumptions(data):
'micro_CHP_thermal': 0.5
}

assump_dict['eff_ey'] = eff_ey # Add dictionaries to assumptions

# -------------
# Fuel Switches assumptions
# -------------
# TODO: Write function to insert fuel swatches

# Technology which is installed for which enduse
# Technology which is installed for which enduse in case of fuel switches
tech_install = {'light': 'boiler_A'}

# Technologies used for the different fuel types where the new technology is used
assump_dict['tech_install'] = tech_install

# Technologies used for the different fuel types where the new technology is introduced
tech_replacement_dict = {'light': {0: 'boiler_B',
1: 'boiler_B',
2: 'boiler_B',
3: 'boiler_B',
4: 'boiler_B',
5: 'boiler_B',
6: 'boiler_B',
7: 'boiler_B'
},
}
1: 'boiler_B',
2: 'boiler_B',
3: 'boiler_B',
4: 'boiler_B',
5: 'boiler_B',
6: 'boiler_B',
7: 'boiler_B'
},
}

assump_dict['tech_replacement_dict'] = tech_replacement_dict


# Percentage of fuel types (base year could also be calculated and loaded)
fuel_type_p_by = {'light': {'0' : 0.0,
'1' : 0.7,
'2' : 0.1,
'3' : 0.0,
'4' : 0.0,
'5' : 0.0,
'6' : 0.2
fuel_type_p_by = {'light': {0 : 0.0,
1 : 0.7,
2 : 0.1,
3 : 0.0,
4 : 0.0,
5 : 0.0,
6 : 0.2
},
'cold': {'0' : 0.0182,
'1' : 0.7633,
Expand Down Expand Up @@ -162,6 +169,9 @@ def load_assumptions(data):
'6' : 0.0
}
}
# Convert to array
fuel_type_p_by = mf.convert_to_array(fuel_type_p_by)
assump_dict['fuel_type_p_by'] = fuel_type_p_by

# Check if base demand is 100 %
#assert p_tech_by['boiler_A'] + p_tech_by['boiler_B'] == 1.0
Expand Down Expand Up @@ -239,133 +249,57 @@ def load_assumptions(data):
'6' : 0.0
}
}

fuel_type_p_ey = mf.convert_to_array(fuel_type_p_ey)
assump_dict['fuel_type_p_ey'] = fuel_type_p_ey

# Check if base demand is 100 %
#assert p_tech_by['boiler_A'] + p_tech_by['boiler_B'] == 1.0


# Convert to array
fuel_type_p_by = mf.convert_to_array(fuel_type_p_by)
fuel_type_p_ey = mf.convert_to_array(fuel_type_p_ey)




# ----------------------------------
# Technologes for different uses
# ----------------------------------
technologies_enduse_by = {'light': {
0: 'boiler_A',
1: 'boiler_A',
2: 'boiler_A',
3: 'boiler_A',
4: 'boiler_A',
5: 'boiler_A',
6: 'boiler_A',
7: 'boiler_A'},
'cold': {
'0' : 0.0182,
'1' : 0.7633,
'2' : 0.0791,
'3' : 0.0811,
'4' : 0.0,
'5' : 0.0581,
'6' : 0.0
},
'cooking': {
'0' : 0.2,
'1' : 0.3,
'2' : 0.4,
'3' : 0.0,
'4' : 0.0,
'5' : 0.0,
'6' : 0.0
},
'wet': {
'0' : 0.0182,
'1' : 0.7633,
'2' : 0.0791,
'3' : 0.0811,
'4' : 0.0,
'5' : 0.0581,
'6' : 0.0
},
'consumer_electronics': {
'0' : 0.0182,
'1' : 0.7633,
'2' : 0.0791,
'3' : 0.0811,
'4' : 0.0,
'5' : 0.0581,
'6' : 0.0
},
'home_computing': {
'0' : 0.0182,
'1' : 0.7633,
'2' : 0.0791,
'3' : 0.0811,
'4' : 0.0,
'5' : 0.0581,
'6' : 0.0
},
'cooking': {
'0' : 0.0182,
'1' : 0.7633,
'2' : 0.0791,
'3' : 0.0811,
'4' : 0.0,
'5' : 0.0581,
'6' : 0.0
}
}






# ----------------------------------
# Fraction of technologies
# Which technologies are used for which end_use and to which share
# ----------------------------------
# p_tech_by : Share of technology in base year [in %]
# p_tech_ey : Share of technology in the end year
#Share of technology for every enduse and fueltype in base year [in %]
technologies_enduse_by = {
'light': {
0: {},
1: {},
2: {'tech_A': 0.5, 'tech_B': 0.5},
3: {},
4: {},
5: {},
6: {},
7: {}
}
}

assump_dict['technologies_enduse_by'] = technologies_enduse_by

# --Technological split in end_year
technologies_enduse_ey = {
'light': {
0: {},
1: {},
2: {'tech_A': 0.3, 'tech_B': 0.4},
3: {},
4: {},
5: {},
6: {},
7: {}
}
}

assump_dict['technologies_enduse_ey'] = technologies_enduse_ey

# Residential, base year
'''
p_tech_by = {
'boiler_A' : 0.5,
'boiler_B' : 0.5,
'new_tech_A': 0.0
}

tech_market_year = {
'new_tech_A': 2000
}

tech_saturation_year = {
'new_tech_A': 2017
}
'''
# Residential, end year
'''p_tech_ey = {
'boiler_A' : 0.4,
'boiler_B' : 0.5,
'new_tech_A' : 0.1
}
'''

# Add dictionaries to assumptions
assump_dict['eff_by'] = eff_by
assump_dict['eff_ey'] = eff_ey
#assump_dict['p_tech_by'] = p_tech_by
#assump_dict['p_tech_ey'] = p_tech_ey
#assump_dict['tech_market_year'] = tech_market_year
#assump_dict['tech_saturation_year'] = tech_saturation_year
assump_dict['fuel_type_p_by'] = fuel_type_p_by
assump_dict['fuel_type_p_ey'] = fuel_type_p_ey

assump_dict['tech_replacement_dict'] = tech_replacement_dict
assump_dict['tech_install'] = tech_install

# ============================================================
# Assumptions Residential Building Stock
Expand All @@ -377,7 +311,6 @@ def load_assumptions(data):
assump_dwtype_floorarea = dwtype_floorarea # Average floor area per dwelling type (loaded from CSV)



# Add to dictionary
assump_dict['assump_change_floorarea_pp'] = assump_change_floorarea_pp
assump_dict['assump_dwtype_distr_ey'] = assump_dwtype_distr_ey
Expand Down
12 changes: 7 additions & 5 deletions energy_demand/building_stock_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ def __init__(self, region_ID, dwellings):
"""
self.region_ID = region_ID
self.dwellings = dwellings

# Execute functions of stock
self.pop = self.get_tot_pop()
self.sd_water_heating = self.get_sum_scenario_driver_water_heating()
self.sd_heating = self.get_sum_scenario_driver_space_heating()
self.sd_lighting = self.get_sum_scenario_driver_lighting()

# Execute functions of stock #TODO: Maybe improve that only end_use needs to be entered...

self.water_heating = self.get_sum_scenario_driver_water_heating()
self.heating = self.get_sum_scenario_driver_space_heating()
self.lighting = self.get_sum_scenario_driver_lighting()
# TODO: Add more

def get_tot_pop(self):
"""Get total population of all dwellings"""
Expand Down
2 changes: 1 addition & 1 deletion energy_demand/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def generate_data(data, run_data_collection):
# - electricity for non-residential
# -
# ---------------------
folder_path = r'C:\Users\cenv0553\Dropbox\00-Office_oxford\07-Data\09_Carbon_Trust_advanced_metering_trial_(owen)\_all_gas' #Community _OWN_SEWAGE
folder_path = r'C:\Users\cenv0553\Dropbox\00-Office_oxford\07-Data\09_Carbon_Trust_advanced_metering_trial_(owen)\__OWN_SEWAGE' #Community _OWN_SEWAGE
out_dict_av, out_dict_not_av, hourly_shape_of_maximum_days = df.read_raw_carbon_trust_data(data, folder_path)


Expand Down

0 comments on commit 798bf92

Please sign in to comment.