stateestimation-self-deriva.../@SEOpti/fun.m

25 lines
1.4 KiB
Mathematica
Raw Normal View History

function [ Objective ] = fun(this, x )
%FUN Summary of this function goes here
% Detailed explanation goes here
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>
% SEBranchI=abs(cmpSEBranchI);% ֧·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
% Objective=Objective+(SEBranchI-this.mBranchI)'*(1./this.sigma^2*eye(length(this.mBranchI)))*(SEBranchI-this.mBranchI);%%<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));
Objective=Objective+(SEBranchP-this.mBranchP)'*(1./this.sigma^2*eye(length(this.mBranchP)))*(SEBranchP-this.mBranchP);
Objective=Objective+(SEBranchQ-this.mBranchQ)'*(1./this.sigma^2*eye(length(this.mBranchQ)))*(SEBranchQ-this.mBranchQ);
%% 0ע<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
PQ=diag(cmpSEV)*conj(this.cmpY*cmpSEV);
%% <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>
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