Determine the output of the given Block diagram

2 ビュー (過去 30 日間)
Mark S
Mark S 2021 年 10 月 9 日
編集済み: Mark S 2021 年 10 月 10 日
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:
clear all
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?
Thank you!


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.
  3 件のコメント
Mark S
Mark S 2021 年 10 月 10 日
"Excellent (but replace the 5 with an s!)." Yes you are right.
I got it now, thank you very much! It is not so easy to do this calculation with matlab. But now I have understood it.


その他の回答 (0 件)




Community Treasure Hunt

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

Start Hunting!

Translated by