Solution 10.8.8.7 The MATLAB program w=logspace(-2,3,200);; s=j*w;; K=100 z1 = 3 z2 = 5 p1 = 0 p2 = 0 p3 = 10 p4 = 15 p5 = 20 mag = 20*log10( abs((K.*(s+z1).*(s+z2))./((s+p1).*(s+p2).*(s+p3).*(s+p4).*(s+p5))));; phase = (angle(s+z1)+angle(s+z1)-angle(s+p1)-angle(s+p2);; phase = phase-angle(s +p3)-angle(s +p4)-angle(s+p5))*180/pi;; plot(phase,mag);; grid on axis([-260,-60,-80 40]) print -deps 10887logmag.eps K=50000 maga = 20*log10( abs((K.*(s+z1).*(s+z2))./((s+p1).*(s+p2).*(s+p3).*(s+p4).*(s+p5))));; phasea = (angle(s+z1)+angle(s+z1)-angle(s+p1)-angle(s+p2);; phasea = phasea -angle(s +p3)-angle(s +p4)-angle(s+p5))*180/pi;; plot(phase,mag,'k-',phasea,maga,'k--');; grid on axis([-260,-60,-80 80]) print -deps 10887logmaga.eps g=zpk([-z1 -z1],[-p1 -p2 -p3 -p4 -p5],100) K=linspace(0,1600,500);; [P,K] = rlocus(g,K);; plot(real(P),imag(P),'k.') grid on print -deps 10887rl.eps pause subplot(2,1,1),semilogx(w,mag) grid on axis([0.1 1000 -80 20]) subplot(2,1,2), semilogx(w,phase) grid on axis([0.1 1000 -280 -60]) print -deps 10887bodema.eps 1 -260 -240 -220 -200 -180 -160 -140 -120 -100 -80 -60 -80 -60 -40 -20 0 20 40 The point (-1,0) Figure 1: Log magnitude chart for K = 100 draws the log magnitude plot shown in Figure 1 With K =100thegain margin is about 42 dB. Converting to a real number wehave 10 42=20 =125:89: Thus, the system is stable for 0 <K<12;;589: Figure 2 Shows the log magnitude plot for both a stable and unstable value of K. The same information is available from the Bode magnitude and phase plots as shown in Figure 3 By tracing the arrows from the phase scale at ;180  to where it intercepts the phase plot and then going up to the mag- nitude plot and thence to the magnitude scale we nd, again, that the gain margin is about 42 dB. From the Bode plot weget the additional information that the root locus will cross the imaginary axis at about ! =20. The root locus is shown in Figure 4. As can be seen, twolimbs of the root locus cross into the righthalf place at ! 20. 2 -260 -240 -220 -200 -180 -160 -140 -120 -100 -80 -60 -80 -60 -40 -20 0 20 40 60 80 The point (-1,0) K = 50,000 K = 100 Figure 2: Log magnitude chart for K =100andK =50;;000 3 10 -1 10 0 10 1 10 2 10 3 -80 -60 -40 -20 0 20 10 -1 10 0 10 1 10 2 10 3 -250 -200 -150 -100 Figure 3: Bode phase and magnitude plots for K =100 4 -70 -60 -50 -40 -30 -20 -10 0 10 20 -50 -40 -30 -20 -10 0 10 20 30 40 50 Figure 4: Root locus 5