Solution 9.10.2.7 The MATLAB statements load bodeid7 topm = size(bodeid7) top = topm(1,1) w=bodeid7(1:top,1);; mag = bodeid7(1:top,2);; phase = bodeid7(1:top,3);; semilogx(w,mag);; grid on axis([0.01,100,-100,40]) print -deps 91027mag.eps semilogx(w,phase);; grid on axis([0.01,1000,-270,-140]) print -deps 91027phase.eps can be used to load the data and plot the magnitude response. Figure 1 shows the magnitude data with the asymptotes added. The transfer function weobtain from the asymptotes is then G(s)= K(s +1) s 2 (s +3)(s +22) : Atlow frequency the only twoterms that contribute are K and 1=s 2 . The term 1=s 2 byitselfpasses through ! =1at 0 dB. The acutal plot crosses ! =1at;20 dB. Thus wehave K =10 ;20=20 =0:1 Thus, our rst guess is G(s) = 0:1(s+1) s 2 (s +3)(s +22) = 6:6(z +1) s 2 (s +3)(s +22) 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 t is prettygood,but the phase t is not at good. It 1 10 -2 10 -1 10 0 10 1 10 2 -100 -80 -60 -40 -20 0 20 40 Figure 1: ABode magnitude plot 2 10 -2 10 -1 10 0 10 1 10 2 10 3 -100 -80 -60 -40 -20 0 20 40 Figure 2: Comparison of actual and derived Bode magnitude plots 3 10 -2 10 -1 10 0 10 1 10 2 10 3 -260 -240 -220 -200 -180 -160 -140 Figure 3: Comparison of actual and derived Bode phase plots 4 10 -2 10 -1 10 0 10 1 10 2 10 3 -100 -80 -60 -40 -20 0 20 40 Figure 4: Comparison of actual and derived Bode magnitude plots looks like the pole at s = ;3should be moved to the left. So wetry G(s) = 0:1(s+1) s 2 (s +5)(s +22) = 11(z +1) s 2 (s +5)(s +22) : As shown in Figures 4 and 5, the t is very good. Wemakeon nal adjustment, moving the pole at s = ;22 to s = ;20, so that G(s) = 0:1(s+1) s 2 (s +5)(s +20) = 10(z +1) s 2 (s +5)(s +20) : The magnitude and phase plots, shown in Figures 6 and 7, indicate that we have identti ed the transfer function. The complete MATLAB program 5 10 -2 10 -1 10 0 10 1 10 2 10 3 -260 -240 -220 -200 -180 -160 -140 Figure 5: Comparison of actual and derived Bode phase plots 6 10 -2 10 -1 10 0 10 1 10 2 10 3 -100 -80 -60 -40 -20 0 20 40 Figure 6: Comparison of actual and derived Bode magnitude plots 7 10 -2 10 -1 10 0 10 1 10 2 10 3 -260 -240 -220 -200 -180 -160 -140 Figure 7: Comparison of actual and derived Bode phase plots 8 that does this analysis is load bodeid7 topm = size(bodeid7) top = topm(1,1) w=bodeid7(1:top,1);; mag = bodeid7(1:top,2);; phase = bodeid7(1:top,3);; semilogx(w,mag);; grid on axis([0.01,100,-100,40]) print -deps 91027mag.eps semilogx(w,phase);; grid on axis([0.01,1000,-270,-140]) print -deps 91027phase.eps z1 = 1 p1 = 0 p2 = 0 p3 =3 p4 = 22 Ktc = 0.1 K=(Ktc * p3 * p4)/(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).*abs(jw + p4) ) );; semilogx(w,mag,'k-',wp,mag1,'kd') grid on axis([0.01,1000,-100,40]) print -deps 91027mag1.eps phase1 = (angle(jw + z1) -angle(jw +p1) -angle(jw + p2) - angle(jw+p3)-angle(jw + p4) )*180/pi;; semilogx(w,phase,'k-',wp,phase1,'kd') grid on axis([0.01,1000,-270,-140]) print -deps 91027phase1.eps z1 = 1 p1 = 0 p2 = 0 p3 = 5 p4 = 22 Ktc = 0.1 K=(Ktc * p3 * p4)/(z1) mag2 = 20*log10( (K*abs(jw + z1) ) 9 ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3).*abs(jw + p4) ) );; semilogx(w,mag,'k-',wp,mag2,'kd') grid on axis([0.01,1000,-100,40]) print -deps 91027mag2.eps phase2 = (angle(jw + z1) -angle(jw +p1) -angle(jw + p2) - angle(jw+p3)-angle(jw + p4) )*180/pi;; semilogx(w,phase,'k-',wp,phase2,'kd') grid on axis([0.01,1000,-270,-140]) print -deps 91027phase2.eps z1 = 1 p1 = 0 p2 = 0 p3 = 5 p4 = 20 Ktc = 0.1 K=(Ktc * p3 * p4)/(z1) mag3 = 20*log10( (K*abs(jw + z1) ) ./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3).*abs(jw + p4) ) );; semilogx(w,mag,'k-',wp,mag3,'kd') grid on axis([0.01,1000,-100,40]) print -deps 91027mag3.eps phase3 = (angle(jw + z1) -angle(jw +p1) -angle(jw + p2) -angle(jw+p3)-angle(jw + p4) )*180/pi;; semilogx(w,phase,'k-',wp,phase3,'kd') grid on axis([0.01,1000,-270,-140]) print -deps 91027phase3.eps 10