Skip to content

Generalise reserve margin constraints for region/tech groups - #361

Draft
idelder wants to merge 26 commits into
TemoaProject:unstablefrom
idelder:rework/generalise_reserves
Draft

Generalise reserve margin constraints for region/tech groups#361
idelder wants to merge 26 commits into
TemoaProject:unstablefrom
idelder:rework/generalise_reserves

Conversation

@idelder

@idelder idelder commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Stacked on PR #350

Generalises the reserve margin constraints to allow reserves over groups of regions. Also now uses tech groups instead of the unique reserve set. Finally, makes operating_reserve_margin and planning_reserve_margin separate constraints that can be applied at the same time (rather than switched in config)

This allows:

  • multiple superimposed reserve margin constraints on different groups of technologies
  • stacking operating reserves with planning reserves
  • reserve margin constraints on non-electricity technologies, like oil refineries
  • reserve margins summed over multiple regions (e.g. ERCOT as a whole instead of texas east/west individually)

Added a reserve test that checks against a cached LP file for identical model formulation. Any changes are diagnosably printed on test failure.

Added a v4.1 schema for this change and v4->v4.1 migrator with test.

As a result, the rps_requirement constraint (already deprecated) was removed as it depended on the now-absent tech_reserve set. This constraint is structurally identical to the limit_activity_share constraint now anyway and the migrator moves rps_requirement to limit_activity_share by creating a tech group for the past tech_reserve set.

Also did some refactoring and docs rework to try to clarify how all this is supposed to work. These constraints were a magnet for bugs in the past.

New docs for group summation
New docs for mathematical formulation

Used the LP file comparer to confirm that, except for the one bug fixed, this version produces identical constraints.

One bug found:
Exchange techs are allowed to be annual. The previous reserve margin constraint did not sum annual exchange flows for its proxy demand.

idelder added 25 commits August 7, 2026 19:41
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
…ctions

Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
… unique elements

Signed-off-by: Davey Elder <iandavidelder@gmail.com>
…o change to sets

Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
… (replaced by limit_activity_share)

Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7ca0ccfd-4b0c-4ebe-811e-6c8a648f4168

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Davey Elder <iandavidelder@gmail.com>
@idelder
idelder marked this pull request as draft August 8, 2026 13:42
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.

1 participant