stateestimation-ipm/@SEOpti/fun.asv

47 lines
1.9 KiB
Plaintext
Raw Normal View History

2013-04-22 21:56:16 +08:00
function [ Objective ] = fun(this, x )
%FUN Summary of this function goes here
% Detailed explanation goes here
Objective=0;
SEVolt=x(1:this.Busnum);
SEVAngel=x(this.Busnum+1:2*this.Busnum);
rVolt=this.rVolt;
sigma=this.sigma;
VoltSigma=rVolt*sigma;
Objective=sum(((SEVolt-this.mVolt)./VoltSigma).^2);%<25><>ѹ
%% ֧·<D6A7><C2B7><EFBFBD><EFBFBD>
2013-04-22 21:56:16 +08:00
cmpSEV=SEVolt.*exp(1j*SEVAngel); %<25><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ
cmpSEBranchI=(cmpSEV(this.lineI)-cmpSEV(this.lineJ))./(this.lineR+1j*this.lineX);%<25><><EFBFBD><EFBFBD>֧·<D6A7><C2B7><EFBFBD><EFBFBD>
SEBranchI=abs(cmpSEBranchI);% ֧·<D6A7><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
% (SEBranchI-this.mBranchI).^2./(this.sigma^2)
% Objective=Objective+sum((SEBranchI-this.mBranchI).^2./(this.sigma^2));%%<25><><EFBFBD><EFBFBD>
2013-04-22 21:56:16 +08:00
%% <20><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>
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(SEBranchPSigma>1e-5);
SEBranchPSigma=SEBranchPSigma(indBranchPS);
SEBranchQSigma=imag(rBranchPQ)*sigma;
indBranchPS=find(SEBranchPSigma>1e-5);
SEBranchQSigma=SEBranchQSigma(abs(SEBranchQSigma)>1e-5);
2013-04-22 21:56:16 +08:00
SEBranchP=real((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
SEBranchQ=imag((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
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
%% <20><>ѹ<EFBFBD><D1B9>
newwordParameter=this.newwordParameter;
cmpY=this.cmpY;
transP=TransPower( newwordParameter,cmpY,SEVolt,SEVAngel );
Objective=Objective+sum((transP-this.mTransP).^2/(this.sigma^2));
transQ=TransReactivePower( newwordParameter,cmpY,SEVolt,SEVAngel );
Objective=Objective+sum((transQ-this.mTransQ).^2/(this.sigma^2));
2013-04-22 21:56:16 +08:00
%% 0ע<30><D7A2><EFBFBD>ڵ<EFBFBD>
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
%% <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EBB9A6>
% 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-22 21:56:16 +08:00
end