stateestimation-ipm-forcomp.../@SEOpti/fun.m

33 lines
1.6 KiB
Mathematica
Raw Normal View History

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;
SEVolt=x(1:this.Busnum);
SEVAngel=x(this.Busnum+1:2*this.Busnum);
Objective=(SEVolt-this.mVolt)'*(1./this.sigma^2*eye(length(this.mVolt)))*(SEVolt-this.mVolt);%<EFBFBD><EFBFBD>ѹ
% Objective=0;
% %% ֧·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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>ֵ
Objective=Objective+sum((SEBranchI-this.mBranchI.^2).^2./this.sigma^2);%%<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
%% <EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SEBranchP=real((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
SEBranchQ=imag((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(cmpSEBranchI));
2013-04-22 21:56:16 +08:00
Objective=Objective+sum((SEBranchP-this.mBranchP).^2/this.sigma^2);
Objective=Objective+sum((SEBranchQ-this.mBranchQ).^2/this.sigma^2);
%% <EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>
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);
%% 0ע<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
%% <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>
2013-04-22 21:56:16 +08:00
% Objective=Objective+(this.mPG(this.onlyPG)-real(PQ(this.onlyPG)))'*(1./this.sigma^2*eye(length(this.mPG(this.onlyPG))))*(this.mPG(this.onlyPG)-real(PQ(this.onlyPG)));
% Objective=Objective+(this.mQG(this.onlyQG)-imag(PQ(this.onlyQG)))'*(1./this.sigma^2*eye(length(this.mQG(this.onlyQG))))*(this.mQG(this.onlyQG)-imag(PQ(this.onlyQG)));
end