diff --git a/20PD0.mat b/20PD0.mat index abd9e7b..f8e0b19 100644 Binary files a/20PD0.mat and b/20PD0.mat differ diff --git a/20QD0.mat b/20QD0.mat index e294606..0296b5f 100644 Binary files a/20QD0.mat and b/20QD0.mat differ diff --git a/FormLz.asv b/FormLz.asv index d73c882..48a736e 100644 --- a/FormLz.asv +++ b/FormLz.asv @@ -1,13 +1,19 @@ -function Lz=FormLz(Mat_G,Init_L,GenL,Busnum,PVQL,PD0,Loadi,KK) -%KK=999; -PL=1*GenL(:,2);%发电机有功下界 -QL=PVQL(:,1);%发电机无功下界 -VoltL=(0.8-1/exp(KK))*ones(1,Busnum); +function Lz=FormLz(Mat_G,Init_L,GenL,Busnum,PVQL,PD,PD0,QD0,Loadi,KK,PF) +KK=999; + +VoltL=(0.9)*ones(1,Busnum); +%VoltL=-10*ones(1,Busnum); PDL=PD0(Loadi); -PDL(PDL>0)=0.8*PDL(PDL>0); -PDL(PDL<0)=1.2*PDL(PDL<0); -PDL(PDL==0)=-.2; -t1=([PL',QL',PDL',VoltL])'; +PDL(PDL>0)=0.700*PDL(PDL>0); +PDL(PDL<0)=1.300*PDL(PDL<0); +PDL(PDL==0)=-0.400; +%PDL=-10*ones(length(Loadi),1); +QDL=QD0(Loadi); +QDL(QDL>0)=0.700*QDL(QDL>0); +QDL(QDL<0)=1.300*QDL(QDL<0); +QDL(QDL==0)=-0.400; +% QDL=0*PD(Loadi).*sqrt((1-PF.^2))./PF; +t1=([PDL',QDL',VoltL])'; t2=Mat_G-Init_L'-t1; Lz=t2; diff --git a/JSMJZM.asv b/JSMJZM.asv new file mode 100644 index 0000000..86be91d --- /dev/null +++ b/JSMJZM.asv @@ -0,0 +1,12 @@ +JSM=[0.0575 0.051 0.0029]; +JZM=[0.003 0.02629 0.0582]; +plot(1:3,JSM,'k'); +axis([0 4 0 0.07]) +text(1,JSM(1)+0.001,'0.0575') +text(2,JSM(2)+0.001,'0.051') +text(3,JSM(3)+0.001,'0.0029') +hold on +plot(1:3,JZM,'k--'); +text(1,JZM(1)+0.001,'0.003') +text(2,JZM(2)+0.001,'0.02629') +text(3,JZM(3)+0.001,'0.0029') \ No newline at end of file diff --git a/JSMJZM.m b/JSMJZM.m new file mode 100644 index 0000000..936502b --- /dev/null +++ b/JSMJZM.m @@ -0,0 +1,18 @@ +JSM=[0.0575 0.051 0.0029]; +JZM=[0.0003 0.02629 0.0582]; +for I=0.01:0.01:0.06 + line([0.5 3.5],[I I],'Color',[220 220 220]/255) +end +hold on +plot(1:3,JSM,'k'); +ylabel('统计误差') +xlabel('情况') +axis([0.5 3.5 0 0.065]) +text(1,JSM(1)+0.001,'0.0575') +text(2,JSM(2)+0.001,'0.0510') +text(3,JSM(3)+0.001,'0.0029') +hold on +plot(1:3,JZM,'k--'); +text(1-.3,JZM(1)+0.001,'0.0003') +text(2,JZM(2)-0.001,'0.0263') +text(3,JZM(3)-0.001,'0.0029') diff --git a/JSNZN.asv b/JSNZN.asv new file mode 100644 index 0000000..ea4d42c --- /dev/null +++ b/JSNZN.asv @@ -0,0 +1,14 @@ +JSN=[0.1213 0.1092 0.0587]; +JZN=[0.0971 0.1314 0.1408]; +plot(1:3,JSM,'k'); +ylabel('值') +xlabel('情况') +axis([0.5 3.5 0 0.065]) +text(1,JSM(1)+0.001,'0.1213') +text(2,JSM(2)+0.001,'0.0510') +text(3,JSM(3)+0.001,'0.0029') +hold on +plot(1:3,JZM,'k--'); +text(1-.3,JZM(1)+0.001,'0.0003') +text(2,JZM(2)-0.001,'0.0263') +text(3,JZM(3)-0.001,'0.0029') \ No newline at end of file diff --git a/JSNZN.m b/JSNZN.m new file mode 100644 index 0000000..8d1451f --- /dev/null +++ b/JSNZN.m @@ -0,0 +1,18 @@ +JSN=[0.1213 0.1092 0.0587]*100; +JZN=[0.0971 0.1314 0.1408]*100; +for I=2:2:14 + line([0.5 3.5],[I I],'Color',[220 220 220]/255) +end +hold on +plot(1:3,JSN,'k'); +ylabel('最大相对偏差/%') +xlabel('情况') +axis([0.5 3.5 0 16]) +text(1,JSN(1)+0.3,'12.13') +text(2,JSN(2)+0.1,'10.92') +text(3,JSN(3)+0.6,'5.87') +hold on +plot(1:3,JZN,'k--'); +text(1,JZN(1)-0.5,'9.71') +text(2,JZN(2)-0.5,'13.14') +text(3,JZN(3)-0.5,'14.08') diff --git a/OPF.m b/OPF.m index 2daf42d..5a67bfc 100644 --- a/OPF.m +++ b/OPF.m @@ -7,7 +7,7 @@ clear thesis=ForThesis(1,45); for II=1:1 [kmax,Precision,UAngel,Volt,Busnum,PVi,PVu,Balance,Y,Angle,P0,Q0,r,c,GB,Linei,Linej,Transfori,Transforj,GenU,GenL,GenC,PG,QG,PD,QD,CenterA,PGi,PVQU,PVQL,Liner,Linex,Lineb,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0]= ... - pf('E:/算例/柳金Ⅰ926_21671693_2012-09-06/newFIle20.txt'); + pf('E:/算例/柳金Ⅰ926_21671693_2012-09-06/newFIle20 - 计算用2 - (最终用这个做20点的计算).txt'); % pf('E:\算例\柳金Ⅰ926_21671693_2012-09-06\newFIle16.txt'); %pf('D:\Project\青秀降损项目\最小化潮流\最小潮流算例\原始\津头站津视922(3-1)_0.5_120%.txt'); %pf('D:\Project\最小化潮流\最小潮流算例\仙海919.txt'); @@ -56,6 +56,8 @@ for II=1:1 %% 加误差 PD0(Loadi)=PD0(Loadi).*(1+normrnd(0,0.05,length(Loadi),1)); QD0(Loadi)=QD0(Loadi).*(1+normrnd(0,0.05,length(Loadi),1)); +% save('20PD0.mat','PD0'); +% save('20QD0.mat','QD0'); load('20PD0.mat'); load('20QD0.mat'); % PG0(PGi)=PG0(PGi).*(1+normrnd(0,0.01,length(PGi),1)); diff --git a/OPF_Init.asv b/OPF_Init.asv index 453a5f4..724c726 100644 --- a/OPF_Init.asv +++ b/OPF_Init.asv @@ -21,9 +21,9 @@ wQG=0; %randPDind=randInt(1:10); randPDind=0; wPD=1/.05^2*ones(size(Loadi,1),1); -wPD(1:2:end)=0; +% wPD(1:2:end)=0; wQD=1/.05^2*zeros(size(Loadi,1),1); -wQD(1:2:end)=0; +% wQD(1:2:end)=0; %wD(randPDind)=0;%一些负荷不约束 %wD(7)=0; % wD(11)=0; diff --git a/OPF_Init.m b/OPF_Init.m index 4ccea57..6ffb2e4 100644 --- a/OPF_Init.m +++ b/OPF_Init.m @@ -20,10 +20,10 @@ wQG=0; %randInt=randperm(size(Loadi,1)); %randPDind=randInt(1:10); randPDind=0; -wPD=1/.05^2*ones(size(Loadi,1),1); -% wPD(1:2:end)=0; -wQD=1/.05^2*ones(size(Loadi,1),1); -% wQD(1:2:end)=0; +wPD=1/.05^2*zeros(size(Loadi,1),1); +wPD(1:2:end)=0; +wQD=1/.05^2*zeros(size(Loadi,1),1); +wQD(1:2:end)=0; %wD(randPDind)=0;%一些负荷不约束 %wD(7)=0; % wD(11)=0; diff --git a/case1V.mat b/case1V.mat index 886f9f7..d303cf9 100644 Binary files a/case1V.mat and b/case1V.mat differ diff --git a/case2V.mat b/case2V.mat index 0f74179..e823a8e 100644 Binary files a/case2V.mat and b/case2V.mat differ diff --git a/case3V.mat b/case3V.mat index 3c80983..38606e3 100644 Binary files a/case3V.mat and b/case3V.mat differ diff --git a/caseM.mat b/caseM.mat index 5d96c58..1dbbd7f 100644 Binary files a/caseM.mat and b/caseM.mat differ diff --git a/caseR.mat b/caseR.mat index d20c4f2..67c6031 100644 Binary files a/caseR.mat and b/caseR.mat differ diff --git a/plotVolt.m b/plotVolt.m index d8503c3..895db0a 100644 --- a/plotVolt.m +++ b/plotVolt.m @@ -11,19 +11,29 @@ load('caseM.mat'); CVM=Volt; subplot(3,2,1) hist(CVR) -title('真实值') +xlabel('电压/p.u'); +ylabel('数量/个'); +title('真实值电压分布') subplot(3,2,2) hist(CVM) -title('测量值') +xlabel('电压/p.u'); +ylabel('数量/个'); +title('测量值电压分布') subplot(3,2,3) hist(CV1) -title('Case 1') +xlabel('电压/p.u'); +ylabel('数量/个'); +title('情形1电压分布') subplot(3,2,4) hist(CV2) -title('Case 2') +xlabel('电压/p.u'); +ylabel('数量/个'); +title('情形2电压分布') subplot(3,2,5) hist(CV3) -title('Case 3') +xlabel('电压/p.u'); +ylabel('数量/个'); +title('情形3电压分布') % figure()