[Z transform] problem with MATLAB

Hi experts, I have a question about Z-transform on MALTAB. When I convert a Laplace function F(s)=1/s to Z function, MATLAB says it is T/(z-1), but the Laplace-Z conversion table show that is z/(z-1). I know MATLAB cannot wrong because I drew a step graph of all these three functions. But all the books I found about Laplace and Z-transform also say the conversion table is right.
It's confusing me and I need an answer. Could anyone give me an explain for that? Thank in advanced.

 Respuesta aceptada

Star Strider
Star Strider el 11 de Sept. de 2017
The Symbolic Math Toolbox doesn’t know you’re trying to convert it from the Laplace domain to the ‘z’ domain. You have to play by its rules.
This works:
syms s t z
T1(s) = 1/s
T2(t) = ilaplace(T1)
T3(z) = ztrans(T2)
T1(s) =
1/s
T2(t) =
1
T3(z) =
z/(z - 1)

5 comentarios

Franklin Ngo
Franklin Ngo el 11 de Sept. de 2017
Thank you for your answer. SOrry for my unclear question. I mean I use the function "c2d", and the result is totally different. As you can see:
>> T_s=tf(1,[1 0])
T_s =
1
-
s
Continuous-time transfer function.
>> c2d(T_s,0.01)
ans =
0.01
-----
z - 1
Sample time: 0.01 seconds Discrete-time transfer function.
Could you explain that for me, please.
Star Strider
Star Strider el 11 de Sept. de 2017
As close as I can get is to use the Tustin approximation for ‘s’, and the Symbolic Math Toolbox for the derivation:
syms s t Ts z
T1(s) = 1/s
Ts = sym(0.01);
T4(z) = 1/((2/Ts)*(z - 1)/(z + 1)); % Substitute The Tustin Approximation For ‘s’
T4 = vpa(simplify(T4, 'Steps',10), 3);
pretty(T4)
0.01
------- + 0.005
z - 1.0
You may have to ask MathWorks about the exact implementation of the c2d function. It is not obvious from the documentation.
Franklin Ngo
Franklin Ngo el 12 de Sept. de 2017
OK. Thank you so much.
Star Strider
Star Strider el 12 de Sept. de 2017
As always, my pleasure.
If my Answer hslped you solve your problem, please Accept it!
Jeovane Sousa
Jeovane Sousa el 21 de Abr. de 2021
Editada: Jeovane Sousa el 21 de Abr. de 2021
Matlab uses the following method to calculate c2d by ZOH
The ZOH block generates the continuous-time input signal u(t) by holding each sample value u(k) constant over one sample period:
The signal u(t) is the input to the continuous system H(s). The output y[k] results from sampling y(t) every Ts seconds.
Resolving to :
each term will look something like that
thus,
And
Or remember the z-transform of a signal tha goes through a sample and holder, tha is:
This is what I think how c2d was implemented. No garantees it is correct or valid.
I hope I have made the correct considerations. Feel free to complement or point any mistake. Sorry about the poor English, it is not my primary language.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 11 de Sept. de 2017

Editada:

el 21 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by