diff --git a/FormLw.m b/FormLw.m index ab128f2..4976df0 100644 --- a/FormLw.m +++ b/FormLw.m @@ -1,5 +1,5 @@ -function Lw=FormLw(Loadi,Mat_G,Init_U) +function Lw=FormLw(Loadi,Mat_G,Init_U,I1measurement) -upper=0.03*sparse(ones(length(Loadi)*1,1)); +upper=abs(I1measurement).^2.*1.1.*sparse(ones(length(Loadi)*1,1)); Lw=Mat_G+Init_U-upper; end \ No newline at end of file diff --git a/FormLz.m b/FormLz.m index 992d38f..a1b41da 100644 --- a/FormLz.m +++ b/FormLz.m @@ -1,5 +1,5 @@ -function Lz=FormLz(Loadi,Mat_G,Init_L) +function Lz=FormLz(Loadi,Mat_G,Init_L,I1measurement) -lower=0*sparse(ones(length(Loadi)*1,1)); +lower=abs(I1measurement).^2.*0.9.*sparse(ones(length(Loadi)*1,1)); Lz=Mat_G-Init_L-lower; end \ No newline at end of file diff --git a/IPMLoop.m b/IPMLoop.m index 9ca35ee..bbf1748 100644 --- a/IPMLoop.m +++ b/IPMLoop.m @@ -8,7 +8,12 @@ KK=0; plotGap=zeros(1,60); %初始化 %状态量为 SEPD SEQD SEVmf1 SEVaf1 -RestraintCount=length(Loadi)*1; +state=1; +if state==1 + RestraintCount=length(Loadi)*2; +else + RestraintCount=length(Loadi)*1; +end ContrlCount=busNum*2+length(Loadi)*2; CenterA=0.1; Init_Z=sparse(ones(RestraintCount,1)); @@ -28,7 +33,10 @@ while(abs(Gap)>0.000001) %% 形成等式约束的雅克比 deltH=func_deltH(busNum,fsY1,Loadi,Balance); %% 形成不等式约束的雅克比 - deltG=func_deltG(busNum,Loadi,I1r,I1i); + if state==1 + else + deltG=func_deltG(busNum,Loadi,I1r,I1i); + end %% L_1Z=diag(Init_Z./Init_L); U_1W=diag(Init_W./Init_U); @@ -49,8 +57,8 @@ while(abs(Gap)>0.000001) Mat_G=FormG(I1r,I1i); Mat_H=FormH(fsY1,Loadi,V1r,V1i,I1r,I1i,BalI1r,BalI1i,Balance); Ly=Mat_H; - Lz=FormLz(Loadi,Mat_G,Init_L); - Lw=FormLw(Loadi,Mat_G,Init_U); + Lz=FormLz(Loadi,Mat_G,Init_L,I1measurement); + Lw=FormLw(Loadi,Mat_G,Init_U,I1measurement); Lx=FormLx(deltF,deltH,Init_Y,deltG,Init_Z,Init_W); YY=FormYY(Lul,Lz,Ly,Luu,Lw,Lx); %% 开始解方程 diff --git a/func_deltGstate1.m b/func_deltGstate1.m new file mode 100644 index 0000000..2db7db9 --- /dev/null +++ b/func_deltGstate1.m @@ -0,0 +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); +]; +end \ No newline at end of file