stateestimateionyalmip-lu9-.../ObjectiveFun.m

10 lines
285 B
Mathematica
Raw Normal View History

function [out_arg]=ObjectiveFun(PG,PG0,PGi,QG,QG0,PVi,PD,PD0,QD,QD0,wPG,wQG,wPD,wQD,Loadi)
t1=PG(PGi)-PG0(PGi);
t2=wPG.*t1.*t1;
t1=QG(PVi)-QG0(PVi);
t3=wQG.*t1.*t1;
t4=wPD.*(PD(PD0~=0)-PD0(PD0~=0)).^2;
t5=wQD.*(QD(QD0~=0)-QD0(QD0~=0)).^2;
out_arg= sum(t2)+sum(t3)+sum(t4)+sum(t5);
end