Skip to content

Commit

Permalink
updated technologies
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Eggimann committed Oct 4, 2018
1 parent c8e5589 commit 8fa6fca
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 71 deletions.
Binary file not shown.
118 changes: 59 additions & 59 deletions energy_demand/config_data/05-technologies/technology_definition.csv
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
technology,fueltype,efficiency in base year,efficiency in future year,year when efficiency is fully realised,diffusion method (sigmoid or linear),market_entry,technology type,maximum theoretical service share of technology,description,TTTT
halogen,electricity,0.04,0.07,2050,linear,2010,lighting,1,,lighting
standard_lighting_bulb,electricity,0.03,0.04,2050,linear,2010,lighting,1,,lighting
fluorescent_strip_lighting,electricity,0.14,0.21,2050,linear,2010,lighting,1,,lighting
energy_saving_lighting_bulb,electricity,0.22,0.3,2050,linear,2010,lighting,1,,lighting
LED,electricity,0.22,0.44,2050,linear,2010,lighting,1,,lighting
washing_machine,electricity,0.61,0.61,2050,linear,2010,wet,1,NOTE: Check: 1.5,wet
tumble_dryer,electricity,0.77,7.7,2050,linear,2010,wet,1,,wet
dishwasher,electricity,0.69,2.3,2050,linear,2010,wet,1,,wet
washer_dryer,electricity,0.61,3.07,2050,linear,2010,wet,1,,wet
hob_gas,gas,0.4,0.5,2050,linear,2010,cooking,1,,cooking
hob_electricity,electricity,0.6,0.7,2050,linear,2010,cooking,1,,cooking
hob_induction_electricity,electricity,0.75,0.9,2050,linear,2010,cooking,1,,cooking
hob_hydrogen,hydrogen,0.4,0.5,2050,linear,2010,cooking,1,,cooking
hob_biomass,biomass,0.4,0.5,2050,linear,2010,cooking,1,,cooking
chest_freezer,electricity,0.54,2.71,2050,linear,2010,cold,1,,cold
fridge_freezer,electricity,0.48,2.71,2050,linear,2010,cold,1,NOTE: Check: 1.5,cold
refrigerator,electricity,0.48,2.71,2050,linear,2010,cold,1,NOTE: Check: 1.5,cold
upright_freezer,electricity,0.5,2.71,2050,linear,2010,cold,1,NOTE: Check: 1.5,cold
boiler_solid_fuel,solid_fuel,0.6,0.7,2050,linear,2010,heating_const,1,,heating_const
boiler_gas,gas,0.65,0.94,2050,linear,2010,heating_const,0.89,,heating_const
boiler_electricity,electricity,0.99,0.99,2050,linear,2010,heating_const,1,,heating_const
boiler_oil,oil,0.7,0.94,2050,linear,2010,heating_const,1,,heating_const
boiler_biomass,biomass,0.6,0.95,2050,linear,2010,heating_const,1,,heating_const
boiler_hydrogen,hydrogen,0.85,0.95,2050,linear,2010,heating_const,0.89,,heating_const
boiler_condensing_gas,gas,0.85,0.95,2050,linear,2010,heating_const,1,,heating_const
boiler_condensing_oil,oil,0.85,0.95,2050,linear,2010,heating_const,1,,heating_const
stirling_micro_CHP_gas,gas,0.8,0.95,2050,linear,2010,tech_CHP,0.89,overall efficiency,tech_CHP
fuel_cell_hydrogen,hydrogen,0.85,0.95,2050,linear,2010,tech_CHP,0.89,,tech_CHP
storage_heater_electricity,electricity,0.99,0.99,2050,linear,2010,storage_heating_electricity,1,,storage_heating_electricity
secondary_heater_electricity,electricity,0.99,0.99,2050,linear,2010,secondary_heating_electricity,1,,secondary_heating_electricity
heat_pump_ASHP_electricity,electricity,3.6,4,2050,linear,2010,heating_non_const,1,,heating_non_const
heat_pump_GSHP_electricity,electricity,4.9,5.4,2050,linear,2010,heating_non_const,1,,heating_non_const
heat_pump_ASHP_hydrogen,hydrogen,3.6,4,2050,linear,2010,heating_non_const,0.89,,heating_non_const
heat_pump_GSHP_hydrogen,hydrogen,4.9,5.4,2050,linear,2010,heating_non_const,0.89,,heating_non_const
central_air_conditioner_electricity,electricity,0.5,1,2050,linear,2010,cooling_const,1,,cooling_const
decentral_air_conditioner_electricity,electricity,0.5,1,2050,linear,2010,cooling_const,1,,cooling_const
central_air_conditioner_oil,oil,0.5,0.5,2050,linear,2010,cooling_const,1,,cooling_const
decentral_air_conditioner_oil,oil,0.5,0.5,2050,linear,2010,cooling_const,1,,cooling_const
central_air_conditioner_gas,gas,0.5,0.5,2050,linear,2010,cooling_const,0.89,,cooling_const
decentral_air_conditioner_gas,gas,0.5,0.5,2050,linear,2010,cooling_const,0.89,,cooling_const
district_heating_CHP_gas,gas,0.45,0.45,2050,linear,2010,tech_CHP,0.2,thermal efficiency,tech_CHP
district_heating_electricity,electricity,1,1,2050,linear,2010,tech_district_heating,0.2,,tech_district_heating
district_heating_biomass,biomass,0.6,0.6,2050,linear,2010,tech_district_heating,0.2,,tech_district_heating
district_heating_fuel_cell,hydrogen,0.85,0.85,2050,linear,2010,tech_district_heating,0.2,,tech_district_heating
basic_oxygen_furnace,solid_fuel,1,1,2050,linear,2010,steel_production,1,,steel_production
electric_arc_furnace,electricity,6.1,6.1,2050,linear,2010,steel_production,1,assumed no technology imporvement,steel_production
SNG_furnace,gas,1,1,2050,linear,2020,steel_production,1,assumed no technology imporvement,steel_production
biomass_furnace,biomass,1,1,2050,linear,2020,steel_production,1,assumed no technology imporvement,steel_production
dry_kiln_coal,solid_fuel,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
dry_kiln_oil,oil,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
dry_kiln_gas,gas,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
dry_kiln_electricity,electricity,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
dry_kiln_biomass,biomass,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
dry_kiln_hydrogen,hydrogen,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
wet_kiln_coal,solid_fuel,1,1,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
wet_kiln_oil,oil,1,1,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
wet_kiln_gas,gas,1,1,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
wet_kiln_electricity,electricity,1,1,2050,linear,2010,cement_production,1,assumed no technology imporvement,cement_production
technology,fueltype,efficiency in base year,efficiency in future year,year when efficiency is fully realised,diffusion method (sigmoid or linear),market_entry,technology type,maximum theoretical service share of technology,description
standard_lighting_bulb,electricity,0.029,0.034,2050,linear,2000,lighting,1,
halogen,electricity,0.037,0.073,2050,linear,2000,lighting,1,
energy_saving_lighting_bulb,electricity,0.220,0.293,2050,linear,2000,lighting,1,
fluorescent_strip_lighting,electricity,0.146,0.220,2050,linear,2000,lighting,1,
LED,electricity,0.220,0.439,2050,linear,2000,lighting,1,
washing_machine,electricity,1.000,1.334,2050,linear,2000,wet,1,
tumble_dryer,electricity,1.000,3.076,2050,linear,2000,wet,1,
dishwasher,electricity,1.000,1.367,2050,linear,2000,wet,1,
washer_dryer,electricity,1.000,1.334,2050,linear,2000,wet,1,
hob_gas,gas,0.400,0.500,2050,linear,2000,cooking,1,
hob_electricity,electricity,0.600,0.700,2050,linear,2000,cooking,1,
hob_induction_electricity,electricity,0.750,0.900,2050,linear,2000,cooking,1,
hob_hydrogen,hydrogen,0.400,0.500,2050,linear,2000,cooking,1,
hob_biomass,biomass,0.400,0.500,2050,linear,2000,cooking,1,
chest_freezer,electricity,1.000,2.709,2050,linear,2000,cold,1,
fridge_freezer,electricity,1.000,2.405,2050,linear,2000,cold,1,
refrigerator,electricity,1.000,2.408,2050,linear,2000,cold,1,
upright_freezer,electricity,1.000,2.500,2050,linear,2000,cold,1,
central_air_conditioner_electricity,electricity,1.000,2.000,2050,linear,2000,cooling_const,1,
decentral_air_conditioner_electricity,electricity,1.000,2.000,2050,linear,2000,cooling_const,1,
central_air_conditioner_oil,oil,1.000,2.000,2050,linear,2000,cooling_const,1,
decentral_air_conditioner_oil,oil,1.000,2.000,2050,linear,2000,cooling_const,1,
central_air_conditioner_gas,gas,1.000,2.000,2050,linear,2000,cooling_const,0.89,
decentral_air_conditioner_gas,gas,1.000,2.000,2050,linear,2000,cooling_const,0.89,
boiler_solid_fuel,solid_fuel,0.600,0.700,2050,linear,2000,heating_const,1,
boiler_gas,gas,0.650,0.940,2050,linear,2000,heating_const,0.89,
boiler_electricity,electricity,0.990,0.990,2050,linear,2000,heating_const,1,
boiler_oil,oil,0.700,0.940,2050,linear,2000,heating_const,1,
boiler_biomass,biomass,0.600,0.950,2050,linear,2000,heating_const,1,
boiler_hydrogen,hydrogen,0.850,0.950,2050,linear,2000,heating_const,0.89,
boiler_condensing_gas,gas,0.850,0.950,2050,linear,2000,heating_const,1,
boiler_condensing_oil,oil,0.850,0.950,2050,linear,2000,heating_const,1,
stirling_micro_CHP_gas,gas,0.800,0.950,2050,linear,2000,tech_CHP,0.89,
fuel_cell_hydrogen,hydrogen,0.850,0.950,2050,linear,2000,tech_CHP,0.89,
storage_heater_electricity,electricity,0.990,0.990,2050,linear,2000,storage_heating_electricity,1,
secondary_heater_electricity,electricity,0.990,0.990,2050,linear,2000,secondary_heating_electricity,1,
heat_pump_ASHP_electricity,electricity,3.600,4.000,2050,linear,2000,heating_non_const,1,
heat_pump_GSHP_electricity,electricity,4.900,5.400,2050,linear,2000,heating_non_const,1,
heat_pump_ASHP_hydrogen,hydrogen,3.600,4.000,2050,linear,2000,heating_non_const,0.89,
heat_pump_GSHP_hydrogen,hydrogen,4.900,5.400,2050,linear,2000,heating_non_const,0.89,
district_heating_CHP_gas,gas,0.450,0.450,2050,linear,2000,tech_CHP,0.2,thermal efficiency
district_heating_electricity,electricity,1.000,1.000,2050,linear,2000,tech_district_heating,0.2,
district_heating_biomass,biomass,0.600,0.600,2050,linear,2000,tech_district_heating,0.2,
district_heating_fuel_cell,hydrogen,0.850,0.850,2050,linear,2000,tech_district_heating,0.2,
basic_oxygen_furnace,solid_fuel,1,1,2050,linear,2010,steel_production,1,assumed no technology imporvement
electric_arc_furnace,electricity,6.1,6.1,2050,linear,2010,steel_production,1,assumed no technology imporvement
SNG_furnace,gas,1,1,2050,linear,2020,steel_production,1,assumed no technology imporvement
biomass_furnace,biomass,1,1,2050,linear,2020,steel_production,1,assumed no technology imporvement
dry_kiln_coal,solid_fuel,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement
dry_kiln_oil,oil,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement
dry_kiln_gas,gas,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement
dry_kiln_electricity,electricity,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement
dry_kiln_biomass,biomass,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement
dry_kiln_hydrogen,hydrogen,1.8,1.8,2050,linear,2010,cement_production,1,assumed no technology imporvement
wet_kiln_coal,solid_fuel,1,1,2050,linear,2010,cement_production,1,assumed no technology imporvement
wet_kiln_oil,oil,1,1,2050,linear,2010,cement_production,1,assumed no technology imporvement
wet_kiln_gas,gas,1,1,2050,linear,2010,cement_production,1,assumed no technology imporvement
wet_kiln_electricity,electricity,1,1,2050,linear,2010,cement_production,1,assumed no technology imporvement
10 changes: 8 additions & 2 deletions energy_demand/plotting/_scrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
from energy_demand.plotting import fig_p2_weather_var

