Signed-off-by: dmy@lab <dmy@lab.lab>
This commit is contained in:
dmy@lab
2015-04-20 22:38:44 +08:00
commit 1506724914
93 changed files with 16359 additions and 0 deletions

14
@ForThesis/AddPDQDPGQG.m Normal file
View File

@@ -0,0 +1,14 @@
function this=AddPDQDPGQG( this, PD,QD,PG,QG)
%ADDPD Summary of this function goes here
% Detailed explanation goes here
if this.currentPos>this.sampleNum
error('');
return;
end
this.currentPos=this.currentPos+1;
this.PDArray(:,this.currentPos)=PD;
this.QDArray(:,this.currentPos)=QD;
this.PGArray(this.currentPos)=PG;
this.QGArray(this.currentPos)=QG;
end

30
@ForThesis/ForThesis.m Normal file
View File

@@ -0,0 +1,30 @@
classdef ForThesis
%UNTITLED Summary of this class goes here
% Detailed explanation goes here
properties
currentPos=0;
sampleNum=0;
LoadNum=0;
PDArray=0;
QDArray=0;
PGArray=0;
QGArray=0;
end
methods
function this=ForThesis(sampleNum,LoadNum)
this.currentPos=0;%100
this.sampleNum=sampleNum;
this.LoadNum=LoadNum;
this.PDArray=zeros(LoadNum,sampleNum);
this.QDArray=zeros(LoadNum,sampleNum);
this.PGArray=zeros(sampleNum,1);
this.QGArray=zeros(sampleNum,1);
end
end
end

View File

@@ -0,0 +1,41 @@
function [ output_args ] = MaxBranchDeviation( ~, Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt0,UAngel0,Volt,UAngel,FileName,PD0,QD0)
%%
% 线
%%
[Busnum,Balance,PQstandard,Precision,~,~,~,~,~,kmax,~ ,...
~,~,~,~,~,~,~,Pointpoweri,PG,QG,PD,QD,PVi,PVu,~,~,~,~,~,~,~]= openfile2(FileName);
PD=PD0;
QD=QD0;
%%
[~,Y,r,c,Angle] = admmatrix(Busnum,Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,...
Transforx,Transfork0,Branchi,Branchg,Branchb);
[P0,Q0,U,Uangle] = Initial(PG,PD,PQstandard,Pointpoweri,QG,QD,Busnum); %
%disp('i ');
%%
for i = 0:kmax
[Jacob,PQ,U,Uangle] = jacobian(Busnum,Balance,PVi,PVu,U,Uangle,Y,Angle,P0,Q0,r,c); %
% disp('');
m = max(abs(PQ));
m=full(m);
%fprintf(' %u %.8f \n',i,m);
if m > Precision %
[Uangle,U] = solvefun(Busnum,Jacob,PQ,Uangle,U); %
else
disp(['',num2str(i),'']);
break %
end
end
Volt0=U;
UAngel0=Uangle;
[dispLineloss0 dispTransloss0]=Lineloss(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt0,UAngel0);%
[dispLineloss dispTransloss]=Lineloss(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt,UAngel);%
t1=(dispLineloss0(:,3) - dispLineloss(:,3))./dispLineloss0(:,3);
t2=(dispTransloss0(:,3) - dispTransloss(:,3))./dispTransloss0(:,3);
t11=dispLineloss0(:,3)>1e-5;%
t22=dispTransloss0(:,3)>1e-5;%
t3=abs([t1(t11);t2(t22)]);
output_args=max(t3(t3~=Inf));
end

11
@ForThesis/MaxDeviation.m Normal file
View File

@@ -0,0 +1,11 @@
function [output_arg]=MaxDeviation(this,PG0,QG0,PD0,QD0)
PD0Array=repmat(PD0,1,this.sampleNum);
QD0Array=repmat(QD0,1,this.sampleNum);
PDMaxDev=max(abs( (this.PDArray-PD0Array)./PD0Array ),[],2);
QDMaxDev=max(abs( (this.QDArray-QD0Array)./QD0Array ),[],2);
PG0Array=repmat(PG0,this.sampleNum,1);
QG0Array=repmat(QG0,this.sampleNum,1);
PGMaxDev=max(abs( (PG0Array-this.PGArray)./PG0Array ));
QGMaxDev=max( abs( (QG0Array-this.QGArray)./QG0Array ) );
output_arg=max([PDMaxDev;QDMaxDev;PGMaxDev;QGMaxDev;]);
end

