Port G-1 reserves - #320
Closed
acostarelli wants to merge 17 commits into
Closed
acostarelli wants to merge 17 commits into
acostarelli wants to merge 17 commits into
Conversation
acostarelli
commented
Sep 23, 2026
Member
- Tests not run because upstream changes broke things, waiting for a POM PR to rebase on
- Requires https://github.com/Sienna-Platform/InfrastructureOptimizationModels.jl/pull/171/changes
added 17 commits
September 17, 2026 17:36
…straint and slacks on flow
… slacks keys need to be reconsidered I think
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved dependency and security-constrained model construction issues block approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 6
Open (11)
Populate deviation variables for all modeled tie axes · New Apply branch-orientation sign to PTDF deployment terms · New Handle AreaBalance with no monitored AreaInterchange devices · New Create zero-valued balance constraints for absent deployments · New Remove invalid redundant contingency reserve variable creation loop · New Replace test dependency path with upstream repository pin · New Preserve public export of HVDCDCControlConstraint · New Add natural-unit conversion for active-power deviation variable · New Avoid empty deviation container without AreaInterchange model · New Create requirement constraints only for services with reserve demand · New Align formulation docstring with actual outage discovery behavior · New
What changed in this PR
Ports G-1 security-constrained reserve modeling and migrates reserve handling to device/service-type keys.
Changes:
- Adds post-contingency reserve deployment, flow, balance, and outage modeling.
- Updates reserve integrations, consumers, and regression tests.
- Updates dependency sources and removes the porting plan.
| File | Summary |
|---|---|
test/test_static_injection_security_constrained_models.jl |
Adds G-1 regression coverage. |
test/test_services_constructor.jl |
Updates reserve container tests. |
test/test_model_decision.jl |
Updates output-key tests. |
test/test_device_reserve_offers.jl |
Updates reserve-offer tests. |
test/Project.toml |
Updates test dependencies and sources. |
src/static_injector_models/thermal_generation.jl |
Updates reserve variable lookup. |
src/static_injector_models/hydro_generation.jl |
Updates reserve variable lookup. |
src/services_models/services_constructor.jl |
Integrates security-constrained reserve construction. |
src/services_models/security_constrained_injectors.jl |
Implements G-1 modeling and constraints. |
src/services_models/reserves.jl |
Supports device-type reserve aggregation. |
src/services_models/reserve_offers.jl |
Updates reserve offer pricing keys. |
src/services_models/reserve_group.jl |
Updates reserve container discovery. |
src/PowerOperationsModels.jl |
Registers and exports G-1 components. |
src/operation/template_validation.jl |
Reorganizes outage validation. |
src/hybrid_system_models/hybrid_systems.jl |
Updates reserve variable keying. |
src/energy_storage_models/storage_models.jl |
Updates reserve variable keying. |
src/core/variables.jl |
Adds post-contingency variables. |
src/core/formulations.jl |
Adds security-constrained reserve formulations. |
src/core/expressions.jl |
Adds post-contingency expressions. |
src/core/constraints.jl |
Adds G-1 constraint types. |
src/common_models/add_to_expression.jl |
Updates reserve variable keying. |
Project.toml |
Updates dependency sources. |
.claude/pom_port_plan.md |
Removes the porting plan. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+183
to
+184
| for (uuid, per_type) in monitored_components | ||
| for name in get(Set{String}, per_type, PSY.AreaInterchange), t in time_steps |
Comment on lines
+407
to
+410
| for entry_name in | ||
| keys(_post_contingency_flow_entries(network_model, line_type, names)) | ||
| df = get!(dfs, entry_name) do | ||
| ptdf_col = ptdf[arc_map[entry_name], :] |
Comment on lines
+450
to
+451
| ) | ||
| flow = get_variable(container, FlowActivePowerVariable, PSY.AreaInterchange) |
Comment on lines
+576
to
+583
| for (area_name, uuid, t) in keys(deployment.data) | ||
| balance = JuMP.AffExpr(0.0) | ||
| JuMP.add_to_expression!(balance, deployment[area_name, uuid, t]) | ||
| for (sign, interchange_name) in get(interchanges, area_name, ()) | ||
| JuMP.add_to_expression!(balance, sign, deviation[interchange_name, uuid, t]) | ||
| end | ||
| cons[area_name, uuid, t] = JuMP.@constraint(jump_model, balance == 0.0) | ||
| end |
Comment on lines
+1152
to
+1154
| for devices in get_contributing_devices_map(model, PSY.get_name(service)) | ||
| _create_post_contingency_reserve_variables!(container, service) | ||
| end |
Comment on lines
+875
to
+877
| export PostContingencyGenerationBalanceConstraint | ||
| export PostContingencyActivePowerGenerationLimitsConstraint | ||
| export PostContingencyActivePowerReserveDeploymentVariableLimitsConstraint |
Comment on lines
+898
to
+899
| convert_output_to_natural_units(::Type{PostContingencyActivePowerReserveDeploymentVariable}) = | ||
| true |
Comment on lines
+174
to
+178
| var = add_variable_container!( | ||
| container, | ||
| PostContingencyAreaInterchangeFlowDeviationVariable, | ||
| PSY.AreaInterchange, | ||
| String[], |
Comment on lines
+1178
to
+1185
| service_names = PSY.get_name.(services) | ||
| add_constraints_container!( | ||
| container, | ||
| RequirementConstraint, | ||
| R, | ||
| service_names, | ||
| get_time_steps(container), | ||
| ) |
Comment on lines
+834
to
+835
| `add_supplemental_attribute!(sys, service, outage)`; template validation | ||
| mirrors those attachments into `service_model.outages`. Post-contingency |
Member
Author
|
Closing for #321 (I messed up something and made a new branch by mistake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


