<<

Lecture 2 – Linear

This lecture: EE263 material recap + some controls motivation • Continuous time (physics) • Linear state space model • Transfer functions • Black-box models; analysis • Linearization

EE392m - Spring 2005 2-1 Gorinevsky Modeling and Analysis

Input signal Model Output signal (control) [internal states] (observation) state evolution This lecture considers • Linear models. More detail on modeling in Lecture 7 • Simulation: computing state evolution and output signal • Stability: does the solution diverge after some time? • Approximate linear models

EE392m - Spring 2005 Control Engineering 2-2 Gorinevsky Linear Models

• Model is a mathematical representations of a system – Models allow simulating the system – Models can be used for conceptual analysis – Models are never exact

• Linear models – Have simple structure – Can be analyzed using powerful mathematical tools – Can be matched against real data using known procedures – Many simple physics models are linear – They are just models, not the real systems

EE392m - Spring 2005 Control Engineering 2-3 Gorinevsky State space model

• Generic state space model Example: F16 Longitudinal Model – is described by ODEs from Aircraft Control and Simulation – e.g., physics-based system by Stevens and Lewis model θ α u = δ – state vector x e V – observation vector y x

– control vector u α δ dx y = 57.3θ z e = state evolution α f (x,u,t) θ dt θ α = = ⋅ -2 + − − + y g(x,t) observation V& -1.93 10 V 8.82 32.2 0.58q 0.17δe = ⋅ -4 − + − ⋅ -3 x1 - velocity V [ft/sec] & -2.54 10 V 1.02 0.91q 2.15 10δ e α x2 - angle of attack α [rad] & = q x3 - pitch angle θ [rad] q = 2.95 ⋅10-12V + 0.82 −1.08q − 0.18δ x4 - pitch rate q [rad/sec] & e δ e - elevator deflection [deg] EE392m - Spring 2005 Control Engineering 2-4 Gorinevsky Linear state space model • Linear Time Invariant (LTI) state space model: dx = Ax + Bu state evolution dt y = Cx observations • Can be integrated analytically or numerically (simulation) • Can be well analyzed: stability, response

Example: F16 Longitudinal Model ⎡−1.93⋅10−2 8.82 − 32.2 − 0.48⎤ ⎡ 0.17 ⎤ ⎢ −4 ⎥ ⎢ −3 ⎥ dx − 2.54 ⋅10 −1.02 0 0.91 − 2.15⋅10 = ⎢ ⎥ ⋅ x + ⎢ ⎥ ⋅ u dt ⎢ 0 0 0 1 ⎥ ⎢ 0 ⎥ ⎢ −12 ⎥ ⎢ − ⎥ ⎣ 2.95⋅10 0.82 0 −1.08⎦ ⎣ 0.18 ⎦ y = []0 0 57.3 0 ⋅ x EE392m - Spring 2005 Control Engineering 2-5 Gorinevsky Integrating linear autonomous system

dx Example: = Ax >>A = [-1.93e-2 8.82 -32.2 -0.58; dt -2.54e-4 -1.02 0 0.91; 0 0 0 1; • exponential 2.95e-12 0.82 0 -1.08]; – Can be computed in Matlab >> expm(A) as expm(A) ans = 0.9802 3.1208 -31.8830 -10.2849 – The definition corresponds -0.0002 0.5004 0.0031 0.3604 -0.0000 0.2216 1.0002 0.6709 to integrating the ODE by -0.0001 0.3239 0.0007 0.4773 Euler method x(T + ∆t) ≈ x(T ) + ∆tAx(t) = ()I + ∆tA x(T ) x(T + n∆t) = ()I + ∆tA n x(T ) → exp( An∆t)x(T ) ∆ exp( At) = lim ()I + ∆tA t / t ∆t→0

EE392m - Spring 2005 Control Engineering 2-6 Gorinevsky Integrating linear autonomous system

3 dx = Ax, x(0) = x 2 dt 0 1 0 5 10 15 20 • Initial condition response 0.02 = 0 x(t) exp( At)x0 -0.02 -0.04 0 5 10 15 20

