Solution 9.10.2.3 The MATLAB program load bodeid1 topm = size(bodeid3) top = topm(1,1) w=bodeid3(1:top,1);; mag = bodeid3(1:top,2);; phase = bodeid3(1:top,3);; semilogx(w,mag);; grid on print -deps 91023mag.eps can be used to load the data and plot the magnitude response. You will havetoedit this data le. You only want the rst 138 lines. There is some other data mistakenly appended. That should be deleted. Figure 1 shows the magnitude data with the asymptotes added. The transfer function we obtain from the asymptotes is then G(s)= K(1 +s=7) (1 +s=0:8)(1+ s=13)(1+s=200) : K =10 6=20 =2 Then G(s) = 2(1+ s=7) (1 +s=0:8)(1+s=13)(1+s=200) = 594Z(s+7) (s+0:8)(s+13)(s+ 200) Wecheckthe accuracy of the model bycomparing the actual magnitude and phase to the phase of the derived transfer function, as shown in Figures 2 and 3 The magnitude plot is very close. From the phase plot weseethat the zero is probably too far to the left in the s plane, so wetry G(s) = 2(1+ s=5) (1 +s=0:8)(1+s=13)(1+s=200) = 832(s+5) (s+0:8)(s+13)(s+ 200) 1 10 -2 10 -1 10 0 10 1 10 2 10 3 -70 -60 -50 -40 -30 -20 -10 0 10 Figure 1: ABode magnitude plot 2 10 -2 10 -1 10 0 10 1 10 2 10 3 -70 -60 -50 -40 -30 -20 -10 0 10 Figure 2: Comparison of actual and derived Bode magnitude plots 3 10 -2 10 -1 10 0 10 1 10 2 10 3 -180 -160 -140 -120 -100 -80 -60 -40 -20 0 Figure 3: Comparison of actual and derived Bode phase plots 4 10 -2 10 -1 10 0 10 1 10 2 10 3 -70 -60 -50 -40 -30 -20 -10 0 10 Figure 4: Comparison of actual and derived Bode magnitude plots 5 10 -2 10 -1 10 0 10 1 10 2 10 3 -180 -160 -140 -120 -100 -80 -60 -40 -20 0 Figure 5: Comparison of actual and derived Bode phase plots 6 Figures 4 and 5 We see that the zero is nowaboutright but the pole at s = ;13 needs to be moved to the right, so wetry G(s) = 2(1+ s=5) (1 +s=0:8)(1+s=10)(1+s=200) = 640(s+5) (s+0:8)(s+10)(s+ 200) The matechisnowperfect. Note that weonly need about twentypoints over four decades to get a prettygood tfor both the magnitude and phase. The MATLAB program that does this analysis is load bodeid3 topm = size(bodeid3) top = topm(1,1) w=bodeid3(1:top,1);; mag = bodeid3(1:top,2);; phase = bodeid3(1:top,3);; semilogx(w,mag);; grid on print -deps 91023mag.eps semilogx(w,phase);; grid on print -deps 91023phase.eps z1 = 7 p1 = 0.8 p2 = 13 p3 = 200 Ktc = 2 K=(Ktc *p1* p2 * p3)/(z1) wp = logspace(-2,3,20);; jw = j*wp;; mag1 = 20*log10( (K*abs(jw + z1) ) ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );; semilogx(w,mag,'k-',wp,mag1,'kd') grid on print -deps 91023mag1.eps phase1 = (angle(jw + z1) -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;; semilogx(w,phase,'k-',wp,phase1,'kd') grid on print -deps 91023phase1.eps z1 = 5 p1 = 0.8 p2 = 13 7 p3 = 200 Ktc = 2 K=(Ktc *p1* p2 * p3)/(z1) mag2 = 20*log10( (K*abs(jw + z1) ) ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );; semilogx(w,mag,'k-',wp,mag2,'kd') grid on print -deps 91023mag2.eps phase2 = (angle(jw + z1) -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;; semilogx(w,phase,'k-',wp,phase2,'kd') grid on print -deps 91023phase2.eps z1 = 5 p1 = 0.8 p2 = 10 p3 = 200 Ktc =2 K=(Ktc *p1* p2 * p3)/(z1) mag3 = 20*log10( (K*abs(jw + z1) ) ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );; semilogx(w,mag,'k-',wp,mag3,'kd') grid on print -deps 91023mag3.eps phase3 = (angle(jw + z1) -angle(jw +p1)-angle(jw + p2) -angle(jw+p3) )*180/pi;; semilogx(w,phase,'k-',wp,phase3,'kd') grid on print -deps 91023phase3.eps 8