# Find poles and zeros of transfer function

158 ビュー (過去 30 日間)
Siddhanth Sunil Shah 2022 年 1 月 7 日

A = [-3 5 -7 0; 0.5 -1.5 0.5 -7.5;-5 0 -3 0; -0.5 -5 0 .7];
B = [1 0 0; 0 -1 0; -2 0 0; 0 1 2];
C = [1 0 0 0; 0 -1 0 0];
D = [-1 0 0; 2 0 0];
S = ss(A, B, C, D)
G = tf(SS)
% Compute Poles
poles = eig(A)
%Compute Zeros
zeros = tzero(A,B,C,D)
Gss = minreal( ss( S ) )
When I run this code i get the following error:
Error using ss (line 278)
The "D" matrix must be a numeric array with no Inf's or NaN's.
Error in Q5 (line 23)
Gss = minreal( ss( S ) );
##### 2 件のコメント表示非表示 1 件の古いコメント
Paul 2022 年 1 月 10 日
I don't think this was the original code for this question ....

サインインしてコメントする。

### 採用された回答

Paul 2022 年 1 月 7 日

That error shows up because minreal() and ss(), etc. are functions in the Control System Toolbox. Those functions cannot accept sym objects like Gsys.
Even if you just use Control System Toolbox functions, you're going to have troubles because the elements of Gsys are improper (degree of numerator > degree of denominator).
Also, I thought the Smith form only applies to the "numerator" of the transfer function matrix, not the entire tranfser function matrix.
Also, doesn't that call to smithForm throw an error because Gsys isn't square?
What exactly are you you trying to do? Find the Smith-McMillan form of Gsys?
##### 2 件のコメント表示非表示 1 件の古いコメント
Paul 2022 年 1 月 7 日
If Gsys were square, then it seems like it should be doable. Here's a simple example.
Define a simple transfer function matrix
syms s
Gsys(s) = [s/((s + 1)^2*(s + 2)^2), s/(s + 2)^2; -s/(s + 2)^2, -s/(s + 2)^2];
Get the least common denominator of all the terms
[num,den] = numden(Gsys);
d(s) = lcm(den)
d(s) = Compute N(s) from d(s) and Gsys(s)
N(s) = simplify(d(s)*Gsys(s))
N(s) = Get the Smith form of N(s)
[U1,U2,L] = smithForm(N(s));
The Smith-McMillan form of Gsys is then
M(s) = simplify(L/d(s))
M(s) = Get the zeros and the poles
[num,den] = numden(M(s));
for ii = 1:2
smzeros{ii} = solve(num(ii,ii),s).';
smpoles{ii} = solve(den(ii,ii),s).';
end
smzeros = [smzeros{:}]
smzeros = smpoles = [smpoles{:}]
smpoles = But your Gsys isn't square. Don't know why smithForm does not handle non square, polynomial matrices.

サインインしてコメントする。

### その他の回答 (1 件)

Emiliano martin 2022 年 5 月 12 日 23:38
clear all
close all
clc
s=tf('s');
TF_Sys=8/s(2*s+1)*(.05*s+1);
figure (1)
pzmap(TF_Sys)

サインインしてコメントする。

R2020b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!