Skip to content

Commit

Permalink
Updated files and code
Browse files Browse the repository at this point in the history
  • Loading branch information
FLomb committed Feb 10, 2020
1 parent 3c8b242 commit 392e776
Show file tree
Hide file tree
Showing 11 changed files with 9,311 additions and 148,391 deletions.
40 changes: 19 additions & 21 deletions RAMP_v02-pre/RAMP_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,39 @@
under the License.
"""

#%% Import required modules
#%% Import required modules and objects
import pandas as pd

from stochastic_process import Stochastic_Process
from post_process import*
import time
from utils import save_obj

provinces = pd.read_csv('time_series/gw_temp_province.csv', sep=';', index_col=0).columns.to_list()
administrative_units = pd.read_csv('time_series/administrative_units.csv', sep=',')
provinces = administrative_units['province'].to_list()
#provinces = pd.read_csv('time_series/gw_temp_province.csv', sep=';', index_col=0).columns.to_list()
archetypes = pd.read_csv('time_series/building_archetypes.csv', sep=';', index_col=0)
archetypes_ratio = {'single_family': 1, 'double_family': 1.2 , 'multi_family': 1.6 , 'apartment_block': 2.1 }
for prov in provinces:
archetypes[prov] = (round(archetypes[prov] * administrative_units['share_DHW_independent'][administrative_units['province']==prov].values))
archetypes_ratio = {'single_family': 2.1, 'double_family': 1.6 , 'multi_family': 1.2 , 'apartment_block': 1.0 }
n_dict = {'U1': 0.253, 'U2': 0.263, 'U3': 0.484}
us_dict = {'U1': 1, 'U2': 2, 'U3': 3}

#provinces_lomb =

#%% Main script
profiles_dict = {}

for prov in provinces:
profiles_dict[prov] = {}
for arch in archetypes[prov].index:
profiles_dict[prov][arch] = {}
n = archetypes[prov].loc[arch]/1e3
n = archetypes[prov].loc[arch]/1e2
for us in n_dict.keys():
profiles_dict[prov][arch][us] = {}
for k in range(int(round(n_dict[us]*n))):
for j in range(1,2):
seconds = time.time()
Profiles_list = Stochastic_Process(j,archetypes_ratio[arch],prov)
Profiles_avg, Profiles_list_kW, Profiles_series = Profile_formatting(Profiles_list)
profiles_dict[prov][arch][us]['%d' %k] = Profiles_series
seconds = time.time() -seconds
# Post-processes the results and generates plots

# Profile_series_plot(Profiles_series) #by default, profiles are plotted as a series

# export_series(Profiles_series,j,arch)

# if len(Profiles_list) > 1: #if more than one daily profile is generated, also cloud plots are shown
# Profile_cloud_plot(Profiles_list, Profiles_avg)
j = us_dict[us]
Profiles_list = Stochastic_Process(j,archetypes_ratio[arch],prov)
Profiles_avg, Profiles_list_kW, Profiles_series = Profile_formatting(Profiles_list)
profiles_dict[prov][arch][us]['%d' %k] = Profiles_series

# Saving the results
save_obj(profiles_dict, 'profiles_dict_Italy_50k')

32 changes: 16 additions & 16 deletions RAMP_v02-pre/input_file_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,38 @@ def input_file(arch,prov):
#Timeseries for DHW tasks median power
T_gw = pd.read_csv('time_series/gw_temp_province.csv', sep=';', index_col=0, usecols=['day',p])

shower_P = 8/60*4186*(45-T_gw)
sink_P = 4/60*4186*(40-T_gw)
shower_P = 8/60*4186*(40-T_gw)
sink_P = 3/60*4186*(35-T_gw)
kitchen_P = 5/60*4186*(40-T_gw)
generic_P = 4/60*4186*(40-T_gw)
generic_P = 3/60*4186*(35-T_gw)

#Create new user classes
U1 = User("User type 1",1)
User_list.append(U1)

#User type 1
U1_shower_wd = U1.Appliance(U1,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.2, P_series=True, wd_we_type=0)
U1_shower_wd.windows([420,720],[960,1380],0.3)
U1_shower_wd = U1.Appliance(U1,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.1, P_series=True, wd_we_type=0)
U1_shower_wd.windows([360,660],[900,1200],0.3)

U1_shower_we = U1.Appliance(U1,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.2, P_series=True, wd_we_type=1)
U1_shower_we.windows([420,720],[960,1260],0.3)
U1_shower_we = U1.Appliance(U1,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.1, P_series=True, wd_we_type=1)
U1_shower_we.windows([360,600],[840,1200],0.3)

U1_sink_wd = U1.Appliance(U1,1,sink_P,1,2*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U1_sink_wd.windows([420,1380],[0,0],0.3)
U1_sink_wd = U1.Appliance(U1,1,sink_P,1,4*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U1_sink_wd.windows([360,1320],[0,0],0.3)

U1_sink_we = U1.Appliance(U1,1,sink_P,1,2*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U1_sink_we.windows([420,1380],[0,0],0.3)
U1_sink_we = U1.Appliance(U1,1,sink_P,1,4*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U1_sink_we.windows([360,1320],[0,0],0.3)

U1_kitchen_wd = U1.Appliance(U1,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U1_kitchen_wd.windows([420,1380],[0,0],0.3)
U1_kitchen_wd = U1.Appliance(U1,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.1, P_series=True, wd_we_type=0)
U1_kitchen_wd.windows([360,1320],[0,0],0.3)

U1_kitchen_we = U1.Appliance(U1,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U1_kitchen_we.windows([420,1380],[0,0],0.3)
U1_kitchen_we = U1.Appliance(U1,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.1, P_series=True, wd_we_type=1)
U1_kitchen_we.windows([360,1320],[0,0],0.3)

U1_generic_wd = U1.Appliance(U1,1,generic_P,1,3*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U1_generic_wd.windows([0,1440],[0,0],0)

U1_generic_we = U1.Appliance(U1,1,generic_P,1,3*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U1_generic_we.windows([0,1440],[0,0],0)

return(User_list)
30 changes: 15 additions & 15 deletions RAMP_v02-pre/input_file_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ def input_file(arch,prov):
#Timeseries for DHW tasks median power
T_gw = pd.read_csv('time_series/gw_temp_province.csv', sep=';', index_col=0, usecols=['day',p])

shower_P = 8/60*4186*(45-T_gw)
sink_P = 4/60*4186*(40-T_gw)
shower_P = 8/60*4186*(40-T_gw)
sink_P = 3/60*4186*(35-T_gw)
kitchen_P = 5/60*4186*(40-T_gw)
generic_P = 4/60*4186*(40-T_gw)
generic_P = 3/60*4186*(35-T_gw)

#Create new user classes
U2 = User("User type 2",1)
User_list.append(U2)

#User type 2
U2_shower_wd = U2.Appliance(U2,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.2, P_series=True, wd_we_type=0)
U2_shower_wd.windows([360,1080],[960,1380],0.3)
U2_shower_wd = U2.Appliance(U2,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.1, P_series=True, wd_we_type=0)
U2_shower_wd.windows([300,660],[900,1320],0.3)

U2_shower_we = U2.Appliance(U2,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.2, P_series=True, wd_we_type=1)
U2_shower_we.windows([360,660],[1020,1380],0.3)
U2_shower_we = U2.Appliance(U2,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.1, P_series=True, wd_we_type=1)
U2_shower_we.windows([360,600],[840,1200],0.3)

U2_sink_wd = U2.Appliance(U2,1,sink_P,2,2*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U2_sink_wd.windows([360,540],[960,1380],0.3)
U2_sink_wd = U2.Appliance(U2,1,sink_P,1,4*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U2_sink_wd.windows([300,1320],[0,0],0.3)

U2_sink_we = U2.Appliance(U2,1,sink_P,1,2*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U2_sink_we.windows([420,1380],[0,0],0.3)
U2_sink_we = U2.Appliance(U2,1,sink_P,1,4*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U2_sink_we.windows([360,1320],[0,0],0.3)

U2_kitchen_wd = U2.Appliance(U2,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U2_kitchen_wd.windows([960,1380],[0,0],0.3)
U2_kitchen_wd = U2.Appliance(U2,1,kitchen_P,2,5*k,0.2,1, thermal_P_var = 0.1, P_series=True, wd_we_type=0)
U2_kitchen_wd.windows([300,540],[900,1320],0.3)

U2_kitchen_we = U2.Appliance(U2,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U2_kitchen_we.windows([420,1380],[0,0],0.3)
U2_kitchen_we = U2.Appliance(U2,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.1, P_series=True, wd_we_type=1)
U2_kitchen_we.windows([360,1320],[0,0],0.3)

U2_generic_wd = U2.Appliance(U2,1,generic_P,1,3*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U2_generic_wd.windows([0,1440],[0,0],0)
Expand Down
30 changes: 15 additions & 15 deletions RAMP_v02-pre/input_file_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ def input_file(arch,prov):
#Timeseries for DHW tasks median power
T_gw = pd.read_csv('time_series/gw_temp_province.csv', sep=';', index_col=0, usecols=['day',p])

shower_P = 8/60*4186*(45-T_gw)
sink_P = 4/60*4186*(40-T_gw)
shower_P = 8/60*4186*(40-T_gw)
sink_P = 4/60*4186*(35-T_gw)
kitchen_P = 5/60*4186*(40-T_gw)
generic_P = 4/60*4186*(40-T_gw)
generic_P = 4/60*4186*(35-T_gw)

#Create new user classes
U3 = User("User type 3",1)
User_list.append(U3)

#User type 3
U3_shower_wd = U3.Appliance(U3,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.2, P_series=True, wd_we_type=0)
U3_shower_wd.windows([360,1080],[1080,1380],0.3)
U3_shower_wd = U3.Appliance(U3,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.1, P_series=True, wd_we_type=0)
U3_shower_wd.windows([300,540],[1020,1320],0.3)

U3_shower_we = U3.Appliance(U3,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.2, P_series=True, wd_we_type=1)
U3_shower_we.windows([360,660],[1020,1380],0.3)
U3_shower_we = U3.Appliance(U3,1,shower_P,2,8*k,0.2,3, thermal_P_var = 0.1, P_series=True, wd_we_type=1)
U3_shower_we.windows([360,600],[840,1200],0.3)

U3_sink_wd = U3.Appliance(U3,1,sink_P,2,2*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U3_sink_wd.windows([360,540],[1080,1380],0.3)
U3_sink_wd = U3.Appliance(U3,1,sink_P,1,4*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U3_sink_wd.windows([360,1320],[0,0],0.3)

U3_sink_we = U3.Appliance(U3,1,sink_P,1,2*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U3_sink_we.windows([420,1380],[0,0],0.3)
U3_sink_we = U3.Appliance(U3,1,sink_P,1,4*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U3_sink_we.windows([360,1320],[0,0],0.3)

U3_kitchen_wd = U3.Appliance(U3,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U3_kitchen_wd.windows([1080,1030],[0,0],0.3)
U3_kitchen_wd = U3.Appliance(U3,1,kitchen_P,2,5*k,0.2,1, thermal_P_var = 0.1, P_series=True, wd_we_type=0)
U3_kitchen_wd.windows([360,540],[1020,1320],0.3)

U3_kitchen_we = U3.Appliance(U3,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=1)
U3_kitchen_we.windows([420,1380],[0,0],0.3)
U3_kitchen_we = U3.Appliance(U3,1,kitchen_P,1,5*k,0.2,1, thermal_P_var = 0.1, P_series=True, wd_we_type=1)
U3_kitchen_we.windows([360,1320],[0,0],0.3)

U3_generic_wd = U3.Appliance(U3,1,generic_P,1,3*k,0.2,1, thermal_P_var = 0.25, P_series=True, wd_we_type=0)
U3_generic_wd.windows([0,1440],[0,0],0)
Expand Down
Loading

0 comments on commit 392e776

Please sign in to comment.