필터 지우기
필터 지우기

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 CenterFile Exchange에서 Oil, Gas & Petrochemical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by