Problem Set 4 for MAE8A Linear Systems Theory, Fall 7: due Tuesday November 8, 7, in class Problem Controllability and reachability Consider the C-circuit depicted in class on Slide 3 of the Controllability lecture sequence. u + _ C + C + v v - - C-circuit example state is the set of capacitor voltage! apple state equation ẋ(t) = C C The state-space system is described by Transition function/matrix exponential 3 / C! 4 C " # 5t ẋ t = / C x e C t / C t + u /! e C t. C = e C t Solution " # e C t Z " For our particular choice of resistors and capacitors, we rewrite the state equations in units of seconds t x x(t) = () 4 as! e C t + C e C (t x () C e C (t ẋ t = x t + u t. Find a control signal, u If C=C t, for t [, ] that transfers the state fromand applex()= then the state is always a sca So [t,t ]= : 5 x =, to x Likewise, =. to transfer 7 x to the origin =e C t x() +! apple [Bonus] Find the minimum-energy control signal. Compute the energy. So C[t,t ]= as well : Hint for both parts: look at the Slides 4 and 5 of the Controllability notes. Solution: The solution for LTI system is When C C we will find that t x(t) = e A(t t) x(t ) + e A(t τ) Bu(τ)dτ, t we substitute the matrix A, B and state of the systems at two different time. 5 x() = = e A( ) + e A( τ) u(τ)dτ, 7 since matrix A is diagonal then we have e At e t = e t and also, e A( τ) = Example e ( τ) e (τ ) e ( τ) = e (τ ). [t,t ]=C[t,t ]=
Now let us check if the system is reachable, C = [ B AB ] = rank of matrix C is, hence the system is reachable. 4 Use the solution equation above and see that we want to drive the zero-state solution x zs (t) = e A( τ) u(τ)dτ, 5 from x zs () = to x zs () = e 7 A. Now we are allow to apply results from Lecture 4, W (, ) = e A( τ) [ ] [ ] e A( τ) T dτ = e (τ ) [ e (τ ) ] e (τ ) e (τ ) dτ W (, ) = [ e (τ ) e (τ ) ] [e (τ ) e (τ )] [ e (τ ) e dτ = 3(τ ) ] dτ e 3(τ ) 4e 4(τ ) W (, ) = [ ( e )/ ( e 3 ] )/3 ( e 3 )/3 ( e 4 ) According to Lecture 4, we need to find η such that 5 x zs () = e A = W 7 (, )η ImW (, ), then, for t [, ] control function, U(t) = B(t) T e A( t)t η = [ ] [ e t ] e (t ) η. The minimum energy is E = U(τ) dτ = x zs () T W (, ) x zs (). Problem Observers with real aeroengine data The file signal.dat contains data from an experiment at United Technologies esearch Center examining combustion instabilities in a jet engine single-nozzle rig. The combustion instability manifests as an audible single tone, sometimes called hooting or howling coming from the engine. The instability is undesirable and causes NO x pollution. The data file contains three columns of numbers: the current time, the pressure signal inside the combustor, and the heat release rate measured with a thermal sensor. You task is to build an observer to estimate the time delay between the peaks in the pressure signal and the peaks in the heat release rate signal. You need to build an observer to do this.
(i) Plot the data versus time to see the main oscillation in the data is around Hz. You can use MATLAB s play function to listen to it, since the data is sampled at 5kHz. Here is the zoomed plot of pressure versus time. Note that there are about.5 cycles in.6 seconds or 8 Hz approximately. 8 6 4 pressure (units) - -4-6 -8.66.68.7.7.74.76.78 Figure : Plot for task (i). (ii) Plot the absolute value of the FFT of the pressure data to show that the main frequency is at.573 Hz. Here a zoomed in view using stem plot of the abs(fft(pressure)). You see that bin 69 is the max. This represents 69 cycles in the data of 6384 samples at 5 Hz or f = 69 6384 5 =.573Hz. (iii) Convert the heat release rate, which is necessarily positive, to a more symmetric signal by taking its logarithm. Call this lheat. (iv) Show that, the signals x i (t) = A cos(ωt + φ) and x q (t) = A sin(ωt + φ) satisfy the state equation xi (t + ) cos ω sin ω xi (t) =. x q (t + ) sin ω cos ω x q (t) x i (t + ) = A cos(ω(t + ) + φ) = A cos(ωt + φ + ω) = A[cos(ωt + φ) cos(ω) sin(ωt + φ) sin(ω)] = x i (t) cos(ω) x q (t) sin(ω) and x q (t + ) = A sin(ω(t + ) + φ) = A sin(ωt + φ + ω) = A[sin(ωt + φ) cos(ω) + cos(ωt + φ) sin(ω)] = x q (t) sin(ω) + x i (t) cos(ω)
amplitude 4.8.6.4..8.6.4. 67 675 68 685 69 695 7 75 7 75 7 bin number + Figure : Plot for task (ii). so we have, xi (t + ) = x q (t + ) [ cos ω sin ω sin ω cos ω ] [ xi (t) x q (t) ] Note: since we are incrementing time, not by second, but by. seconds, we need to take ω = π.573. =.646 c /s.
(v) Accordingly, argue for the following being a state-space realization for pressure and for lheat. x p i (t + ) cos ω sin ω x p x p i (t) q(t + ) x h i (t + ) = sin ω cos ω x p q(t) cos ω sin ω x h x h i (t), q (t + ) sin ω cos ω x h q (t) x p i (t) pressure(t) = x p q(t) lheat(t) x h i (t). x h q (t) That is, this model describes pressure= A cos(ωt + φ p ) and lheat= B cos(ωt + φ h ) with the same frequency ω but differing amplitudes A and B and differing phases φ p and φ h. Note that this model has no input signal, since the audible oscillation is self-supporting. This is fairly obvious, since both pressure and lheat are described by separate signals with the same frequency. (vi) If you had the full dimension 4 state x(t) available, determine an approach to compute A, B, ωt + φ p and ωt + φ h at that time from the state elements. From part (iv) we see that A = (x p i (t)) + (x p q(t)) and ωt + φ p = atan(x p q(t), x p i (t)). and also B = (x h i (t)) + (x h q (t)) and ωt + φ h = atan(x h q (t), x h i (t)). (vii) Work a bit harder and derive a formula for estimating φ h φ p as a function of the state. Work even harder still and express this phase difference at this ω as a time delay. Start with the following trigonometric formulæ. So, AB cos(φ h φ p ) = AB cos[(ωt + φ h ) (ωt + φ p )], = AB cos(ωt + φ h ) cos(ωt + φ p ) + AB sin(ωt + φ h ) sin(ωt + φ p ), = x h i (t) x p i (t) + xh q (t) x p q(t). AB sin(φ h φ p ) = AB sin[(ωt + φ h ) (ωt + φ p )], = AB sin(ωt + φ h ) cos(ωt + φ p ) AB cos(ωt + φ h ) sin(ωt + φ p ), = x h q (t) x p i (t) xh i (t) x p q(t). φ h φ p = atan(ab sin(φ h φ p ), AB cos(φ h φ p )), [ ] = atan x h q (t) x p i (t) xh i (t) x p q(t), x h i (t) x p i (t) + xh q (t) x p q(t). Since this is a radian phase difference of a signal at radian frequency ω radians/sec, the time difference is τ = φh φ p. ω
(viii) Using the value ω = π.573 rad/s, write this model in MATLAB. Call the matrices A and C as usual. Do not forget to include the sampling time of T s =. s. (ix) Show that the entire state is observable from the two outputs for this model. We can check the rank of the observability matrix, which is the controllability matrix of A and C. rank(ctrb(a,c ))=4 (x) Select an appropriate place for observer poles and determine using place an observer output-injection gain. Note that this is all in discrete time. I tried two selections:.98 eig(a) and.975 eig(a). Both were found using commands like L=place(A,C,.98*eig(A)). (xi) Write the MATLAB code to do the following. (a) Start from an initial state estimate of, say, zero and run this observer, taking the two measurements, pressure(t) and lheat(t) as inputs and yielding state estimate ˆx(t) as its output. In general we have observer In this problem we do have u(t) = so ˆx(t + ) = (A LC)ˆx(t) + Bu(t) + Ly(t). ˆx(t + ) = (A LC)ˆx(t) + Ly(t) Since we want all elements of the state estimate, we have Ā = (A LC), B = L, C = eye(4), D = and our observer is defined as the following system, observ=ss(a-lc, L,eye(4),zeros(4,),/5) Here are the zoomed plots of state estimates with each set of poles. (b) Apply your formula from step?? to compute the time delay estimate between pressure and heat release rate over the entire data set. (xii) Plot your estimate over time. Let s take things slowly. Here are the sin term plot(time,xhq.*xpi-xhi.*xpq) and the cos term plot(time,xhi.*xpi+xhq.*xpq), where xpi = xhat(:,); xpq = xhat(:,); xhi = xhat(:,3); xhq = xhat(:,4); Now consider the computed phase difference: atan(xhq.*xpi-xhi.*xpq,xhi.*xpi+xhq.*xpq). We see that the computed phase difference is jumping over π a lot. Let s unwrap it. This suggests that the computed phase difference via atan(.,.) is unreliable, since it is drifting over time. Take a backward step and use the mean sin and cos terms to compute
5 poles.98*eig(a) 4 3 xhat - - -3-4.3.4.5.6.7.8.9.. atan(mean(xhq.*xpi-xhi.*xpq),mean(xhi.*xpi+xhq.*xpq)) = -.555. Now add the phase difference from the differentiator, π, and the negatively sloped memoryless nonlinearity, π, to get a total phase difference of 4.73 radians or a time delay of τ = 4.73/(ω.) =.36 seconds. Hint: I get something like delay τ=3.7 ms on average. Welcome to the world of state estimation. The time delay is a central modeling parameter describing the propagation time of the fuel exiting the nozzle to the flame front.
4 poles.975*eig(a) 3 xhat - - -3.3.4.5.6.7.8.9-3 ABsin( h - p ) plot ABsin( h - p ) -.5.5.5 3 3.5 Figure 3: AB sin plot: mean -3.354e-35.
.5-3 ABcos( h - p ) plot.5 h - p ) ABcos( -.5 - -.5.5.5.5 3 3.5 Figure 4: AB cos plot: mean 5.9494e-34. 4 computed phase difference plot 3 computed phase difference - - -3-4.5.5.5 3 3.5 Figure 5: φ h φ p plot: mean -.663.
Unwrapped computed phase difference plot 9 8 unwrapped phase difference 7 6 5 4 3.5.5.5 3 3.5 Figure 6: Unwrappped φ h φ p plot.