Quantities and signs
The reporting layer converts power fields to the configured unit even when an internal field name ends in
_mw. Do not infer the exported unit solely from the internal field name.
Market, enrollment and calls
For a resource’s total market , applicability factor , enrollment propensity and opt-out rate , the ordinary portfolio path uses: Program-competition allocations, when present, supply the resolved enrolled and called units instead. The independently evaluated single-unit dispatch path sets enrolled and called units to one. Its purpose is characterization; it is not a market forecast. The standalone propensity function is: The curve is logarithmic, despite a source docstring describing it as logistic regression. Marketing-level selection is year-specific. Incentive strategies include a percentage of benefits, a break-even cost-effective-potential strategy, and a net-benefit maximization strategy. For benefit , non-incentive cost and incentive , the optimization objective is based on . Strategy bounds, feasibility and the selected objective determine the result; the break-even strategy is not the same as maximizing net benefits. Program ramp-up and scenario-specific mappings are resolved before the final enrollment arrays are used. Connected studies also carry DERP propensity and market information in the handoff; do not apply either a second time as an external multiplier.Baseline and technology layers
Load layering maintains baseline, current and reporting shapes. The declared layer order is baseline, EE, DG, BE, FS, HP, EV, TVR and DR. The orchestrator applies the active configured layers in sequence, using the appropriate savings distribution or generation shape. DR therefore acts on the residual curve after preceding technology impacts. Local mode preserves grid targets. Regional-bulk aggregates grid levels within regions. Bulk uses aggregated end-use curves and shared dispatch grouping across regions while retaining market lookups in each measure’s real region. These modes do not merge every market into one regionless denominator.Standard peak day
For the selected year and period, the calculator:- Selects the configured top load hours and their unique dates.
- Adds dates in descending daily-maximum order if too few dates were selected.
- Truncates the date set to
fallback_days. - Retains complete 24-hour, positive-maximum profiles for shape averaging.
- Normalizes each retained profile by its own maximum, averages the normalized profiles, and normalizes that average by its maximum.
- Scales the normalized shape by the configured percentile of the selected daily maxima.
fallback_days is part of the current implementation. It is not simply a minimum-day condition with every initially selected date retained. Defaults are 100 top hours, the 97.5th percentile and ten fallback days.
Resource impact geometry
For a validated event with curtailment fractions , pre-charge fractions , rebound fractions and called-unit weighted power profile : The updated load is . Typical-day placement uses 24-hour geometry and can wrap hours. Annual placement rejects any candidate whose complete pre-charge/curtailment/rebound window crosses the year boundary. The annual enrolled-capacity reporting profile uses the first relative-curtailment value applied to enrolled capacity. It is not the entire event-shaped curtailment vector. Called impact, enrolled capacity and market size therefore have different denominators and meanings.Peak-chasing dispatch
The dispatcher prioritizes eligible resources using the configured economic score, evaluates candidate windows against the current residual load, and retains a feasible placement that improves the descending peak stack lexicographically: first the maximum, then the second-highest value, and so on. A placement can therefore be accepted with zero reduction of the absolute maximum when it improves a lower-ranked peak. Equal candidate peak stacks use lower total load as a further tie-breaker. A full-day curtailment shape without pre-charge/rebound remains pinned to clock hours rather than rotating. After placement, the dispatcher updates the load used for later resources. Screening and missing-market/profile decisions produce explicit non-placement records. Effective portfolio peak reduction is: The maximum can move to another hour. Therefore this quantity differs from curtailment at the original peak, total curtailed energy and the resource’s independent peak effect. Independent peak reductions generally cannot be summed to recover portfolio reduction. The strategy registry exposespeak_chasing, system_needs, annual_peak_chasing and annual_system_needs, with greedy as a peak-chasing alias. A constant or setting mentioning MIP does not establish an active MIP strategy in this registry.
System-needs dispatch
System-needs dispatch requires eligible grid-service streams, hourly avoided-cost shapes and remaining service caps. Program stream scope further restricts eligibility. In current stream classification:- A stream with no re-optimized type uses peak chasing.
- A re-optimized demand stream uses peak chasing when its relative standard deviation is below
STREAM_VARIATION_THRESHOLD. - Other typed streams, including an energy stream with a flat shape, use system-needs placement.
is_stream_flat. This code-level rule is more specific than classifying every flat stream identically.
For value-based placement, candidate windows are valued using the applicable impact and avoided-cost stream, including pre-charge/rebound effects. The dispatcher selects a positive-value feasible assignment, records its stream, updates load and reduces applicable remaining caps. Missing eligibility, exhausted caps and missing avoided-cost shapes are distinct failure reasons. Resources returned as remaining can enter the fallback peak-chasing stage.
Caps and placement order affect later choices. This is sequential resource allocation, not a simultaneous perfect-foresight optimization of every measure and service.
Annual constraints and call-number sweeps
Annual event placement enforces the measure’s available-hour mask, full-window geometry,annual_max_events, daily_max_events and cooldown. After an event, the blocking helper excludes the complete impact window expanded by cooldown on both sides. Every calendar day touched by pre-charge, curtailment or rebound increments its event counter; reaching the daily maximum blocks the rest of that day.
Defaults are zero cooldown hours and one daily and annual event. Invalid negative cooldown or event maxima below one are normalized by the input reader with warnings. Annual dispatch must be evaluated on the 8,760-hour sequence; it cannot be reproduced by multiplying one 24-hour result by an assumed number of days.
Typical-day typical_days.number_of_calls is a nonempty list of positive integers, default [1]. Each configured call number evaluates the applicable call eligibility; it is an analysis dimension. Do not sum rows for call numbers [1,10,25] as 36 disjoint events or treat them as an annual event schedule.
Screening and program competition
Dispatch evaluates PACT against the normalized economic threshold, with applicable override and screening settings. This differs from DERP’s JST economic screen. When no PACT ratio is available, the current screening method passes the resource rather than forcing exclusion; the placement record reports a numeric ratio of zero in that case. The result retains ratio, pass/fail, override and placement reason for diagnosis. Program variants can compete for the same underlying market. Competition resolves allocations before portfolio dispatch, preserving the group identity, algorithm, score and post-competition propensity. The allocation can also partition called units across allowed stream scopes. Inspect post-competition rather than pre-competition enrollment when reconciling dispatched units. For a competitive group, the code uses the largest variant market as the common denominator and the maximum standalone callable units as the group ceiling. Scores are nonnegative callable units times the selected per-unit independent energy/demand metric, subject to the minimum eligible score. Winner-takes-all assigns the ceiling to the highest-score variant; proportional allocation divides the same ceiling by score shares. Additive allocation preserves each variant’s own callable units. Zero scores or a zero ceiling give zero competitive allocations. Configured competition order or input order breaks ties. Unknown groups and duplicate program names are rejected.Results and limitations
Keep independent and effective impacts, enrolled and called units, grid target, program, year, scenario, period/day type and call number with each result. A measure can enroll but fail dispatch because it does not reduce the residual peak or lacks an eligible positive-value window. Its zero effective impact does not imply zero technical unit flexibility. The annual model assumes the supplied 8,760-hour calendar. Validate leap-day and daylight-saving handling during input preparation. The current registered strategies model planned dispatch on supplied curves; they do not represent stochastic customer response, live control or a network feasibility guarantee unless those effects are explicitly characterized in the inputs.Implementation
Inputs and execution contract
A standalone study with cost effectiveness supplies DR measures, DER measure characterization, markets, programs, settings, valuations/rates and adoption curves. These are data inputs to the DR runner; they do not require execution of DERP potential calculations.run_in_memory and run_from_files_with_settings return a ZIP report as BytesIO together with a timestamp string. The latter accepts a JSON settings override. run_write_to_file writes the file-based report.
The timestamp reader accepts its implemented date/time or date-plus-hour conventions. Market time-series scenario selectors must match the configured study mapping. Validate grid market totals and end-use grid coverage before interpreting node results. Missing optional grid-service tables are logged and skipped; this does not establish that system-needs dispatch has sufficient data.
Local grid-level batch execution uses a processor, checkpoint and output sink. Explicit grid levels or the configured profile source supply the work list. Checkpoint failure counts determine cleanup; an incomplete job must not be interpreted as a complete zero-impact result.
--no-multiprocess selects sequential grid processing for file-based CLI execution. --overwrite refreshes the configured data/memmap caches.
Output contract
The report exportsMeasures Savings Impact and Measures Load Impact worksheets, with report construction supporting file and in-memory results. Retain the exported power-unit convention when interpreting fields.
Non-placement reasons distinguish missing market, missing DR characterization, no matching end-use profile, PACT screening, no eligible streams, missing avoided-cost shape, exhausted caps, no positive savings and no peak reduction. Review these reasons before treating every unplaced resource as technically unavailable. Array-valued output fields are serialized; rounding in reporting can prevent exact reconstruction of intermediate floating-point arrays.