Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 540 Principles of Embedded Computation Spring 2015 Instructor: Rajeev Alur

Similar presentations


Presentation on theme: "CIS 540 Principles of Embedded Computation Spring 2015 Instructor: Rajeev Alur"— Presentation transcript:

1 CIS 540 Principles of Embedded Computation Spring 2015 http://www.seas.upenn.edu/~cis540/ Instructor: Rajeev Alur alur@cis.upenn.edu

2 Control Design Problem Plant model as Continuous-time Component H Uncontrolled Inputs Observable Outputs  Design a controller C so that the composed system C || H is stable  Is there a mathematical way to check when a system is stable?  Is there a way to design C so that C||H is stable ?  Yes, if the plant model is linear ! Controllable inputs Controller C CIS 540 Spring 2015; Lecture April 6

3 Eigenvalues and Eigenvectors  For an (n x n) matrix A, if the equation A x = x holds, for an n- dimensional non-zero vector x and scalar, then x is called an eigenvector of A, and is called a corresponding eigenvalue  The characteristic polynomial of A is the degree-n polynomial in variable given by determinant (A – I )  For 2 x2 matrix A, it is (A 1,1 - )(A 2,2 - ) - A 1,2 A 2,1  Eigenvalues are the roots of this characteristic polynomial  An eigenvalue can be a complex number  Multiplicity of eigenvalue can be more than 1  If A is a diagonal matrix then diagonal entries are the eigenvalues  For a given eigenvalue, compute the corresponding eigenvector(s) by solving system of linear equations A x = x, with unknown vector x  If all eigenvalues are distinct then corresponding eigenvectors are linearly independent CIS 540 Spring 2015; Lecture April 6

4 Response of Linear Systems  S contains n variables, system has no inputs, and dynamics is given by: dS/dt = A S; initial state is s 0  Execution is given by the signal S(t) = e At s 0  Matrix exponential e A = I + A + A 2 /2 + A 3 /3! + A 4 /4! + …  If A is diagonal matrix D(a 1, a 2, … a n ) then e A is the diagonal matrix D(e a1, e a2, …e an )  What if A is not diagonal?  Consider the behavior of a transformed system whose dynamics is simpler to analyze! CIS 540 Spring 2015; Lecture April 6

5 Similarity Transformation  Consider H with dynamics given by: dS/dt = A S; Initial state s 0  Let P be an invertible (n x n) matrix  Consider the dynamical system H’ whose state vector S’ is P -1 S  Note the original system state S equals P S’  Dynamics of the transformed system H’ d/dt S’ = d/dt (P -1 S) = P -1 dS/dt = P -1 A S = P -1 A P S’ = J S’  The matrix J = P -1 A P, and is said to be similar to A  Initial state of transformed system H’ is S’(0) = P -1 s 0  Response of the transformed system H’ is given by S’(t) = e Jt P -1 s 0  Response of original system S(t) = P e Jt P -1 s 0  When is all this useful ??  Choose P so that J is diagonal ! CIS 540 Spring 2015; Lecture April 6

6 Similarity Transformation using Eigenvectors  Consider H with dynamics is given by: dS/dt = A S; Initial state s 0  Calculate eigenvalues 1,…  n and eigenvectors x 1, … x n  Suppose all eigenvectors are linearly independent  Consider the (n x n) matrix P = [x 1 x 2 … x n ]  Let P -1 be its inverse (note: inverse must exist in this case)  Claim: The matrix J = P -1 A P is the diagonal matrix D( 1,…  n )  Execution of the system is given by S(t) = P D(e  t, …e n t ) P -1 s 0 CIS 540 Spring 2015; Lecture April 6

7 Example: Response of Linear Systems Consider 2-dimensional system with dynamics given by d s 1 = 4 s 1 + 6 s 2 d s 2 = s 1 + 3 s 2 1.Calculate eigenvalues 1 and 2 of A = [[4 6] [1 3]] 2.Calculate eigenvectors x 1 and x 2 3.Choose the similarity transformation matrix P = [x 1 x 2 ] 4.Find the inverse P -1 of P 5.Calculate J = P -1 A P (verify this is indeed diagonal matrix D[ 1 2 ]) 6.Desired solution is S(t) = P J P -1 s 0 CIS 540 Spring 2015; Lecture April 6

8 Back to Equilibria and Stability  Consider a linear system H with dynamics given by: dS/dt = A S  A state s is an equilibrium state of H if A s = 0  How to compute equilibria: solve system of linear equations  Claim 1: the state 0 is always an equilibrium  Claim 2: If A is invertible, then 0 is the sole equilibrium  If state s is a (non-zero) equilibrium of the system H, then consider the transformed system H’ whose state S’ = S – s  Properties of the equilibrium 0 of the transformed system H’ coincide with the properties of the equilibrium s of H  Henceforth, let us focus on a linear system H and the equilibrium 0  H is stable = equilibrium state 0 is stable  H is asymptotically stable = equilibrium 0 is asymptotically stable CIS 540 Spring 2015; Lecture April 6

