redbusad.m

来自「电力系统电压稳定研究的图形化软件」· M 代码 · 共 23 行

M
23
字号
function Yred=redbusad(Y,M)
% Yred=RedBusAd(Y,M) returns the reduced bus admittance matrix, for
% a network with full admittance matrix Y and in which the last M
% buses are to be eliminated. If Y is given as a sparse matrix,
% the Yred is returned as sparse. If Y is full, then Yred is full.
if M==0
	Yred=Y;
else
N=size(Y,1);
Y11=Y(1:N-M,1:N-M);Y12=Y(1:N-M,N-M+1:N);
Y21=Y(N-M+1:N,1:N-M);Y22=Y(N-M+1:N,N-M+1:N);
B=[Y22
   Y12];
U=orth(full(B));Q=U'*B;
Bstar=Q\U';
AA=Y11-Y12*Bstar*[Y21;Y11];
Yred=(eye(N-M)-Y12*Bstar(1:M,M+1:N))\AA;
if issparse(Y) == 1;
   Yred=sparse(Yred);
end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?