Skip to content

Commit

Permalink
Switch to adding incremental envelope costs in pkg_env_cost
Browse files Browse the repository at this point in the history
When the user specifies the pkg_env_cost option, only the incremental (vs. total) measure envelope component upgrade cost vs. baseline envelope component upgrade cost is added to the overall HVAC+envelope measure cost. This ensures that when users define HVAC+envelope measure packages and compete them against HVAC-only measures (where baseline envelope costs will not be reflected), the competition fairly reflects the incremental cost difference between two those measures (vs. representing the full HVAC+envelope cost vs. the HVAC-only cost).

Addresses #465.
  • Loading branch information
jtlangevin committed Feb 26, 2025
1 parent e168d55 commit 3ddcdf8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
52 changes: 26 additions & 26 deletions scout/ecm_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -13196,7 +13196,7 @@ def merge_htcl_overlaps(
def add_env_costs_to_pkg(
self, msegs_meas, adopt_scheme, htcl_key_match, key_list, cm_key,
common_stk):
"""Reflect envelope stock costs in HVAC/envelope package data.
"""Reflect incremental envelope stock costs in HVAC/envelope package data.

Args:
msegs_meas (dict): Data for the contributing microsegment of an
Expand Down Expand Up @@ -13238,7 +13238,9 @@ def add_env_costs_to_pkg(
yr: 0 for yr in self.handyvars.aeo_years}
for n in range(8))
# Loop through all contributing microsegments for the overlapping
# envelope measure and add to initialized stock cost/stock data
# envelope measure and add to initialized stock cost/stock data. Note
# that any overlaps in stock data across multiple envelope components within
# the same measure have been worked out/adjusted already in fill_mkts
for c_mseg in range(len(olm_sc)):
tot_stk_eff, tot_stk_cost_eff, tot_stk_base, \
tot_stk_cost_base, comp_stk_eff, comp_stk_cost_eff, \
Expand Down Expand Up @@ -13354,50 +13356,48 @@ def add_env_costs_to_pkg(
1 if comp_stk_eff_hvac_unadj[yr] != 0 else 0)
for yr in self.handyvars.aeo_years}

# Set efficient and baseline envelope costs, normalized by the
# stock (converted above to same units as HVAC equipment), to add
# to the unit costs of the HVAC equipment measure; note that in
# both cases, aggregate costs are anchored on the measure-captured
# stock numbers
# Set efficient and baseline envelope costs, normalized by the stock (converted above
# to same units as HVAC equipment), and calculate incremental difference between the
# two to add to the unit costs of the HVAC equipment measure
env_cost_eff_tot_unit = {
yr: ((tot_stk_cost_eff[yr] / tot_stk_eff[yr]) *
tot_env_to_hvac_stk[yr]) if tot_stk_eff[yr] != 0
else 0 for yr in self.handyvars.aeo_years}
env_cost_base_tot_unit = {
yr: ((tot_stk_cost_base[yr] / tot_stk_eff[yr]) *
yr: ((tot_stk_cost_base[yr] / tot_stk_base[yr]) *
tot_env_to_hvac_stk[yr]) if tot_stk_eff[yr] != 0
else 0 for yr in self.handyvars.aeo_years}
# Incremental
env_cost_inc_tot_unit = {
yr: (env_cost_eff_tot_unit[yr] - env_cost_base_tot_unit[yr])
if (env_cost_eff_tot_unit[yr] - env_cost_base_tot_unit[yr]) >= 0 else 0
for yr in self.handyvars.aeo_years
}
env_cost_eff_comp_unit = {
yr: ((comp_stk_cost_eff[yr] / comp_stk_eff[yr]) *
comp_env_to_hvac_stk[yr]) if comp_stk_eff[yr] != 0
else 0 for yr in self.handyvars.aeo_years}
env_cost_base_comp_unit = {
yr: ((comp_stk_cost_base[yr] / comp_stk_eff[yr]) *
comp_env_to_hvac_stk[yr]) if comp_stk_eff[yr] != 0
yr: ((comp_stk_cost_base[yr] / comp_stk_base[yr]) *
comp_env_to_hvac_stk[yr]) if comp_stk_base[yr] != 0
else 0 for yr in self.handyvars.aeo_years}
# Incremental
env_cost_inc_comp_unit = {
yr: (env_cost_eff_comp_unit[yr] - env_cost_base_comp_unit[yr])
if (env_cost_eff_comp_unit[yr] - env_cost_base_comp_unit[yr]) >= 0 else 0
for yr in self.handyvars.aeo_years
}

# Adjust total efficient stock cost to account for envelope
# Adjust total efficient stock cost to account for incr. envelope cost over base
msegs_meas["cost"]["stock"]["total"]["efficient"] = {
yr: msegs_meas["cost"]["stock"]["total"][
"efficient"][yr] + env_cost_eff_tot_unit[yr] *
"efficient"][yr] + env_cost_inc_tot_unit[yr] *
msegs_meas["stock"]["total"]["measure"][yr] for
yr in self.handyvars.aeo_years}
# Adjust total baseline stock cost to account for envelope
msegs_meas["cost"]["stock"]["total"]["baseline"] = {
yr: msegs_meas["cost"]["stock"]["total"][
"baseline"][yr] + env_cost_base_tot_unit[yr] *
msegs_meas["stock"]["total"]["measure"][yr] for
yr in self.handyvars.aeo_years}
# Adjust competed efficient stock cost to account for envelope
# Adjust competed efficient stock cost to account for incr. envelope cost over base
msegs_meas["cost"]["stock"]["competed"]["efficient"] = {
yr: msegs_meas["cost"]["stock"]["competed"][
"efficient"][yr] + env_cost_eff_comp_unit[yr] *
msegs_meas["stock"]["competed"]["measure"][yr] for
yr in self.handyvars.aeo_years}
# Adjust competed baseline stock cost to account for envelope
msegs_meas["cost"]["stock"]["competed"]["baseline"] = {
yr: msegs_meas["cost"]["stock"]["competed"][
"baseline"][yr] + env_cost_base_comp_unit[yr] *
"efficient"][yr] + env_cost_inc_comp_unit[yr] *
msegs_meas["stock"]["competed"]["measure"][yr] for
yr in self.handyvars.aeo_years}

Expand Down
12 changes: 6 additions & 6 deletions tests/ecm_prep_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126138,12 +126138,12 @@ def setUpClass(cls):
"baseline": {
"2009": 10, "2010": 10},
"efficient": {
"2009": 10, "2010": 10}},
"2009": 15, "2010": 15}},
"competed": {
"baseline": {
"2009": 10, "2010": 0},
"efficient": {
"2009": 10, "2010": 0}}},
"2009": 15, "2010": 0}}},
"energy": {
"total": {
"baseline": {
Expand Down Expand Up @@ -127979,11 +127979,11 @@ def setUpClass(cls):
"cost": {
"stock": {
"total": {
"baseline": {"2009": 35, "2010": 35},
"efficient": {"2009": 35, "2010": 35}},
"baseline": {"2009": 25, "2010": 25},
"efficient": {"2009": 27.5, "2010": 27.5}},
"competed": {
"baseline": {"2009": 35, "2010": 25},
"efficient": {"2009": 35, "2010": 25}}},
"baseline": {"2009": 25, "2010": 25},
"efficient": {"2009": 27.5, "2010": 25}}},
"energy": {
"total": {
"baseline": {"2009": 25, "2010": 25},
Expand Down

0 comments on commit 3ddcdf8

Please sign in to comment.