9 Stability: Single Dimensional System  Consider a single-dimensional linear system H with dynamics is given by: dx/dt = a x  H is stable: for every  >0, there exists  >0 such that for all states s 0 with || s 0 || =0, ||e at s 0 ||<   H is asymptotically stable: there exists  >0 such that for all states s 0 with || s 0 ||< , ||e at s 0 ||  0 as t  infinity  Case coefficient a < 0: e at s 0 converges exponentially to 0 as t goes to infinity, no matter what the initial state s 0 is. Asymptotically stable !  Case coefficient a = 0: dynamics is dx/dt = 0. The state stays equal to the initial state. Stable but not asymptotically stable.  Case coefficient a > 0: e at grows exponentially as t increases, and thus, state diverges away from 0. Unstable ! CIS 540 Spring 2015; Lecture April 6

10 Stability: Diagonal State Dynamics  Consider n-dimensional linear system H with dynamics given by dS/dt = A S, where A is the diagonal matrix D(a 1, … a n )  Each dimension evolves independently: the i-th component of state vector at time t is e ai t s 0i where s 0 is the initial state vector  Case all coefficients a i < 0: Asymptotically stable ! State converges to the equilibrium 0 no matter what the initial state is  Case all coefficients a i <= 0: Stable. Not asymptotically stable if some coefficient a i = 0 (this state component stays unchanged)  Case some coefficient a i > 0: Unstable ! Some state component grows unboundedly away from equilibrium 0 CIS 540 Spring 2015; Lecture April 6

11 Similarity Transformations and Stability  Consider H with dynamics given by: dS/dt = A S  Let P be an invertible (n x n) matrix, and consider J = P -1 A P  Consider the dynamical system H’ whose state vector S’ is P -1 S, and note the original system state S equals P S’  Response of the transformed system H’ is given by S’(t) = e Jt P -1 s 0  Response of original system S(t) = P e Jt P -1 s 0  Response signal of H’ is simply a linear transformation of the response signal of H  If a signal is bounded, then its linear transformation is also bounded  The bounds can be different  If a signal converges to 0, then so does its linear transformation  Claim: H is stable if and only if H’ is stable  Claim: H is asymptotically stable if and only if H’ is asymptotically stable CIS 540 Spring 2015; Lecture April 6

12 Eigenvalues and Stability  Consider H with dynamics is given by: dS/dt = A S  Suppose all eigenvalues 1,…  n are real and distinct  Then all eigenvectors are guaranteed to be linearly independent  Choose (n x n) matrix P = [x 1 x 2 … x n ] for similarity transformation  The matrix J = P -1 A P is the diagonal matrix D( 1,…  n )  If all eigenvalues are negative, the transformed system is asymptotically stable, and so is the original system  If all eigenvalues are non-positive, the transformed system is stable, and so is the original system  Theorem: Linear system H with dynamics dS/dt = A S is asymptotically stable if and only if every eigenvalue of the matrix A has a negative real part CIS 540 Spring 2015; Lecture April 6

13 Continuous-time Component Car v F dx = v; dv = (F-kv)/ m;  The matrix A is given by [ [ 0 1] [ 0 -k/m] ]  Eigenvalues: 0 and –k/m  Conclusion: Stable  If we consider only the velocity, then asymptotically stable  Set F=0, and analyze what happens if we perturb the system from the equilibrium x=0, v=0 CIS 540 Spring 2015; Lecture April 6

14 Lyapunov Stability vs BIBO Stability  Consider linear component H with dynamics given by: dS/dt = A S + B I; O = C S + D I  BIBO stability: Starting from initial state 0, if the input is a bounded signal, output must be a bounded signal  Theorem: For linear components, asymptotic stability implies BIBO stability  Note: Asymptotic stability depends only on the properties of matrix A  Proof of the theorem relies of analysis of dynamical systems using transfer functions CIS 540 Spring 2015; Lecture April 6

15 Course Project  Goal: Design and implement a distributed collision avoidance protocol for autonomous vehicles moving in 2-dimensional plane  See handout in canvas  Can be done in groups of two  Phase 1 (design and modeling): Due Fri, April 17  Phase 2 (implementation in Matlab): Due Fri, May 1  Questions? Attend recitation by Nimit on Friday, April 10 CIS 540 Spring 2015; Lecture April 6


Download ppt "CIS 540 Principles of Embedded Computation Spring 2015 Instructor: Rajeev Alur"

Similar presentations


Ads by Google