ss2tf error. The TF does not match.

4 次查看(过去 30 天)
Dear all,
I am working in State-Sapce (SS) representation, so, when I want to obtain a Transfer Function (TF) in order to create a bode, the bode does not match with the expected frequency response. The A matrix in SS is 13x13. I tried with a simple example that I know what is its TF, and I do not obtain the expected resoult. How could I solve it? I think the problem is in the way that the determinant is calculated. It is not a problem to wait more time to obtain a more precise TF.
Thank you very much fot your time.
  2 个评论
Siddharth Jawahar
Siddharth Jawahar 2021-3-23
Hi Alvaro,
Can you share an example of how you are doing this conversion?
Best,
Sid
Álvaro Morales Muñoz
This is the code:
format long
A = [
0 1 0 0 0 0 0 0 0 0 0 0 0;
0 0 1 0 0 0 0 0 0 0 0 0 0;
0 0 0 1 0 0 0 0 0 0 0 0 0;
0 0 0 0 1 0 0 0 0 0 0 0 0;
0 0 0 0 0 1 0 0 0 0 0 0 0;
0 0 0 0 0 0 1 0 0 0 0 0 0;
0 0 0 0 0 0 0 1 0 0 0 0 0;
0 0 0 0 0 0 0 0 1 0 0 0 0;
0 0 0 0 0 0 0 0 0 1 0 0 0;
0 0 0 0 0 0 0 0 0 0 1 0 0;
0 0 0 0 0 0 0 0 0 0 0 1 0;
0 0 0 0 0 0 0 0 0 0 0 0 1;
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1];
B = [1 0 0 0 0 0 0 0 0 0 0 0 0]';
C = [1 0 0 0 0 0 0 0 0 0 0 0 0];
D = 0;
[num, den] = ss2tf(A,B,C,D)
% The denominator should be [1 1 1 1 1 1 1 1 1 1 1 1 1], but I obtain in
% den =
% Columns 1 through 7
% 1.000000000000000 1.000000000000009 1.000000000000009 1.000000000000008 1.000000000000004 0.999999999999994 0.999999999999990
% Columns 8 through 14
% 0.999999999999994 1.000000000000001 1.000000000000004 1.000000000000001 0.999999999999996 0.999999999999999 0.999999999999999

请先登录,再进行评论。

回答(1 个)

Star Strider
Star Strider 2021-3-23
编辑:Star Strider 2021-3-23
The bode function accepts state space models as input. See the sys documentation section for an extended discussion.
EDIT — (23 Mar 2021 at 15:50)
Try this:
sys = ss(A,B,C,D);
figure
bode(sys)
grid
.

社区

更多回答在  Power Electronics Control

Community Treasure Hunt

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

Start Hunting!

Translated by