aminit;

%The sensitivity function for
%PI Control of a process with 4 equal lags
P = tf(1,[1 4 6 4 1]); 
%Controller parameters
k=0.8;%k=0.77506;
Ti=2;%Ti=2.0511;
ki=k/Ti;
T=0.5;
%---------------------------------------------------
%Prels
dencl=[1 4 6 4 1+k ki];numr=[k ki];
denp=[1 4 6 4 1];
S=tf(conv([1 0],denp),dencl);
w=logspace(-2,1,200);
one=ones(size(w));
sa=squeeze(bode(S,w));
subplot(2,1,1)
loglog(w,sa,'b-',w,one,'b-',0.32,1,'+',0.56,2.1,'o')
xlabel('x');ylabel('y');

amprint('procctrl-lagpi.eps');
