24 lines
487 B
Matlab
24 lines
487 B
Matlab
function [ phaseABCY ] = Yf2p( fs0,fs1,fs2 )
|
|
[r,c]=find(fs1);
|
|
a=exp(1j*2*pi/3);
|
|
Tp2f=1/3*[1 1 1;
|
|
1 a a^2;
|
|
1 a^2 a];
|
|
Tf2p=inv(Tp2f);
|
|
%
|
|
% Tf2p=[1 1 1;
|
|
% 1 a^2 a;
|
|
% 1 a a^2];
|
|
busNum=size(fs0,1);
|
|
phaseABCY=sparse(3*busNum,3*busNum);
|
|
for I=1:length(r)
|
|
v0=fs0(r(I),c(I));
|
|
v1=fs1(r(I),c(I));
|
|
v2=fs2(r(I),c(I));
|
|
pabc=Tf2p*diag([v0,v1,v2])*Tp2f;
|
|
[pr,pc,pv]=find(pabc);
|
|
phaseABCY=phaseABCY+sparse(pr+3*(r(I)-1),pc+3*(c(I)-1),pv,3*busNum,3*busNum);
|
|
end
|
|
end
|
|
|