Discrepancy with d2c function?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
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)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Transportation Engineering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!