%Exercise 6.2
%Example which shows that delay may help in some cases

%n = order of pade approx
n=5;
pade=1;
delay = nd2sys([-0.5/n 1],[0.5/n 1]);
for i=1:n pade=mmult(pade,delay); end

%Plant (6.20);
g21 = mmult(0.99,pade);
G = abv(sbs(1,1),sbs(g21,1));
omega=logspace(-2,2,401);  
Gf= frsp(G,omega);
figure(1);
vplot('liv,lm',vrga(Gf),1,':');

ks=[0.1 1 8];
for i=1:3,
  k=ks(i);
  dynk = nd2sys(1,[1 1.e-6],k); K = daug(dynk,dynk);
  L = mmult(G,K); S = minv(madd(eye(2),L)); spoles(S)
  Sf = frsp(S,omega);
  figure;
  vplot('liv,lm',Sf,1,':');
  axis([0.01,100,.01,2]); 
end



