stateestimateionyalmip-lu9-.../@Opti/obj.m

31 lines
870 B
Mathematica
Raw Normal View History

function [ output_args ] = obj( this,x )
%OBJ Summary of this function goes here
% Detailed explanation goes here
PDi=this.PDi;
QDi=this.QDi;
PD=x(1:length(PDi));
QD=x(length(PDi)+1:length(PDi)+length(QDi));
wPD=this.wPD;
wQD=this.wQD;
% wVolt=this.wVolt;
PD0=this.PD0;
QD0=this.QD0;
t4=(wPD(PDi).*(PD-PD0(PDi))).^2;
t5=(wQD(QDi).*(QD-QD0(QDi))).^2;
Volt0=this.Volt0;
SEVolt=x(length(PDi)+length(QDi)+1:length(PDi)+length(QDi)+length(Volt0));
wVolt=this.wVolt;
t6=(wVolt.*(SEVolt-Volt0)).^2;
Balance=this.Balance;
t6(Balance)=0;%<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>
% <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SEVAngel=x(length(PDi)+length(QDi)+length(SEVolt)+1:end);
loadCurrent=LoadCurrent( SEVolt,SEVAngel,PD0(PDi),QD0(QDi),PDi,QDi );
wLoadCurrent=this.wLoadCurrent;
mLoadCurrent=this.mLoadCurrent;
t7=(wLoadCurrent.*(loadCurrent-mLoadCurrent)).^2;
output_args=sum(t4)+sum(t5)+sum(t7);
output_args=full(output_args);
end