Solution 4.6.4.7
The closed loop transfer function is
T(c(s) =
K
(s+2)(s+4)
1+
K
(s+2)(s+4)
=
K
s
2
+6s +(8+K)
:
The characteristic equation is
s
2
+6s+(8+K)=0:
The MATLAB program
K=0.5
p=[1 6 8+K]
roots(p)
K=1
p=[1 6 8+K]
roots(p)
K=2
p=[1 6 8+K]
roots(p)
K=10
p=[1 6 8+K]
roots(p)
K=[0.5 1 2 10]
gh = zpk([],[-2 -4],1)
[R,K] = rlocus(gh,K)
plot(R,'kd')
print -deps rl4647.eps
generates the following output
EDU>sm4647
K=
0.50000000000000
1
p=
1.00000000000000 6.00000000000000 8.50000000000000
ans =
-3.70710678118655
-2.29289321881345
K=
1
p=
1 6 9
ans =
-3
-3
K=
2
p=
1 6 10
ans =
2
-3.00000000000000 + 1.00000000000000i
-3.00000000000000 - 1.00000000000000i
K=
10
p=
1 6 18
ans =
-3.00000000000000 + 3.00000000000000i
-3.00000000000000 - 3.00000000000000i
K=
0.50000000000000 1.00000000000000 2.00000000000000 10.00000000000000
Zero/pole/gain:
1
-----------
(s+2) (s+4)
R=
Columns 1 through 2
-3.70710678118655 -3.00000000000000
-2.29289321881345 -3.00000000000000
Columns 3 through 4
3
-3.8 -3.6 -3.4 -3.2 -3 -2.8 -2.6 -2.4 -2.2
-3
-2
-1
0
1
2
3
Figure 1: Plot of solutions
-3.00000000000000 + 1.00000000000000i -3.00000000000000 + 3.00000000000000i
-3.00000000000000 - 1.00000000000000i -3.00000000000000 - 3.00000000000000i
K=
0.50000000000000
1.00000000000000
2.00000000000000
10.00000000000000
EDU>
The plot of the points is shown in Figure 1
For K =0:5, the closed loop transfer function is
T
c
(s)=
0:5
(s+2:29289)(s+3:7071)
:
4
Then the step response is
C(s)=
0:5
s(s+2:29289)(s+3:7071)
=
D
1
s
+
D
2
s2:29289
+
D
3
s +3:7071
:
The residues A and M are determined bythefollowing MATLAB program,
whichalso plots the step response, shown in Figure 2.
K=0.5
p0 = 0
p1 = 2.29289
p2 = 3.7071
v0 = [1 p0]
v1 = [1 p1]
v2 = [1 p2]
B=K
A=conv(v0,v1)
A=conv(A,v2)
[R,P,K1] = residue(B,A)
t=0
dt = 0.01
kount = 1
while t<6
c(kount) = R(3) + R(2)*exp(-p1*t) +R(1)*exp(-p2*t);;
time(kount) = t;;
t=t+dt;;
kount = kount + 1;;
end
plot(time,c)
print -deps sr4647a.eps
The step response can also be generated by the MATLAB dialogue
EDU>g = zpk([],[-2 -4],0.5)
Zero/pole/gain:
0.5
-----------
(s+2) (s+4)
EDU>tc = feedback(g,1)
5
0 1 2 3 4 5 6
0
0.01
0.02
0.03
0.04
0.05
0.06
Figure 2: Step Response for K =0:5
Zero/pole/gain:
0.5
-------------------
(s+3.707) (s+2.293)
EDU>step(tc)
EDU>print -deps sr4647aa.eps
EDU>
For K =1,therearetwo closed loop poles are at s = ;3. For K =2,
the poles of the closed loop systme are at s = ;1j.Thus, the closed loop
transfer function is
T
c
(s)=
1
(s+3)
2
:
Then the step response is
C(s) =
1
s(s +3)
2
=
D
1
s
+
D
2
s+3
+
M
(s+3)
2
:
6
Then
D
1
=
1
(s+3)
2
s=0
=
1
9
D
2
=
d
ds
1
s
s=;3
=
;1
s
2
s=;3
=
;1
9
D
3
=
1
s
s=;3
=
;1
3
The residues D
1
, D
2
and D
3
can also be determined by the MATLAB pro-
gram
K=1
p0 = 0
p1 = 3
p2 = 3
v0 = [1 p0]
v1 = [1 p1]
v2 = [1 p2]
B=K
A=conv(v0,v1)
A=conv(A,v2)
[R,P,K1] = residue(B,A)
t=0
dt = 0.01
kount = 1
while t<6
c(kount) = R(3) + R(1)*exp(-p1*t) +R(2)*t*exp(-p1*t);;
time(kount) = t;;
t=t+dt;;
kount = kount + 1;;
7
0 1 2 3 4 5 6
0
0.02
0.04
0.06
0.08
0.1
0.12
Figure 3: Step Response for K =1
end
plot(time,c)
print -deps sr4647b.eps
whichalso plots the step response, shown in Figure 3.
The step response can also be found using the MATLAB dialogue:
EDU>clear all
EDU>g = zpk([],[-2 -4],1)
Zero/pole/gain:
1
-----------
(s+2) (s+4)
EDU>tc = feedback(g,1)
Zero/pole/gain:
1
-------
8
(s+3)^2
EDU>step(tc)
EDU>print -deps sr4647bb.eps
EDU>
For K =2,the closed loop transfer function is
T
c
(s)=
2
(s+3;j)(s+3+j)
:
Then the step response is
C(s)=
2
s(s +3;j)(s+3+j)
=
D
1
s
+
M
s+3;j
+
C
s +3+j
:
The residues D
1
and M are determined by the MATLAB program
K=2
p0 = 0
p1 = 3 + j
p2 = conj(p1)
v0 = [1 p0]
v1 = [1 p1]
v2 = [1 p2]
B=K
A=conv(v0,v1)
A=conv(A,v2)
[R,P,K1] = residue(B,A)
M=R(1)
absm =abs(M)
abs2m = 2*abs(M)
angm =angle(M)
sigma = real(p1)
omega = imag(p1)
t=0
dt = 0.01
kount = 1
while t<6
c(kount) = R(3) + +2*absm*exp(-sigma*t)*cos(omega*t + angm);;
time(kount) = t;;
t=t+dt;;
9
0 1 2 3 4 5 6
-0.05
0
0.05
0.1
0.15
0.2
0.25
0.3
Figure 4: Step Response for K =2
kount = kount + 1;;
end
plot(time,c)
whichalso plots the step response, shown in Figure 4.
For K = 10, the closed loop transfer function is
T
c
(s)=
10
(s+3;j3)(s+3+j3)
:
Then the step response is
C(s)=
10
s(s+3;j3)(s+3+j3)
=
D
1
s
+
M
s+3;3j
+
C
s +3+3j
:
The residues D
1
and M are determined by the MATLAB program
K=10
p0 = 0
p1 = 3 + j*3
p2 = conj(p1)
10
v0 = [1 p0]
v1 = [1 p1]
v2 = [1 p2]
B=K
A=conv(v0,v1)
A=conv(A,v2)
[R,P,K1] = residue(B,A)
M=R(1)
absm =abs(M)
abs2m = 2*abs(M)
angm =angle(M)
sigma = real(p1)
omega = imag(p1)
t=0
dt = 0.01
kount = 1
while t<6
c(kount) = R(3) + +2*absm*exp(-sigma*t)*cos(omega*t + angm);;
time(kount) = t;;
t=t+dt;;
kount = kount + 1;;
end
plot(time,c)
print -deps sr4647d.eps
whichalso plots the step response, shown in Figure 5.
11
0 1 2 3 4 5 6
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
Figure 5: Step Response for K =2
12