0.02 Example: 0 %Take A, B, C from the F16 example -0.02 -0.04 >> k = 0.02 -0.06 >> G = A + k*B*C; -0.08 >> x0 = [0.1700; 0 5 10 15 20 -0.0022; 0.05 0; 0 -0.1800]; -0.05 >> -0.1 for j = 1:length(t); -0.15 x(:,j)=expm(G*t(j))*x0; end; 0 5 10 15 20 EE392m - Spring 2005 Control EngineeringTIME 2-7 Gorinevsky Eigenvalues and Stability Example: % take A from % the F16 example • Consider eigenvalues of the matrix A >> eig(A) ans = λ = λ − = -1.9125 { j } eig( A); det( I A) 0 -0.1519 + 0.1143i -0.1519 - 0.1143i 0.0970 • Suppose A has all different and nonzero eigenvalues, then = ⋅ λ ⋅ −1 A V diag{ j } V λ − exp( At) = V ⋅ diag{e jt } ⋅V 1 λ < • The system solution is exponentially stable if Re j 0 • If A has eigenvalues with multiplicity more than 1, things are a bit more complicated: Jordan blocks, polynomials in t λ < • Still the condition of exponentially stability is Re j 0

EE392m - Spring 2005 Control Engineering 2-8 Gorinevsky Input-output models

• Black-box models – describe system P as an operator

u P y input signal output signal x internal state (hidden) • Historically (50 years ago) – Black-box models EE – State-space models ME, AA

EE392m - Spring 2005 Control Engineering 2-9 Gorinevsky Linear System (input-output)

⋅ ⎯⎯→P ⋅ ⋅ ⎯⎯→P ⋅ u1( ) y1( ) u2 ( ) y2 ( ) ⋅ + ⋅ ⎯⎯→P ⋅ + ⋅ au1( ) bu2 ( ) ay1( ) by2 ( ) • Linear Time-Invariant systems - LTI u(⋅ − T ) ⎯⎯→P y(⋅ − T )

u y ⎯⎯→P t t

EE392m - Spring 2005 Control Engineering 2-10 Gorinevsky representation

• Convolution integral τ signal t τ y(t) = ∫ h(t − )u( )dτ processing y = h * u −∞ notation • u(t) = δ (t) ⇒ y(t) = h(t)

• Step response: uτ = 1τ for t > 0 t t τ d g(t) = ∫ h(t − )d =∫ h( )dτ h(t) = g(t) 0 0 dt

EE392m - Spring 2005 Control Engineering 2-11 Gorinevsky Impulse Response for State Space Model

dx Example: = + Ax Bu state evolution >> A = [-0.3130 56.7000 0; dt -0.0139 -0.4260 0; y = Cx observation 0 56.7000 0]; >> B = [0.232; 0.0203; 0]; >> C = [0, 0, 1];

