📄 fex_lineflows.m
字号:
function [P_s,Q_s,P_r,Q_r,Is,Ir] = fex_lineflows
% FEX_LINEFLOWS -> called by FEX_ABCD
% compute line flows
%
% Author: Alberto Del Rosso
% Date: June 2004
% Update:
% Version: preliminary version
% E-mail: adelrosso@mercadosenergeticos.com
%
% I M P O R T A N T N O T E
% ===========================
% This external function is not part of the original PSAT software
% package although it uses many of PSAT functions. It has not been
% approved yet by Dr. Federico Milano to be distributed along with
% PSAT files.
global Fig Settings Snapshot Hdl
global Bus File DAE Theme
global SW PV PQ Fault Mn Ltc Syn
global Varout Breaker Line Path clpsat
jay=sqrt(-1);
if Line.n
tps = Line.con(:,11).*exp(jay*Line.con(:,12)*pi/180);
VV = DAE.V.*exp(jay*DAE.a);
r = Line.con(:,8);
rx = Line.con(:,9);
chrg = Line.con(:,10)/2;
%if strcmp(checkshunt,'on')
% chrg1 = chrg - jay*Shunt.g(Line.from) + Shunt.b(Line.from);
% chrg2 = chrg - jay*Shunt.g(Line.to) + Shunt.b(Line.to);
%else
chrg1 = chrg;
chrg2 = chrg;
%end
z = r + jay*rx;
y = ones(Line.n,1)./z;
MW_s = VV(Line.from).* ...
conj((VV(Line.from) - tps.*VV(Line.to)).*y ...
+ VV(Line.from).*(jay*chrg1))./(tps.*conj(tps));
P_s = real(MW_s); % active power sent out by from_bus to to_bus
Q_s = imag(MW_s); % reactive power sent out by from_bus to to_bus
MW_r = VV(Line.to).* ...
conj((VV(Line.to) - VV(Line.from)./tps).*y + ...
VV(Line.to).*(jay*chrg2));
P_r = real(MW_r); % active power received by to_bus from from_bus
Q_r = imag(MW_r); % reactive power received by to_bus from from_bus
from_bus = Line.from;
to_bus = Line.to;
% Current
Ss = abs(MW_s);
Sr = abs(MW_r);
Is = Ss./DAE.V(Line.from);
Ir = Sr./DAE.V(Line.to);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -