Skip to content

Add demand-flex analytical validation and elasticity calibration#382

Open
alxsmith wants to merge 7 commits intomainfrom
377-add-demand-flex-analytical-validation-framework-and-elasticity-sensitivity-analysis
Open

Add demand-flex analytical validation and elasticity calibration#382
alxsmith wants to merge 7 commits intomainfrom
377-add-demand-flex-analytical-validation-framework-and-elasticity-sensitivity-analysis

Conversation

@alxsmith
Copy link
Contributor

Implements the analytical demand-flex validation and elasticity calibration framework for NY HP rate design, grounded in the Arcturus 2.0 meta-analysis.

What this PR adds

utils/post/diagnose_demand_flex.py — Elasticity sweep diagnostic. For each NY utility, loads real HP building loads and TOU derivation data, sweeps candidate elasticity values, and recommends the value whose peak reduction % most closely matches the Arcturus 2.0 "no enabling technology" empirical prediction. Runs in ~15s per utility without a CAIRO run.

utils/post/validate_demand_flex_shift.py — Shift validation and diagnostic plots. Reproduces the constant-elasticity demand-response shift analytically using the same functions CAIRO uses, then verifies: (1) energy conservation, (2) correct direction (peak kWh down, off-peak up), (3) match against CAIRO's saved demand_flex_elasticity_tracker.csv. All 7 NY utilities pass at ε=-0.10. Produces 5 diagnostic plots per utility (aggregate daily profile, net-shift-by-hour bars, month×hour heatmap, peak reduction distribution, per-building daily profiles) and CSV/parquet outputs for report reuse.

context/methods/tou_and_rates/demand_flex_elasticity_calibration.md — Methodology writeup: Arcturus 2.0 anchor, two savings mechanisms (rate arbitrage vs RR reduction), per-utility results table (ε=-0.10 or -0.12), known limitations.

rate_design/hp_rates/ny/Justfile — Three new recipes: validate-demand-flex, validate-demand-flex-all, diagnose-demand-flex.

Reviewer focus

  • The savings calculation in diagnose_demand_flex.py normalizes by number of HP buildings (n_bldgs) not by weighted customer count — this is intentional and correct; see the savings decomposition in the context doc.
  • The CAIRO tracker cross-check shows max |Δε| < 0.015 across all utilities. The non-zero differences are only on the receiver (off-peak) period where CAIRO's zero-sum residual allocation differs slightly from our analytical reproduction due to floating-point accumulation order. Donor period epsilons match exactly.
  • Recommended elasticities are ε=-0.10 for utilities with 3-hour peak windows (ConEd, NiMo, NYSEG, RGE) and ε=-0.12 for 5-hour peak windows (CenHud, OR, PSEG-LI).

Closes #377

Made with Cursor

Made-with: Cursor
…nalytical-validation-framework-and-elasticity-sensitivity-analysis
Implements utils/post/diagnose_demand_flex.py: an analytical diagnostic
that loads real HP building loads and TOU derivation data to sweep
candidate elasticity values (-0.02 to -0.20), compute peak reduction %
and rate-arbitrage savings per HP building, and recommend the elasticity
that best matches the Arcturus 2.0 "no enabling technology" empirical
target for each NY utility.

Runs in ~15s per utility without requiring a CAIRO run.

Made-with: Cursor
Implements utils/post/validate_demand_flex_shift.py: reproduces the
constant-elasticity demand-response shift analytically using the same
functions CAIRO uses, then verifies correctness via three checks:
energy conservation (per-building kWh preserved), direction (peak kWh
decreases, off-peak increases), and cross-check against CAIRO's saved
demand_flex_elasticity_tracker.csv. All 7 NY utilities pass at ε=-0.10.

Produces five diagnostic plots per utility: aggregate daily load
profile (pre/post with shaded fill), net shift by hour bars, month×hour
heatmap, per-building peak reduction distribution, and per-building
daily profiles at representative consumption percentiles. Also writes
CSV/parquet data outputs for report reuse.

Made-with: Cursor
context/methods/tou_and_rates/demand_flex_elasticity_calibration.md:
accessible writeup of the per-utility elasticity calibration methodology,
Arcturus 2.0 empirical anchor, two savings mechanisms (rate arbitrage vs
RR reduction), results table (ε=-0.10 or -0.12 per utility), and known
limitations.

context/plans/demand-flex_elasticity_calibration.md: living plan document
for the broader demand-flex calibration and validation work.

Made-with: Cursor
rate_design/hp_rates/ny/Justfile: add validate-demand-flex,
validate-demand-flex-all, and diagnose-demand-flex recipes for running
the shift validation and elasticity sweep diagnostic from the command
line.

context/README.md: index the new demand_flex_elasticity_calibration.md
context document.

Made-with: Cursor
context/methods/tou_and_rates/demand_flex_elasticity_calibration.md:
- Add Validation section: all-utilities pass results at ε=-0.10
  (energy conservation, direction, CAIRO tracker cross-check)
- Add per-utility peak reduction table at ε=-0.10
- Document the five diagnostic plot types and what they show
- Add invoke instructions for the new Justfile recipes

context/plans/demand-flex_elasticity_calibration.md:
- Update todos to reflect Phase 1 completion (diagnostic script,
  validation script, Justfile recipes, results review all done)
- Add status table at the top of the plan body
- Add pending items: scenario YAML update, optional Phase 2 sweep

Made-with: Cursor
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.

Add demand-flex analytical validation framework and elasticity sensitivity analysis

1 participant