MATPOWER/matpower

HVDC lines

yanda1234 opened this issue · 5 comments

Hi Dr. Zimmerman,

I am interested in knowing whether it is permissible to exclusively utilize a DC line to sustain load or generation in an isolated bus. I conducted a test using the provided code and observed that the load is no longer present on that bus. The fundamental logic involves substituting AC line 110-112 with a DC line of sufficient capacity. Bus 112 carries a load of 68 MW. My objective is to observe the DC line transferring the 68 MW load from bus 110 to bus 112. The code is attached below. Kindly advise!

%%%% code

initial_case=loadcase('case118.m');

tf_select_branch112_1=ismember(initial_case.branch(:,1),112);
tf_select_branch112_2=ismember(initial_case.branch(:,2),112);
initial_case.branch(logical(tf_select_branch112_1+tf_select_branch112_2),:)=[];

initial_case=rmfield(initial_case,'bus_name');
% fbus tbus status Pf Pt Qf Qt Vf Vt Pmin Pmax QminF QmaxF QminT QmaxT loss0 loss1
initial_case.dcline = [
30 4 1 10 8.9 0 0 1.01 1 10 10 -10 10 -10 10 1 0.01;
110 112 1 10 9.5 0 0 1 0.98 0 100 -10 10 -10 10 0 0.05;
];

%% DC line cost data
% 1 startup shutdown n x1 y1 ... xn yn
% 2 startup shutdown n c(n-1) ... c0
initial_case.dclinecost = [
2 0 0 2 0 0 0 0 0 0 0 0 0 0;
2 0 0 2 7.3 0 0 0 0 0 0 0 0 0;
];
initial_case2 = toggle_dcline(initial_case, 'on');
results_dc = rundcopf(initial_case2);

Best,
Yanda

The DC line tests in t_dcline include one with an isolated generator bus connected only by a DC line ...

matpower/lib/t/t_dcline.m

Lines 279 to 311 in 2028dec

t = 'AC OPF (isolated gen bus w/DC connection) : ';
mpc = loadcase(casefile2);
% use case9 with bus 2 connected by DC line instead of AC line
% requires making bus 2 a REF bus as well
%%----- DC Line Data -----
% fbus tbus status Pf Pt Qf Qt Vf Vt Pmin Pmax QminF QmaxF QminT QmaxT loss0 loss1
mpc.dcline = [
8 2 1 -163 163 0 0 1.025 1.025 -200 200 0 0 0 0 0 0;
];
mpc.branch(7, BR_STATUS) = 0;
mpc.bus(2, BUS_TYPE) = REF;
mpc = toggle_dcline(mpc, 'on');
[r, success] = runopf(mpc, mpopt);
t_ok(success, [t 'success']);
t_is(r.dcline(:, c.PF:c.VT), [-134.3323 -134.3323 0 0 1.1 1], 4, [t 'P Q V']);
t_is(r.dcline(:, c.MU_PMIN:c.MU_QMAXT), [0 0 0.1311 0 0 0], 4, [t 'mu']);
t = 'AC PF (isolated gen bus w/DC connection) : ';
[r, success] = runpf(mpc, mpopt);
t_ok(success, [t 'success']);
t_is(r.dcline(:, c.PF:c.VT), [-163 -163 -9.6926 0 1.025 1.025], 4, [t 'P Q V']);
t = 'DC OPF (isolated gen bus w/DC connection) : ';
[r, success] = rundcopf(mpc, mpopt);
t_ok(success, [t 'success']);
t_is(r.dcline(:, c.PF:c.VT), [-134.3776 -134.3776 0 0 1.025 1.025], 4, [t 'P Q V']);
t_is(r.dcline(:, c.MU_PMIN:c.MU_QMAXT), [0 0 0 0 0 0], 3, [t 'mu']);
t = 'DC PF (isolated gen bus w/DC connection) : ';
[r, success] = rundcpf(mpc, mpopt);
t_ok(success, [t 'success']);
t_is(r.dcline(:, c.PF:c.VT), [-163 -163 0 0 1.025 1.025], 4, [t 'P Q V']);

I suspect it should work with a load bus as well, but haven't attempted your case yet.

Hi Dr. Zimmerman,

Thank you for your reply. Upon revisiting the results of my case, I observed that when bus 112 is connected with a DC line, it appears as though an additional generator has been added to it, and the dispatched power matches its load. Can you provide insights into the potential reasons behind this occurrence?
image

From the screenshot below, we can see there is no gen on bus 112.

image

Best,
Yanda

There is already a generator at bus 112 in the original model. It just isn't dispatched in the original, because power from the rest of the grid is cheaper. When you put the DC line there and disconnect the AC line, the cost of the local generation is cheaper than importing via the DC line, so the local generator is dispatched, not the DC line. If you turn that generator off, the DC line provides the expected 68 MW.

define_constants
mpc = loadcase('case118.m');
il = find(mpc.branch(:, F_BUS) == 112 | mpc.branch(:, T_BUS) == 112);
mpc.branch(il, BR_STATUS) = 0;
ig = find(mpc.gen(:, GEN_BUS) ==  112);
mpc.gen(ig, GEN_STATUS) = 0;
mpc.bus(112, BUS_TYPE) = REF;

% fbus tbus status Pf Pt Qf Qt Vf Vt Pmin Pmax QminF QmaxF QminT QmaxT loss0 loss1
mpc.dcline = [
30 4 1 10 8.9 0 0 1.01 1 10 10 -10 10 -10 10 1 0.01;
110 112 1 10 9.5 0 0 1 0.98 0 100 -10 10 -10 10 0 0.05;
];

%% DC line cost data
% 1 startup shutdown n x1 y1 ... xn yn
% 2 startup shutdown n c(n-1) ... c0
mpc.dclinecost = [
2 0 0 2 0 0;
2 0 0 2 7.3 0;
];

mpc = toggle_dcline(mpc, 'on');
results_dc = rundcopf(mpc);

FWIW, decreasing the cost on the DC line to zero and leaving the generator on results in some of the load being served by the local generator and some by the DC line.

Thanks, Dr. Zimmerman! Sorry for this silly mistake.

No worries.