36 lines
1.1 KiB
Matlab
36 lines
1.1 KiB
Matlab
function deltF=func_deltF(V1measurement,wV1r,wV1i,I1measurement,wI1r,wI1i,busNum,fsY11,Loadi,V1r,V1i,I1r,I1i)
|
|
%t1=PG(setdiff(PVi,Balance));
|
|
% t2=Volt'*Volt;
|
|
% t3=real(GB).*cos(AngleIJMat)+imag(GB).*sin(AngleIJMat);
|
|
% t4=t2.*t3;
|
|
% t5=sum(t4,2);
|
|
% PBal=t5(Balance);
|
|
% PPG=([PQ(1),PBal])';%ÔÝʱÓÃÍÁ°ì·¨´¦ÀíÒ»ÏÂ
|
|
|
|
% wV1r_=(1)^2.*ones(length(wV1r),1);
|
|
% wV1i_=(1)^2.*ones(length(wV1i),1);
|
|
% wI1r_=(1)^2.*ones(length(wI1r),1);
|
|
% wI1i_=(1)^2.*ones(length(wI1i),1);
|
|
%
|
|
% infWV=find(wV1r==Inf);
|
|
% infWI=find(wI1r==Inf);
|
|
% wV1r=wV1r_;
|
|
% wV1i=wV1i_;
|
|
% wI1r=wI1r_;
|
|
% wI1i=wI1i_;
|
|
% wV1r(infWV)=Inf;
|
|
% wV1i(infWV)=Inf;
|
|
% wI1r(infWI)=Inf;
|
|
% wI1i(infWI)=Inf;
|
|
|
|
%%
|
|
deltF=[
|
|
%zeros(busNum*2,1);
|
|
sparse(Loadi,1,2*( abs(V1measurement).^2- (V1r(Loadi).^2+ V1i(Loadi).^2) ).*(-2*V1r(Loadi))./wV1r./wV1r,busNum,1);
|
|
sparse(Loadi,1,2*( abs(V1measurement).^2- (V1r(Loadi).^2+ V1i(Loadi).^2) ).*(-2*V1i(Loadi))./wV1i./wV1i,busNum,1);
|
|
%-2*( [real(Imeasurement);imag(Imeasurement)]-[I1r;I1i]);
|
|
sparse(1:length(Loadi),1,-2*(real(I1measurement)-I1r)./wI1r./wI1r,length(Loadi),1);
|
|
sparse(1:length(Loadi),1,-2*(imag(I1measurement)-I1i)./wI1i./wI1i,length(Loadi),1);
|
|
];
|
|
|
|
end |