2013-04-14 19:40:35 +08:00
|
|
|
|
function [ Objective ] = fun(this, x )
|
|
|
|
|
|
%FUN Summary of this function goes here
|
|
|
|
|
|
% Detailed explanation goes here
|
2013-04-22 21:56:16 +08:00
|
|
|
|
Objective=0;
|
2013-04-14 20:33:17 +08:00
|
|
|
|
SEVolt=x(1:this.Busnum);
|
|
|
|
|
|
SEVAngel=x(this.Busnum+1:2*this.Busnum);
|
2013-08-14 10:46:45 +08:00
|
|
|
|
rVolt=this.rVolt;
|
|
|
|
|
|
sigma=this.sigma;
|
|
|
|
|
|
VoltSigma=rVolt*sigma;
|
|
|
|
|
|
Objective=sum(((SEVolt-this.mVolt)./VoltSigma).^2);%<EFBFBD><EFBFBD>ѹ
|
2013-04-23 11:43:35 +08:00
|
|
|
|
%% ֧·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-04-14 20:33:17 +08:00
|
|
|
|
cmpSEV=SEVolt.*exp(1j*SEVAngel); %<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ
|
|
|
|
|
|
cmpSEBranchI=(cmpSEV(this.lineI)-cmpSEV(this.lineJ))./(this.lineR+1j*this.lineX);%<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-04-22 21:56:16 +08:00
|
|
|
|
SEBranchI=abs(cmpSEBranchI);% ֧·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
2013-04-23 11:43:35 +08:00
|
|
|
|
% (SEBranchI-this.mBranchI).^2./(this.sigma^2)
|
2013-08-14 10:46:45 +08:00
|
|
|
|
% Objective=Objective+sum((SEBranchI-this.mBranchI).^2./(this.sigma^2));%%<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-04-22 21:56:16 +08:00
|
|
|
|
%% <EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-08-14 10:46:45 +08:00
|
|
|
|
rVAngel=this.rVAngel;
|
|
|
|
|
|
cmpV=rVolt.*exp(1j*rVAngel);
|
|
|
|
|
|
rBranchPQ=(cmpV(this.lineI)-cmpV(this.lineJ)).*conj( (cmpV(this.lineI)-cmpV(this.lineJ))./(this.lineR+1j*this.lineX) );
|
|
|
|
|
|
SEBranchPSigma=real(rBranchPQ)*sigma;
|
|
|
|
|
|
indBranchPS=find(real(rBranchPQ)>1e-5);%<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD>̫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0
|
|
|
|
|
|
SEBranchPSigma=SEBranchPSigma(indBranchPS);
|
|
|
|
|
|
SEBranchQSigma=imag(rBranchPQ)*sigma;
|
|
|
|
|
|
indBranchQS=find(imag(rBranchPQ)>1e-5);%<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD>̫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0
|
|
|
|
|
|
SEBranchQSigma=SEBranchQSigma(indBranchQS);
|
2013-04-14 20:33:17 +08:00
|
|
|
|
SEBranchP=real((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
|
2013-08-14 10:46:45 +08:00
|
|
|
|
SEBranchP=SEBranchP(indBranchPS);
|
2013-04-14 20:33:17 +08:00
|
|
|
|
SEBranchQ=imag((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
|
2013-08-14 10:46:45 +08:00
|
|
|
|
SEBranchQ=SEBranchQ(indBranchQS);
|
|
|
|
|
|
Objective=Objective+sum((SEBranchP-this.mBranchP).^2./(SEBranchPSigma.^2));
|
|
|
|
|
|
Objective=Objective+sum((SEBranchQ-this.mBranchQ).^2./(SEBranchQSigma.^2));
|
2013-04-22 21:56:16 +08:00
|
|
|
|
%% <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>
|
|
|
|
|
|
newwordParameter=this.newwordParameter;
|
|
|
|
|
|
cmpY=this.cmpY;
|
|
|
|
|
|
transP=TransPower( newwordParameter,cmpY,SEVolt,SEVAngel );
|
2013-04-23 11:43:35 +08:00
|
|
|
|
Objective=Objective+sum((transP-this.mTransP).^2/(this.sigma^2));
|
2013-04-22 21:56:16 +08:00
|
|
|
|
transQ=TransReactivePower( newwordParameter,cmpY,SEVolt,SEVAngel );
|
2013-08-14 10:46:45 +08:00
|
|
|
|
% Objective=Objective+sum((transQ-this.mTransQ).^2/(this.sigma^2));
|
2013-04-14 20:33:17 +08:00
|
|
|
|
%% 0ע<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
|
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
|
|
|
|
|
|
%% <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>빦<EFBFBD><EFBFBD>
|
2013-04-23 11:43:35 +08:00
|
|
|
|
% Objective=Objective+sum(((this.mPG(this.onlyPG)-real(PQ(this.onlyPG)))/this.sigma).^2);
|
|
|
|
|
|
% Objective=Objective+sum(((this.mQG(this.onlyQG)-imag(PQ(this.onlyQG)))./this.sigma).^2);
|
2013-04-14 19:40:35 +08:00
|
|
|
|
end
|
|
|
|
|
|
|