parent
c8406a43c0
commit
fd65438b98
|
|
@ -1,7 +1,7 @@
|
|||
function [ output_args ] = Geteb( this )
|
||||
function [ output_args ] = Getcl( this )
|
||||
%BE Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
output_args=this.eb;
|
||||
output_args=this.cl;
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
function [ output_args ] = Getgle( this )
|
||||
function [ output_args ] = Getcu( this )
|
||||
%GLE Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
output_args=this.gle;
|
||||
output_args=this.cu;
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -17,8 +17,8 @@ classdef Opti
|
|||
c=NaN;
|
||||
PG=NaN;
|
||||
QG=NaN;
|
||||
gle=NaN;%opti toolbox大于小于等于
|
||||
eb=NaN;%等式、不等式约束右边的值
|
||||
cl=NaN;%opti toolbox大于小于等于
|
||||
cu=NaN;%等式、不等式约束右边的值
|
||||
Balance=NaN;
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,11 @@ VMatrix=sparse(r,c,VAngel(r)-VAngel(c)-Angel,busNum,busNum);
|
|||
dP=PG-PD_-diag(Volt)*(Y.*cos(VMatrix))*Volt;
|
||||
dQ=QG-QD_-diag(Volt)*(Y.*spfun(@sin,VMatrix))*Volt;
|
||||
output_args=[dP;dQ;VAngel(Balance)];
|
||||
%% 开始增加不等式约束-电压\PD\QD
|
||||
%电压不等式约束
|
||||
|
||||
output_args=full(output_args);
|
||||
this.gle=zeros(length(output_args),1);
|
||||
this.eb=this.gle;
|
||||
this.cu=zeros(length(output_args),1);
|
||||
this.cl=this.cu;
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -79,9 +79,9 @@ opts.display='iter';
|
|||
% zeros(length(Volt),1)];
|
||||
x0=[PD(PDi);QD(QDi);xVolt';xUAngel'];
|
||||
[~,seOpti]=seOpti.equ(x0);
|
||||
nlrhs=seOpti.Geteb();
|
||||
nle=seOpti.Getgle();
|
||||
Opt = opti('fun',@seOpti.obj,'ndec',length(Volt)*2+length(PDi)+length(QDi),'nlmix',@seOpti.equ,nlrhs,nle,'options',opts)
|
||||
cl=seOpti.Getcl();
|
||||
cu=seOpti.Getcu();
|
||||
Opt = opti('fun',@seOpti.obj,'ndec',length(Volt)*2+length(PDi)+length(QDi),'nl',@seOpti.equ,cl,cu,'options',opts)
|
||||
% Opt = opti('fun',@seOpti.obj,'ndec',length(PDi)+length(QDi),'options',opts)
|
||||
[x,fval,exitflag,info] = solve(Opt,x0);
|
||||
info
|
||||
|
|
@ -96,3 +96,5 @@ fprintf('
|
|||
PD=x(1:length(PDi));
|
||||
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
||||
MaxDeviation(rVolt,SEVolt,rVAngel,SEVAngel,rPD(PDi),rQD(QDi),PD,QD)
|
||||
fprintf('ͳ¼ÆÆ«²î\n')
|
||||
StatDeviation(rVolt,SEVolt,rVAngel,SEVAngel,rPD(PDi),rQD(QDi),PD,QD)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
function [ output_args ] = StatDeviation( this,PG0,QG0,PD0,QD0 )%ͳ¼ÆÎó²î
|
||||
%STATDEVIATION Summary of this function goes here
|
||||
% Detailed explanation goes here
|
||||
PDArray=PD;
|
||||
PD0Array=repmat(PD0,1,1);
|
||||
QD0Array=repmat(QD0,1,1);
|
||||
PDDev=(PDArray-PD0Array)/0.05;
|
||||
QDDev=(QDArray-QD0Array)/0.05;
|
||||
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
|
||||
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
function [ output_args ] = StatDeviation( this,PG0,QG0,PD0,QD0 )%ͳ¼ÆÎó²î
|
||||
function [ output_args ] = StatDeviation(rVolt,SEVolt,rVAngel,SEVAngel,rPD,rQD,PD,QD)%ͳ¼ÆÎó²î
|
||||
%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;
|
||||
PDArray=PD;
|
||||
QDArray=QD;
|
||||
PD0Array=repmat(rPD,1,1);
|
||||
QD0Array=repmat(rQD,1,1);
|
||||
PDDev=(PDArray-PD0Array)/0.05;
|
||||
QDDev=(QDArray-QD0Array)/0.05;
|
||||
% VoltDev=(SEVolt-rVolt)/0.05;
|
||||
% VAngelDev=(SEVAngel-QD0Array)/0.05;
|
||||
wholeMat=[PDDev;QDDev;];
|
||||
t1=wholeMat.^2;
|
||||
t2=sum(t1,1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue