MATLAB: Bump –> using tfdata on Discrete Transfer Function

c2ddiscrete transfer functiontfdatatustin

1. I am using tfdata to get the numerator and denominator coefficients of discrete transfer function. Note that the discrete transfer function matches the underlying continuous transfer function in Bode Diagram. [Ts=time period = 40e-6]
sysdxx=c2d(sys_xx,Ts,'tustin'); %getting Discrete system from continuous system sys_xx
[numdxx,dendxx]=tfdata(sysdxx,'v'); %getting num & den using tfdata
2. This is the continuous time system.
sys_xx =
(-3.71e05 s^15 - 4.784e08 s^14 - 2.247e13 s^13 - 2.501e16 s^12 - 4.589e20 s^11 - 4.249e23 s^10 - 3.745e27 s^9 - 2.865e30 s^8 - 1.161e34 s^7 - 7.184e36 s^6 - 1.12e40 s^5 - 5.53e42 s^4 - 1.47e45 s^3 - 6.161e47 s^2 - 1.661e47 s - 2.484e43)
/( s^16 + 9.043e05 s^15 + 1.002e10 s^14 + 1.114e14 s^13 + 5.156e17 s^12 + 3.396e21 s^11 + 8.22e24 s^10 + 3.55e28 s^9 + 4.978e31 s^8 + 1.385e35 s^7 + 9.979e37 s^6 + 1.805e41 s^5 + 3.511e43 s^4 + 3.205e46 s^3 + 1.786e48 s^2 + 5.594e47 s + 1.782e44)
sys_xx = num/den;
num = [-3.71e05 -4.784e08 -2.247e13 -2.501e16 -4.589e20 -4.249e23 -3.745e27 -2.865e30 -1.161e34 -7.184e36 -1.12e40 -5.53e42 -1.47e45 -6.161e47 -1.661e47 -2.484e43]
den = [1 9.043e05 1.002e10 1.114e14 5.156e17 3.396e21 8.22e24 3.55e28 4.978e31 1.385e35 9.979e37 1.805e41 3.511e43 3.205e46 1.786e48 5.594e47 1.782e44]
3. Then if I construct a discrete transfer function (or filter) from this numerator & denominator coefficients it does not match the original discrete system or the continuous-time system in bode diagram.
sysdxx2 = tf(numdxx,dendxx,Ts,'variable','z'); %reconstructing discrete system
4. If the discrete system is converted back to continuous time system, even then it does not match.
sysdxx3 = d2c(sysdxx2,'tustin');
5. "sysdxx" does not match with "sys_xx".
6. "sysdxx2" does not match with "sys_xx".
7. "sysdxx3" does not match with "sys_xx".
Anyone have any idea of what might be the reason.
Thanks.

Best Answer

You are not using the same variables, (numdxx and numkdxx). Also, if you want to make a comparison, just use the same variable z, instead of z^(-1). And why do you think that a discrete model will match a corresponding continuous model?
Look at this example
Ts=1
sys_xx=tf(1,[2 3]);
sysdxx=c2d(sys_xx,Ts,'tustin')
[numdxx,dendxx]=tfdata(sysdxx,'v')
sysdxx2 = tf(numdxx,dendxx,Ts)
sysdxx and sysdxx2 are identical