uk_gdf = pd.DataFrame(np.array(
[[-5, 1], [-3, 10], [0, 100], [3, 100], [5, 100]]),
columns=['diff_av_max', 'b'])
[
[-5, 1],
[-3, 10],
[0, 100],
[3, 100],
[5, 100]]),

columns=['diff_av_max', 'b'])

uk_gdf = fig_p2_weather_var.user_defined_bin_classification(
uk_gdf,
Expand Down
132 changes: 132 additions & 0 deletions energy_demand/plotting/fig_p2_annual_hours_sorted.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
"""Fig 2 figure
"""
import numpy as np
import matplotlib.pyplot as plt
#from scipy.stats import mstats
import pandas as pd
import geopandas as gpd
from scipy import stats
from shapely.geometry import Point
import matplotlib.pyplot as plt
from collections import defaultdict
from matplotlib.colors import Normalize

from energy_demand.plotting import result_mapping
from energy_demand.technologies import tech_related
from energy_demand.plotting import basic_plot_functions

def run(
data_input,
regions,
simulation_yrs_to_plot,
fueltype_str,
path_shapefile,
fig_name
):
"""
"""
fueltype_int = tech_related.get_fueltype_int(fueltype_str)

# Figure related
fig = plt.figure() #(figsize = cm2inch(10,10))
ax = fig.add_subplot(111)
period_h = range(8760)

for sim_yr_to_plot in simulation_yrs_to_plot:

# ---Collect data for every weather year
weather_yrs_data_regional = defaultdict(dict)
weather_yrs_data_total = []
for weather_yr, data_weather_yr in data_input.items():

# Weather year specific data for every region
regions_fuel = data_weather_yr[sim_yr_to_plot][fueltype_int]

# Total fuel
national_fuel = np.sum(regions_fuel, axis=0)

for region_nr, region_name in enumerate(regions):
try:
weather_yrs_data_regional[region_name].append(regions_fuel[region_nr])
except (KeyError, AttributeError):
weather_yrs_data_regional[region_name] = [regions_fuel[region_nr]]
try:
weather_yrs_data_total.append(national_fuel)
except:
weather_yrs_data_total = [national_fuel]

# ---Collect data for every weather year

# Convert regional data to dataframe
national_fuel_array = np.array(weather_yrs_data_total)

df = pd.DataFrame(
national_fuel_array,
columns=range(8760))

# Calculate regional statistics
mean_data = df.mean(axis=0)

mean_data = mean_data.sort_values(ascending=False)

# Reorder df according to ordering of mean values
ordering_of_hours_index = list(mean_data.index)

df = df[ordering_of_hours_index]

#std_dev = df.std(axis=0) #standard deviation across every hour
# Calculate quantiles
quantile_95 = 0.95
quantile_05 = 0.05

df_q_95 = df.quantile(quantile_95)
df_q_05 = df.quantile(quantile_05)

#Transpose for plotting purposes
df = df.T
df_q_95 = df_q_95.T
df_q_05 = df_q_05.T

# ---------------
# Smoothing lines
# ---------------
try:
period_h_smoothed, df_q_95_smoothed = basic_plot_functions.smooth_data(period_h, df_q_95, num=40000)
period_h_smoothed, df_q_05_smoothed = basic_plot_functions.smooth_data(period_h, df_q_05, num=40000)
period_h_smoothed, mean_data_smoothed = basic_plot_functions.smooth_data(period_h, mean_data, num=40000)
except:
period_h_smoothed = period_h
df_q_95_smoothed = df_q_95
df_q_05_smoothed = df_q_05
mean_data_smoothed = mean_data

plt.plot(period_h_smoothed, mean_data_smoothed, color='tomato', linestyle='-', linewidth=2, label="average")
#plt.plot(period_h_smoothed, df_q_05_smoothed, color='black', linestyle='--', linewidth=0.5, label="0.05")
#plt.plot(period_h_smoothed, df_q_95_smoothed, color='black', linestyle='--', linewidth=0.5, label="0.95")

# -----------------
# Uncertainty range
# -----------------
plt.fill_between(
period_h_smoothed, #x
df_q_95_smoothed, #y1
df_q_05_smoothed, #y2
alpha=.40,
facecolor="grey",
label="uncertainty band")

plt.legend(
prop={
'family':'arial',
'size': 10},
loc='best',
frameon=False,
shadow=True)

plt.xlabel("Load duration curve")
plt.ylabel("energy demand")

plt.xlim(0, 8760)
plt.show()

print("--")
26 changes: 24 additions & 2 deletions energy_demand/plotting/fig_p2_weather_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def run(
'mean_peak_h',
'diff_av_max',
'mean_peak_h_pp',
'diff_av_max_pp']
'diff_av_max_pp',
'std_dev_average_every_h',
'std_dev_peak_h_norm_pop']

