Discrepancy with d2c function?

1 次查看(过去 30 天)
Tariq Ahamed
Tariq Ahamed 2015-6-18
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 CenterFile Exchange 中查找有关 Transportation Engineering 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by