• Impulse response for the state x 1 x(∆t) ≈ ∆tAx(0) + B∆tu 0.5 0 {1 -0.5 x(∆t) ≈ B∆tu = B 0 10 20 0.04 x(t) = exp( At)B 0.02 0 -0.02 0 10 20 • System impulse response 1

h(t) = C exp( At)B 0.5

0 0 10 20 TIME EE392m - Spring 2005 Control Engineering 2-12 Gorinevsky Formal transfer

• Rational transfer function = IIR (Infinite Impulse Response) model – Broad class of input-output linear models d m y d m−1 y d n u d n−1u a + a + + a + y = b + b + + b + u 1 dt m 2 dt m−1 K m 1 1 dt n 2 dt n−1 K n 1 d • Differentiation operator → s dt • Formal transfer function – rational function of s N (s) N (s) = a s m + + a s + a y = H (s) ⋅ u = ⋅ u 1 K m m+1 D(s) = n + + + D(s) b1s K bn s bn+1 • For a causal system m ≤ n

EE392m - Spring 2005 Control Engineering 2-13 Gorinevsky Poles, Impulse Response N (s) N (s) = 0 - zeros y = ⋅ u D(s) D(s) = 0 - poles

= − M 1 ⋅ ⋅ − M K • Expand D(s) (s p1 ) K (s pK ) N (s) N (s) Then y = 1 ⋅ u + + K ⋅ u − M 1 K − M K (s p1 ) (s p K ) • Quasi-polynomial impulse response – see a textbook

− − M 1 1 p1t M K 1 pK t h(t) = (c t + + c + )e + + (c t + + c + )e 1,1 K 1,M 1 1 K K ,1 K K ,M K 1 2 d y = 1 ⋅ •Example: = u Transfer function: y 2 u dt 2 s = + Impulse response: h(t) v0t x0

EE392m - Spring 2005 Control Engineering 2-14 Gorinevsky Transfer Function for State Space

• Formal transfer function for a state space model

−1 d sx = Ax + Bu y = ()sI − A B ⋅ u → s ()−1 dt y = Cx H (s) = C sI − A B • Characteristic polynomial N (s) = det()sI − A = 0

Poles det()sI − A = 0 eigenvalues • Poles are the same as eigenvalues of the state-space matrix A λ • For stability we need Re pk = Re k < 0

EE392m - Spring 2005 Control Engineering 2-15 Gorinevsky ∞ • Laplace integral transform: x(t) → xˆ(s) = ∫ x(t)e st dt 0 • Laplace transform of the convolution integral yields ∞ Imag s yˆ(s) = H (s)uˆ(s) H (s) = ∫ h(t)est dt 0 • Transfer function: H (s) Re s – function of complex variable s – analytical in a right half-plane Re s ≥ a – for a stable system a ≤ 0 N(s) dx –for an IIR model H(s) = → sxˆ(s) D(s) dt

EE392m - Spring 2005 Control Engineering 2-16 Gorinevsky Frequency decomposition

• Sinusoids are eigenfunctions of an LTI system: y = H (s)u

LTI Plant ω iωt iωt H (iω)e e ω d ω s()ei t → ei t = iωei t ω dt • Frequency domain analysis

ω i kt → = ω i kt ∑uk e y ∑uk H(i k )e

EE392m - Spring 2005 Control Engineering 2-17 Gorinevsky π ω Frequency ωdomainω description

• Frequency domain analysis π ω ω 1 − 1 − ω u = u~( )e i t d ⇒ y = H(i )u~( )e i t dω 2 ∫ 2 ∫ 142 43ω ~y ( ) ω Packet ei t Packet eiωt ~ ω ~ u ωof u(ω) H(i ) of y(ω) y sinusoids sinusoids

ω ω • Fourier transform – numerical analysis • Laplace transform – complex analysis ω u(t) = 0, for t < 0 ∞ ∞ u~( ) = u(t)ei t d = ⎛ u(t)est d ⎞ = uˆ(iω) −∞ ⎜ −∞ ⎟ ∫ ⎝∫ ⎠s=iω

EE392m - Spring 2005 Control Engineering 2-18 Gorinevsky ω Continuous systems in frequency domain

∞ ω ~x( ) = ∫ x(t)ei t dt • Fourier transform −∞ [−∞,∞] → [−∞,∞] π ω ∞ 1 − ω x(t) = ∫ ~x( ω)e i t d • Inverse Fourier transform 2 −∞ t τ τ y(t) = ∫ h(t − )u( )dt • I/O impulse response model −∞ ∞ st • Transfer function H (ωs) = ∫ h(t)e dt 0 ω ~ = ~ ω y( ) H (i )u( ) • System frequency response

EE392m - Spring 2005 Control Engineering 2-19 Gorinevsky Frequency domainω description ϕ ω Mω( ) = H(i ) • Bode plots:ω ( ) = arg H(iω) u = ei t Bode 15 iωt = ω y H(i )e 10 • Example: 5 1 0 Magnitude (dB) H(s) = -5 s − 0.7 0

-45 •|H| is often measured -90 in dB -135

– [dB] = 20 log M (deg) Phase 10 -180 -2 -1 0 10 10 10 Frequency (rad/sec) EE392m - Spring 2005 Control Engineering 2-20 Gorinevsky Model Approximation

• Model structure – physics, computational • Determine parameters from data • Step/impulse responses are close  the input/output models are close • Example – fit step response • Linearization of nonlinear model

EE392m - Spring 2005 Control Engineering 2-21 Gorinevsky Black-box model from data

• Linear black-box model can be determined from the data, e.g., step response data, or frequency response STEP RESPONSE 1

0.8 0.6

0.4

HEAT FLUX 0.2

0 0 20 40 60 80 100 TIME • Example problem: fit an IIR model of a given order • This is called model identification • Considered in more detail in Lecture 8

EE392m - Spring 2005 Control Engineering 2-22 Gorinevsky Linear PDE models

• Include functions of spatial variables – electromagnetic fields – mass and heat transfer – fluid dynamics – structural deformations • Example: sideways heat equation x ∂ ∂2 T = T k 2 ∂t ∂x Tinside=u Toutside=0 T (0) = u; T (1) = 0 ∂T y = y ∂ heat flux x x=1

EE392m - Spring 2005 Control Engineering 2-23 Gorinevsky Linear PDE System Example ∂T ∂2T • Heat transfer equation, = k ∂ ∂ 2 – boundary temperature input u t x – heat flux output y u = T (0) T (1) = 0 • Impulse response and step response ∂T y = TEMPERATURE ∂ • Transfer function is not rational x x=1 -2 x 10 PULSE RESPONSE 6 1 4 0.8 2

HEAT FLUX 0.6

0 0.4 0 20 40 60 80 100 TIME STEP RESPONSE 0.2 1

0.8 0 0 15 0.6 10 0.4 0.5 5 heat HEAT FLUX 0.2 10 TIME COORDINATE flux 0 0 20 40 60 80 100 EE392m - Spring 2005 TIME Control Engineering 2-24 Gorinevsky Impulse response approximation • Approximating impulse 0.08s2 − 0.4s + 2.8 H(s) = 0.01 and step responses by a s2 + 0.34s + 0.03 low order rational transfer 0.06

• Higher order model can 0.04 provide very accurate approximation 0.02 0 • Methods: 0 20 40 60 80 100 – trial and error 1 – sampled time response fit, e.g., Matlab’s prony – identification, Lecture 8 0.5 – formal model reduction approaches - advanced 0 0 20 40 60 80 100 TI ME EE392m - Spring 2005 Control Engineering 2-25 Gorinevsky Validity of Model Approximation

• Why can we use an approximate model instead of the ‘real’ model? • Will the analysis hold? • The input-output maps of two systems are ‘close’ if the convolution kernels (impulse responses) are ‘close’ t τ τ y(t) = ∫ h(t − )u( )τ −∞ • The closed-loop stability impact of the modeling error – Control robustness – Will be discussed in Lecture 9

EE392m - Spring 2005 Control Engineering 2-26 Gorinevsky Nonlinear map linearization

• Nonlinear - detailed model • Linear - conceptual design model • Differentiation, secant method

• Example: static map linearization ∆f y = f (u) ≈ (u − u ) ∆u 0

EE392m - Spring 2005 Control Engineering 2-27 Gorinevsky Linearization Example: RTP

• RTP – Rapid Thermal dT = − 4 − 4 − − bu c1 (T TF ) c2 (T TF ) Processing dt • Major semiconductor T – part temperature manufacturing process u – IR heater power TF – furnace temperature • Stefan-Boltzmann law nonlinearity

• TF is assumed to be constant

u input heaters

T heated part output furnace EE392m - Spring 2005 Control Engineering 2-28 Gorinevsky RTP, cont’d dT = f (T ) + bu f (T ) = −c (T 4 − T 4 ) − c (T − T ) dt 1 F 2 F Linearize around a steady state point dT = + = − + f L (T ) bu f L (T ) a(T T* ) d dt f (T + ∆) − f (T ) d = f (T ) a = f ′(T ) ≈ * * * * ∆ 0 b = 1000, -200 ⋅ -10 c1 = 1.1 10 , -400 c2 = 0.8, -600 f(T) TF = 300 -800 -1000

-1200 300 400 500 600 700 800 900 1000 1100 1200 1300 TEMPERATURE EE392m - Spring 2005 Control Engineering 2-29 Gorinevsky RTP, cont’d

x = ax + bu + d = − & x T T* Linear system with a pole u = −kx p = −(a + bk)

= − T* = 1000, a = -1.7425, b = 1000, k = 0.01 p 11.7425 Simulate performance: 1 1000 900 p 800 700 Linear T 600 Non- model, 500 linear d = 0 400 model 300 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 TIME

EE392m - Spring 2005 Control Engineering 2-30 Gorinevsky Nonlinear state space model linearization ∆ ∆ • Linearize the r.h.s. map = ≈ f − + f − x& f (x,u) (x x0 ) (u u0 ) ∆x 14243 ∆u 14243 in a state-space model q v q& = Aq + Bv

= • Linearize around an equilibrium 0 f (x0,u0 ) • Secant method ∆ j f (x + s ,u ) − f (x ,u ) ⎡ f ⎤ = 0 j 0 0 0 ⎢ ∆ ⎥ ⎣ x ⎦ d j = s j [0 ... d j ... 0] { # j • This is how Simulink computes linearization

EE392m - Spring 2005 Control Engineering 2-31 Gorinevsky Example: F16 Longitudinal Model x

dx θ α u = δ = f (x,u) e dt V x’

= θ δ • State vector x y 57.3 z z’ e 1 x - velocity V [ft/sec] V& = (F cos + F sin ) 1 m α x z ⎡V ⎤α x2 - angle of attack α [rad] = 1 − α + + α⎢ ⎥ & ( Fx sin Fz cos ) q = ⎢ ⎥ mV x3 - pitch angle θ [rad] x α ⎢q⎥ M y ⎢ ⎥ q& = α x4 - pitch rate q [rad/sec] θ I ⎣ ⎦ y = α − θ + Fx rCx,t ( ) mg sin T • Control input θ& = q α δ F = rC ( , ) + mg cos δ z z,t e u - elevator deflection e [deg]. = α δ θ M y RCm,t ( , e ) For more detail see: Aircraft Control and Simulation by Stevens and Lewis EE392m - Spring 2005 Control Engineering 2-32 Gorinevsky Nonlinear Model of F16 dx = f (x,u) state evolution dt y = g(x) observation

• Aircraft models are understood by groups of people • Could take many man-years worth of effort • Aerodynamics model is based on empirical data • f(x,u) available as a computational function can be used without a deep understanding of the model • The nonlinear model can be used for simulation, or linearized for analysis

EE392m - Spring 2005 Control Engineering 2-33 Gorinevsky Linearized Longitudinal Model of F16

• Assume trim condition - velocity V [ft/sec] ⎡V0 ⎤ ⎡ 500 ⎤ α ⎢ ⎥ ⎢0.0393⎥ - angle of attack α [rad] = ⎢ 0 ⎥ = ⎢ ⎥ x0 ⎢q0 ⎥ ⎢ 0 ⎥ -pitch rate q [rad/sec] ⎢θ ⎥ ⎢ ⎥ ⎣ 0 ⎦ ⎣0.0393⎦ - pitch angle θ [rad • Linearize the nonlinear function f(x,u) by a finite difference method (secant method). Step = [1 0.001 0.01 0.001] ⎡−1.93⋅10−2 8.82 − 32.2 − 0.48⎤ ⎡ 0.17 ⎤ ⎢ − ⎥ ⎢ −3 ⎥ ∆f − 2.54 ⋅10 4 −1.02 0 0.91 ∆f − 2.15⋅10 A = = ⎢ ⎥ B = = ⎢ ⎥ ∆x ⎢ 0 0 0 1 ⎥ ∆u ⎢ 0 ⎥ ⎢ −12 ⎥ ⎢ − ⎥ ⎣ 2.95⋅10 0.82 0 1.08 ⎦ ⎣ 0.18 ⎦ • These are the matrices we considered in the linear F16 model example EE392m - Spring 2005 Control Engineering 2-34 Gorinevsky Simulation-based validation

• Simulate with nonlinear model, compare with linear model results • Doublet response

EE392m - Spring 2005 Control Engineering 2-35 Gorinevsky LTI models - summary

• ODE model • State space linear model • Linear system can be described by impulse response or step response • Linear system can be described by frequency response = Fourier transform of the impulse response • Linear model approximations can be obtained from more complex models – Approximation of a linear model response – Linearization of a nonlinear model

EE392m - Spring 2005 Control Engineering 2-36 Gorinevsky