Determine the output of the given Block diagram
2 ビュー (過去 30 日間)
I have calculated by hand the output of the given block diagram Y(z), in Z-Domain. T=1 sec.
I get as result: Y(z)=4z/[3(z-1)^2]
I want to calculate the same result with matlab. Therefore I have written the following matlab script:
s = tf('s');
% model Gp(s)
Gp = 2/s;
H = s;
% close-loop transfer function in continuous domain
Tc = feedback(Gp,H);
% model Y(s)
Y = Tc*(2/s);
%% continuous to discrete transformation
T = 1; % sampling time 1 sec
Y_z = c2d(Y,T,'zoh')
But with matlab I receive as result:
Y_z = (0.6667 z + 0.6667)/(z^2 - 2 z + 1)
So my question is, is my matlab code wrong? Can I define with the matlab command c2d also the location where the sampler is placed?
Paul 2021 年 10 月 9 日
編集済み: Paul 2021 年 10 月 9 日
Not clear how that Matlab code would mimic the by-hand solution without seeing the by-hand solution. But I really doubt that it does. Did your by-hand solution solve for the Y(s) by ignoring the sampler and then discretizing the result?
I solved the problem by hand and then evaluated it in Matlab and got the same result as your by-hand solution. If you post your by-hand solution we can probably figure out how to implement it in Matlab.