Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
75dac31
wip
alxsmith Mar 23, 2026
8d8a1e6
Merge remote-tracking branch 'origin/main' into 377-add-demand-flex-a…
alxsmith Mar 25, 2026
20db62c
Add per-utility demand-flex elasticity diagnostic script
alxsmith Mar 25, 2026
4c4b720
Add demand-flex shift validation script and diagnostic plots
alxsmith Mar 25, 2026
c4006ac
Add elasticity calibration context docs
alxsmith Mar 25, 2026
7055076
Add demand-flex Justfile recipes and update context index
alxsmith Mar 25, 2026
6dbcf21
Update demand-flex context doc and plan with validation results
alxsmith Mar 25, 2026
185519c
Add seasonal elasticity support to demand-flex runtime
alxsmith Mar 26, 2026
fee4706
Wire seasonal elasticity dict through run_scenario
alxsmith Mar 26, 2026
42b2232
Add calibrate_demand_flex_elasticity to utils/pre
alxsmith Mar 26, 2026
f56475e
Read no-tech or with-tech elasticity from periods YAML based on enabl…
alxsmith Mar 26, 2026
776b419
Add trailing newline to calibrated tariff JSON output
alxsmith Mar 26, 2026
12902a9
Fix ty/ruff errors and add usage examples to validate_demand_flex_shift
alxsmith Mar 26, 2026
29846ca
Remove superseded demand-flex scripts and stale tests
alxsmith Mar 26, 2026
96cf35f
Update Justfiles for calibrate-demand-flex-elasticity recipe
alxsmith Mar 26, 2026
e62be88
Write calibrated seasonal elasticities to all NY utility periods YAMLs
alxsmith Mar 26, 2026
ce75b14
Regenerate all NY utility scenario YAMLs with seasonal elasticity
alxsmith Mar 26, 2026
27be1e4
Update CenHud calibrated tariffs from ny_20260326_elast_seasonal_tech…
alxsmith Mar 26, 2026
a5c00b6
Update demand-flex calibration docs with corrected Arcturus model and…
alxsmith Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions context/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ BAT framework, residual allocation, and how they connect to the literature.

Cost-reflective TOU design: theory and window optimization.

| File | Purpose |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cost_reflective_tou_rate_design.md | Theory and practice of cost-reflective TOU rate design: demand-weighted MC averages, cost-causation ratios, period selection, assumptions, demand flexibility implications, and partial vs. general equilibrium |
| tou_window_optimization.md | TOU window width ($N$) sweep: welfare-loss metric derivation, HP-demand weighting proof, sweep algorithm, CLI/Justfile, NY results |
| File | Purpose |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cost_reflective_tou_rate_design.md | Theory and practice of cost-reflective TOU rate design: demand-weighted MC averages, cost-causation ratios, period selection, assumptions, demand flexibility implications, and partial vs. general equilibrium |
| tou_window_optimization.md | TOU window width ($N$) sweep: welfare-loss metric derivation, HP-demand weighting proof, sweep algorithm, CLI/Justfile, NY results |
| demand_flex_elasticity_calibration.md | Per-utility elasticity calibration: Arcturus 2.0 meta-analysis anchor, diagnostic methodology, results table (ε = -0.10 or -0.12 per utility), two savings mechanisms, known limitations |

### methods/marginal_costs/

Expand Down
Binary file not shown.
248 changes: 248 additions & 0 deletions context/methods/tou_and_rates/demand_flex_elasticity_calibration.md

Large diffs are not rendered by default.

290 changes: 290 additions & 0 deletions context/plans/demand-flex_elasticity_calibration.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions rate_design/hp_rates/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,8 @@ run-all-sequential:
: "${RDP_BATCH:?Set RDP_BATCH before running (e.g. ny_20260305c_r1-8)}"
export RDP_BATCH
echo ">> run-all-sequential [${RDP_BATCH}]" >&2
# just run-1
# just run-2
just run-1
just run-2
just compute-rev-requirements
just run-3
just run-4
Expand Down
55 changes: 55 additions & 0 deletions rate_design/hp_rates/ny/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,58 @@ validate-all-runs-ny timestamp="":
just validate-or "{{ timestamp }}"
just validate-psegli "{{ timestamp }}"
just validate-rge "{{ timestamp }}"

# =============================================================================
# NY-only: demand-flex diagnostics
# =============================================================================

path_flex_plots := path_repo / "dev_plots/flex"

# Validate demand-flex load shifting for one utility: reproduces the shift
# analytically, checks energy conservation and direction, cross-checks against
# CAIRO's elasticity tracker, and generates diagnostic plots.
# just -f ny/Justfile validate-demand-flex coned

