From b3410ff03397e50bec2cc5bf01b0d59f3e91526d Mon Sep 17 00:00:00 2001 From: "dmy@lab" Date: Tue, 21 Apr 2015 16:03:11 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=94=A8=E8=BF=99=E4=B8=AA=E5=8F=82=E6=95=B0?= =?UTF-8?q?=202.=E7=94=B5=E5=8E=8B=E5=88=86=E5=B8=83=E7=9A=84=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=8D=95=E7=8B=AC=E6=8F=90=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dmy@lab --- Lineloss.m | 3 ++- MainOPF.m | 1 + OPF.m | 3 ++- OPF_Init.m | 8 ++++---- VoltDistribution.m | 6 ++++++ 5 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 VoltDistribution.m diff --git a/Lineloss.m b/Lineloss.m index f2c1428..ef7eae1 100644 --- a/Lineloss.m +++ b/Lineloss.m @@ -35,5 +35,6 @@ ss=Volt(Branchi)'.^2.*(Branchg) %% dispTransloss=[Transi Transj real(deltTransS)*100 imag(deltTransS)*100]; dispTransloss=sortrows(dispTransloss,-3); -full(dispTransloss); +dispLineloss=full(dispLineloss); +dispTransloss=full(dispTransloss); end \ No newline at end of file diff --git a/MainOPF.m b/MainOPF.m index 878a58a..50d5679 100644 --- a/MainOPF.m +++ b/MainOPF.m @@ -20,6 +20,7 @@ while 1 % totallossSum=totallossSum+totalloss; [totalloss,JSM]=OPF('E:/算例/新民Ⅰ906_2729823_2012-09-06/newFIle20.txt'); totallossSum=totallossSum+totalloss; +totallossSum*4 JSM_Sum=JSM_Sum+JSM; loopN=loopN+1; % totallossSum=totallossSum*4; diff --git a/OPF.m b/OPF.m index 1e163f8..7c6c1d8 100644 --- a/OPF.m +++ b/OPF.m @@ -166,7 +166,8 @@ setIneq=0; fprintf('总的损耗为%f(MW 有名值)\n',full(totalLoss)); fprintf('线损率为 %f\n',full(totalLoss/sum(PG))); %% 计算各线损 - %Lineloss(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Transfork0,Volt,UAngel); +% Lineloss(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Transfork0,Volt,UAngel); +% Lineloss(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,k0,Volt,Angle) thesis=thesis.AddPDQDPGQG(PD(Loadi),QD(Loadi),PG(Balance),QG(PVi)); end diff --git a/OPF_Init.m b/OPF_Init.m index bb4d4e1..f6c3afd 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=zeros(size(Loadi,1),1); -wPD(1:2:end)=0; -wQD=zeros(size(Loadi,1),1); -wQD(1:2:end)=0; +wPD=ones(size(Loadi,1),1); +% wPD(1:2:end)=0; +wQD=ones(size(Loadi,1),1); +% wQD(1:2:end)=0; %wD(randPDind)=0;%一些负荷不约束 %wD(7)=0; % wD(11)=0; diff --git a/VoltDistribution.m b/VoltDistribution.m new file mode 100644 index 0000000..4fcacff --- /dev/null +++ b/VoltDistribution.m @@ -0,0 +1,6 @@ +function [ output_args ] = VoltDistribution( CV4 ) +hist(CV4) +xlabel('电压/p.u'); +ylabel('数量/个'); +end +