Hi,
I was looking at the makePTDF function and was a bit confused with the
option for having distributed slack. Instead of feeding the distributed
slack weights to makePTDF(mpc,slack) you can just add the slack to the
delta power injections. For example the following options give exactly the
same result (4-buses):
dP = [1 0 0 0 ], with slack = [0 1/2 1/2 0 ]
dP = [1 -1/2 -1/2 0 ], default slack
Is always the case? In that case it seems you can just forget about using
the slack argument.
Regards,
Elis Nycander
Example code:
% PTDF_test
mpc = case24_ieee_rts;
nb = size(mpc.bus,1);
%% using distributed slack
w = zeros(nb,1);
w([13 14 22]) = 1/3; % slack at bus 13,14,22
H2 = makePTDF(mpc,w); % distributed slack
dP2 = diag( ones(nb,1) ); % unit injection at each bus
dL2 = H2*dP2;
%% using default slack with modified injections
H1 = makePTDF(mpc); % default slack configuration
dP1 = dP2;
for i=1:size(dP1,2)
dP1(:,i) = dP1(:,i) - w; % add compensation from slack
end
dL1 = H1*dP1;
diff = max(max(abs(dL1 - dL2))) % <- answers are the same