Solution 9.10.2.5 The MATLAB program load bodeid1 topm = size(bodeid1) top = topm(1,1) w=bodeid1(1:top,1);; mag = bodeid1(1:top,2);; phase = bodeid1(1:top,3);; semilogx(w,mag);; grid on print -deps 91025mag.eps p1 = 1 p2 = 10 p3 = 10 wp = logspace(-2,3,20);; jw = j*wp;; K=200;; p1 = 1;; p2 = 10;; p3 = 10;; mag1 = 20*log10( (K )./ (abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );; semilogx(w,mag,'k-',wp,mag1,'kd') grid on print -deps 91025mag1.eps phase1 = ( -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;; semilogx(w,phase,'k-',wp,phase1,'kd') grid on print -deps 91025phase.eps K=10^(6/20) can be used to load and plot the data. You will havetoedit this data le. You only wantthe rst 138 lines. There is some other data mistakenly appended. That should be deleted. Figure 1 shows the magnitude data with some asymptotes added. There is a pole at the origin for sure. The magnitude plot has a sharp peak downward ,indicating complex zeros, then attens and heads down at ;20 dB/dec. So wehavetwo zeros and three poles. The phase plot, shown in Figure 2 also inidcates the presence of two zeros by the fact that phase swings from ;160  all the waybackto;30  . The slope of ;20 dB/dec has magnitude 21 dB at ! =1. Since, at low frequencies the only two terms contributing are K and 1 s ;; 1 10 -2 10 -1 10 0 10 1 10 2 10 3 -60 -40 -20 0 20 40 60 80 Figure 1: Bode magnitude plot 2 10 -2 10 -1 10 0 10 1 10 2 10 3 -160 -140 -120 -100 -80 -60 -40 -20 Figure 2: Bode phase plot 3 10 -2 10 -1 10 0 10 1 10 2 10 3 -60 -40 -20 0 20 40 60 80 Figure 3: Comparison of acutal and propose Bode magnitude plots we see that K =10 21=20 =11:22 By laying in some asymnptotes, as shown in Figure 1 and and noting that the damping ratio of the complex poles is small wechoose G(s) = 11:22(s 2 =101+ (2=101)s+1) s(1 + s=1:5)(1+ s=50) = 8:33(s+1;j10)(s+1+j10) s(s +1:5)(s+50) The comparison of the Bode magnitude plot and the proposed magnitude plot is shown in Figure 3 A similar comparison of the phase plots is shown in Figure 4 Both plots indicate that weare reasonably close. We increase the gain a little bit and move the pole at s = ;50 to s = ;40 an try We 4 10 -2 10 -1 10 0 10 1 10 2 10 3 -160 -140 -120 -100 -80 -60 -40 -20 Figure 4: Comparison of acutal and propose Bode phase plots 5 10 -2 10 -1 10 0 10 1 10 2 10 3 -60 -40 -20 0 20 40 60 80 Figure 5: Comparison of acutal and propose Bode magnitude plots next try G(s) = 11:3(s 2 =101+ (2=101)s+1) s(1 + s=1:5)(1+ s=40) = 6:712(s+1;j10)(s+1+j10) s(s +1:5)(s+40) The results are shown in Figures 5 and 6. The matchismuchbetter but it looks likewe need to movepoleats = ;300 in towards the origin a bit. Then G(s) = 11:4(s 2 =101+ (2=101)s+1) s(1 + s=2)(1+ s=40) = 9:03(s+1;j10)(s+1+j10) s(s + 2)(s+40) The comparisons of magnitude and angle shown in Figures 7 and 7 show that weare close. Wehaveagoodmatchthus 6 10 -2 10 -1 10 0 10 1 10 2 10 3 -160 -140 -120 -100 -80 -60 -40 -20 Figure 6: Comparison of acutal and propose Bode phase plots 7 10 -2 10 -1 10 0 10 1 10 2 10 3 -60 -40 -20 0 20 40 60 80 Figure 7: Comparison of acutal and propose Bode magnitude plots 8 10 -2 10 -1 10 0 10 1 10 2 10 3 -160 -140 -120 -100 -80 -60 -40 -20 Figure 8: Comparison of acutal and propose Bode phase plots 9 G(s) = 12:6[s 2 =101+ (2=101)s+1] s(1+ s=2)(1+ s=40) = 10(s+1;j10)(s+1+j10)) s(s + 2)(s+40) The MATLAB program that does this analysis is load bodeid5 topm = size(bodeid5) top = topm(1,1) w=bodeid5(1:top,1);; mag = bodeid5(1:top,2);; phase = bodeid5(1:top,3);; semilogx(w,mag);; grid on print -deps 91025mag.eps semilogx(w,phase);; grid on print -deps 91025phase.eps z1 = 1 - j*10 z2 = 1 + j*10 p1 = 0 p2 = 1.5 p3 = 50 Ktc = 11.22 K=(Ktc *abs( p2) * abs(p3) )/(abs(z1)*abs(z2)) wp = logspace(-2,3,20);; jw = j*wp;; mag1 = 20*log10( (K*abs(jw + z1).*abs(jw +z2) ) ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );; semilogx(w,mag,'k-',wp,mag1,'kd') print -deps 91025mag1.eps phase1 = (angle(jw + z1) + angle(jw + z2) -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;; semilogx(w,phase,'k-',wp,phase1,'kd') grid on print -deps 91025phase1.eps pause z1 = 1 - j*10 z2 = 1 + j*10 p1 = 0 p2 = 1.5 p3 = 40 Ktc = 12.5 K=(Ktc * p2 * p3)/(z1*z2) 10 mag2 = 20*log10( (K*abs(jw + z1).*abs(jw +z2) ) ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );; semilogx(w,mag,'k-',wp,mag2,'kd') print -deps 91025mag2.eps phase2 = (angle(jw + z1) + angle(jw + z2) -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;; semilogx(w,phase,'k-',wp,phase2,'kd') grid on print -deps 91025phase2.eps z1 = 1 -j*10 z2 = 1 + j*10 p1 = 0 p2 = 2 p3 = 40 Ktc = 12.6 K=(Ktc * p2 * p3)/(z1*z2) mag3 = 20*log10( (K*abs(jw + z1).*abs(jw +z2) ) ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );; semilogx(w,mag,'k-',wp,mag3,'kd') grid on print -deps 91025mag3.eps phase3 = (angle(jw + z1) + angle(jw + z2) -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;; semilogx(w,phase,'k-',wp,phase3,'kd') grid on print -deps 91025phase3.eps z1 = 10 z2 = 10 p1 = 0 p2 = 100 p3 = 200 Ktc = 0.5 K=(Ktc * p2 * p3)/(z1*z2) mag4 = 20*log10( (K*abs(jw + z1).*abs(jw +z2) ) ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );; semilogx(w,mag,'k-',wp,mag4,'kd') grid on print -deps 91025mag4.eps phase4 = (angle(jw + z1) + angle(jw + z2) -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;; semilogx(w,phase,'k-',wp,phase4,'kd') grid on print -deps 91025phase4.eps 11