Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed May 9, 2024
1 parent 73d174b commit a6b5224
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/form/acp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ function constraint_mc_power_balance_capc(pm::AbstractUnbalancedACPModel, nw::In
cap_state = 1.0
ncnds = length(terminals)
Gs = fill(0.0, ncnds, ncnds)
Bs = convert(Matrix{JuMP.NonlinearExpr}, JuMP.@expression(pm.model, [idx=1:ncnds, jdx=1:ncnds], 0.0))
Bs = Any[0.0 for idx in 1:ncnds, jdx in 1:ncnds]
for (val, connections) in bus_shunts
shunt = ref(pm,nw,:shunt,val)
for (idx,c) in enumerate(connections)
Expand Down
2 changes: 1 addition & 1 deletion src/form/acr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ function constraint_mc_power_balance_capc(pm::AbstractUnbalancedACRModel, nw::In
# calculate Gs, Bs
ncnds = length(terminals)
Gt = fill(0.0, ncnds, ncnds)
Bt = convert(Matrix{JuMP.Nonlinear}, JuMP.@expression(pm.model, [idx=1:ncnds, jdx=1:ncnds], 0.0))
Bt = Any[0.0 for idx in 1:ncnds, jdx in 1:ncnds]
for (val, connections) in bus_shunts
shunt = ref(pm,nw,:shunt,val)
for (idx,c) in enumerate(connections)
Expand Down
1 change: 1 addition & 0 deletions src/form/en_ivr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ function constraint_mc_generator_power_delta(pm::AbstractNLExplicitNeutralIVRMod
push!(qg, JuMP.@expression(pm.model, -vrg[idx]*cig[idx]+vig[idx]*crg[idx]))
end

# TODO(odow): refactor as pmin[i] <= pg[i] <= pmax[i]
JuMP.@constraint(pm.model, [i in 1:nph], pmin[i] <= pg[i])
JuMP.@constraint(pm.model, [i in 1:nph], pmax[i] >= pg[i])
JuMP.@constraint(pm.model, [i in 1:nph], qmin[i] <= qg[i])
Expand Down
3 changes: 2 additions & 1 deletion src/form/ivr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ function constraint_mc_current_balance_capc(pm::AbstractUnbalancedIVRModel, nw::
# calculate Gs, Bs
ncnds = length(terminals)
Gt = fill(0.0, ncnds, ncnds)
Bt = convert(Matrix{JuMP.NonlinearExpr}, JuMP.@expression(pm.model, [idx=1:ncnds, jdx=1:ncnds], 0.0))
Bt = Any[0.0 for idx in 1:ncnds, jdx in 1:ncnds]
for (val, connections) in bus_shunts
shunt = ref(pm,nw,:shunt,val)
for (idx,c) in enumerate(connections)
Expand Down Expand Up @@ -787,6 +787,7 @@ function constraint_mc_generator_power_delta(pm::IVRUPowerModel, nw::Int, id::In
end

if bounded
# TODO(odow): refactor as pmin[i] <= pg[i] <= pmax[i]
JuMP.@constraint(pm.model, [i in 1:nph], pmin[i] <= pg[i])
JuMP.@constraint(pm.model, [i in 1:nph], pmax[i] >= pg[i])
JuMP.@constraint(pm.model, [i in 1:nph], qmin[i] <= qg[i])
Expand Down

0 comments on commit a6b5224

Please sign in to comment.