38 lines
1.6 KiB
Plaintext
38 lines
1.6 KiB
Plaintext
%% 计算线损
|
|
function [dispLineloss dispTransloss]=Lineloss(Linei,Linej,Liner,Linex,Lineb2,Transi,Transj,Transr,Transx,Branchi,Branchg,Branchb,k0,Volt,Angle)
|
|
%format long
|
|
% fprintf('功率为有名值\n');
|
|
% fprintf('节点号\t节点号\t有功损耗 MW\t无功损耗 MVar')
|
|
cmpVolt=Volt'.*cos(Angle')+1i*Volt'.*sin(Angle');
|
|
% cmpVolt=cmpVolt';
|
|
y0=1i*Lineb2;
|
|
%yj0=1i*standardinput(:,7);
|
|
yij=1./(Liner+1i*Linex);
|
|
%% 线路损耗
|
|
Sij=cmpVolt(Linei).*conj( cmpVolt(Linei) .* y0 + ( cmpVolt(Linei)- cmpVolt(Linej) ).*yij );
|
|
Sji=cmpVolt(Linej).*conj( cmpVolt(Linej) .*y0 + ( cmpVolt(Linej)- cmpVolt(Linei) ).*yij );
|
|
%Sij1==Sij2
|
|
deltLineS=Sij+Sji;
|
|
|
|
%% 另一种计算方式begin
|
|
ss=1*(Volt(Linei)'.^2.*abs(yij).*cos( angle(yij) ) -Volt(Linei)'.*Volt(Linej)'.*cos( Angle(Linei)' - Angle(Linej)' - angle(yij)).*abs(yij));
|
|
ss=(Volt(Linei)'.^2+Volt(Linej)'.^2).*abs(yij).*cos(angle(yij))-2*Volt(Linei)'.*Volt(Linej)'.*cos( Angle(Linei)' - Angle(Linej)').*cos( - angle(yij)).*abs(yij);
|
|
ss=Volt(Linei)'.*Volt(Linej)'.*abs(yij).*cos()
|
|
%% 另一种计算方式end
|
|
dispLineloss=[Linei Linej real(deltLineS)*100 imag(deltLineS)*100];
|
|
%full(dispLineloss)
|
|
% dispLineloss=sortrows(dispLineloss,-3);
|
|
full(dispLineloss);
|
|
%% 以下是变压器损耗
|
|
yij=1./(Transr+1i*Transx);
|
|
Sij=cmpVolt(Transi)./k0.*conj( ( cmpVolt(Transi)./k0- cmpVolt(Transj) ).*yij );
|
|
Sji=cmpVolt(Transj).*conj( ( cmpVolt(Transj)- cmpVolt(Transi)./k0 ).*yij );
|
|
deltTransS=Sij+Sji;
|
|
%% 接地支路损耗
|
|
% 没有考虑变压器变比
|
|
deltTransS =deltTransS+sum(cmpVolt(Branchi).*conj((cmpVolt(Branchi).*(Branchg+1j*Branchb))));
|
|
%%
|
|
dispTransloss=[Transi Transj real(deltTransS)*100 imag(deltTransS)*100];
|
|
% dispTransloss=sortrows(dispTransloss,-3);
|
|
full(dispTransloss);
|
|
end |