Diffrent results using tf(ss(A,B,C,D)) or C*inv(s*I-A)*B+D

1 回表示 (過去 30 日間)
rupprechtt
rupprechtt 2019 年 9 月 7 日
コメント済み: rupprechtt 2019 年 9 月 7 日
Why do I obtain diffrent results?
A = rand(3,3);
B = rand(3,1);
C = rand(4,3);
D = rand(4,1);
% using matlab function
tf1 = tf(ss(A,B,C,D));
% calculated by hand
s = zpk('s');
tf2 = D + C*inv(s*eye(3)-A)*B;
Does anyone have an idea why tf1-tf2 is not zero?
Thank you

採用された回答

Raj
Raj 2019 年 9 月 7 日
The results are not different. They are same. Minor differences can be due to numerical/computational tolerances and accuracy. At any given natural frequency, magnitude of (tf1-tf2) is indeed very close to zero. You can check the similarity yourself by comparing their bode plots like this:
bode(tf1)
hold on
bode(tf2)
  3 件のコメント
Raj
Raj 2019 年 9 月 7 日
Why are you 'unhappy' with the result of bode(tf1-tf2)? The magnitude of the difference as I mentioned earlier is in the order of 10^-13 which is very very small for almost any practical aspect.
You need even higher precision?
Capture.JPG
rupprechtt
rupprechtt 2019 年 9 月 7 日
Uhh.. my bad!
I have overlooked the factors .. (what an idiot)
Thanks a lot!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Control System Toolbox についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by