diff --git a/200PD0.mat b/200PD0.mat new file mode 100644 index 0000000..abd9e7b Binary files /dev/null and b/200PD0.mat differ diff --git a/200QD0.mat b/200QD0.mat new file mode 100644 index 0000000..e294606 Binary files /dev/null and b/200QD0.mat differ diff --git a/NormalDistributionCurve.m b/NormalDistributionCurve.m new file mode 100644 index 0000000..1ba077f --- /dev/null +++ b/NormalDistributionCurve.m @@ -0,0 +1,14 @@ +%% +% 画正态分布曲线 +%% + +x=-4:0.1:4; +y=gaussmf(x,[1 0]); +plot(x,y) +hold on +% line([0 0],[ 0 1]) +% set(gca,'xtick',[],'xticklabel',[]) +% set(gca,'ytick',[],'yticklabel',[]) +axis([-4 4 0 1.2]) +axis normal +xlabel('gaussmf, P=[2 5]') \ No newline at end of file diff --git a/OPF.m b/OPF.m index f41efec..b59f5ce 100644 --- a/OPF.m +++ b/OPF.m @@ -53,10 +53,10 @@ for II=1:1 %% Precision=Precision/1; %% 加误差 - PD0(Loadi)=PD0(Loadi).*(1+normrnd(0,0.5,length(Loadi),1)); - QD0(Loadi)=QD0(Loadi).*(1+normrnd(0,0.5,length(Loadi),1)); - load('0PD0.mat'); - load('0QD0.mat'); + PD0(Loadi)=PD0(Loadi).*(1+normrnd(0,0.05,length(Loadi),1)); + QD0(Loadi)=QD0(Loadi).*(1+normrnd(0,0.05,length(Loadi),1)); + load('200PD0.mat'); + load('200QD0.mat'); % PG0(PGi)=PG0(PGi).*(1+normrnd(0,0.01,length(PGi),1)); % QG0(PVi)=QG0(PVi).*(1+normrnd(0,0.01,length(PVi),1)); %% 读变压器容量 @@ -132,12 +132,14 @@ PD(Loadi)=thesis.MeanPD(); QD(Loadi)=thesis.MeanQD(); PG(Balance)=thesis.MeanPG(); QG(PVi)=thesis.MeanQG(); +thesis.MaxDeviation(RealPG(Balance),RealQG(PVi),RealPD(Loadi),RealQD(Loadi)) +thesis.StatDeviation(RealPG(Balance),RealQG(PVi),RealPD(Loadi),RealQD(Loadi)) thesis.MaxDeviation(PG0(Balance),QG0(PVi),PD0(Loadi),QD0(Loadi)) thesis.StatDeviation(PG0(Balance),QG0(PVi),PD0(Loadi),QD0(Loadi)) % thesis.SqareDeviation(RealPG(Balance(1)),RealQG(PVi(1)),RealPD(Loadi),RealQD(Loadi)) thesis.SqareDeviation(PG0(Balance(1)),QG0(PVi(1)),PD0(Loadi),QD0(Loadi)) thesis.PercentOfPass(PG0(Balance(1)),QG0(PVi(1)),PD0(Loadi),QD0(Loadi)) -thesis.MaxBranchDeviation(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt0,UAngel0,Volt,UAngel,'E:\算例\柳金Ⅰ926_21671693_2012-09-06\newFIle0.txt',PD0,QD0) +thesis.MaxBranchDeviation(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt0,UAngel0,Volt,UAngel,'E:\算例\柳金Ⅰ926_21671693_2012-09-06\newFIle20.txt',PD0,QD0) thesis.StatBranchDeviation(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt0,UAngel0,Volt,UAngel) toc diff --git a/OPF_Init.asv b/OPF_Init.asv index c0cfc2d..d4c67dd 100644 --- a/OPF_Init.asv +++ b/OPF_Init.asv @@ -20,9 +20,9 @@ wQG=0; %randInt=randperm(size(Loadi,1)); %randPDind=randInt(1:10); randPDind=0; -wPD=1/.5^2*zeros(size(Loadi,1),1); +wPD=1/.05^2*zeros(size(Loadi,1),1); wPD(1:2:end)=0; -wQD=1/.5^2*ones(size(Loadi,1),1); +wQD=1/.05^2*ones(size(Loadi,1),1); wQD(1:2:end)=0; %wD(randPDind)=0;%一些负荷不约束 %wD(7)=0; diff --git a/OPF_Init.m b/OPF_Init.m index 6dfd73d..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/.5^2*ones(size(Loadi,1),1); -% wPD(1:2:end)=0; -wQD=1/.5^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;