I have closed loop - discrete model. This is how it looks in matlab:
I need to compute analitically output $y(t)$ (same as in the Matlab's scope) having $Y(z)$.
Where
$Y(z)=U(z)*G(z)$
Input is sine wave so Z transform for sine is:
$U(z) = \frac{z\sin(\omega T)}{z^2-2zcos(\omega T)+1}$
and
$G(z) = \frac{G_o(z)}{1+G_o(z)} = \frac{kz^3}{(a+k)z^3+bz^2+cz+d} = \frac{kz^3}{(a+k)(z-z_1)(z-z_2)(z-z_3)}$
Where:
$\omega$, $k$, $a$, $b$, $c$, $d$ - are given parameters.
So:
$Y(z) = \frac{z\sin(\omega T)kz^3}{(z^2-2zcos(\omega T)+1)(a+k)(z-z_2)(z-z_3)(z-z_4)}$
I saw on Wolfram Alpha that roots of $z^2-2zcos(\omega T)+1$
are
$z_0 = cos(\omega T)-isin(\omega T)$
$z_1 = cos(\omega T)+isin(\omega T)$
and rest of roots ($z_2$, $z_3$, $z_4$) I compute using roots
function in matlab from $G(z)$.
$z_2 = 0.9889+0.022i$
$z_3 = 0.9889-0.022i$
$z_4 = 0.8784$
The residue method is what I know but other would be good too.
For example:
$res_{z=z_0}=\lim_{z\to z_0}(z-z_0)Y(z)z^{n-1}=\lim_{z\to z_0}\frac{z\sin(\omega T)kz^3z^{n-1}}{(a+k)(z-z_1)(z-z_2)(z-z_3)(z-z_4)}=lim_{z\to z_0}\frac{\sin(\omega T)kz^{n+3}}{(a+k)(z-cos(\omega T)-isin(\omega T))(z-z_2)(z-z_3)(z-z_4)}=\frac{\sin(\omega T)k[cos(\omega T)-isin(\omega T)]^{n+3}}{(a+k)(-2isin(\omega T))(cos(\omega T)-isin(\omega T)-z_2)(cos(\omega T)-isin(\omega T)-z_3)(cos(\omega T)-isin(\omega T)-z_4)}$
$y(t)$ as you know is sum of residues for all poles.
In order to plot graph from my function $y(t)$ I have to get rid of imaginary parts of equation. How can I do this?
Yeah it's boring because it's a homework.