7
@ForThesis/MeanPD.m Normal file
View File

@@ -0,0 +1,7 @@
function [ output_args ] = MeanPD(this)
%MEANPD Summary of this function goes here
% Detailed explanation goes here
output_args=sum(this.PDArray,2)/this.sampleNum;
end

7
@ForThesis/MeanPG.m Normal file
View File

@@ -0,0 +1,7 @@
function [ output_args ] = MeanPG( this )
%MEANPG Summary of this function goes here
% Detailed explanation goes here
output_args=sum(this.PGArray,1)/this.sampleNum;
end

7
@ForThesis/MeanQD.m Normal file
View File

@@ -0,0 +1,7 @@
function [ output_args ] = MeanQD(this)
%MEANQD Summary of this function goes here
% Detailed explanation goes here
output_args=sum(this.QDArray,2)/this.sampleNum;
end

7
@ForThesis/MeanQG.m Normal file
View File

@@ -0,0 +1,7 @@
function [ output_args ] = MeanQG( this )
%MEAQG Summary of this function goes here
% Detailed explanation goes here
output_args=sum(this.QGArray,1)/this.sampleNum;
end

View File

@@ -0,0 +1,12 @@
function [ output_args ] = PercentOfPass( this, PG0,QG0,PD0,QD0 )
%%
PD=this.PDArray(:,end);%
QD=this.QDArray(:,end);%
t1=PD-PD0;
t2=QD-QD0;
t3=abs(t1)/3*0.05;
t4=abs(t2)/3*0.05;
output_args=sum(t3<=1)+sum(t4<=1);
end

View File

@@ -0,0 +1,13 @@
function [ output_args ] = SqareDeviation( this, PG0,QG0,PD0,QD0)
%% 0
PD=this.PDArray(:,end);%
QD=this.QDArray(:,end);%
t1=PD-PD0;
t2=t1./0.05;
t3=QD-QD0;
t4=t3./0.05;
output_args=sqrt(sum(t2.^2)+sum(t4.^2));
end

View File

@@ -0,0 +1,19 @@
function [ output_args ] = StatBranchDeviation( ~, Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt0,UAngel0,Volt,UAngel )
%STATBRANCHDEVIATION Summary of this function goes here
% Detailed explanation goes here
%% L2
% 线
%%
[dispLineloss0 dispTransloss0]=Lineloss(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt0,UAngel0);
[dispLineloss dispTransloss]=Lineloss(Linei,Linej,Liner,Linex,Lineb,Transfori,Transforj,Transforr,Transforx,Branchi,Branchg,Branchb,Transfork0,Volt,UAngel);
t1=(dispLineloss0(:,3) - dispLineloss(:,3))./dispLineloss0(:,3);
t2=(dispTransloss0(:,3) - dispTransloss(:,3))./dispTransloss0(:,3);
t11=dispLineloss0(:,3)>1e-5;%
t22=dispTransloss0(:,3)>1e-5;%
t3=[t1(t11);t2(t22)];
t4=t3.^2;
t5=sum(t4).^.5;
output_args=t5;
end

View File

@@ -0,0 +1,20 @@
function [ output_args ] = StatDeviation( this,PG0,QG0,PD0,QD0 )%ͳ¼ÆÎó²î
%STATDEVIATION Summary of this function goes here
% Detailed explanation goes here
PD0Array=repmat(PD0,1,this.sampleNum);
QD0Array=repmat(QD0,1,this.sampleNum);
PDDev=(this.PDArray-PD0Array)/0.05;
QDDev=(this.QDArray-QD0Array)/0.05;
% PG0Array=repmat(PG0,this.sampleNum,1);
% QG0Array=repmat(QG0,this.sampleNum,1);
% PGDev=(PG0Array-this.PGArray)/0.01;
% QGDev=(QG0Array-this.QGArray)/0.01;
wholeMat=[PDDev;QDDev;];
t1=wholeMat.^2;
t2=sum(t1,1);
t3=t2/size(t1,1);
t4=t3.^.5;
output_args=sum(t4)/length(t4);
end