Solution 10.8.8.5 The MATLAB program w=logspace(-2,3,200);; s=j*w;; K=100 z1 = 1 p1 = 0 p2 = 0 p3 = 5 p4 = 30 mag = 20*log10( abs( ( K.*(s + z1) ) ./ ( (s + p1).*(s + p2).*(s +p3).*(s + p4) ) ) );; phase = (angle(s + z1) -angle(s + p1)-angle(s + p2) -angle(s + p3)-angle(s + p4) )*180/pi;; plot(phase,mag);; grid on axis([-260,-60,-80 40]) print -deps 10885logmag.eps g=zpk([-z1],[-p1 -p2 -p3 -p4],100) K=linspace(0,1600,500);; [P,K] = rlocus(g,K);; plot(real(P),imag(P),'k.') grid on print -deps 10885rl.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 10885bodema.eps draws the log magnitude plot shown in Figure 1 With K =100thegain margin is about 35 dB. Converting to a real number wehave 10 30=20 =31:6227: Thus, the system is stable for 0 <K<3;;162:7: The same information is available from the Bode magnitude and phase plots as shown in Figure 2 By tracing the arrows from the phase scale at ;180  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 2 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 2: Bode phase and magnitude plots for K =100 3 -70 -60 -50 -40 -30 -20 -10 0 10 20 -50 -40 -30 -20 -10 0 10 20 30 40 50 Figure 3: Root locus to where it intercepts the phase plot and then going up to the magnitude plot and thence to the magnitude scale we nd, again, that the gain margin is about 35 dB. From the Bode plot wegetthe additional information that the root locus will cross the imaginary axis at about ! =9. The root locus is shown in Figure 3. As can be seen, twolimbs of the root locus cross into the righthalf place at ! 9. 4