2013-04-17 10:04:43 +08:00
|
|
|
function [ output_args,this ] = equ( this,x )
|
|
|
|
|
%EQU Summary of this function goes here
|
|
|
|
|
% Detailed explanation goes here
|
|
|
|
|
PDi=this.PDi;
|
|
|
|
|
QDi=this.QDi;
|
|
|
|
|
Volt0=this.Volt0;
|
|
|
|
|
Angel=this.Angel;
|
|
|
|
|
r=this.r;
|
|
|
|
|
c=this.c;
|
|
|
|
|
PG=this.PG;
|
|
|
|
|
QG=this.QG;
|
|
|
|
|
Balance=this.Balance;
|
|
|
|
|
Y=this.Y;
|
|
|
|
|
PD=x(1:length(PDi));
|
|
|
|
|
QD=x(length(PDi)+1:length(PDi)+length(QDi));
|
|
|
|
|
Volt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(Volt0));
|
2013-04-17 11:15:22 +08:00
|
|
|
VAngel=x(length(PDi)+length(QDi)+length(Volt0)+1:end);
|
2013-04-17 10:04:43 +08:00
|
|
|
PD_=zeros(length(Volt0),1);
|
|
|
|
|
QD_=zeros(length(Volt0),1);
|
|
|
|
|
PD_(PDi)=PD;
|
|
|
|
|
QD_(QDi)=QD;
|
|
|
|
|
busNum=length(Volt0);
|
|
|
|
|
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;
|
2013-04-17 11:15:22 +08:00
|
|
|
output_args=[dP;dQ;VAngel(Balance)];
|
2013-04-17 15:43:43 +08:00
|
|
|
output_args=full(output_args);
|
2013-04-17 10:04:43 +08:00
|
|
|
this.gle=zeros(length(output_args),1);
|
|
|
|
|
this.eb=this.gle;
|
|
|
|
|
end
|
|
|
|
|
|