2013-04-21 10:46:45 +08:00
|
|
|
|
function [ output_args ] = obj( this,x )
|
2013-04-17 10:04:43 +08:00
|
|
|
|
%OBJ Summary of this function goes here
|
|
|
|
|
|
% Detailed explanation goes here
|
2013-04-21 10:46:45 +08:00
|
|
|
|
PDi=this.PDi;
|
|
|
|
|
|
QDi=this.QDi;
|
2013-04-17 10:04:43 +08:00
|
|
|
|
wPD=this.wPD;
|
|
|
|
|
|
wQD=this.wQD;
|
2013-04-21 10:46:45 +08:00
|
|
|
|
PD0=this.PD0;
|
|
|
|
|
|
QD0=this.QD0;
|
|
|
|
|
|
Volt0=this.Volt0;
|
2015-03-19 13:19:57 +08:00
|
|
|
|
SEVolt=x(1:length(Volt0));
|
2013-04-25 09:52:16 +08:00
|
|
|
|
wVolt=this.wVolt;
|
2015-03-19 13:19:57 +08:00
|
|
|
|
t6=(wVolt.*((SEVolt-Volt0))).^2;
|
2013-04-25 09:52:16 +08:00
|
|
|
|
Balance=this.Balance;
|
|
|
|
|
|
t6(Balance)=0;%<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>
|
|
|
|
|
|
% <20><><EFBFBD><EFBFBD>
|
2015-03-19 13:19:57 +08:00
|
|
|
|
SEVAngel=x(length(SEVolt)+1:end);
|
|
|
|
|
|
busNum=length(Volt0);
|
|
|
|
|
|
Angel=this.Angel;
|
|
|
|
|
|
r=this.r;
|
|
|
|
|
|
c=this.c;
|
|
|
|
|
|
PG=this.PG;
|
|
|
|
|
|
QG=this.QG;
|
|
|
|
|
|
|
|
|
|
|
|
VMatrix=sparse(r,c,SEVAngel(r)-SEVAngel(c)-Angel,busNum,busNum);
|
|
|
|
|
|
PD_=PG-diag(SEVolt)*(Y.*cos(VMatrix))*Volt;
|
|
|
|
|
|
QD_=QG-diag(SEVolt)*(Y.*spfun(@sin,VMatrix))*Volt;
|
|
|
|
|
|
t4=(wPD(PDi).*(PD_-PD0(PDi))).^2;
|
|
|
|
|
|
t5=(wQD(QDi).*(QD_-QD0(QDi))).^2;
|
|
|
|
|
|
% loadCurrent=LoadCurrent( SEVolt,SEVAngel,PD0(PDi),QD0(QDi),PDi,QDi );
|
|
|
|
|
|
% wLoadCurrent=this.wLoadCurrent;
|
|
|
|
|
|
% mLoadCurrent=this.mLoadCurrent;
|
|
|
|
|
|
% t7=(wLoadCurrent.*(loadCurrent-mLoadCurrent)).^2;
|
|
|
|
|
|
% t7=wLoadCurrent.*((loadCurrent-mLoadCurrent)./mLoadCurrent).^2;
|
|
|
|
|
|
output_args=sum(t4)+sum(t5)+sum(t6);
|
2013-04-21 10:46:45 +08:00
|
|
|
|
output_args=full(output_args);
|
2015-03-19 13:19:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-17 10:04:43 +08:00
|
|
|
|
end
|
|
|
|
|
|
|