
Let's say that we have a system that looks like this:

where G(s) is:
(s + 1) (s + 3) ------------------- s^2 (s + 2)(s + 3)
Let's look at the closed-loop response for this system when we use different inputs:
num = conv([1 1],[1 3]); den = conv([1 2],[1 3]); den = conv(den,[1 0]); den = conv(den,[1 0]); sys = tf(num,den); sys_cl = feedback(sys,1); [y,t] = step(sys_cl); u = ones(size(t)); plot(t,y,'b',t,u,'g')

Our steady-state error is zero.
num = conv([1 1],[1 3]);
den = conv([1 2],[1 3]);
den = conv(den,[1 0]);
den = conv(den,[1 0]);
sys = tf(num,den);
sys_cl = feedback(sys,1);
t = 0:0.1:50;
u = t;
[y,t,x] = lsim(sys_cl,u,t);
plot(t,y,'b',t,u,'m')
xlabel('Time(secs)')
ylabel('Amplitude')
title('Input-purple, Output-yellow')

Our steady-state error is zero.
num = conv([1 1],[1 3]);
den = conv([1 2],[1 3]);
den = conv(den,[1 0]);
den = conv(den,[1 0]);
sys = tf(num,den);
sys_cl = feedback(sys,1);
t = 0:0.1:20;
u = 0.5*t.*t;
[y,x] = lsim(sys_cl,u,t);
plot(t,y,'b',t,u,'m')
xlabel('Time(secs)')
ylabel('Amplitude')
title('Input-purple, Output-blue')

Our steady-state error is constant, but it's kind of hard to see. Therefore, we will zoom in to show this steady-state error:
axis([10,14,50,100])
