📄 mimo2t.m
字号:
% Program "mimo2t.m"
% Implementation of Node Reduction Algorithm.
% Calculates impedances of node-equivalent
% T-shaped two-port network.
% Input Parameters:
% - Number of internal and exterior nodes: P
% - Admittances connecting nodes
P = 1;
while P < 2;
P = input('Number of Nodes P = ');
if P < 2
disp('Specify more nodes!')
end;
end;
% Input of admittances connecting nodes
disp('Make sure off-diagonal elements have negative sign')
disp(' ')
for k=1:P;
for n=k:P;
if k==n;
disp('Admittance of'), disp(n), disp('th node');
Y(k,n)=input('Y(k, n) = ');
else
disp('Admittances connecting nodes'),disp(k),disp(n);
Y(k,n)=input('Y(k, n) = ');
Y(n,k)=Y(k,n);
end;
end;
end;
% ===============
Yr=Y;
% Calculation of reduced admittance matrix, Yr
for k=1:P-2;
Yr=Yr(1:P-k,1:P-k)-Yr(1:P-k,P+1-k)*Yr(P+1-k,1:P-k)/Yr(P+1-k,P+1-k);
end;
% ===============
disp(' ')
disp('Original Admittance Matrix:'),Y
% disp('Reduced Admittance Matrix:'),Yr
y2=-Yr(1,2); y1=Yr(1,1)-y2; y3=Yr(2,2)-y2;
% Calculation of reduced impedance matrix, Zr, of T circuit
disp(' ')
if det(Yr)==0
disp('Impossible to calculate reduced impedance matrix Zr')
exist=0;
else
disp('Reduced two-port T-circuit impedance matrix Zr ')
Zr=inv(Yr)
z2=Zr(1,2); z1=Zr(1,1)-z2; z3=Zr(2,2)-z2;
exist=1;
end;
% ==================
if exist;
disp('Impedances of equivalent two-port T-circuit')
z1, z2, z3
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -