Commit 2043af59 authored by Andrea Angioni's avatar Andrea Angioni

minor updates

parent cc889944
......@@ -28,14 +28,15 @@ HW = H'*W;
G1 = HW*H;%gain matrix
G2 = G1;
P_post = inv(G2); %estimated state error covariance
ref1 = 11*GridData.DM.NGF+10*GridData.DM.NGS+2*GridData.DM.Nload;
if GridData.inj_status == 1
P_post(:,11*GridData.DM.NGF+10*GridData.DM.NGS+2*GridData.DM.Nload+1)=[];
P_post(11*GridData.DM.NGF+10*GridData.DM.NGS+2*GridData.DM.Nload+1,:)=[];
P_post(:,ref1+1)=[];
P_post(ref1+1,:)=[];
for x = 1 : 11*GridData.DM.NGF + 10*GridData.DM.NGS + 2*GridData.DM.Nload + 2*GridData.Lines_num
for x = 1 : ref1 + 2*GridData.Lines_num
P_post(:,x) = P_post(:,x) .* ([GridData.base_status; GridData.base_current*ones(2*GridData.Lines_num,1)] );
end
for x = 1 : 11*GridData.DM.NGF + 10*GridData.DM.NGS + 2*GridData.DM.Nload + 2*GridData.Lines_num
for x = 1 : ref1 + 2*GridData.Lines_num
P_post(x,:) = P_post(x,:) .* ([GridData.base_status; GridData.base_current*ones(2*GridData.Lines_num,1)] )';
end
end
......
......@@ -37,22 +37,23 @@ if strcmp(GridData.type_of_model,'single_phase') == 1
R = 0;
% we search for the available measurements in all the nodes and later in all the branches
if GridData.inj_status == 1 %in case we consider dynamic measuremetns
for x = 1 : 11*GridData.DM.NGF + 10*GridData.DM.NGS + 2*GridData.DM.Nload
if Combination_devices.xstatus_measure(1,x)==1
Rtemp = (Accuracy.Accuracy_pseudo*PowerData.x_status(x)).^2;
if Rtemp(1,1) < LM; Rtemp(1,1) = LM; end
R(n+1,n+1) = Rtemp;
W(n+1,n+1) = Rtemp^-1;
n = n +1;
LocationMeas(n,1) = x;
TypeMeas(n,1) = 100;
DelayMeas(n,1) = Combination_devices.xstatus_measure(2,x);
if isfield(Combination_devices,'xstatus_measure') == 1
if GridData.inj_status == 1 %in case we consider dynamic measuremetns
for x = 1 : 11*GridData.DM.NGF + 10*GridData.DM.NGS + 2*GridData.DM.Nload
if Combination_devices.xstatus_measure(1,x)==1
Rtemp = (Accuracy.Accuracy_pseudo*PowerData.x_status(x)).^2;
if Rtemp(1,1) < LM; Rtemp(1,1) = LM; end
R(n+1,n+1) = Rtemp;
W(n+1,n+1) = Rtemp^-1;
n = n +1;
LocationMeas(n,1) = x;
TypeMeas(n,1) = 100;
DelayMeas(n,1) = Combination_devices.xstatus_measure(2,x);
end
end
end
end
for x=1:GridData.Nodes_num
if Combination_devices.P_measure(1,x)==1 && Combination_devices.Q_measure(1,x)==1
rotPQ(1,1) = cos(PowerData.Vph(x))/(PowerData.Vmagn(x)^2);
......@@ -83,7 +84,6 @@ if strcmp(GridData.type_of_model,'single_phase') == 1
rotPQ(1,2) = sin(PowerData.Vph(x))/(PowerData.Vmagn(x));
rotPQ(2,1) = sin(PowerData.Vph(x))/(PowerData.Vmagn(x));
rotPQ(2,2) =-cos(PowerData.Vph(x))/(PowerData.Vmagn(x));
Rtemp = rotPQ*[(Accuracy.Accuracy_pseudo*PowerData.Pinj(x))^2, 0; 0 (Accuracy.Accuracy_pseudo*PowerData.Qinj(x))^2]*rotPQ';
if Rtemp(1,1) < LM; Rtemp(1,1) = LM; end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment