修复了Lz=FormLz(Loadi,Mat_G,Init_L);和Lw=FormLw(Loadi,Mat_G,Init_U);中的bug。

Signed-off-by: dugg@lab-desk <dugg@lab-desk>
This commit is contained in:
dugg@lab-desk 2014-10-15 11:54:26 +08:00
parent 60434809c4
commit 89b368dedf
3 changed files with 14 additions and 9 deletions

View File

@ -1,4 +1,4 @@
function Lw=FormLw(Loadi)
function Lw=FormLw(Loadi,Mat_G,Init_U)
% VoltU=sparse(1.2*ones(Busnum,1));
% PDU=sparse(2*ones(length(Loadi),1));
% QDU=sparse(2*ones(length(Loadi),1));
@ -7,6 +7,6 @@ function Lw=FormLw(Loadi)
% VoltU];
% t2=Mat_G+Init_U-t1;
% Lw=t2;
Lw=0.1*sparse(ones(length(Loadi)*2,1));
upper=0.20*sparse(ones(length(Loadi)*2,1));
Lw=Mat_G+Init_U-upper;
end

View File

@ -1,4 +1,4 @@
function Lz=FormLz(Loadi)
function Lz=FormLz(Loadi,Mat_G,Init_L)
% VoltL=sparse(0.8*ones(Busnum,1));
% PDL=sparse(-2*ones(length(Loadi),1));
% QDL=sparse(-2*ones(length(Loadi),1));
@ -8,5 +8,7 @@ function Lz=FormLz(Loadi)
% ];
% t2=Mat_G-Init_L-t1;
% Lz=t2;
Lz=-0.1*sparse(ones(length(Loadi)*2,1));
lower=-0.20*sparse(ones(length(Loadi)*2,1));
Lz=Mat_G-Init_L-lower;
% Lz=-[]
end

11
run.m
View File

@ -233,10 +233,10 @@ BalI1r=real(-sum(mIf1));
BalI1i=imag(-sum(mIf1));
inv(fsY11)*(mIf1);
V1r=1*ones(busNum,1);
V1i=1*ones(busNum,1);
V1i=0*ones(busNum,1);
I1r=0.01*ones(length(Loadi),1);%
I1i=0.01*ones(length(Loadi),1);%
measurement=-mIf1(2);
measurement=-mIf1(Loadi);
clear PD QD PG QG;
%
% SEVoltpA=sparse(ones(busNum,1));
@ -277,20 +277,23 @@ while Gap>1e-5 && KK<20
Init_u=Gap/2/RestraintCount*CenterA;
deltH=func_deltH(busNum,fsY1,Loadi,Balance);
deltG=func_deltG(busNum,Loadi);
% deltG=0;
L_1Z=diag(Init_Z./Init_L);
U_1W=diag(Init_W./Init_U);
deltdeltF=func_deltdeltF(busNum,fsY1,Loadi);
% deltdeltF=0;
% ddh=func_ddh(SEVmf1,Init_Y,busNum,fsY1amp,SEVaf1,r,c,fsY1ang,Loadi,ContrlCount);
ddh=0;
ddg=func_ddg();
deltF=func_deltF(measurement,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);
Mat_H=FormH(fsY1,Loadi,V1r,V1i,I1r,I1i,BalI1r,BalI1i,Balance);
Ly=Mat_H;
Lz=FormLz(Loadi);
Lw=FormLw(Loadi);
Lz=FormLz(Loadi,Mat_G,Init_L);
Lw=FormLw(Loadi,Mat_G,Init_U);
Lx=FormLx(deltF,deltH,Init_Y,deltG,Init_Z,Init_W);
YY=FormYY(Lul,Lz,Ly,Luu,Lw,Lx);
%%