MATLAB: Discrete transfer fcn 1/z-1 (Z-transform) How it Works

simulinktransfer function

Hi,
i would like to ask you for little explanation of a simple model.
In this model is one Constant block with value = 1.
The second block is discrete transfer fcn with Z-Transform in this form : 1/z-1
time is set to 2 sec and the sample time of trans. fcn blok to 1. the result is 2 but why? how it works.. this concrete function 1/z-1
and in my view it works like this: 1*1^(-1) + 1*^(-2) = 2 (but im not sure, plz answer if its wrong or correct)
my next question is, can be z=1 , i think "z" in form at the page i pasted? or what the "z" is?
thank you very much. i hope its easy but i realy wondering about it a lot.

Best Answer

If the input of your system is u[n] and its output is Y[n] then
% H(z)=Y(z)/U(z)
% 1/(z-1)=Y(z)/U(z)
% which gives Y(z)(z-1)=U(z)
% zY(z)-Y(z)=U(z)
% In the temporal domain
% y[n+1]-y[n]=u[n]
% y[n+1]=y[n]+u[n]
% finaly: y[n]=y[n-1]+u[n-1]
% In your example
% y[1]=y[0]+u[0]= 0+1
% y[2]=y[1]+u[1]=1+1=2
% y[3]=y[2]+u[2]=2+1=3
% and so on