df_stats = pd.DataFrame(columns=regional_statistics_columns)

Expand All @@ -68,6 +70,14 @@ def run(

# Calculate regional statistics
mean = df.mean(axis=0)
std_dev = df.std(axis=0) #standard deviation across every hour

# Get maximum per colum
#max_every_h = df.max()
#colum_max_h = max_every_h.argmax() #get colum (respesctively hour) of maximum value

# Average standard deviation across every hour
std_dev_average_every_h = np.std(list(std_dev))

max_entry = df.max(axis=0) #maximum entry for every hour
min_entry = df.min(axis=0) #maximum entry for every hour
Expand All @@ -76,6 +86,9 @@ def run(
hour_nr_max = max_entry.argmax()
hour_nr_min = min_entry.argmin()

# standard deviation of peak hour
std_dev_peak_h = std_dev[hour_nr_max]

# Difference between average and max
diff_av_max = max_entry[hour_nr_max] - mean[hour_nr_max]
mean_peak_h = mean[hour_nr_max]
Expand All @@ -91,6 +104,10 @@ def run(
break
pop = population[nr_of_reg]

# Divide standard deviation of peak hour by population
# which gives measure of weather variability in peak hour
std_dev_peak_h_norm_pop = std_dev_peak_h / pop

diff_av_max_pp = diff_av_max / pop
mean_peak_h_pp = mean_peak_h / pop

Expand All @@ -99,7 +116,9 @@ def run(
mean_peak_h,
diff_av_max,
mean_peak_h_pp,
diff_av_max_pp]]
diff_av_max_pp,
std_dev_average_every_h,
std_dev_peak_h_norm_pop]]

