Get difference equation from continuous transfer function
13 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have a continuous transfer function such as:
0.002174 s + 0.0001581
----------------------------------------------------------
6.267 s^4 + 3.378 s^3 + 0.6042 s^2 + 0.04081 s + 0.0007907
I'm trying to convert it to a difference equation with negative exponents(z^(-n)).
I've already tried to calculate it manually with syms but, i found it quite impossible to work with.
tustin =(2/Ts)*(1-z^(-1))/(1+z^(-1))
modello_disc = subs(modello, s, tustin)%this is just an example. i gotta split num and den before cause it gives me an error if i try it with the tf above.
i've also tried to use the common c2d command but it doesn't give me the result i hope for.
z = tf('z', 'Variable','z^-1')
modello = tf(c2d(modello, Ts, 'tustin'))
0 件のコメント
採用された回答
Star Strider
2024 年 12 月 22 日
One approach —
0.002174 s + 0.0001581
----------------------------------------------------------
6.267 s^4 + 3.378 s^3 + 0.6042 s^2 + 0.04081 s + 0.0007907
s = tf('s');
Hs = (0.002174*s + 0.0001581) / (6.267*s^4 + 3.378*s^3 + 0.6042*s^2 + 0.04081*s + 0.0007907)
Ts = 1;
Hz = c2d(Hs, Ts, 'tustin')
Hz.Variable = 'z^-1'
.
2 件のコメント
Star Strider
2024 年 12 月 22 日
My pleasure!
That would work if you defined your transfer function in the ‘z’ domain. (See Discrete-Time Transfer Function Model Using Rational Expression for those details.) It will not automatically convert a continuous to a discrete transfer function. You need to do that similarly to the way I did here.
.