CDS 11/11a: Lecture 2.1 Dynamic Behavior Richard M. Murray 6 October 28 Goals: Learn to use phase portraits to visualize behavior of dynamical systems Understand different types of stability for an equilibrium point Know the difference between local/global stability and related concepts Reading: Åström and Murray, Feedback Systems, Chapter 4 [9 minutes] Advanced: S. H. Strogatz, Nonlinear Dynamics and Chaos, Chapter 6
Dynamic Behavior (and Stability) Actuate Gas Pedal Sense Vehicle Speed Compute Control Law Goal #1: Stability Check if closed loop response is stable Goal #2: Performance Look at how the closed loop system behaves, in a dynamic context Goal #3: Robustness (later) control law system input Response depends on choice of control (all are stable) CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 2
Phase Portraits (2D systems only) Phase plane plots show 2D dynamics as vector fields & stream functions ẋ = f(x, u(x)) = F (x) Plot F(x) as a vector on the plane; stream lines follow the flow of the arrows phaseplot( dosc,... [-1 1 1], [-1 1 1],.1,... boxgrid([-1 1 1], [-1 1 1])); 1 1.5.5!.5!.5!1!1!.5.5 1!1!1!.5.5 1 CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 3
Stability of Equilibrium Points An equilibrium point is: Stable if initial conditions that start near the equilibrium point, stay near Also called stable in the sense of Lyapunov Asymptotically stable if all nearby initial conditions converge to the equilibrium point Stable + converging Unstable if some initial conditions diverge from the equilibrium point May still be some initial conditions that converge.5!.5!1!1!.5.5 1 1.5!.5 1!1!1!.5.5 1 1.5!.5, 2 1!1!2 2 4 6 8 1 time x() x e < δ = x(t) x e < ɛ,, 1.5!.5!1 2 4 6 8 1 time lim t x(t) =x e 1 5!5!1 1 2 3 4 5 time x() x e < ɛ!1!1!.5.5 1 CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 6 4
Equilibrium Points Equilibrium points represent stationary conditions for the dynamics The equilibria of the system x = F(x) are the points x e such that f(x e ) =. dx dt = [ ] x 2 sin x 1 γx 2 x e = [ ] ±nπ CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 5
Example #1: Double Inverted Pendulum Two series coupled pendula States: pendulum angles (2), velocities (2) Dynamics: F = ma (balance of forces) Dynamics are very nonlinear Eq #1 Eq #2 Eq #3 Eq #4 Stability of equilibria Eq #1 is stable Eq #3 is unstable Eq #2 and #4 are unstable, but with some stable modes CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 6
Stability of Linear Systems Linear dynamical system with state x R: n dx dt = Ax x() = x, Stability determined by the eigenvalues λ(a) = {s C : det(si A) = } Simplest case: diagonal A matrix (all eigenvalues are real) λ 1 ẋ i = λ i x i dx dt = λ 2... x x i (t) = e λit x() λ n System is asy stable if λ i < Block diagonal case (complex eigenvalues) σ 1 ω 1 dx ω 1 σ 1 dt =..... x σ m ω m ω m σ m x 2j 1 (t) = e σ jt ( x i () cos ω j t + x i+1 () sin ω j t ) x 2j (t) = e σ jt ( x i () sin ω j t x i+1 () cos ω j t ) System is asy stable if Re λ i = σ i < Theorem linear system is asymptotically stable if and only if Re λ i < λ i λ(a) CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 7
Local Stability of Nonlinear Systems Asymptotic stability of the linearization implies local asymptotic stability of equilibrium point Linearization around equilibrium point captures tangent dynamics ẋ = F (x e ) + F x (x x e ) + higher order terms xe approx z = x x e ż = Az If linearization is unstable, can conclude that nonlinear system is locally unstable If linearization is stable but not asymptotically stable, can t conclude anything about nonlinear system: linearize linearization is stable (but not asy stable) nonlinear system can be asy stable or unstable Local approximation particularly appropriate for control systems design Control often used to ensure system stays near desired equilibrium point If dynamics are well-approximated by linearization near equilibrium point, can use this to design the controller that keeps you there (!) CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 8
Example: Stability Analysis of Inverted Pendulum System dynamics dx dt = [ ] x 2, sin x 1 γx 2 Upward equilibrium: θ = x 1 1 = sin x 1 x 1 [ ] = dx dt = x 2 x 1 γx 2 [ ] 1 x 1 γ Eigenvalues: 1 2 γ ± 1 2 4 + γ 2 Downward equilibrium: Linearize around = π + z1: z 1 = x 1 π z 2 = x 2 = sin(π + z 1 )= sin z 1 z 1 [ ] [ ] dz dt = z 2 1 = z z 1 γ z 2 1 γ Eigenvalues: 1 2 γ ± 1 2 4 + γ 2 CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 9
Reasoning about Stability using Lyapunov Functions Basic idea: capture the behavior of a system by tracking energy in system Find a single function that captures distance of system from equilibrium Try to reason about the long term behavior of all solutions Example: spring mass system Can we show that all solutions return to rest w/out explicitly solving ODE? Idea: look at how energy evolves in time Start by writing equations in state space form Compute energy and its derivative V (x) = 1 2 k 1 + 1 2 m 2 dx dt = [ dv dt = kx 1ẋ 1 + mx 2 ẋ 2 m q + c q + kq = x 2 k m x 1 c m x 2 ] x 1 = q x 2 = q = kx 1 x 2 + mx 2 ( c m x 2 k m x 1) = cx 2 2 Energy is positive x 2 must eventually go to zero If x 2 goes to zero, can show that x 1 must also approach zero (Krasovskii-Lasalle) CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 1
Local versus Global Behavior Stability is a local concept Equilibrium points define the local behavior of the dynamical system Single dynamical system can have stable and unstable equilibrium points Region of attraction Set of initial conditions that converge to a given equilibrium point CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 11
Example #2: Predator Prey (ODE version) Continuous time (ODE) version of predator prey dynamics: ( dh dt = rh 1 H k dl dt = b ahl c + H ) Equilibrium points (2) ~(2.5, 29.5): unstable (, ): unstable ahl c + H H dl L. Lynxes Limit cycle Population of each species oscillates over time Limit cycle is stable (nearby solutions converge to limit cycle) This is a global feature of the dynamics (not local to an equilibrium point) 1 Continuous time (ODE) model MATLAB: predprey.m (from web page) 8 6 4 2 2 4 6 8 1 12 Hares stable unstable CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 12
Simpler Example of a Limit Cycle Dynamics: Stability of invariant set dx 1 dt dx 2 dt = x 2 x 1 (1 x 2 1 x 2 2) Note that x = 1 is an invariant set From simulation, x(t+t) = x(t) V (x) = 1 1 x 2 4( 1 x 2 ) 2 2 = x 1 x 2 (1 x 2 1 x 2 2). V (x) = ( ẋ 1 + x 2 ẋ 2 )(1 x 2 1 x 2 2) = = (x 2 1 + x 2 2) ( 1 x 2 1 x 2 2 ) 2 CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 13
Summary: Stability and Performance Key topics for this lecture Stability of equilibrium points Eigenvalues determine stability for linear systems Local versus global behavior 1 8 Lynxes 6 4 2 2 4 6 8 1 12 Hares CDS 11/11, 6 Oct 8 Richard M. Murray, Caltech CDS 14