line_df = pd.DataFrame(
line_entry, columns=regional_statistics_columns)
Expand All @@ -111,6 +130,7 @@ def run(
#print("---------")
print(df_stats['diff_av_max'].max())
print(df_stats['mean_peak_h'].max())
print(df_stats['std_dev_peak_h_norm_pop'].max())
print("-")
print(df_stats['diff_av_max_pp'].max())
print(df_stats['diff_av_max_pp'].min())
Expand Down Expand Up @@ -144,6 +164,8 @@ def run(
# Field to plot
field_to_plot = "diff_av_max_pp" # Difference between average and peak per person in KWh
#field_to_plot = "diff_av_max" # Difference between average and peak
field_to_plot = 'std_dev_peak_h_norm_pop'

nr_of_intervals = 6

bin_values = result_mapping.get_reasonable_bin_values_II(
Expand Down
20 changes: 17 additions & 3 deletions energy_demand/plotting/plots_paper_II.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from energy_demand.validation import elec_national_data
from energy_demand.technologies import tech_related
from energy_demand.plotting import fig_p2_weather_var
from energy_demand.plotting import fig_p2_annual_hours_sorted

def main(
path_data_ed,
Expand Down Expand Up @@ -73,7 +74,7 @@ def main(

population_data = read_data.read_scenaric_population_data(
os.path.join(path_data_ed, 'model_run_pop'))

# ####################################################################
# Create plot with regional and non-regional plots for second paper
# Compare hdd calculations and disaggregation of regional and local
Expand Down Expand Up @@ -192,7 +193,7 @@ def main(

# plot over period of time across all weather scenario
fig_weather_variability_priod.run(
data_input=weather_yr_container['tot_fueltype_yh'], #[weather_yr],
data_input=weather_yr_container['tot_fueltype_yh'],
fueltype_str='electricity',
simulation_yr_to_plot=2015, # Simulation year to plot
period_h=list(range(200,500)), #period to plot
Expand All @@ -212,4 +213,17 @@ def main(
fueltype_str='electricity',
path_shapefile=path_shapefile_input,
fig_name=os.path.join(path_out_plots, "fig_paper_IIb_weather_var_map.pdf"))


# ####################################################################
# Create plot with regional and non-regional plots for second paper
# Compare hdd calculations and disaggregation of regional and local
# ####################################################################
if plot_crit_dict['plot_scenarios_sorted']:

fig_p2_annual_hours_sorted.run(
data_input=weather_yr_container['results_enduse_every_year'],
regions=data['regions'],
simulation_yrs_to_plot=[2015], # Simulation year to plot
fueltype_str='electricity',
path_shapefile=path_shapefile_input,
fig_name=os.path.join(path_out_plots, "fig_paper_IIb_weather_var_map.pdf"))

0 comments on commit 8fa6fca

Please sign in to comment.