Skip to content

Commit d352d0a

Browse files
authored
Merge pull request #29 from lanl-ansi/loss-lb-fix
fixing typos in loss lb constraints, closes #27
2 parents ef11351 + c26159a commit d352d0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/constraint.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function constraint_active_loss_lb{T}(pm::GenericPowerModel{T}, branch)
110110
t_idx = (i, t_bus, f_bus)
111111

112112
p_fr = getvariable(pm.model, :p)[f_idx]
113-
p_to = getvariable(pm.model, :p)[f_idx]
113+
p_to = getvariable(pm.model, :p)[t_idx]
114114

115115
c = @constraint(m, p_fr + p_to >= 0)
116116
return Set([c])
@@ -126,10 +126,10 @@ function constraint_reactive_loss_lb{T}(pm::GenericPowerModel{T}, branch)
126126
t_idx = (i, t_bus, f_bus)
127127

128128
v_fr = getvariable(pm.model, :v)[f_bus]
129-
v_to = getvariable(pm.model, :v)[f_bus]
129+
v_to = getvariable(pm.model, :v)[t_bus]
130130

131131
q_fr = getvariable(pm.model, :q)[f_idx]
132-
q_to = getvariable(pm.model, :q)[f_idx]
132+
q_to = getvariable(pm.model, :q)[t_idx]
133133

134134
c = @constraint(m, q_fr + q_to >= -branch["br_b"]/2*(v_fr^2/branch["tap"]^2 + v_to^2))
135135
return Set([c])

0 commit comments

Comments
 (0)