Skip to content
Snippets Groups Projects

Stats

Merged pmag requested to merge stats into master
5 files
+ 555
1078
Compare changes
  • Side-by-side
  • Inline

Files

@@ -4,7 +4,9 @@
import numpy as np
from geopandas import GeoDataFrame
from ...misc.utils import discrete_sinusoid_matching_integral
from ...misc.utils import create_profile_using_time_weighted_state
# from ...misc.utils import create_profile_using_time_weighted_state
from ...misc.utils import generate_manual_state_correlated_profile
from ...misc.utils import generate_state_correlated_profile
from .bbr import label_bbr_entrance_id, label_bbr_housing_area
# *****************************************************************************
@@ -66,6 +68,8 @@ def heat_demand_dict_by_building_entrance(
key_bbr_entr_id: str = label_bbr_entrance_id,
avg_state: list = None,
state_correlates_with_output: bool = False,
deviation_gain: float = 1.0,
solver: str = 'glpk'
) -> dict:
# initialise dict for each building entrance
@@ -84,11 +88,8 @@ def heat_demand_dict_by_building_entrance(
# for each building
for building_index in building_indexes:
# get relevant data
# base_load_avg_ratio = 0.3
# specific_demand = 107 # kWh/m2/year
area = gdf_buildings.loc[building_index][label_bbr_housing_area]
# estimate its demand
# generate the profile
if type(avg_state) == type(None):
# ignore states
heat_demand_profiles.append(
@@ -104,21 +105,49 @@ def heat_demand_dict_by_building_entrance(
)
)
else:
# states matter
elif type(deviation_gain) == type(None):
# states matter but the gain must be determined
# heat_demand_profiles.append(
# np.array(
# create_profile_using_time_weighted_state(
# integration_result=(
# bdg_specific_demand[building_index] * area
# ),
# avg_state=avg_state,
# time_interval_durations=time_interval_durations,
# min_to_max_ratio=bdg_ratio_min_max[building_index],
# state_correlates_with_output=state_correlates_with_output,
# )
# )
# )
heat_demand_profiles.append(
np.array(
create_profile_using_time_weighted_state(
generate_state_correlated_profile(
integration_result=(
bdg_specific_demand[building_index] * area
),
avg_state=avg_state,
),
states=avg_state,
time_interval_durations=time_interval_durations,
min_to_max_ratio=bdg_ratio_min_max[building_index],
state_correlates_with_output=state_correlates_with_output,
states_correlate_profile=state_correlates_with_output,
min_max_ratio=bdg_ratio_min_max[building_index],
solver=solver
)
)
)
else:
# states matter and the gain is predefined
heat_demand_profiles.append(
np.array(
generate_manual_state_correlated_profile(
integration_result=(
bdg_specific_demand[building_index] * area
),
states=avg_state,
time_interval_durations=time_interval_durations,
deviation_gain=deviation_gain
)
)
)
)
# add the profiles, time step by time step
if len(heat_demand_profiles) == 0:
Loading