%Figure 7.2
%
close all
w=logspace(-2,1,101);
%Plant of (7.9) forms inside edge
k=2;tau=3;theta=2;
Gf1=mmult(frsp(nd2sys(1,[tau 1],k),w),delay(theta,w));

%plant of (7.9) forms outside edge
k=3;tau=2;theta=3;
Gf2=mmult(frsp(nd2sys(1,[tau 1],k),w),delay(theta,w));

%Edges of uncertain region
vplot('nyq',Gf1,'r--',Gf2,'r--');hold
X=axis;
plot(X(1:2),[0 0],'w-',[0 0],X(3:4),'w-');
axis('square');
drawnow

K=[2 3];
Tau=linspace(2,3,11);
Theta=linspace(2,3,11);
%Given frequencies.
W=[0.01 0.05 0.2 0.5 1 2 7];
for i=1:length(W),
  w=W(i)
  gf=uncreg(w); %Uncertainty region
  plot(real(gf),imag(gf),'-');drawnow;
end
