Constraints
All the OPF constraints for the AC grids have been re-used from PowerModels.jl, and are therefore not repeated here.
DC Bus Constraints
Setpoint Constraints
PowerModelsACDC.constraint_dc_voltage_magnitude_setpoint
— Functionvdc[i] == vdcm
vdc[i] == vdcm
vdc[i] == vdcm
wdc[i] == vdcm^2
KCL Constraints existing dc buses
PowerModelsACDC.constraint_power_balance_dc
— Functionsum(p_dcgrid[a] for a in bus_arcs_dcgrid) + sum(pconv_dc[c] for c in bus_convs_dc) == pd
AC Bus Constraints
KCL Constraints existing ac buses
PowerModelsACDC.constraint_power_balance_ac
— Functionsum(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(pconvac[c] for c in bus_convs) - pd - gs*v^2
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(qconvac[c] for c in bus_convs) - qd + bs*v^2
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(pconvac[c] for c in bus_convs) - pd - gs*1^2
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(qconvac[c] for c in bus_convs) - qd + bs*1^2
Shunt constraint using linearized voltage magnitude difference phi
sum(p) + sum(pconv_grid_ac) == sum(pg) - sum(pd) - sum(gs*(1.0 + 2*phi)
sum(p[a] for a in bus_arcs) + sum(pconv_grid_ac[c] for c in bus_convs_ac) == sum(pg[g] for g in bus_gens) - pd - gs*w
sum(q[a] for a in bus_arcs) + sum(qconv_grid_ac[c] for c in bus_convs_ac) == sum(qg[g] for g in bus_gens) - qd + bs*w
DC Branch Constraints
Ohm's Law Constraints
PowerModelsACDC.constraint_ohms_dc_branch
— FunctionCreates Ohms constraints for DC branches
p[f_idx] == p * g[l] * vmdc[f_bus] * (vmdc[f_bus] - vmdc[t_bus])
Creates Ohms constraints for DC branches
p[f_idx] + p[t_idx] == 0)
Creates Ohms constraints for DC branches
p[f_idx] + p[t_idx] == p * g[l] * (wdc[f_bus] - wdcr[f_bus,t_bus])
DC branch power flow using linearized voltage magnitude difference phi
p_dc_fr == p * g * (phi_fr - phi_to)
p_dc_to == p * g * (phi_to - phi_fr)
Creates Ohms constraints for DC branches
p[f_idx] + p[t_idx] == p * g[l] * (wdc[f_bus] - wdcr[f_bus,t_bus])
ACDC Converter Constraints
Ohm's Law Constraints
PowerModelsACDC.constraint_converter_losses
— FunctionCreates lossy converter model between AC and DC grid
pconv_ac[i] + pconv_dc[i] == a + bI + cI^2
Creates lossy converter model between AC and DC grid using a lifted converter current magnitude variable
pconv_ac[i] + pconv_dc[i] == a + b * iconv[i] + c * iconv_sq[i]
Links the converter current magnitude variable with the squared converter current magnitude variable
iconv_sq[i] == iconv[i]^2
Creates lossy converter model between AC and DC grid, assuming U_i is approximatley 1 numerically
pconv_ac[i] + pconv_dc[i] == a + b*pconv_ac
Creates lossy converter model between AC and DC side
pconv_ac[i] + pconv_dc[i] == a + b*I + c*Isq
Current
PowerModelsACDC.constraint_converter_current
— FunctionLinks converter power & current
pconv_ac[i]^2 + pconv_dc[i]^2 == vmc[i]^2 * iconv_ac[i]^2
Links converter power & current
pconv_ac[i]^2 + pconv_dc[i]^2 == (vrc[i]^2 + vic[i]^2) * iconv_sq[i]
Converter current constraint (not applicable)
Links converter power & current
pconv_ac[i]^2 + pconv_dc[i]^2 <= wc[i] * iconv_ac_sq[i]
pconv_ac[i]^2 + pconv_dc[i]^2 <= (Umax)^2 * (iconv_ac[i])^2
Links converter power & current
pconv_ac[i]^2 + pconv_dc[i]^2 <= wc[i] * iconv_ac_sq[i]
pconv_ac[i]^2 + pconv_dc[i]^2 <= (Umax)^2 * (iconv_ac[i])^2
Links converter power & current
pconv_ac[i]^2 + pconv_dc[i]^2 <= wc[i] * iconv_ac_sq[i]
pconv_ac[i]^2 + pconv_dc[i]^2 <= (Umax)^2 * (iconv_ac[i])^2
Setpoint Constraints (PF only)
PowerModelsACDC.constraint_active_conv_setpoint
— Functionpconv[i] == pconv
Converter auxiliary constraints
PowerModelsACDC.constraint_conv_transformer
— FunctionConverter transformer constraints
p_tf_fr == g/(tm^2)*vm_fr^2 + -g/(tm)*vm_fr*vm_to * cos(va_fr-va_to) + -b/(tm)*vm_fr*vm_to*sin(va_fr-va_to)
q_tf_fr == -b/(tm^2)*vm_fr^2 + b/(tm)*vm_fr*vm_to * cos(va_fr-va_to) + -g/(tm)*vm_fr*vm_to*sin(va_fr-va_to)
p_tf_to == g*vm_to^2 + -g/(tm)*vm_to*vm_fr * cos(va_to - va_fr) + -b/(tm)*vm_to*vm_fr *sin(va_to - va_fr)
q_tf_to == -b*vm_to^2 + b/(tm)*vm_to*vm_fr * cos(va_to - va_fr) + -g/(tm)*vm_to*vm_fr *sin(va_to - va_fr)
Converter transformer constraints
p_tf_fr == g/(tm^2)*(vr_fr^2+vi_fr^2) + -g/(tm)*(vr_fr*vr_to + vi_fr*vi_to) + -b/(tm)*(vi_fr*vr_to-vr_fr*vi*to)
q_tf_fr == -b/(tm^2)*(vr_fr^2+vi_fr^2) + b/(tm)*(vr_fr*vr_to + vi_fr*vi_to) + -g/(tm)*(vi_fr*vr_to-vr_fr*vi*to)
p_tf_to == g*(vr_to^2+vi_to^2) + -g/(tm)*(vr_fr*vr_to + vi_fr*vi_to) + -b/(tm)*(-(vi_fr*vr_to-vr_fr*vi*to))
q_tf_to == -b*(vr_to^2+vi_to^2) + b/(tm)*(vr_fr*vr_to + vi_fr*vi_to) + -g/(tm)*(-(vi_fr*vr_to-vr_fr*vi*to))
Converter transformer constraints
p_tf_fr == -btf*(v^2)/tm*(va-vaf)
p_tf_to == -btf*(v^2)/tm*(vaf-va)
Converter transformer constraints
p_tf_fr + ptf_to == rtf*itf
q_tf_fr + qtf_to == xtf*itf
p_tf_fr^2 + qtf_fr^2 <= w/tm^2 * itf
wf == w/tm^2 -2*(rtf*ptf_fr + xtf*qtf_fr) + (rtf^2 + xtf^2)*itf
Converter transformer constraints
p_tf_fr == g/(tm^2)*w_fr + -g/(tm)*wr + -b/(tm)*wi)
q_tf_fr == -b/(tm^2)*w_fr + b/(tm)*wr + -g/(tm)*wi)
p_tf_to == g*w_to + -g/(tm)*wr + -b/(tm)*(-wi))
q_tf_to == -b*w_to + b/(tm)*wr + -g/(tm)*(-wi))
PowerModelsACDC.constraint_conv_reactor
— FunctionConverter reactor constraints
-pconv_ac == gc*vmc^2 + -gc*vmc*vmf*cos(vac-vaf) + -bc*vmc*vmf*sin(vac-vaf)
-qconv_ac ==-bc*vmc^2 + bc*vmc*vmf*cos(vac-vaf) + -gc*vmc*vmf*sin(vac-vaf)
p_pr_fr == gc *vmf^2 + -gc *vmf*vmc*cos(vaf - vac) + -bc *vmf*vmc*sin(vaf - vac)
q_pr_fr == -bc *vmf^2 + bc *vmf*vmc*cos(vaf - vac) + -gc *vmf*vmc*sin(vaf - vac)
Converter reactor constraints
-pconv_ac == gc*(vrc^2 + vic^2) + -gc*(vrc * vrf + vic * vif) + -bc*(vic * vrf - vrc * vif)
-qconv_ac ==-bc*(vrc^2 + vic^2) + bc*(vrc * vrf + vic * vif) + -gc*(vic * vrf - vrc * vif)
p_pr_fr == gc *(vrf^2 + vif^2) + -gc *(vrc * vrf + vic * vif) + -bc *(-(vic * vrf - vrc * vif))
q_pr_fr == -bc *(vrf^2 + vif^2) + bc *(vrc * vrf + vic * vif) + -gc *(-(vic * vrf - vrc * vif))
Converter reactor constraints
p_pr_fr == -bc*(v^2)*(vaf-vac)
pconv_ac == -bc*(v^2)*(vac-vaf)
Converter reactor constraints
p_pr_fr + ppr_to == rc*ipr
q_pr_fr + qpr_to == xc*ipr
p_pr_fr^2 + qpr_fr^2 <= wf * ipr
wc == wf -2*(rc*ppr_fr + xc*qpr_fr) + (rc^2 + xc^2)*ipr
Converter reactor constraints
p_pr_fr == g/(tm^2)*w_fr + -g/(tm)*wr + -b/(tm)*wi)
q_pr_fr == -b/(tm^2)*w_fr + b/(tm)*wr + -g/(tm)*wi)
p_pr_to == g*w_to + -g/(tm)*wr + -b/(tm)*(-wi))
q_pr_to == -b*w_to + b/(tm)*wr + -g/(tm)*(-wi))
PowerModelsACDC.constraint_conv_filter
— FunctionConverter filter constraints
ppr_fr + ptf_to == 0
qpr_fr + qtf_to + (-bv) * filter *vmf^2 == 0
Converter filter constraints
ppr_fr + ptf_to == 0
qpr_fr + qtf_to + (-bv) * filter *(vrf^2 + vif^2) == 0
Converter filter constraints (no active power losses)
p_pr_fr + p_tf_to == 0
Converter filter constraints
p_pr_fr + p_tf_to == 0
q_pr_fr + q_tf_to + -bv*filter*wf == 0
Converter firing angle for LCC
PowerModelsACDC.constraint_conv_firing_angle
— FunctionLCC firing angle constraints
pconv_ac == cos(phi) * Srated
qconv_ac == sin(phi) * Srated
LCC firing angle constraints
pconv_ac == cos(phi) * Srated
qconv_ac == sin(phi) * Srated
Converter firing angle constraint (not applicable)
LCC firing angle constraints
qconv_ac >= Q1 + (pconv_ac-P1) * (Q2-Q1)/(P2-P1)
P1 = cos(0) * Srated
Q1 = sin(0) * Srated
P2 = cos(pi) * Srated
Q2 = sin(pi) * Srated