Solution 4.6.4.2
The closed loop transfer function is
(s+1)
s
2
1+
K(s+1)
s
2
=
(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)=
(s+1)
(s+1;j)(s+1+j)
:
Then the step response is
C(s)=
(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)
A= R(3)
absm =abs(M)
abs2m = 2*abs(M)
angm =angle(M)
test = 1 + 2*abs(M)*cos(angle(M))
t=0
dt = 0.025
kount = 1
while t<5
c(kount) = A+abs2m*exp(-1*t) *cos(t*t + angm);;
time(kount) = t;;
t=t+dt;;
4
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Figure 2: Step Response for K =2
kount = kount + 1;;
end
plot(time,c)
print -deps sr4641a.eps
For K =4,there are twoclosed loop poles are at s = ;2. Thus, the
closed loop transfer function is
T
c
(s)=
(s+1)
(s =2)
2
:
Then the step response is
C(s)=
(s+1)
s(s+2)
2
=
A
s
+
B
s+2
+
C
(s+2)
2
:
Then
A =
(s+1)
(s+2)
2
s=0
= 0:25
5
B =
d
ds
(s+1)
s
s=;2
=
d
ds
(s+1)
s
2
+
1
s
s=;2
=
;s;1+s
(s+2)
2
s=;2
= ;0:25
C =
(s+1)
s
s=;2
= 0:5
The residues A, B, and C are determined bytheMATLAB program
p0 = [1 0]
p1 = [1 2]
p2 = [1 2]
B=[11]
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) = A+B*exp(-2*t) +C*t*exp(-2*t);;
time(kount) = t;;
t=t+dt;;
kount = kount + 1;;
end
plot(time,c)
print -deps sr4642b.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 3.5 4 4.5 5
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
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)=
(s+1)
(s+1:0557)(s+18:9443)
:
Then the step response is
C(s)=
(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
p0 = [1 0]
p1 = [1 1.0557]
p2 = [1 18.9443]
B=[11]
A=conv(p1,p2)
A=conv(A,p0)
[R,P,K] = residue(B,A)
A=R(3)
7
0 0.5 1 1.5 2 2.5 3
-0.01
0
0.01
0.02
0.03
0.04
0.05
0.06
Figure 4: Step Response for K =20
B=R(2)
C= R(1)
t=linspace(0,3,100);;
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