Solution 4.6.4.1
The closed loop transfer function is
K(s+1)
s
2
1+
K(s+1)
s
2
=
K(s+1)
s
2
+ Ks+ K
:
The characteristic equation is
s
2
+Ks+K =0:
The MATLAB program
K=2
p=[1 K K]
roots(p)
K=4
p=[1 K K]
roots(p)
K=20
p=[1 K K]
roots(p)
K=[2 40 20]
gh = zpk([],[-1 -10],1)
[R,K] = rlocus(gh,K)
plot(R,'kd')
print -deps rl4641.eps
generates the following output
EDU>sm4641
K=
2
p=
1 2 2
1
ans =
-1.0000+ 1.0000i
-1.0000- 1.0000i
K=
4
p=
1 4 4
ans =
-2
-2
K=
20
p=
1 20 20
ans =
-18.9443
-1.0557
K=
2
2 40 20
Zero/pole/gain:
1
------------
(s+1) (s+10)
R=
-9.7720 -5.5000+ 4.4441i -6.0000
-1.2280 -5.5000- 4.4441i -5.0000
K=
2
40
20
EDU>
EDU>
The plot of the points is shown in Figure 1
For K =2,the poles of the closed loop systme are at s = ;1j.Thus,
the closed loop transfer function is
T
c
(s)=
2(s+1)
(s+1;j)(s+1+j)
:
Then the step response is
C(s)=
2(s+1)
s(s+1;j)(s+1+j)
=
A
s
+
M
s+1;j
+
M
s+1+j
:
The residues A and M are determined bythefollowing MATLAB program,
whichalso plots the step response, shown in Figure 2.
K=2;;
p0 = [1 0];;
p1 = [1 1+j*1];;
3
-20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Figure 1: Plot of solutions
p2 = [1 1-j*1];;
B=2*[1 1]
A=conv(p1,p2);;
A=conv(A,p0)
[R,P,K] = residue(B,A)
M=R(1)
absm =abs(M)
abs2m = 2*abs(M)
angm =angle(M)
test = 1 + 2*abs(M)*cos(angle(M))
t=0
dt = 0.1
kount = 1
while t<3
c(kount) = 1+0.02728*exp(-1.1436*t) +2*absm*exp(-2.928*t)*cos(3*t + angm);;
time(kount) = t;;
t=t+dt;;
kount = kount + 1;;
4
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Figure 2: Step Response for K =2
end
plot(time,c)
print -deps sr4641a.eps
For K =4,therearetwo closed loop poles are at s = ;2. For K =2,
the poles of the closed loop systme are at s = ;1j.Thus, the closed loop
transfer function is
T
c
(s)=
4(s+1)
(s =2)
2
:
Then the step response is
C(s)=
4(s+1)
s(s+2)
2
=
A
s
+
B
s+2
+
C
(s+2)
2
:
Then
A =
4(s+1)
(s+2)
2
s=0
= 1
5
B =
d
ds
4(s+1)
s
s=;2
=
d
ds
;4(s+1)
s
2
+
4
s
s=;2
=
;4s;4+4s
(s+2)
2
s=;2
= ;1
C =
4(s+1)
s
s=;2
= 2
The residues A, B, and C are determined bytheMATLAB program
K=4;;
p0 = [1 0]
p1 = [1 2]
p2 = [1 2]
B=K*[1 1]
A=conv(p1,p2)
A=conv(A,p0)
[R,P,K] = residue(B,A)
A=R(3)
B=R(1)
C= R(2)
t=0
dt = 0.1
kount = 1
while t<3
c(kount) = 1+B*exp(-2*t) +C*t*exp(-2*t);;
time(kount) = t;;
t=t+dt;;
kount = kount + 1;;
end
plot(time,c)
print -deps sr4641b.eps
whichalso plots the step response, shown in Figure 3. For K =20, there
6
0 0.5 1 1.5 2 2.5 3
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Figure 3: Step Response for K =4
are two closed loop poles are at s = ;1:0557 and s = ;18:9443 Thus, the
closed loop transfer function is
T
c
(s)=
20(s+1)
(s+1:0557)(s+18:9443)
:
Then the step response is
C(s)=
20(s+1)
s(s+1:0557)(s+18:9443)
=
A
s
+
B
s+1:0557
+
C
s+18:9443
:
The residues A, B, and C are determined by theMATLAB program
K=20;;
p0 = [1 0]
p1 = [1 1.0557]
p2 = [1 18.9443]
B=K*[1 1]
A=conv(p1,p2)
A=conv(A,p0)
7
0 0.5 1 1.5 2 2.5 3
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
Figure 4: Step Response for K =4
[R,P,K] = residue(B,A)
A=R(3)
B=R(2)
C= R(1)
t=linspace(0,3,100);;
A=ones(100,1)
c=A+(B*exp(-1.0557*t))'+(C*exp(-18.9443*t))'
plot(t,c)
print -deps sr4641c.eps
whichalso plots the step response, shown in Figure 4.
8