Skip to content

Port G-1 reserves - #320

Closed
acostarelli wants to merge 17 commits into
mainfrom
ac/g1-reserves
Closed

acostarelli wants to merge 17 commits into
mainfrom
ac/g1-reserves

Conversation

@acostarelli

Copy link
Copy Markdown
Member

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 High severity · 4 Medium severity · 1 Low severity

Open (11)
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 thread src/core/variables.jl
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 thread src/core/formulations.jl
Comment on lines +834 to +835
`add_supplemental_attribute!(sys, service, outage)`; template validation
mirrors those attachments into `service_model.outages`. Post-contingency
@acostarelli

Copy link
Copy Markdown
Member Author

Closing for #321 (I messed up something and made a new branch by mistake)

@jd-lara
jd-lara deleted the ac/g1-reserves branch September 25, 2026 21:49
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.

2 participants