2 Solutions to Questions Question 1 a) System poles occur at the roots of the denominator of 5 5 = s2 + 11s + 10 (s + 1)(s + 10) G(s) = The poles are at s = −1, s = −10. There are no zeros. The poles are in the left half plane so the system is stable. b) The steady state gain of the system is 0.5 = −3dB. There are break points at frequencies s = 1rad/s and s = 10 rad/s, with attenuation of 40 dB per decade at high frequencies. As there are 2 poles and no zeros the total phase lag is 180o at high frequencies. One way to draw the Bode plot in Matlab is to use the commands: >> s=tf(’s’); >>G=5/(s^2+11*s+10); >>bode(G); The result is shown in Figure 2.1. Bode Diagram Magnitude (dB) 0 −20 −40 −60 −80 Phase (deg) −100 0 −45 −90 −135 −180 −2 10 −1 10 0 1 10 10 2 10 Frequency (rad/sec) Figure 2.1: Bode plot of G(s) 4 3 10 The Nyquist plot starts at the point (0.5+0j), proceeds with negative phase, crosses the imaginary axis and terminates at the origin. It has a phase of −180o as it approaches the origin. The Nyquist plot is drawn with the command: >>nyquist(G); The result is shown in Figure 2.2. Nyquist Diagram 0.3 0.2 Imaginary Axis 0.1 0 −0.1 −0.2 −0.3 −0.4 −0.2 −0.1 0 0.1 0.2 Real Axis 0.3 0.4 0.5 Figure 2.2: Nyquist plot of G(s) c) i) The closed loop transfer function from r to y is Gyr (s) = K(s)G(s) 1 + K(s)G(s) ii) The closed loop transfer function from r to e is Gye (s) = 1 1 + K(s)G(s) Gyr (s) is then 1 50(1+s) s(s+1)(s+10) 50(1+s) + s(s+1)(s+10) 50 s(s + 10) + 50 50 = 2 s + 10s + 50 = In the transfer function from r to y there are no closed loop zeros; the closed loop poles are at s = −5 + 5i and s = −5 − 5i. The steady state gain in closed loop is 1 because of the presence of the integrator in the loop. 5 Bode Diagram Magnitude (dB) 0 −20 −40 −60 Phase (deg) −80 0 −45 −90 −135 −180 −1 10 0 1 10 10 2 10 3 10 Frequency (rad/sec) Figure 2.3: Bode plot of Gyr (s) One way to calculate the closed loop transfer function and its poles using Matlab is as follows: >> K=10*(1+s)/s; >> Gyr=G*K/(1+G*K) Transfer function: 50 s^4 + 600 s^3 + 1050s^2 + 500 s --------------------------------------------------s^6 + 22 s^5 + 191 s^4 + 820 s^3 + 1150 s^2 + 500 s >> Gyr=minreal(G*K/(1+G*K)) Transfer function: 50 --------------s^2 + 10 s + 50 >> pole(Gyr) ans = -5.0000 + 5.0000i 6 Bode Diagram Magnitude (dB) 10 0 −10 −20 −30 Phase (deg) −40 90 45 0 −1 10 0 1 10 10 2 10 Frequency (rad/sec) Figure 2.4: Bode plot of Ger (s) -5.0000 - 5.0000i Where the command minreal removes the pole zero cancellations in Gyr. √ 10 The natural frequency is ωn = 50 = 7.07 and the damping factor is ζ = 2ω = 0.707. n d) The closed loop step response from r to y is obtained with >> step(Gyr) The result is shown in Figure 2.6. 7 Bode Diagram 40 Magnitude (dB) 20 0 −20 −40 −60 Phase (deg) −80 −90 −135 −180 −1 10 0 10 1 10 Frequency (rad/sec) 2 10 3 10 Figure 2.5: Bode plot of K(s)G(s) e) Matlab code for the Bode plot of i) Gyr (s) is >> bode(Gyr) ii) and for the Bode plot of Ger (s) >> Ger=1/(1+G*K); >>bode(Ger); The results are shown in Figures 2.3 and 2.4. f) The closed loop response from r to y has 0 dB gain at low frequency, i.e. steady state gain of 1. The response is critically damped with natural frequency ωn = 7 radians/s. The rise time is approximately 1.7 τr ≈ = 0.24s ωn g) The open loop Bode plot of G(s)K(s) can be generated in Matlab with the command bode(G*K) The Bode plot is shown on Figure 2.5. At zero frequency the bode plot has infinite gain, which correlates to a closed loop steady state gain of 1. The magnitude plot crosses 1 (0dB) at frequency 4.5radians/s, this is approximately the closed loop bandwidth. 8 Step Response 1.4 1.2 Amplitude 1 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1 1.2 Time (sec) Figure 2.6: Closed loop step response of Gyr (s) The phase margin is 65.5o , while the gain margin is infinite. A rule of thumb relating the damping factor ζ to the phase margin PM is PM ζ= 100 Using this rule yields a closed loop damping factor of approximately 0.65. The actual value is 0.707, from part c. 9 Question 2 The unforced solution can be obtained as follows. The homogeneous equation is ẋ = −3x Using the fact that d 3t (e x) = e3t (ẋ + 3x) = 0 dt integrating both sides gives e3t x(t) = c Here c takes the value x0 , so the homogenous solution is x(t) = x0 e−3t The solution with an input u(t) uses d 3t (e x) = e3t (ẋ + 3x) = e3t u dt Integrating yields Z x(t) = x0 e−3t + t e−3(t−τ ) u(τ )dτ 0 which for the given input is Z −3t x(t) = x0 e t + 1.5 e−3(t−τ ) dτ 0 or x(t) = x0 e−3t + 0.5(1 − e−3t ) Question 3 a) Using the formula for 2 × 2 matrices, one obtains · −1 A −5 = −2 ¸ 6 2 The characteristic polynomial is det(sI − A) For the given matrix we have (s + 5)(s − 2) + 12 = s2 + 3s + 2 10 The eigenvalues of A are the roots of the characteristic polynomial, s = −1 and s = −2. An eigenvector of A corresponding to an eigenvalue λ is a vectors q that satisfies Aq = λq So with λ1 = −1 Aq1 = −q1 This leads to two equations in the elements of q1 with solution · ¸ 2 q1 = ρ1 1 where ρ1 6= 0 is an arbitrary scaling factor. Similarly, · ¸ 3 q2 = ρ2 2 The eigenvalue-eigenvector decomposition is then A = QΛQ−1 or · −0.8944 A= −0.4472 ¸· −0.8321 −0.5547 −2 0 ¸· 0 −1 ¸ −4.4721 6.7082 3.6056 −7.2111 where the factors ρi have been used to scale the eigenvectors to norm 1. b) The Matlab commands are as follows: >>A=[-5 6;-2 2]; >> Ainv=inv(A) Ainv = 1.0000 -3.0000 1.0000 -2.5000 >> [e,ev]=eig(A) e = -0.8944 -0.8321 -0.4472 -0.5547 ev = -2 0 0 -1 >> poly(A) ans = 1 3 2 11