Solution 9.10.2.2
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 91022mag.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 91022mag1.eps
phase1 = ( -angle(jw +p1) -angle(jw + p2) - angle(jw+p3) )*180/pi;;
semilogx(w,phase,'k-',wp,phase1,'kd')
grid on
print -deps 91022phase.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 rst
attens and then
starts upward, indicating twozeros.Itthen
attens and then starts down-
ward again indicating twopolestothe left of the twozeros. The phase plot,
shown in Figure 2 also inidcates the presence of twozerosby the fact that
phase swings from ;90
all the way backto30
.The asymptote of slope
+20 dB/dec through the in
ection pointgiveusarough idea of one pole
and one zero location. The twohorizontal asymptotes giveusanidea on
the other zero and pole. The slope of ;20 dB/dec has magnitude ;6dBat
1
10
-2
10
-1
10
0
10
1
10
2
10
3
-100
-80
-60
-40
-20
0
20
40
Figure 1: Bode magnitude plot
2
10
-2
10
-1
10
0
10
1
10
2
10
3
-30
-20
-10
0
10
20
30
40
Figure 2: Bode phase plot
3
10
-2
10
-1
10
0
10
1
10
2
10
3
-30
-20
-10
0
10
20
30
40
Figure 3: Comparison of acutal and propose Bode magnitude plots
! =1.Since, at low frequencies the only twoterms contributing are
K and
1
s
;;
we see that
K =10
;6=20
=0:5
Our rst guess at the transfer function is then transfer function is then
G(s) =
0:5(1+ s=5)(1+ s=10)
s(1 + s=100)(1+ s=300)
2
=
300(s+5)(s+10)
s(s +100)(s+300)
2
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 we should moveoneof the zeros to the
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 acutal and propose Bode phase plots
5
10
-2
10
-1
10
0
10
1
10
2
10
3
-30
-20
-10
0
10
20
30
40
Figure 5: Comparison of acutal and propose Bode magnitude plots
left. Wenexttry
G(s) =
0:5(1+ s=9)(1+ s=10)
s(1 + s=100)(1+ s=300)
2
=
166:7(s+5)(s +10)
s(s +100)(s+300)
2
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) =
0:5(1+ s=9)(1+ s=10)
s(1 + s=100)(1+ s=200)
2
=
111:11(s+5)(s +10)
s(s +100)(s+200)
2
The comparisons of magnitude and angle shown in Figures 7 and 9 show
that weare close. Asanalchoice wechoose
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 acutal and propose Bode phase plots
7
10
-2
10
-1
10
0
10
1
10
2
10
3
-30
-20
-10
0
10
20
30
40
Figure 7: Comparison of acutal and propose Bode magnitude plots
8
10
-2
10
-1
10
0
10
1
10
2
10
3
-100
-80
-60
-40
-20
0
20
40
Figure 8: Comparison of acutal and propose Bode phase plots
9
10
-2
10
-1
10
0
10
1
10
2
10
3
-30
-20
-10
0
10
20
30
40
Figure 9: Comparison of actual and derived Bode magnitude plots
G(s) =
0:5(1+ s=10)(1+ s=10)
s(1 + s=100)(1+ s=200)
2
=
100(s+10)(s+10)
s(s +100)(s+200)
2
Figures 9 and 10 showthatwehavenowidentied the transfer function.
The MATLAB program that does this analysis is
load bodeid2
topm = size(bodeid2)
top = topm(1,1)
w=bodeid2(1:top,1);;
mag = bodeid2(1:top,2);;
phase = bodeid2(1:top,3);;
semilogx(w,mag);;
grid on
print -deps 91022mag.eps
semilogx(w,phase);;
grid on
10
10
-2
10
-1
10
0
10
1
10
2
10
3
-100
-80
-60
-40
-20
0
20
40
Figure 10: Comparison of actual and derived Bode phase plots
11
print -deps 91022phase.eps
z1 = 5
z2 = 10
p1 = 0
p2 = 100
p3 = 300
Ktc = 0.5
K=(Ktc * p2 * p3)/(z1*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 91022mag1.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 91022phase1.eps
z1 = 9
z2 = 10
p1 = 0
p2 = 100
p3 = 300
Ktc = 0.5
K=(Ktc * p2 * p3)/(z1*z2)
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 91022mag2.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 91022phase2.eps
z1 = 9
z2 = 10
p1 = 0
p2 = 100
p3 = 200
Ktc = 0.5
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')
12
grid on
print -deps 91022mag3.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 91022phase3.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 91022mag4.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 91022phase4.eps
13