Skip to content

Group-stepwise ORDC, load reserve provision, and OfflineReserve ORDC supply - #236

Closed
rodrigomha wants to merge 6 commits into
mainfrom
rh/new_load_and_group_services
Closed

Group-stepwise ORDC, load reserve provision, and OfflineReserve ORDC supply#236
rodrigomha wants to merge 6 commits into
mainfrom
rh/new_load_and_group_services

Conversation

@rodrigomha

@rodrigomha rodrigomha commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Stacked on #235 (base branch rh/reserve_refactor); the diff shows only this feature's commits.

New features (not refactor items) re-expressed on the psy6 reserve tree:

  • GroupStepwiseCostReserve: elastic group ORDC. One dense ServiceRequirementVariable per group, a clearing constraint sum(member awards) >= requirement variable, and the group's demand curve (static or time series) priced through the existing delta-PWL path. Mis-paired ServiceModels (GroupReserve with a non-group formulation and vice versa) fail at declaration.
  • Load reserve provision under PowerLoadDispatch: the inverse of a generator. Up reserve is committed shed (P - r_up >= 0), down reserve is committed extra consumption (P + r_down <= forecast), gated on an attached service model. A costless load selling reserves errors since nothing pins its consumption.
  • OfflineReserve (non-spin) as ORDC supply from storage and loads: non-spinning is upward-only, so it routes like an up reserve everywhere a device supplies it (new UP_RESERVE union). Previously only thermal was wired: the storage reserve-balance multipliers MethodError'd, two storage coverage branches silently skipped the service, complete coverage hit an @assert false, and _modify_device_model! no-opped every OfflineReserve model. The no-op is now scoped to NonSpinningReserve, whose awards ride ReservePowerConstraint instead of the device range expressions.
  • Integration test: energy + reserve co-clearing with an elastic service, a stepwise group, and per-resource offers from thermal, storage, and load participants.

Tests live in existing files: group-stepwise testsets in test_services_constructor.jl; market integration, load provision, and the OfflineReserve ORDC scenarios in test_device_reserve_offers.jl; the storage non-spin coverage testset in test_storage_device_models.jl.

Full suite green: 106708/106708. Docs build green.

🤖 Generated with Claude Code

@rodrigomha

Copy link
Copy Markdown
Contributor Author

New commit 3479231: OfflineReserve can now supply an ORDC (StepwiseCostReserve) from storage and loads, not just thermal. Non-spin is upward-only, so it routes like an up reserve everywhere (new UP_RESERVE union). This fixes two silent skip branches and an @assert false in the storage coverage constraints, and scopes the _modify_device_model! no-op to NonSpinningReserve only. Full suite 106708/106708.

@rodrigomha rodrigomha changed the title Group-stepwise ORDC and load reserve provision Group-stepwise ORDC, load reserve provision, and OfflineReserve ORDC supply Aug 13, 2026
Base automatically changed from rh/reserve_refactor to main August 15, 2026 23:13
@jd-lara

jd-lara commented Aug 15, 2026

Copy link
Copy Markdown
Member

@rodrigomha this PR needs to be rebased

@rodrigomha

Copy link
Copy Markdown
Contributor Author

@jd-lara rebased onto main (post #235 squash-merge): the 7 feature commits replayed clean with zero conflicts (git rebase --onto main <235-head>), full suite green on the rebased branch (106708/106708). Base is already main.

@rodrigomha
rodrigomha force-pushed the rh/new_load_and_group_services branch from 3479231 to f33d289 Compare August 16, 2026 00:00
@rodrigomha

Copy link
Copy Markdown
Contributor Author

Done with the rebase

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown

Performance Results

Version Precompile Time
Main 5.911655268
This Branch 5.895921239
Version Build Time
Main-Build Time Precompile 100.085987451
Main-Build Time Postcompile 5.104126136
This Branch-Build Time Precompile 95.252371564
This Branch-Build Time Postcompile 4.570282716
Version Solve Time
Main-Solve Time Precompile 250.573936162
Main-Solve Time Postcompile 218.707044414
This Branch-Solve Time Precompile 139.960491362
This Branch-Solve Time Postcompile 89.101204677

@rodrigomha

Copy link
Copy Markdown
Contributor Author

CI status after the rebase, fully diagnosed:

  • Fixed on this branch (518ae0e, f0fda18): environment resolution. PSY psy6 now depends on the unregistered OpenAPI-models packages, and PSB psy6 on PowerTableDataParser/PowerFlowFileParser - Pkg ignores [sources] of non-root projects, so POM's root/test/docs environments now pin them directly. Docs, build, and comparison jobs are green.
  • Remaining test-job failures are upstream PSY psy6 bugs, reproduced and fixed locally (pending review before push): (1) the generated HydroPumpTurbine exporter calls _turbinepump_po, which was never added to the hand-written export helpers; (2) DOCUMENT_PLAN imports HydroPumpTurbine after HydroReservoir, which resolves its unit ids -> unresolved-id error; (3) FuelCurve.fuel_cost::TimeSeriesKey has no OpenAPI serde, which breaks PSB's bundle cache for c_sys5_re_fuel_cost (fixed via the schema's string variant + a document-level key-resolution pass).
  • With those PSY fixes applied locally: PSY test_openapi_document 448/448, POM full suite 106708/106708. No further POM commits needed - the pins float on psy6.
  • Separate flag: PSB's new bundle cache write is non-atomic; parallel first-builds can read a half-written system.json (UnexpectedEOF) - the old first-serialization race in a new spot. Worth a write-to-temp+rename in PSB.

@rodrigomha
rodrigomha force-pushed the rh/new_load_and_group_services branch from f0fda18 to 3382f8f Compare August 17, 2026 17:05
@rodrigomha
rodrigomha changed the base branch from main to jd/network_matrix_consolidation August 17, 2026 17:05
@rodrigomha

Copy link
Copy Markdown
Contributor Author

Restacked on #233 per the network-consolidation sequencing: base is now jd/network_matrix_consolidation and the branch is rebased onto it (4e28ede), so the diff shows only this PR's commits.

  • The 7 feature commits replayed clean. Of the two CI environment-pin commits, the PSB transitive-deps one was dropped entirely and the OpenAPI one shrank to docs-env pins only - network matrix consolidation #233 already carries the same root/test pins (same non-root [sources] traps, fixed independently there).
  • Note network matrix consolidation #233 pins IOM at jd/network-sources; this stack inherits that.
  • Validation on the stacked branch with latest psy6 (which now includes the _turbinepump_po and hydro DOCUMENT_PLAN fixes): compile + zero method ambiguities, and the full suite 106951/106951. The one remaining upstream gap for CI is the FuelCurve.fuel_cost time-series serde in PSY (fix staged locally, pending review) - without it the thermal fuel-cost test fails via PSB's bundle cache.

Base automatically changed from jd/network_matrix_consolidation to main August 18, 2026 03:43

@luke-kiernan luke-kiernan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, no issues at a glance. However, you should probably have others review it too--I'm not very familiar the distinctions between these differennt types of reserves...

Comment thread src/common_models/add_to_expression.jl
Comment thread src/core/reserve_traits.jl
rodrigomha and others added 6 commits August 19, 2026 14:28
…eCostReserve

The group formulation has supported time-series-backed ORDCs since the
stepwise parameter machinery generalized to the reserve tree, but had no
dedicated coverage. The test alternates the group curve's demand cap 40/80 MW
by hour at a decisive price and asserts the cleared group demand tracks the
alternation exactly - something a static curve cannot produce.
@rodrigomha rodrigomha closed this Aug 24, 2026
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.

3 participants