EE263 Autumn 2007-08 Stephen Boyd Lecture 1 Overview • course mechanics • outline & topics • what is a linear dynamical system? • why study linear systems? • some examples 1–1 Course mechanics • all class info, lectures, homeworks, announcements on class web page: www.stanford.edu/class/ee263 course requirements: • weekly homework • takehome midterm exam (date TBD) • takehome final exam (date TBD) Overview 1–2 Prerequisites • exposure to linear algebra (e.g., Math 103) • exposure to Laplace transform, differential equations not needed, but might increase appreciation: • control systems • circuits & systems • dynamics Overview 1–3 Major topics & outline • linear algebra & applications • autonomous linear dynamical systems • linear dynamical systems with inputs & outputs • basic quadratic control & estimation Overview 1–4 Linear dynamical system continuous-time linear dynamical system (CT LDS) has the form dx = A(t)x(t) + B(t)u(t), dt y(t) = C(t)x(t) + D(t)u(t) where: • t ∈ R denotes time • x(t) ∈ Rn is the state (vector) • u(t) ∈ Rm is the input or control • y(t) ∈ Rp is the output Overview 1–5 • A(t) ∈ Rn×n is the dynamics matrix • B(t) ∈ Rn×m is the input matrix • C(t) ∈ Rp×n is the output or sensor matrix • D(t) ∈ Rp×m is the feedthrough matrix for lighter appearance, equations are often written ẋ = Ax + Bu, y = Cx + Du • CT LDS is a first order vector differential equation • also called state equations, or ‘m-input, n-state, p-output’ LDS Overview 1–6 Some LDS terminology • most linear systems encountered are time-invariant: A, B, C, D are constant, i.e., don’t depend on t • when there is no input u (hence, no B or D) system is called autonomous • very often there is no feedthrough, i.e., D = 0 • when u(t) and y(t) are scalar, system is called single-input, single-output (SISO); when input & output signal dimensions are more than one, MIMO Overview 1–7 Discrete-time linear dynamical system discrete-time linear dynamical system (DT LDS) has the form x(t + 1) = A(t)x(t) + B(t)u(t), y(t) = C(t)x(t) + D(t)u(t) where • t ∈ Z = {0, ±1, ±2, . . .} • (vector) signals x, u, y are sequences DT LDS is a first order vector recursion Overview 1–8 Why study linear systems? applications arise in many areas, e.g. • automatic control systems • signal processing • communications • economics, finance • circuit analysis, simulation, design • mechanical and civil engineering • aeronautics • navigation, guidance Overview 1–9 Usefulness of LDS • depends on availability of computing power, which is large & increasing exponentially • used for – analysis & design – implementation, embedded in real-time systems • like DSP, was a specialized topic & technology 30 years ago Overview 1–10 Origins and history • parts of LDS theory can be traced to 19th century • builds on classical circuits & systems (1920s on) (transfer functions . . . ) but with more emphasis on linear algebra • first engineering application: aerospace, 1960s • transitioned from specialized topic to ubiquitous in 1980s (just like digital signal processing, information theory, . . . ) Overview 1–11 Nonlinear dynamical systems many dynamical systems are nonlinear (a fascinating topic) so why study linear systems? • most techniques for nonlinear systems are based on linear methods • methods for linear systems often work unreasonably well, in practice, for nonlinear systems • if you don’t understand linear dynamical systems you certainly can’t understand nonlinear dynamical systems Overview 1–12 Examples (ideas only, no details) • let’s consider a specific system ẋ = Ax, y = Cx with x(t) ∈ R16, y(t) ∈ R (a ‘16-state single-output system’) • model of a lightly damped mechanical system, but it doesn’t matter Overview 1–13 typical output: 3 2 y 1 0 −1 −2 −3 0 50 100 150 200 250 300 350 t 3 2 y 1 0 −1 −2 −3 0 100 200 300 400 500 600 700 800 900 1000 t • output waveform is very complicated; looks almost random and unpredictable • we’ll see that such a solution can be decomposed into much simpler (modal) components Overview 1–14 t 0.2 0 −0.2 0 1 50 100 150 200 250 300 350 50 100 150 200 250 300 350 50 100 150 200 250 300 350 50 100 150 200 250 300 350 50 100 150 200 250 300 350 50 100 150 200 250 300 350 50 100 150 200 250 300 350 50 100 150 200 250 300 350 0 −1 0 0.5 0 −0.5 0 2 0 −2 0 1 0 −1 0 2 0 −2 0 5 0 −5 0 0.2 0 −0.2 0 (idea probably familiar from ‘poles’) Overview 1–15 Input design add two inputs, two outputs to system: ẋ = Ax + Bu, y = Cx, x(0) = 0 where B ∈ R16×2, C ∈ R2×16 (same A as before) problem: find appropriate u : R+ → R2 so that y(t) → ydes = (1, −2) simple approach: consider static conditions (u, x, y constant): ẋ = 0 = Ax + Bustatic, y = ydes = Cx solve for u to get: ustatic = −CA−1B Overview −1 ydes = −0.63 0.36 1–16 let’s apply u = ustatic and just wait for things to settle: u1 0 −0.2 −0.4 −0.6 −0.8 −1 −200 0 200 400 600 800 0 200 400 600 800 0 200 400 600 800 0 200 400 600 800 t 1000 1200 1400 1600 1800 1000 1200 1400 1600 1800 1000 1200 1400 1600 1800 1000 1200 1400 1600 1800 u2 0.4 0.3 0.2 0.1 0 −0.1 −200 2 t y1 1.5 1 0.5 0 −200 t y2 0 −1 −2 −3 −4 −200 t . . . takes about 1500 sec for y(t) to converge to ydes Overview 1–17 using very clever input waveforms (EE263) we can do much better, e.g. 0.2 u1 0 −0.2 −0.4 −0.6 0 10 20 0 10 20 0 10 20 0 10 20 30 40 50 60 30 40 50 60 30 40 50 60 30 40 50 60 t u2 0.4 0.2 0 −0.2 t y1 1 0.5 0 −0.5 t y2 0 −0.5 −1 −1.5 −2 −2.5 t . . . here y converges exactly in 50 sec Overview 1–18 in fact by using larger inputs we do still better, e.g. u1 5 0 −5 −5 0 5 10 15 20 25 0 5 10 15 20 25 0 5 10 15 20 25 0 5 10 15 20 25 t 1 u2 0.5 0 −0.5 −1 −1.5 −5 2 t y1 1 0 −1 −5 t 0 y2 −0.5 −1 −1.5 −2 −5 t . . . here we have (exact) convergence in 20 sec Overview 1–19 in this course we’ll study • how to synthesize or design such inputs • the tradeoff between size of u and convergence time Overview 1–20 Estimation / filtering u H(s) w A/D y • signal u is piecewise constant (period 1 sec) • filtered by 2nd-order system H(s), step response s(t) • A/D runs at 10Hz, with 3-bit quantizer Overview 1–21 u(t) 1 0 −1 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 s(t) 1.5 1 0.5 0 w(t) 1 0 −1 y(t) 1 0 −1 t problem: estimate original signal u, given quantized, filtered signal y Overview 1–22 simple approach: • ignore quantization • design equalizer G(s) for H(s) (i.e., GH ≈ 1) • approximate u as G(s)y . . . yields terrible results Overview 1–23 formulate as estimation problem (EE263) . . . u(t) (solid) and û(t) (dotted) 1 0.8 0.6 0.4 0.2 0 −0.2 −0.4 −0.6 −0.8 −1 0 1 2 3 4 5 6 7 8 9 10 t RMS error 0.03, well below quantization error (!) Overview 1–24