Find poles and zeros of transfer function

245 次查看(过去 30 天)
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 个评论
Paul
Paul 2022-1-10
Why did you delete the code from your question?
And why did you change the question itself? It used to be Find poles and zeros of a transfer function
Paul
Paul 2022-1-10
I don't think this was the original code for this question ....

请先登录,再进行评论。

采纳的回答

Paul
Paul 2022-1-7
编辑: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 个评论
Siddhanth Sunil Shah
编辑:Siddhanth Sunil Shah 2022-1-7
Sorry that I was not clear. Yes the MATLAB throws an error since Gsys is not square and a 2x3 sym.
And I am trying to figure out a way to find the Smith-McMillan form of Gsys and also a method to derive the Smith Form for non-square matrix but unable to succeed.
After finding the Smith-McMillan form of Gsys, I want to compute the poles and zeros of that form
Best Regards,
Siddhanth
Paul
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
Emiliano martin 2022-5-12
clear all
close all
clc
s=tf('s');
TF_Sys=8/s(2*s+1)*(.05*s+1);
figure (1)
pzmap(TF_Sys)
is giving me an arror, please help!!

Community Treasure Hunt

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

Start Hunting!

Translated by