parent
fd65438b98
commit
56724685da
|
|
@ -1,4 +1,4 @@
|
||||||
function [ output_args,this ] = equ( this )
|
function [ output_args,this ] = equ( this,x )
|
||||||
%EQU Summary of this function goes here
|
%EQU Summary of this function goes here
|
||||||
% Detailed explanation goes here
|
% Detailed explanation goes here
|
||||||
PDi=this.PDi;
|
PDi=this.PDi;
|
||||||
|
|
@ -9,19 +9,29 @@ r=this.r;
|
||||||
c=this.c;
|
c=this.c;
|
||||||
PG=this.PG;
|
PG=this.PG;
|
||||||
QG=this.QG;
|
QG=this.QG;
|
||||||
|
Balance=this.Balance;
|
||||||
|
Y=this.Y;
|
||||||
PD=x(1:length(PDi));
|
PD=x(1:length(PDi));
|
||||||
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
||||||
Volt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(Volt0));
|
Volt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(Volt0));
|
||||||
VAngel=x(length(PDi)+length(QDi)+length(Volt0):end);
|
VAngel=x(length(PDi)+length(QDi)+length(Volt0)+1:end);
|
||||||
PD_=zeros(PD,length(Volt0));
|
PD_=zeros(length(Volt0),1);
|
||||||
QD_=zeros(QD,length(Volt0));
|
QD_=zeros(length(Volt0),1);
|
||||||
PD_(PDi)=PD;
|
PD_(PDi)=PD;
|
||||||
QD_(QDi)=QD;
|
QD_(QDi)=QD;
|
||||||
busNum=length(Volt0);
|
busNum=length(Volt0);
|
||||||
VMatrix=sparse(r,c,VAngel(r)-VAngel(c)-Angel,busNum,busNum);
|
VMatrix=sparse(r,c,VAngel(r)-VAngel(c)-Angel,busNum,busNum);
|
||||||
dP=PG-PD_-diag(Volt)*(Y.*cos(VMatrix))*Volt;
|
dP=PG-PD_-diag(Volt)*(Y.*cos(VMatrix))*Volt;
|
||||||
dQ=QG-QD_-diag(Volt)*(Y.*spfun(@sin,VMatrix))*Volt;
|
dQ=QG-QD_-diag(Volt)*(Y.*spfun(@sin,VMatrix))*Volt;
|
||||||
output_args=[dP;dQ];
|
output_args=[dP;dQ;VAngel(Balance)];
|
||||||
this.gle=ze
|
%% 开始增加不等式约束-电压\PD\QD
|
||||||
|
%电压不等式约束
|
||||||
|
output_args=[output_args;Volt];
|
||||||
|
output_args=full(output_args);
|
||||||
|
this.cu=zeros(length(output_args),1);
|
||||||
|
this.cl=this.cu;
|
||||||
|
%电压
|
||||||
|
this.cu=[this.cu;1.1];
|
||||||
|
this.cl=this.cu;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,12 @@ dQ=QG-QD_-diag(Volt)*(Y.*spfun(@sin,VMatrix))*Volt;
|
||||||
output_args=[dP;dQ;VAngel(Balance)];
|
output_args=[dP;dQ;VAngel(Balance)];
|
||||||
%% 开始增加不等式约束-电压\PD\QD
|
%% 开始增加不等式约束-电压\PD\QD
|
||||||
%电压不等式约束
|
%电压不等式约束
|
||||||
|
|
||||||
output_args=full(output_args);
|
|
||||||
this.cu=zeros(length(output_args),1);
|
this.cu=zeros(length(output_args),1);
|
||||||
this.cl=this.cu;
|
this.cl=this.cu;
|
||||||
|
output_args=[output_args;Volt];
|
||||||
|
output_args=full(output_args);
|
||||||
|
%µçѹ
|
||||||
|
this.cu=[this.cu;1.1*ones(length(Volt),1)];
|
||||||
|
this.cl=[this.cl;0.9*ones(length(Volt),1)];
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue