Solution 4.6.4.5 The closed loop transfer function is K(s+1) s 2 (s+4) 1+ K(s+1) s 2 (s+4) = K(s+1) s 3 +4s 2 +Ks+ K : The characteristic equation is s 3 +4s 2 +Ks+ K =0: The MATLAB program K=1 p=[1 4 KK] roots(p) K=6 p=[1 4 KK] roots(p) K=20 p=[1 4 K K] roots(p) K=[1 4 20] gh = zpk([-1],[0 0 -4],1) [R,K] = rlocus(gh,K) plot(R,'kd') print -deps rl4645.eps produces the output \begin{verbatim} EDU>sm4645 K= 1 p= 1 4 1 1 1 ans = -3.8063 -0.0968+ 0.5033i -0.0968- 0.5033i K= 6 p= 1 4 6 6 ans = -2.5747 -0.7126+ 1.3500i -0.7126- 1.3500i K= 20 p= 1 4 20 20 ans = -1.3989+ 3.8314i -1.3989- 3.8314i -1.2022 2 K= 1 4 20 Zero/pole/gain: (s+1) --------- s^2 (s+4) R= -3.8063 -3.1304 -1.3989+ 3.8314i -0.0968+ 0.5033i -0.4348+ 1.0434i -1.2022 -0.0968- 0.5033i -0.4348- 1.0434i -1.3989- 3.8314i K= 1 4 20 EDU> The plot of the points is shown in Figure 1 For K =1,the poles of the closed loop systme are at s = ;1j.Thus, the closed loop transfer function is T c (s)= (s+1) (s+3:8063)(s+0:0968;j0:5033)(s+0:0968+j0:5033) : Then the step response is C(s) = (s+1) s(s+3:8063)(s+0:0968;j0:5033)(s+0:0968;j0:5033) = R 1 s + R 2 s+3:8063 + M s +0:0968;j0:5033 + M  s+0:0968+ j0:5033 : The residues R 1 , R 2 , and M are determined by the following MATLAB program, whichalso plots the step response, shown in Figure 2. 3 -4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 -4 -3 -2 -1 0 1 2 3 4 Figure 1: Plot of solutions K=1;; p0 = 0 p1 = 3.8063 p2 = 0.0968 + j*0.5033 p3 = conj(p2) v0 = [1 p0] v1 = [1 p1] v2 = [1 p2] v3 = [1 p3] B=K*[1 1] A=conv(v0,v1) A=conv(A,v2) A=conv(A,v3) [R,P,K1] = residue(B,A) M=R(2) absm =abs(M) abs2m = 2*abs(M) angm =angle(M) 4 0 5 10 15 20 25 30 35 40 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Figure 2: Step Response for K =1 sigma = real(p2) omega = imag(p2) t=0 dt = 0.1 kount = 1 while t<40 c(kount) = R(4) + R(1)*exp(-p1*t) +2*absm*exp(-sigma*t)*cos(omega*t + angm);; time(kount) = t;; t=t+dt;; kount = kount + 1;; end plot(time,c) print -deps sr4645a.eps The response can also be generated bytheMATLAB dialogue: EDU>clear all EDU>g = zpk([-1],[0 0 -4],1) Zero/pole/gain: 5 (s+1) --------- s^2 (s+4) EDU>h = 1 h= 1 EDU>tc = feedback(g,h) Zero/pole/gain: (s+1) ---------------------------------- (s+3.806) (s^2 + 0.1937s + 0.2627) EDU>step(tc) EDU>print -deps sr4645aa.eps EDU> The response is shown in Figure 3, and clearly same response we obtained above. For K =6,the closed loop transfer function is T c (s)= 6(s+1) (s+2:5747)(s+0:7126;j1:35)(s+0:7126+j1:35) : Then the step response is C(s) = 6(s+1) s(s+2:5747)(s+0:7126;j1:35)(s+0:7126+j1:35) = R 1 s + R 2 s+2:5747 + M s +0:7126;j1:35 + M s+0:7126;+j1:35 : Then the MATLAB program K=6;; p0 = 0 p1 = 2.5747 p2 = 0.7126 + j*1.3500 p3 = conj(p2) 6 Time (sec.) A mp li tu d e Step Response 0 10 20 30 40 50 60 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Figure 3: Step Response for K =1using MATLAB 7 v0 = [1 p0] v1 = [1 p1] v2 = [1 p2] v3 = [1 p3] B=K*[1 1] A=conv(v0,v1) A=conv(A,v2) A=conv(A,v3) [R,P,K1] = residue(B,A) M=R(2) absm =abs(M) abs2m = 2*abs(M) angm =angle(M) sigma = real(p2) omega = imag(p2) t=0 dt = 0.01 kount = 1 while t<8 c(kount) = R(4) + R(1)*exp(-p1*t) +2*absm*exp(-sigma*t)*cos(omega*t + angm);; time(kount) = t;; t=t+dt;; kount = kount + 1;; end plot(time,c) print -deps sr4645a.eps generates the residues and the step response shown in Figure 4. The step response can also be generated by the MATLAB program EDU>g = zpk([-1],[0 0 -4],6) Zero/pole/gain: 6 (s+1) --------- s^2 (s+4) EDU>h = 1 h= 8 0 1 2 3 4 5 6 7 8 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Figure 4: Step Response for K =6 1 EDU>tc = feedback(g,h) Zero/pole/gain: 6(s+1) ------------------------------- (s+2.575) (s^2 + 1.425s + 2.33) EDU>step(tc) EDU> For K = 20, there are twoclosed 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:2022)(s+1:3989;j3:8314)(s+1:3989+j3:8314) : 9 Then the step response is C(s) = 20(s+1) s(s+1:3989;j3:8314)(s+1:3989+j3:8314) = R 1 s + R 2 s+1:2022 + M s +1:3989;j3:8314) + M  s+1:3989+j3:8314) : The residues R 1 , R 2 ,andM are determined by theMATLAB program K=20;; p0 = 0 p1 = 1.2022 p2 = 1.3989 + j*3.8314 p3 = conj(p2) v0 = [1 p0] v1 = [1 p1] v2 = [1 p2] v3 = [1 p3] B=K*[1 1] A=conv(v0,v1) A=conv(A,v2) A=conv(A,v3) [R,P,K1] = residue(B,A) M=R(2) absm =abs(M) abs2m = 2*abs(M) angm =angle(M) sigma = real(p2) omega = imag(p2) t=0 dt = 0.01 kount = 1 while t<5 c(kount) = R(4) + R(3)*exp(-p1*t) +2*absm*exp(-sigma*t)*cos(omega*t + angm);; time(kount) = t;; t=t+dt;; kount = kount + 1;; end plot(time,c) print -deps sr4645c.eps whichalso plots the step response, shown in Figure 5. 10 0 0.5 1 1.5 2 2.5 3 3.5 4 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Figure 5: Step Response for K =20 11