Discrepancy with d2c function?

3 ビュー (過去 30 日間)
Tariq Ahamed
Tariq Ahamed 2015 年 6 月 18 日
回答済み: Andrew Schenk 2015 年 6 月 19 日
den = [(Me*c1) (Me*k1) (c1*(k1+k2)) (k1*k2)];
num = [(c1*N) (k1*N)];
sys1 = tf(num,den);
sys1d = c2d(sys1,0.001);
When I run the above piece of code and then use d2c on sys1d, I get my original transfer function sys1. However, if I copy the num and den fieds in sys1d, create a discrete transfer function from it and use d2c, it does not give me the original sys1. I am stumped as to why. Any help will be highly appreciated.
Thanks

回答 (1 件)

Andrew Schenk
Andrew Schenk 2015 年 6 月 19 日
The following code does what you are describing and is able to exactly recover the original sys1. It is better to use the tfdata function instead of copying the num and den fields as the full precision is then preserved.
sys1 = tf([1 -1],[1 4 5]);
sys1d = c2d(sys1,0.001);
[num, den] = tfdata(sys1d); %extract discrete tf num and den fields
sys2d = tf(num, den, 0.001);
sys2 = d2c(sys2d)

カテゴリ

Help Center および File ExchangeOil, Gas & Petrochemical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by