Plan of the Lecture Review: control, feedback, etc Today s topic: state-space models of systems; linearization Goal: a general framework that encompasses all examples of interest Once we have mastered this framework, we can proceed to analysis and then to design Reading: FPE, Sections 11, 12, 21 24, 72, 921 Chapter 2 has lots of cool examples of system models!!
Notation Reminder We will be looking at dynamic systems whose evolution in time is described by differential equations with external inputs We will not write the time variable t explicitly, so we use etc x instead of x(t) ẋ instead of x (t) or dx dt ẍ instead of x (t) or d2 x dt 2
Example 1: Mass-Spring System x m u Newton s second law (translational motion): }{{} F = ma = spring force + friction + external force total force spring force = kx friction force = ρẋ (Hooke s law) mẍ = kx ρẋ + u Move x, ẋ, ẍ to the LHS, u to the RHS: (Stokes law linear drag, only an approximation!!) ẍ + ρ mẋ + k m x = u m 2nd-order linear ODE
Example 1: Mass-Spring System x m u ẍ + ρ mẋ + k m x = u m 2nd-order linear ODE Canonical form: convert to a system of 1st-order ODEs ẋ = v (definition of velocity) v = ρ m v k m x + 1 m u
Example 1: Mass-Spring System x m u State-space model: express in matrix form (ẋ ) ( 0 1 = v k m ρ m ) ( ) ( ) x 0 + 1 u v m Important: start reviewing your linear algebra now!! matrix-vector multiplication; eigenvalues and eigenvectors; etc
General n-dimensional State-Space Model state x = ẋ 1 ẋ n = x 1 x n R n input u = A n n matrix x 1 x n + B u 1 u m n m matrix R m u 1 u m ẋ = Ax + Bu
Partial Measurements state x = output y = x 1 x n y 1 y p R n input u = u 1 u m R m R p y = Cx C p n matrix ẋ = Ax + Bu y = Cx Example: if we only care about (or can only measure) x 1, then x 1 y = x 1 = ( 1 0 0 ) x 2 x n
State-Space Models: Bottom Line ẋ = Ax + Bu y = Cx State-space models are useful and convenient for writing down system models for different types of systems, in a unified manner When working with state-space models, what are states and what are inputs? match against ẋ = Ax + Bu
Example 2: RL Circuit V S + + V R I + V L V S + V R + V L = 0 V R = RI V L = LI V S + RI + L I = 0 Kirchhoff s voltage law Ohm s law Faraday s law I = R L I + 1 L V S (1st-order system) I state, V S input Q: How should we change the circuit in order to implement a 2nd-order system? A: Add a capacitor
Example 3: Pendulum ` mg sin mg T e external torque Newton s 2nd law (rotational motion): T }{{} total torque = J }{{} moment of inertia α }{{} angular acceleration = pendulum torque + external torque pendulum torque = mg sin θ }{{} }{{} l force lever arm moment of inertia J = ml 2 mgl sin θ + T e = ml 2 θ θ = g l sin θ + 1 ml 2T e (nonlinear equation)
Example 3: Pendulum θ = g l sin θ + 1 ml 2T e For small θ, use the approximation sin θ θ sin Θ Θ 3 2 1 3 2 1 1 2 3 1 2 3 ( θ1 θ 2 ) = ( 0 1 g l 0 (nonlinear equation) θ = g l θ + 1 ml 2 T e State-space form: θ 1 = θ, θ 2 = θ θ 2 = g l θ + 1 ml 2 T e = g l θ 1 + 1 ml 2 T e ) ( ) θ1 θ 2 + ( 0 1 ml 2 ) T e
Linearization Taylor series expansion: f(x) = f(x 0 ) + f (x 0 )(x x 0 ) + 1 2 f (x 0 )(x x 0 ) 2 + f(x 0 ) + f (x 0 )(x x 0 ) linear approximation around x = x 0 Control systems are generally nonlinear: ẋ = f(x, u) x = x 1 x n u = u 1 u m f = f 1 f n nonlinear state-space model Assume x = 0, u = 0 is an equilibrium point: f(0, 0) = 0 This means that, when the system is at rest and no control is applied, the system does not move
Linearization Linear approx around (x, u) = (0, 0) to all components of f: For each i = 1,, n, ẋ 1 = f 1 (x, u),, ẋ n = f n (x, u) f i (x, u) = f i (0, 0) }{{} =0 + f i x 1 (0, 0)x 1 + + f i x n (0, 0)x n + f i u 1 (0, 0)u 1 + + f i u m (0, 0)u m Linearized state-space model: ẋ = Ax + Bu, where A ij = f i x j x=0 u=0, B ik = f i u k x=0 u=0 Important: since we have ignored the higher-order terms, this linear system is only an approximation that holds only for small deviations from equilibrium
Example 3: Pendulum, Revisited Original nonlinear state-space model: θ 1 = f 1 (θ 1, θ 2, T e ) = θ 2 already linear θ 2 = f 2 (θ 1, θ 2, T e ) = g l sin θ 1 + 1 ml 2 T e Linear approx of f 2 around equilibrium (θ 1, θ 2, T e ) = (0, 0, 0): f 2 = g θ 1 l cos θ 1 f 2 = g θ 1 l 0 f 2 = 0 θ 2 f 2 = 0 θ 2 0 Linearized state-space model of the pendulum: θ 1 = θ 2 θ 2 = g l θ 1 + 1 ml 2T e f 2 = 1 T e ml 2 f 2 = 1 T e ml 2 0 valid for small deviations from equ
General Linearization Procedure Start from nonlinear state-space model ẋ = f(x, u) Find equilibrium point (x 0, u 0 ) such that f(x 0, u 0 ) = 0 Note: different systems may have different equilibria, not necessarily (0, 0), so we need to shift variables: x = x x 0 u = u u 0 f(x, u) = f(x + x 0, u + u 0 ) = f(x, u) Note that the transformation is invertible: x = x + x 0, u = u + u 0
General Linearization Procedure Pass to shifted variables x = x x 0, u = u u 0 ẋ = ẋ (x 0 does not depend on t) = f(x, u) = f(x, u) equivalent to original system The transformed system is in equilibrium at (0, 0): f(0, 0) = f(x 0, u 0 ) = 0 Now linearize: ẋ = Ax + Bu, where A ij = f i f i, B x j ik = x=x0 u k u=u 0 x=x0 u=u 0
General Linearization Procedure Why do we require that f(x 0, u 0 ) = 0 in equilibrium? This requires some thought Indeed, we may talk about a linear approximation of any smooth function f at any point x 0 : f(x) f(x 0 )+f (x 0 )(x x 0 ) f(x 0 ) does not have to be 0 The key is that we want to approximate a given nonlinear system ẋ = f(x, u) by a linear system ẋ = Ax + Bu (may have to shift coordinates: x x x 0, u u u 0 ) Any linear system must have an equilibrium point at (x, u) = (0, 0): f(x, u) = Ax + Bu f(0, 0) = A0 + B0 = 0