I’m running an OPF problem with SDPWRMForm and SOCWRConicForm formulations (AbstractWForms) and I’m trying to retrieve the duals from the power balance constraints (lam_kcl_r in the output). However, it seams that the reference to those constraints (kcl_p) is not stored as it is in the DCPlosslessForm (in the “con” dictionary).
Could the solution be to change the power balance constraint in “shared form” to:
function constraint_power_balance_shunt(pm::GenericPowerModel{T}, n::Int, c::Int, i, bus_arcs, bus_arcs_dc, bus_gens, bus_pd, bus_qd, bus_gs, bus_bs) where T <: AbstractWForms
w = var(pm, n, c, :w, i)
pg = var(pm, n, c, :pg)
qg = var(pm, n, c, :qg)
p = var(pm, n, c, :p)
q = var(pm, n, c, :q)
p_dc = var(pm, n, c, :p_dc)
q_dc = var(pm, n, c, :q_dc)
con(pm, n, c, :kcl_p)[i] = JuMP.@constraint(pm.model, sum(p[a] for a in bus_arcs) + sum(p_dc[a_dc] for a_dc in bus_arcs_dc) == sum(pg[g] for g in bus_gens) - sum(pd for pd in values(bus_pd)) - sum(gs for gs in values(bus_gs))*w)
con(pm, n, c, :kcl_q)[i] = JuMP.@constraint(pm.model, sum(q[a] for a in bus_arcs) + sum(q_dc[a_dc] for a_dc in bus_arcs_dc) == sum(qg[g] for g in bus_gens) - sum(qd for qd in values(bus_qd)) + sum(bs for bs in values(bus_bs))*w)
end