# just -f ny/Justfile validate-demand-flex coned -0.12 ny_20260325b_r1-16
validate-demand-flex utility_arg elasticity="-0.10" batch="":
cd {{ project_root }} && uv run python -m utils.post.validate_demand_flex_shift \
--utility {{ utility_arg }} \
--elasticity {{ elasticity }} \
--output-dir "{{ path_flex_plots }}/{{ utility_arg }}" \
{{ if batch != "" { "--batch " + batch } else { "" } }}

validate-demand-flex-all elasticity="-0.10" batch="":
just validate-demand-flex cenhud {{ elasticity }} "{{ batch }}"
just validate-demand-flex coned {{ elasticity }} "{{ batch }}"
just validate-demand-flex nimo {{ elasticity }} "{{ batch }}"
just validate-demand-flex nyseg {{ elasticity }} "{{ batch }}"
just validate-demand-flex or {{ elasticity }} "{{ batch }}"
just validate-demand-flex psegli {{ elasticity }} "{{ batch }}"
just validate-demand-flex rge {{ elasticity }} "{{ batch }}"

# Run the elasticity calibration sweep: tests a range of elasticity values per
# utility and finds the one matching the Arcturus 2.0 empirical target.
#
# Sweep all utilities (default range -0.04 to -0.50, step -0.02):
# just -f ny/Justfile calibrate-demand-flex-elasticity
#
# Subset of utilities:
# just -f ny/Justfile calibrate-demand-flex-elasticity --utilities=coned,nimo
#
# Custom range:
# just -f ny/Justfile calibrate-demand-flex-elasticity --epsilon-start -0.04 --epsilon-end -0.30 --epsilon-step -0.01
#
# Write no-tech + with-tech seasonal elasticities to config/periods/*.yaml:
# just -f ny/Justfile calibrate-demand-flex-elasticity --write-periods
#
# Compare analytical predictions against a CAIRO batch (no-tech):
# just -f ny/Justfile calibrate-demand-flex-elasticity --utilities=cenhud --compare-batch ny_20260326_batch
#
# Compare against a CAIRO batch that used with-tech elasticities:

