From 420ac03a9288ad1d8f8518f88e71909c2385b22e Mon Sep 17 00:00:00 2001 From: "dugg@lab-desk" Date: Sun, 19 Oct 2014 20:52:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=80=E7=A7=8D=E7=94=B5=E6=B5=81?= =?UTF-8?q?=E7=BA=A6=E6=9D=9F=E7=9A=84=E5=BD=A2=E5=BC=8F=EF=BC=8C=E8=BF=98?= =?UTF-8?q?=E6=B2=A1=E6=94=B9=E5=AE=8C=EF=BC=8C=E6=AD=A3=E5=9C=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=B8=AD=E2=80=A6=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dugg@lab-desk --- FormLw.m | 4 ++-- FormLz.m | 4 ++-- IPMLoop.m | 16 ++++++++++++---- func_deltGstate1.m | 7 +++++++ 4 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 func_deltGstate1.m 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