改一种电流约束的形式,还没改完,正在进行中……

This commit is contained in:
dugg@lab-desk 2014-10-28 22:43:23 +08:00
parent 420ac03a92
commit d81d1fd26e
5 changed files with 48 additions and 8 deletions

16
FormGstate1.m Normal file
View File

@ -0,0 +1,16 @@
function Mat_G=FormGstate1(I1r,I1i)
%t1=PG(PVi);
%GP=t1;%P
%GP=[4.5 4.5]';
%%线
%Q
% t1=Volt'*Volt;
% t2=real(GB).*sin(AngleIJMat)-imag(GB).*cos(AngleIJMat);
% t3=t1.*t2;
% t4=sum(t3,2);%Q
%GQ=t4;
Mat_G=[
I1r;
I1i;
];
end

5
FormLwstate1.m Normal file
View File

@ -0,0 +1,5 @@
function Lw=FormLwstate1(Loadi,Mat_G,Init_U,I1measurement)
upper=0.2.*sparse(ones(length(Loadi)*2,1));
Lw=Mat_G+Init_U-upper;
end

5
FormLzstate1.m Normal file
View File

@ -0,0 +1,5 @@
function Lz=FormLzstate1(Loadi,Mat_G,Init_L,I1measurement)
lower=-0.2*sparse(ones(length(Loadi)*2,1));
Lz=Mat_G-Init_L-lower;
end

View File

@ -8,7 +8,7 @@ KK=0;
plotGap=zeros(1,60);
%
% SEPD SEQD SEVmf1 SEVaf1
state=1;
state=1;%state1±íʾÓÃl<=I1r<=u ÕâÑùµÄÔ¼ÊøÐÎʽ
if state==1
RestraintCount=length(Loadi)*2;
else
@ -34,6 +34,7 @@ while(abs(Gap)>0.000001)
deltH=func_deltH(busNum,fsY1,Loadi,Balance);
%%
if state==1
deltG=func_deltGstate1(busNum,Loadi,I1r,I1i);
else
deltG=func_deltG(busNum,Loadi,I1r,I1i);
end
@ -47,18 +48,31 @@ while(abs(Gap)>0.000001)
% ddh=func_ddh(busNum,Loadi,Init_Z,Init_W);
ddh=0;
%% ddg
ddg=func_ddg(busNum,Loadi,Init_Z,Init_W);
if state==1
ddg=0;
else
ddg=func_ddg(busNum,Loadi,Init_Z,Init_W);
end
%% deltF
deltF=func_deltF(V1measurement,wV1r,wV1i,I1measurement,wI1r,wI1i,busNum,fsY1,Loadi,V1r,V1i,I1r,I1i);
% deltF=0;
%%
Luu=Init_U.*Init_W+Init_u*ones(RestraintCount,1);
Lul=Init_L.*Init_Z-Init_u*ones(RestraintCount,1);
Mat_G=FormG(I1r,I1i);
if state==1
Mat_G=FormGstate1(I1r,I1i);
else
Mat_G=FormG(I1r,I1i);
end
Mat_H=FormH(fsY1,Loadi,V1r,V1i,I1r,I1i,BalI1r,BalI1i,Balance);
Ly=Mat_H;
Lz=FormLz(Loadi,Mat_G,Init_L,I1measurement);
Lw=FormLw(Loadi,Mat_G,Init_U,I1measurement);
if state==1
Lz=FormLzstate1(Loadi,Mat_G,Init_L,I1measurement);
Lw=FormLwstate1(Loadi,Mat_G,Init_U,I1measurement);
else
Lz=FormLz(Loadi,Mat_G,Init_L,I1measurement);
Lw=FormLw(Loadi,Mat_G,Init_U,I1measurement);
end
Lx=FormLx(deltF,deltH,Init_Y,deltG,Init_Z,Init_W);
YY=FormYY(Lul,Lz,Ly,Luu,Lw,Lx);
%%

View File

@ -1,7 +1,7 @@
function deltG=func_deltGstate1(busNum,Loadi,I1r,I1i)
deltG=[
zeros(busNum*2,length(Loadi)*1);
2*eye(length(Loadi)*1)*diag(I1r);
2*eye(length(Loadi)*1)*diag(I1i);
zeros(busNum*2,length(Loadi)*2);
1*eye(length(Loadi)*1),zeros(length(Loadi)*1);%I1r
zeros(length(Loadi)*1),1*eye(length(Loadi)*1);%I1i
];
end