www.pudn.com > OPF.zip > Loss.m, change:2011-11-25,size:2233b


%% *************************************************************** 
%             作者:陆镛 
%             原创日期:2012年11月25号 
%             修改日期:2012年11月25号 
%             函数说明:算出平衡节点的功率和各支路损耗 
%% *************************************************************** 
function [BalanceP,BalanceQ,LineLoss,TransformerLoss,GroundLoss,LineSij,... 
    LineSji,TransformerSij,TransformerSji] = Loss(BalanceI,AmplitudeU,... 
    AngleU,Ysin,Ycos,LineI,LineJ,LineY,LineB,TransformerI,TransformerJ,... 
    TransformerY,TransformerK,GroundI,GroundB)   
%% 变量说明:****************************************************** 
% 输入参数说明:BalanceI:平衡节点号  AmplitudeU:电压幅值  AngleU:电压相角 
% Ysin:导纳矩阵幅值点乘Uij减去导纳矩阵相角的正弦值 
% Ycos:导纳矩阵幅值点乘Uij减去导纳矩阵相角的余弦值  LineI:线路节点i 
% LineJ:线路节点j  LineY:线路导纳  LineB:线路对地电纳  TransformerI:变压器节点i 
% TransformerJ:变压器节点j  TransformerY:变压器导纳  TransformerK:变压器变比 
% 输出参数说明:BalanceP:平衡节点有功  BalanceQ:平衡节点无功  LineLoss:线损 
% TransformerLoss:变损  GroundLoss:接地支路损耗 
%% *************************************************************** 
%变压器pi型模型 
TransformerYij=TransformerY./TransformerK; 
TransformerYi0=(1-TransformerK).*TransformerY./TransformerK./TransformerK; 
TransformerYj0=(TransformerK-1).*TransformerY./TransformerK; 
%计算平衡节点有功和无功 
BalanceP=AmplitudeU(BalanceI)*Ycos(BalanceI,:)*AmplitudeU;  
BalanceQ=AmplitudeU(BalanceI)*Ysin(BalanceI,:)*AmplitudeU; 
%两端功率 
U=conj(AmplitudeU.*exp(1i*AngleU)); 
LineSij=conj(U(LineI)).*(U(LineI).*conj(1i*LineB)+(U(LineI)-U(LineJ)).*... 
    conj(LineY)); 
LineSji=conj(U(LineJ)).*(U(LineJ).*conj(1i*LineB)+(U(LineJ)-U(LineI)).*... 
    conj(LineY)); 
TransformerSij=conj(U(TransformerI)).*(U(TransformerI).*conj(... 
    TransformerYi0)+(U(TransformerI)-U(TransformerJ)).*conj(TransformerYij)); 
TransformerSji=conj(U(TransformerJ)).*(U(TransformerJ).*conj(... 
    TransformerYj0)+(U(TransformerJ)-U(TransformerI)).*conj(TransformerYij)); 
%损耗 
LineLoss=LineSij+LineSji; 
TransformerLoss=TransformerSij+TransformerSji; 
GroundLoss=conj(U(GroundI)).*U(GroundI).*conj(1i*GroundB); 
end