Bump --> using tfdata on Discrete Transfer Function

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.

댓글 수: 3

Post your continuous system
Please write your continuous system as numerator and denominator, without variable s
I wrote the system in numerator and denominator vector above.

댓글을 달려면 로그인하십시오.

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 26일
편집: Azzi Abdelmalek 2014년 1월 26일
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

댓글 수: 13

z^-1 is not the variable name. The variable name is still z, by specifying 'variable','z^-1' , Matlab will return the z-transform depending on z^-1, which is (1/z).
Ts=1
sys_xx=tf(1,[2 3]);
sysdxx=c2d(sys_xx,Ts,'tustin')
[numdxx,dendxx]=tfdata(sysdxx,'v')
sysdxx2 = tf(numdxx,dendxx,Ts)
sysdxx3 = tf(numdxx,dendxx,Ts,'variable','z^-1')
sysdxx2 and sysdxx3 look different, but you can check they are identical , by multiplying the numerator and the denominator of sysdxx3 by z,
That is right. It works for some system, but it is not working for the system I gave above.
What is not working?
1) First thing, try it with the system that I provided.
2) The simple examples you are providing works for everything. Please look at the continuous time system I provided.
3) sysdxx3 is just the continuous time version of sysdxx2. I am not trying to match sysdxx2 to sysdxx3.
4) I rephrased some of my questions for clarity. Look at my original question and please answer #5 or #6 for the continuous time system I provided.
You sais sysdxx doesn't match sysdxx2, it's not true.
You sais sysdxx doesn't match sys_xx. Why do you want to compare a discrete model with a continuous model?
Ts=1;
%---------continuous system sys_xx-------------------------------
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]
sys_xx=tf(num,den)
%-----------discreste system sysdxx-------------------------------------
sysdxx=c2d(sys_xx,Ts,'tustin')
[numdxx,dendxx]=tfdata(sysdxx,'v')
%----------discreste system sysdxx2--------------------------------
sysdxx2 = tf(numdxx,dendxx,Ts,'variable','z')
%---------compare sysdxx and sysdxx2-------------------------------
isequal(sysdxx,sysdxx2)
Try with Ts = 40e-6; as I mentioned.
It does not match at the Ts I mentioned.
I tried it, it matches.
Maybe there is a problem when you convert from discrete model to continuous model, the function d2c has its limitations. You should read
doc d2c
The Tustin approximation is not defined for systems with poles at z = –1 and is ill-conditioned for systems with poles near z = –1.
1)If you discretize the continuous time system directly from the continuous-time transfer function I gave then, with Ts = 40e-6, then the sys_xx and sysdxx matches. That means it is discretized properly. (Right way)
2) The way you did it first taking it as numerator and denominator coefficients and then discretizing from that; results in a discrete system that does not match with the underlying continuous time system. i.e. sysdxx does not match sys_xx. (Flawed way).
3) #1 and #2 does not give the same thing.
4) If the discretization is not done properly the following step does not mean anything.
5) Main idea is that at any point whatever system we have it "will" have to match with the original continuous-time system sys_xx. (I am rephrasing the question because we just figured out a loop-hole in MATLAB coding).
6) All systems sysdxx, sysdxx2, sysdxx3 has to match with original continuous-time system sys_xx.
I will read into the stuff you mentioned about "d2c".
Have you read my above comment about the limitations of the function d2c?
1) I have read it, but I don't know why I am supposed to be concerned about limitations of d2c.
2) I am more concerned about limitations of "tfdata" and may be the Tustin's method.
There is another problem with the c2d function. The poles of your continuous model are all stables, but the real part of some of them are near 0 (model at the limit of instability). If you check the poles of the discrete model obtained by c2d, you will notice that some of them are unstable. This is due to numerical errors. It's obvious that trying to get the original continuous model will be difficult from this unstable discrete model.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2014년 1월 26일

편집:

2014년 1월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by