Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove constraint_power_magnitude_sqr_on_off(pm::_PM.AbstractQCWRModel ...) #74

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions src/form/wr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,29 +126,6 @@ function constraint_voltage_magnitude_bounds_soft(pm::_PM.AbstractWRModel, n::In
JuMP.@constraint(pm.model, w >= vm_min^2 - w_vio)
end

"`p[arc_from]^2 + q[arc_from]^2 <= w[f_bus]/tm*ccm[i]`"
function _PM.constraint_power_magnitude_sqr_on_off(pm::_PM.AbstractQCWRModel, n::Int, i, f_bus, arc_from, tm)
w = _PM.var(pm, n, :w, f_bus)
p_fr = _PM.var(pm, n, :p, arc_from)
q_fr = _PM.var(pm, n, :q, arc_from)
ccm = _PM.var(pm, n, :ccm, i)
z = _PM.var(pm, n, :z_branch, i)

# TODO see if there is a way to leverage relaxation_complex_product_on_off here
w_lb, w_ub = InfrastructureModels.variable_domain(w)
ccm_lb, ccm_ub = InfrastructureModels.variable_domain(ccm)
if isinteger(z)
z_lb = z_ub = z
else
z_lb, z_ub = InfrastructureModels.variable_domain(z)
end
Comment on lines -140 to -144
Copy link

Choose a reason for hiding this comment

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

Just noting here, while I remember, that this "if block" is the main difference between this and the PowerModels implementation. If this function is necessary for anything, we should (a) document the purpose of this change and (b) find a way to implement it without redefining the PowerModels method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This goes back 5 years, but if I remember right, the intent is that only damaged lines have a binary variable. Non-damaged lines have the non-switching power flow constraints, while damaged lines have the switching power flow constraints.


JuMP.@constraint(pm.model, p_fr^2 + q_fr^2 <= w*ccm*z_ub/tm^2)
JuMP.@constraint(pm.model, p_fr^2 + q_fr^2 <= w_ub*ccm*z/tm^2)
JuMP.@constraint(pm.model, p_fr^2 + q_fr^2 <= w*ccm_ub*z/tm^2)
end



""
function constraint_ohms_yt_from_damage(pm::_PM.AbstractWRModel, i::Int; nw::Int=nw_id_default)
Expand Down
Loading