# just -f ny/Justfile calibrate-demand-flex-elasticity --utilities=cenhud --compare-batch ny_20260326_batch --with-tech
calibrate-demand-flex-elasticity *args:
cd {{ project_root }} && uv run python -m utils.pre.calibrate_demand_flex_elasticity \
--state ny \
--output-dir "{{ path_flex_plots }}/diagnostic" \
{{ args }}
14 changes: 13 additions & 1 deletion rate_design/hp_rates/ny/config/periods/cenhud.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
winter_months: [10, 11, 12, 1, 2, 3]
winter_months:
- 10
- 11
- 12
- 1
- 2
- 3
tou_window_hours: 5
elasticity:
summer: -0.14
winter: -0.12
elasticity_with_tech:
summer: -0.22
winter: -0.18
14 changes: 13 additions & 1 deletion rate_design/hp_rates/ny/config/periods/coned.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
winter_months: [10, 11, 12, 1, 2, 3]
winter_months:
- 10
- 11
- 12
- 1
- 2
- 3
tou_window_hours: 3
elasticity:
summer: -0.12
winter: -0.1
elasticity_with_tech:
summer: -0.18
winter: -0.16
14 changes: 13 additions & 1 deletion rate_design/hp_rates/ny/config/periods/nimo.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
winter_months: [10, 11, 12, 1, 2, 3]
winter_months:
- 10
- 11
- 12
- 1
- 2
- 3
tou_window_hours: 3
elasticity:
summer: -0.1
winter: -0.1
elasticity_with_tech:
summer: -0.18
winter: -0.16
14 changes: 13 additions & 1 deletion rate_design/hp_rates/ny/config/periods/nyseg.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
winter_months: [10, 11, 12, 1, 2, 3]
winter_months:
- 10
- 11
- 12
- 1
- 2
- 3
tou_window_hours: 3
elasticity:
summer: -0.1
winter: -0.1
elasticity_with_tech:
summer: -0.18
winter: -0.16
14 changes: 13 additions & 1 deletion rate_design/hp_rates/ny/config/periods/or.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
winter_months: [10, 11, 12, 1, 2, 3]
winter_months:
- 10
- 11
- 12
- 1
- 2
- 3
tou_window_hours: 5
elasticity:
summer: -0.14
winter: -0.12
elasticity_with_tech:
summer: -0.24
winter: -0.2
14 changes: 13 additions & 1 deletion rate_design/hp_rates/ny/config/periods/psegli.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
winter_months: [10, 11, 12, 1, 2, 3]
winter_months:
- 10
- 11
- 12
- 1
- 2
- 3
tou_window_hours: 5
elasticity:
summer: -0.14
winter: -0.12
elasticity_with_tech:
summer: -0.22
winter: -0.18
14 changes: 13 additions & 1 deletion rate_design/hp_rates/ny/config/periods/rge.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
winter_months: [10, 11, 12, 1, 2, 3]
winter_months:
- 10
- 11
- 12
- 1
- 2
- 3
tou_window_hours: 3
elasticity:
summer: -0.1
winter: -0.1
elasticity_with_tech:
summer: -0.18
winter: -0.16
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
utility: cenhud
group_col: has_hp
cross_subsidy_col: BAT_percustomer
source_run_dir: s3://data.sb/switchbox/cairo/outputs/hp_rates/ny/cenhud/ny_20260325b_r1-16/20260325_143137_ny_cenhud_run1_up00_precalc__default
source_run_dir: s3://data.sb/switchbox/cairo/outputs/hp_rates/ny/cenhud/ny_20260326_elast_seasonal_tech/20260326_194621_ny_cenhud_run1_up00_precalc__default
total_delivery_revenue_requirement: 418151641.73
total_delivery_and_supply_revenue_requirement: 646688375.32
subclass_revenue_requirements:
non-hp:
delivery: 401392812.5614301
supply: 209823391.6038903
total: 611216204.1653204
delivery: 401392812.56143004
supply: 209823391.60389048
total: 611216204.1653205
hp:
delivery: 16758829.168569982
supply: 18713341.98610972
total: 35472171.1546797
delivery: 16758829.16856999
supply: 18713341.986109704
total: 35472171.15467969
16 changes: 12 additions & 4 deletions rate_design/hp_rates/ny/config/scenarios/scenarios_cenhud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.22
winter: -0.18
14:
run_name: ny_cenhud_run14_up00_precalc_supply__hp_seasonalTOU_flex_vs_default
state: NY
Expand Down Expand Up @@ -396,7 +398,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.22
winter: -0.18
15:
run_name: ny_cenhud_run15_up02_default__hp_seasonalTOU_flex
state: NY
Expand Down Expand Up @@ -424,7 +428,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.22
winter: -0.18
16:
run_name: ny_cenhud_run16_up02_default_supply__hp_seasonalTOU_flex
state: NY
Expand Down Expand Up @@ -452,4 +458,6 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.22
winter: -0.18
16 changes: 12 additions & 4 deletions rate_design/hp_rates/ny/config/scenarios/scenarios_coned.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
14:
run_name: ny_coned_run14_up00_precalc_supply__hp_seasonalTOU_flex_vs_default
state: NY
Expand Down Expand Up @@ -396,7 +398,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
15:
run_name: ny_coned_run15_up02_default__hp_seasonalTOU_flex
state: NY
Expand Down Expand Up @@ -424,7 +428,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
16:
run_name: ny_coned_run16_up02_default_supply__hp_seasonalTOU_flex
state: NY
Expand Down Expand Up @@ -452,4 +458,6 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
16 changes: 12 additions & 4 deletions rate_design/hp_rates/ny/config/scenarios/scenarios_nimo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
14:
run_name: ny_nimo_run14_up00_precalc_supply__hp_seasonalTOU_flex_vs_default
state: NY
Expand Down Expand Up @@ -396,7 +398,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
15:
run_name: ny_nimo_run15_up02_default__hp_seasonalTOU_flex
state: NY
Expand Down Expand Up @@ -424,7 +428,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
16:
run_name: ny_nimo_run16_up02_default_supply__hp_seasonalTOU_flex
state: NY
Expand Down Expand Up @@ -452,4 +458,6 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
16 changes: 12 additions & 4 deletions rate_design/hp_rates/ny/config/scenarios/scenarios_nyseg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
14:
run_name: ny_nyseg_run14_up00_precalc_supply__hp_seasonalTOU_flex_vs_default
state: NY
Expand Down Expand Up @@ -396,7 +398,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
15:
run_name: ny_nyseg_run15_up02_default__hp_seasonalTOU_flex
state: NY
Expand Down Expand Up @@ -424,7 +428,9 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
16:
run_name: ny_nyseg_run16_up02_default_supply__hp_seasonalTOU_flex
state: NY
Expand Down Expand Up @@ -452,4 +458,6 @@ runs:
year_run: 2025
year_dollar_conversion: 2025
process_workers: 8
elasticity: -0.1
elasticity:
summer: -0.18
winter: -0.16
Loading