Open pplagowski opened 4 years ago
Hi,
I came across the same problem raised by you in item 4.
The problem is that pandapower transforms each dcline in 2 decoupled generators to run the PowerModels optimization. This issue leads to inconsistencies.
For example, as res_dcline.pl_mw is the sum of res_dcline.p_from_mw and res_dcline.p_to_mw for each dcline, pl_mw actually shows the value of activate power "generated" (if it's negative) or "consumed" (if it's positive) by the dcline.
Where the problem lays: in the function pandapower.auxiliary._add_dcline_gens:
def _add_dcline_gens(net):
from pandapower.create import create_gen
for dctab in net.dcline.itertuples():
pfrom = dctab.p_mw
pto = (pfrom * (1 - dctab.loss_percent / 100) - dctab.loss_mw)
pmax = dctab.max_p_mw
create_gen(net, bus=dctab.to_bus, p_mw=pto, vm_pu=dctab.vm_to_pu,
min_p_mw=0, max_p_mw=pmax,
max_q_mvar=dctab.max_q_to_mvar, min_q_mvar=dctab.min_q_to_mvar,
in_service=dctab.in_service)
create_gen(net, bus=dctab.from_bus, p_mw=-pfrom, vm_pu=dctab.vm_from_pu,
min_p_mw=-pmax, max_p_mw=0,
max_q_mvar=dctab.max_q_from_mvar, min_q_mvar=dctab.min_q_from_mvar,
in_service=dctab.in_service)
Quick solution: tying the active power limits of the generators to their nominal values. This makes the dclines not "controllable" by the PowerModels, but it's easy to implement and consistent.
def _add_dcline_gens(net):
from pandapower.create import create_gen
for dctab in net.dcline.itertuples():
pfrom = dctab.p_mw
pto = (pfrom * (1 - dctab.loss_percent / 100) - dctab.loss_mw)
pmax = dctab.max_p_mw
create_gen(net, bus=dctab.to_bus, p_mw=pto, vm_pu=dctab.vm_to_pu,
min_p_mw=pto, max_p_mw=pto, max_q_mvar=dctab.max_q_to_mvar,
min_q_mvar=dctab.min_q_to_mvar, in_service=dctab.in_service)
create_gen(net, bus=dctab.from_bus, p_mw=-pfrom, vm_pu=dctab.vm_from_pu,
min_p_mw=-pfrom, max_p_mw=-pfrom,
max_q_mvar=dctab.max_q_from_mvar,
min_q_mvar=dctab.min_q_from_mvar,
in_service=dctab.in_service)
A better fix would be: modeling the HVDCs as dclines inside PowerModels.
Hi @gdgarcia ! Indeed, we only have a simplified model for the DC lines that doesn't convert to "real controllable" DC lines in powermodels. We would appreciate an update of our powermodels interface to be able to cope with this 😄
Hi folks, I'm trying to get dclines running in an OPF with pypower as solver (powermodels has still the interface and cost curve limitations). A network is created in the file attached, where line 5 can be an AC or DC line. It does converge with an AC line, but it doesn't with a DC line. Pips however starts iterating as can be seen in PyPower (ppci) System Summary attached. What am I doing wrong in this small DC line example? I would very much appreciate if anyone can help with a hint or provides a working example of OPF with pypower and a DC line.
Hi, thanks for your continuous effort in maintaing pandapower! I'm trying to run OPF simulations of a network with/without HVDC powerlines and compare the results.