26 lines
1.6 KiB
Mathematica
26 lines
1.6 KiB
Mathematica
|
|
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>ѹ
|
|||
|
|
%% ֧·<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(SEBranchI));
|
|||
|
|
SEBranchQ=imag((cmpSEV(this.lineI)-cmpSEV(this.lineJ)).*conj(SEBranchI));
|
|||
|
|
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);
|
|||
|
|
% zeroInjP=real(PQ(this.zerosInjectionIndex));%% 0ע<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
|||
|
|
% zeroInjQ=imag(PQ(this.zerosInjectionIndex));%% 0ע<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
|||
|
|
%% <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>빦<EFBFBD><EFBFBD>
|
|||
|
|
Objective=Objective+(this.PG(this.onlyPG)-real(PQ(this.onlyPG)))'*(1./this.sigma^2*eye(length(this.PG(this.onlyPG))))*(this.PG(this.onlyPG)-real(PQ(this.onlyPG)));
|
|||
|
|
Objective=Objective+(this.QG(this.onlyQG)-imag(PQ(this.onlyQG)))'*(1./this.sigma^2*eye(length (this.QG(this.onlyQG))))*(this.QG(this.onlyQG)-imag(PQ(this.onlyQG)));
|
|||
|
|
end
|
|||
|
|
|