Skip to content

Commit

Permalink
FIX: monotonic constraint for traditional formulations
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudocubic committed Oct 11, 2023
1 parent a599061 commit 798d3ac
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## staged

- Fixed monotonic constraint for traditional formulations
- Added function keyword argument `check_enabled` to `build_nested_graph` to control `calc_connected_components`
- Added option `disable-grid-forming-constraint-block-cuts` to disable block-cut constraints in grid-forming inverter constraints
- Added support for PowerModelsDistribution v0.15
Expand Down
16 changes: 16 additions & 0 deletions src/core/constraint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1188,3 +1188,19 @@ function constraint_energized_blocks_strictly_increasing(pm::AbstractUnbalancedP
JuMP.@constraint(pm.model, z_block_n2 >= z_block_n1)
end
end


"""
constraint_energized_loads_strictly_increasing(pm::AbstractUnbalancedPowerModel, n_1::Int, n_2::Int)
Constraint to ensure that the number of energized load blocks from one timestep to another is strictly increasing
and that once energized, a load block cannot be shed in a later timestep.
"""
function constraint_energized_loads_strictly_increasing(pm::AbstractUnbalancedPowerModel, n_1::Int, n_2::Int)
for load_id in ids(pm, n_2, :load)
z_demand_n1 = var(pm, n_1, :z_demand, load_id)
z_demand_n2 = var(pm, n_2, :z_demand, load_id)

JuMP.@constraint(pm.model, z_demand_n2 >= z_demand_n1)
end
end
4 changes: 2 additions & 2 deletions src/prob/mld_traditional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function build_mn_traditional_mld(pm::PMD.AbstractUBFModels)
end

if ref(pm, n_1, :options, "constraints")["enable-strictly-increasing-restoration-constraint"]
constraint_energized_blocks_strictly_increasing(pm, n_1, n_2)
constraint_energized_loads_strictly_increasing(pm, n_1, n_2)
end

n_1 = n_2
Expand Down Expand Up @@ -258,7 +258,7 @@ function build_mn_traditional_mld(pm::PMD.AbstractUnbalancedPowerModel)
end

if ref(pm, n_1, :options, "constraints")["enable-strictly-increasing-restoration-constraint"]
constraint_energized_blocks_strictly_increasing(pm, n_1, n_2)
constraint_energized_loads_strictly_increasing(pm, n_1, n_2)
end

n_1 = n_2
Expand Down

0 comments on commit 798d3ac

Please sign in to comment.