Skip to content

Conversation

jtlangevin
Copy link
Collaborator

@jtlangevin jtlangevin commented Oct 13, 2025

Where to focus your attention:

  • In this commit a new high_res_comp option is added to config_readable. In general, wherever that is called in the run module is a good place to review.
  • More specifically, the most important changes to review are found in the compete_res_primary and compete_com_primary functions of the run module. Other changes in there are largely supporting refactoring of existing code and/or smaller tweaks in how adjustments are made to breakout data during the measure competition.
  • Note that to support changes to these functions in the run module, certain technical potential competition data that weren't previously reported are now being written out from ecm_prep (see here) and are used for the detailed competition calculations. These data are useful for calculating unit-level cost characteristics for a measure entering the market in a given year (since technical potential represents 100% turnover in each year). They are read into the run module here.
  • Similarly, capacity factors for commercial cost calculations (needed to correctly translate to unit-level cost data) are carried through from ecm_prep to run (e.g., see here in ecm_prep and the supporting calculations to prepare the variable stk_cap_fact).

Overview of approach (addresses #408):

  • When users specify a new “high_res_comp” option in run.py, measure unit capital and operating costs will be separately calculated for each of its applicable market microsegment (the default is to calculate these measure costs across all its markets.) These more highly resolved cost data will then be used to compete the measure’s microsegments with overlapping measures.
  • The calculations are supported with uncompeted technical potential case cost data for each microsegment generated in ecm_prep.py. These data are now generated whether or not the technical potential case has been restricted out by the user when running ecm_prep.
  • Information used to link stock turnover calculations across microsegments is now determined in a separate function, find_join_keys, which is refactored out of the compete_adj_dicts function. In addition to determining stock turnover, this linking information is now used to pull mseg-specific stock cost information when high_res_comp is used.
  • In run.py, commercial time preference premiums/market share distributions were updated to the latest EIA NEMS docs. When high_res_comp is specified, the latest EIA method of determining life cycle costs is used – this method annualizes capital costs and adds those to annual energy costs for each year. (The legacy method of calculating NPV is retained when users do not use the high_res_comp option.)
  • The factors used to translate from unit service demand to unit service capacity in ecm_prep are reported through to run to ensure correct processing of unit-level costs for competition.

* Support new measure attribute, “backup_fuel_fraction” that points to a CSV with information about the portion of annual energy use that remains with backup fuels, for dual fuel measures. These data come from the Stock tools, and CSVs for Stock measures have been added in ./ecm_definitions/energyplus_data/dual_fuel_ratios. For example, a measure input could look like this: backup_fuel_fraction: RTU_other_fossil.csv.
* Update the function partition_microsegment to report the amount of energy, carbon, and cost that remains with the baseline fuel for a fuel switching measure b/c the measure has not yet switched over that fuel (see ‘add_fs’ variables ending in ‘_base’) vs. the amounts that remain as backup consumption for stock that has switched over to the measure fuel as primary (see ‘add_fs’ variables ending in ‘_switch’).
* Handle these more refined estimates of remaining fuel in Measure results breakouts for attribute ‘mseg_out_break’ (via function ‘breakout_mseg’).
* Also handle these refinements in MeasurePackage results breakouts for attribute ‘mseg_out_break‘ (via function ‘find_adj_out_break_cats’).
* Update test ecm_prep_test to account for new measure attribute.
A bug in the variable used to record and report remaining baseline fuel costs for dual fuel measures was fixed.
* This is a new measure attribute that is useful in handling the 'add_typ_eff' argument properly, and also will be useful in handling code/BPS provisions as that feature is added down the line.
The changes to ecm_prep reflect the following approach to estimate added cooling energy use when homes without existing cooling switch to a heat pump:

1: Loop through measure heating segments and determine/record the # of heating units that convert to heat pumps by region, building type, and building vintage.
2: Loop through measure cooling segments and pull the following data for each region, building type, and vintage combination (in partition_microsegment function):
2.1: Unit-level baseline cooling energy use (MMBtu/base cooling unit) and
2.2: Measure relative cooling performance vs. baseline cooling unit (%).
3: Calculate total added cooling energy (and emissions/costs) for region/building/vintage; added cooling = #1 * #2.1 * #2.2.
4: Add result from #3 to the measure’s efficient results.
For representation of alternate utility rate structures (addresses #411):

* Create a database that lists assumptions about electrification-friendly rate structures (e.g., % or absolute reductions in volumetric $/kWh) by state, customer class (res/com), fuel, and start/end year, with applicability factor to map rates that only affect a portion of the state’s area.
* Database can include rows for representing rate structure sensitivities that are tested across all or a large grouping of states (e.g., state = “all”; state = ”leading”; state= “usca”).
* Use data from the first bullet to modify energy cost application in partition_microsegment function (e.g., reduce volumetric rate for scenario).

For enhanced representation of state/utility incentives (addresses #410):

* Create a database that lists assumptions about new incentives (e.g., % of total installed cost for given performance threshold; start and end year); extensions of existing incentives (through end year) and/or increases (or, for fossil equipment, removals) of existing incentives (% max ref. case incentive for start/end year) by state, building type, building vintage (new/existing), and technology, with applicability factors to map incentives that affect a portion of the state’s area.
* Database can include rows for representing federal incentives (e.g., state = “all”) or in broad groupings of states (e.g., state = ”leading”; state= “usca”).
* Apply the assumptions from the first bullet to code that applies first cost incentives:
For new incentives, assume new incentive replaces any existing incentives already in the AEO forecast for the applicable segment.
For extension, find the first year in the reference case forecast that reaches the maximum incentive level and extend it forward through the end year in (a).
For an increase, same as bullet above but then increase by % specified in (a) for subsequent years.
The changes to ecm_prep reflect the following approach to estimate added cooling energy use when homes without existing cooling switch to a heat pump:

1: Loop through measure heating segments and determine/record the # of heating units that convert to heat pumps by region, building type, and building vintage.
2: Loop through measure cooling segments and pull the following data for each region, building type, and vintage combination (in partition_microsegment function):
2.1: Unit-level baseline cooling energy use (MMBtu/base cooling unit) and
2.2: Measure relative cooling performance vs. baseline cooling unit (%).
3: Calculate total added cooling energy (and emissions/costs) for region/building/vintage; added cooling = #1 * #2.1 * #2.2.
4: Add result from #3 to the measure’s efficient results.
@jtlangevin jtlangevin linked an issue Oct 13, 2025 that may be closed by this pull request
@jtlangevin jtlangevin added this to the v1.2.0 milestone Oct 13, 2025
* When users specify a new “high_res_comp” option in run.py, measure unit capital and operating costs will be separately calculated for each of its applicable market microsegment (the default is to calculate these measure costs across all its markets.) These more highly resolved cost data will then be used to compete the measure’s microsegments with overlapping measures.
* The calculations are supported with uncompeted technical potential case cost data for each microsegment generated in ecm_prep.py. These data are now generated whether or not the technical potential case has been restricted out by the user when running ecm_prep.
* Information used to link stock turnover calculations across microsegments is now determined in a separate function, find_join_keys, which is refactored out of the compete_adj_dicts function. In addition to determining stock turnover, this linking information is now used to pull mseg-specific stock cost information when high_res_comp is used.
* In run.py, commercial time preference premiums/market share distributions were updated to the latest EIA NEMS docs. When high_res_comp is specified, the latest EIA method of determining life cycle costs is used – this method annualizes capital costs and adds those to annual energy costs for each year. (The legacy method of calculating NPV is retained when users do not use the high_res_comp option.)
* The factors used to translate from unit service demand to unit service capacity in ecm_prep are reported through to run to ensure correct processing of unit-level costs for competition.

Addresses #408.
@jtlangevin jtlangevin force-pushed the 408-state-level-competition-framework branch from 710761a to e018240 Compare October 13, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State-level competition framework

1 participant