Solution 9.10.2.6
The MATLAB statements
load bodeid6
topm = size(bodeid6)
top = topm(1,1)
w=bodeid6(1:top,1);;
mag = bodeid6(1:top,2);;
phase = bodeid6(1:top,3);;
semilogx(w,mag);;
grid on
print -deps 91026mag.eps
semilogx(w,phase);;
grid on
print -deps 91026phase.eps
can be used to load the data and plot the magnitude response. You will
havetoedit this data le. You only wantthe rst 138 lines.
Figure 1 shows the magnitude data with the asymptotes added. The
transfer function we obtain from the asymptotes is then
G(s)=
K
s(s+ ;j!
d
)(s+ + j!
d
)
:
Atlow frequency the only twoterms that contribute are K and 1=s.There-
fore at s = j wehave
K =10
;18=20
=0:12589
The hump in the magnitude plot is about 18 dB, so weexpect
0:05 <<0:1:
The resonantfrequency is around 9 rad/s. So our rst guess is
G(s) =
0:12589
s[(s=
p
82)
2
+(2=82)s+1]
=
10:32
s(s+1;j9)(s+1+j9)
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 t is excellent, so wehavefound the transfer function. The
complete MATLAB program to nd the transfer function is
1
10
-2
10
-1
10
0
10
1
10
2
10
3
-160
-140
-120
-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
-160
-140
-120
-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
-280
-260
-240
-220
-200
-180
-160
-140
-120
-100
-80
Figure 3: Comparison of actual and derived Bode phase plots
4
load bodeid6
topm = size(bodeid6)
top = topm(1,1)
w=bodeid6(1:top,1);;
mag = bodeid6(1:top,2);;
phase = bodeid6(1:top,3);;
semilogx(w,mag);;
grid on
print -deps 91026mag.eps
semilogx(w,phase);;
grid on
print -deps 91026phase.eps
p1 = 0
p2 = 1 - j*9
p3 = 1 + j*9
Ktc = 10^(-18/20)
K=Ktc *abs( p2) * abs(p3)
wp = logspace(-2,3,20);;
jw = j*wp;;
mag1 = 20*log10( (K)./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );;
semilogx(w,mag,'k-',wp,mag1,'kd')
grid on
print -deps 91026mag1.eps
pause
phase1 = ( -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;;
semilogx(w,phase,'k-',wp,phase1,'kd')
grid on
print -deps 91026phase1.eps
p1 = 0
p2 = 1 - j*9
p3 = 1 + j*9
Ktc =
K=(Ktc *p1* p2 * p3)
mag2 = 20*log10( (K )./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );;
semilogx(w,mag,'k-',wp,mag2,'kd')
print -deps 91026mag2.eps
phase2 = ( -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;;
semilogx(w,phase,'k-',wp,phase2,'kd')
grid on
print -deps 91026phase2.eps
p1 = 1
p2 = 3 -j*3
p3 = 3 + j*3
Ktc = 2
K=Ktc*p1*p2*p3
5
mag3 = 20*log10( K./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3) ) );;
semilogx(w,mag,'k-',wp,mag3,'kd')
grid on
print -deps 91026mag3.eps
phase3 = ( -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;;
semilogx(w,phase,'k-',wp,phase3,'kd')
grid on
print -deps 91026phase3.eps
6