ECE 680 Linear Matrix Inequalities Stan Żak School of Electrical and Computer Engineering Purdue University zak@purdue.edu October 11, 2017 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 1 / 42
Outline Motivation Definitions of convex set and convex function Linear matrix inequality (LMI) Canonical LMI Example of LMIs LMI solvers Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 2 / 42
The Lyapunov theorem Lyapunov s thm: A constant square matrix A R n n has its eigenvalues in the open left half-complex plane if and only if for any real, symmetric, positive definite Q R n n, the solution P = P to the Lyapunov matrix equation is positive definite A P + PA = Q Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 3 / 42
The Lyapunov thm re-stated Lyapunov s thm: The real parts of the eigenvalues of A are all negative if and only if there exists a real symmetric positive definite matrix P such that A P + PA < 0 Equivalently, A P PA > 0 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 4 / 42
A P + PA < 0 re-stated Let Define P 1 = P = 1 0 0 0 0 0 0 0 0 0 0 0.. 0 0 0 0 x 1 x 2 x n x 2 x n+1 x 2n 1.. x n x 2n 1 x q, P 2 = 0 1 0 0 1 0 0 0 0 0 0 0.. 0 0 0 0 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 5 / 42
Defining P i s 0 0 0 0 0 0 0 0 P q = 0 0 0 0.. 0 0 0 1 Note that each P i has only non-zero elements corresponding to x i in P Let F i = A P i P i A, i = 1, 2,..., q Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 6 / 42
Manipulate ) A P + PA = x 1 (A P 1 + P 1 A ) +x 2 (A P 2 + P 2 A ) + + x q (A P q + P q A = x 1 F 1 x 2 F 2 x q F q < 0 Let F (x) = x 1 F 1 + x 2 F 2 + + x q F q Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 7 / 42
Lyapunov s Inequality restated P = P > 0 and A P + PA < 0 if and only if F (x) > 0 Equivalently, [ P O O A P PA ] > 0 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 8 / 42
Linear Matrix Inequality Consider n + 1 real symmetric matrices F i = F i R m m, i = 0, 1,..., n and a vector x = [ x 1 x 2 ] x n Construct an affine function F (x) = F 0 + x 1 F 1 +... + x n F n n = F 0 + x i F i i=1 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 9 / 42
Linear Matrix Inequality Definition F (x) = F 0 + x 1 F 1 + + x n F n 0 Find a set of vectors x such that z F (x)z 0 for all z R m, that is, F (x) is positive definite Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 10 / 42
Convex Set Definition A set Ω R n is convex if for any x and y in Ω, the line segment between x and y lies in Ω, that is, αx + (1 α)y Ω for any α (0, 1) Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 11 / 42
Convex Function Definition A real-valued function f : Ω R defined on a convex set Ω R n is convex if for all x, y Ω and all α (0, 1), f (αx + (1 α)y) αf (x) + (1 α)f (y) Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 12 / 42
Convex Optimization Problem Definition A convex optimization problem is the one where the objective function to be minimized is convex and the constraint set, over which we optimize the objective function, is a convex set. Warning: If f is a convex function, then max f (x) subject to x Ω is NOT a convex optimization problem! Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 13 / 42
Another LMI Example A system of LMIs, F 1 (x) 0, F 2 (x) 0,..., F k (x) 0 can be represented as one single LMI F 1 (x) F 2 (x) F (x) =... F k(x) 0 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 14 / 42
Yet Another LMI Example A linear matrix inequality, involving an m-by-n constant matrix A, of the form, Ax b can be represented as m LMIs b i a i x 0, i = 1, 2,..., m, where a i is the i-th row of the matrix A Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 15 / 42
Example # 2 Contd View each scalar inequality as an LMI Represent m LMIs as one LMI, b 1 a 1 x b 2 a 2 x F (x) =... b m a m x 0 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 16 / 42
Notation > versus Most of the optimization solvers do not handle strict inequalities Therefore, the operator > is the same as, and so > implements the non-strict inequality Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 17 / 42
Solving LMIs F (x) = F 0 + x 1 F 1 + + x n F n 0 is called the canonical representation of an LMI The LMIs in the canonical form are very inefficient from a storage view-point as well as from the efficiency of the LMI solvers view-point The LMI solvers use a structured representation of LMIs Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 18 / 42
LMI Solvers Three types of LMI solvers To test whether or not there exists a solution x to F (x) > 0 is called a feasibility problem Minimization of a linear objective under LMI constraints Generalized eigenvalue minimization problem Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 19 / 42
Solving the feasibility problem Can solve LMIs of the form N L(X 1,..., X k )N < M R(X 1,..., X k )M X 1,..., X k matrix variables N left outer factor, M right outer factor L(X 1,..., X k ) left inner factor, R(X 1,..., X k ) right inner factor Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 20 / 42
Left-hand side vs. the right-hand side The term left-hand side refers to what is on the smaller side of the inequality 0 < X In X > 0, the matrix X is on the right-hand side it is on the larger side of the inequality Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 21 / 42
A general structure for finding a feasible soln setlmis([]) lmivar lmiterm... lmiterm getlmis feasp dec2mat Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 22 / 42
X=lmivar(type,structure) The input type specifies the structure of the variable X Three structures of matrix variables type=1 symmetric block diagonal matrix variable type=2 full rectangular matrix variable type=3 other cases Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 23 / 42
Second input of X=lmivar(type,structure) Additional info on the structure of the matrix variable X Example D 1 O O O D 2 O X =..... O O D r Each D i is a square symmetric matrix type=1 r blocks structure is r 2 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 24 / 42
The input structure The first component of each row of the input structure corresponding block size The second element of each row the block type X=lmivar(1,[3 1]) full symmetric 3 3 matrix variable X=lmivar(2,[2 3]) rectangular 2 3 matrix variable Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 25 / 42
Scalar block S = s 1 0 0 0 0 s 1 0 0 0 0 s 2 s 3 0 0 s 3 s 4, S=lmivar(1,[2 0;2 1]) describes a scalar block matrix, D 1 = s 1 I 2 The second block is a 2 2 symmetric full block Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 26 / 42
lmiterm(termid,a,b,flag) termid row with four elements specify the terms of each LMI of the LMI system termid(1)=n to specify the left-hand side of the n-th LMI termid(1)=-n to specify the right-hand side of the n-th LMI termid(2,3)=[i j] specifies the term of the (i, j) block of the LMI specified by the first component Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 27 / 42
More on lmiterm(termid,a,b,flag) termid(4)=0 for the constant term termid(4)=x for the variable term in the form AX B termid(4)=-x for the variable term in the form AX B Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 28 / 42
Second and third inputs in lmiterm(termid,a,b,flag) A and B give the value of the constant outer factors in the variable terms, AX B or in AX B the flag input to lmiterm serves as a compact way to specify the expression AX B + (AX B) Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 29 / 42
Using flag in lmiterm(termid,a,b,flag) flag= s use for symmetrized expression PA + A P < 0 lmiterm([1 1 1 P],1,A) lmiterm([1 1 1 -P],A,1) Note that PA + A P = PA + (PA) lmiterm([1 1 1 P],1,A, s ) Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 30 / 42
[tmin,xfeas]=feasp(lmis) Feasibility problem find such that x L(x) < R(x) feasp solves the auxiliary convex minimize t subject to L(x) < R(x) + ti. Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 31 / 42
P=dec2mat(lmis,xfeas,P) The system of LMIs is feasible if the minimal t < 0 P=dec2mat(lmis,xfeas,P) converts the output of the LMI solver into matrix variables Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 32 / 42
Minimizer of a Linear Objective Subject to LMI Constraints Invoked using the function mincx minimize subject to c x A(x) < B(x). A(x) < B(x) is a shorthand notation for general structured LMI systems Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 33 / 42
Observer Design Plant model: ẋ = Ax + Bu y = Cx Linear observer: ˆx = Aˆx + Bu + L(y C ˆx) Goal: Design L to ensure asymptotic stability of the error dynamics Matrix inequality for observer design: (A LC) P + P(A LC) 0, P = P 0 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 34 / 42
Observer Design Contd. A P + PA C L P PLC 0, P 0 To-do: Find L, P Problem: Bi-linear matrix inequality in L and P Technique #1: Choose Y = PL LMIs: A } P {{ + PA } C } Y {{ YC } 0, P 0 linear in P linear in Y For robustness of solution, rewrite as with fixed α > 0 A P + PA C Y YC + 2αP 0, P 0 Get back L = P 1 Y (P 0, hence invertible) Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 35 / 42
General Structure of CVX Code in MATLAB as summarized by Dr. Ankush Chakrabarty cvx_begin sdp quiet % sdp: semi-definite programming mode % quiet: no display during computing include CVX [variables] % very intuitive variable initialization % for example: variable P(3,3) symmetric minimize([cost]) % convex function subject to [affine constraints] % preferably non-strict inequalities cvx_end disp(cvx_status) % solution status Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 36 / 42
Snippet in CVX by Dr. Ankush Chakrabarty cvx_begin sdp % Variable definition variable P(n, n) symmetric variable Y(n, p) % LMIs P*sys.A + sys.a *P - Y*sys.C - sys.c *Y + P <= 0 P >= eps*eye(n) % eps is a very small number in MATLAB cvx_end sys.l = P\Y; % compute L matrix Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 37 / 42
State/Output Feedback Control LTI System with output feedback control: ẋ = Ax + Bu y = Cx u = Ky Goal: Design K to ensure asymptotic stability of (A BKC) Matrix inequality for output-feedback controller design: (A BKC) P + P(A BKC) 0, P 0 Simpler case: state-feedback (C = I ) (A BK) P + P(A BK) 0, P 0 Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 38 / 42
Simpler Case: State-Feedback Control To-do: Find K, P (A BK) P + P(A BK) 0, P 0 Problem: Bi-linear matrix inequality in K and P Technique #2: Congruence transformation with S P 1 and Z KS New inequalities LMIs: Get back P = S 1, K = ZP SA + AS SK B BKS 0 } SA {{ + AS } Z } B {{ BZ } 0, P 0 linear in S linear in Z Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 39 / 42
Snippet in CVX by Dr. Ankush Chakrabarty cvx_begin sdp % Variable definition variable S(n, n) symmetric variable Z(m, n) % LMIs sys.a*s + S*sys.A - sys.b*z - Z *sys.b <= -eps*eye(n) S >= eps*eye(n) cvx_end sys.k = Z/S; % compute K matrix Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 40 / 42
Output-Feedback Control A P + PA C K B P PBKC 0, P 0 To-do: Find K, P Problem: Bi-linear matrix inequality in K and P Technique #3: Choose M such that BM = PB and N MK New inequalities: A P + PA C K MB BMKC 0 Linear matrix (in)equalities: A } P {{ + PA } } C N B {{ BNC } 0, BM = PB, P 0 linear in P linear in N Get back K = M 1 N (M is invertible if B has full column rank) Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 41 / 42
Snippet in CVX by Dr. Ankush Chakrabarty Cool fact: CVX/YALMIP can handle equality constraints! cvx_begin sdp quiet % Variable definition variable P(n, n) symmetric variable N(m, p) variable M(m, m) % LMIs P*sys.A + sys.a *P - sys.b*n*sys.c... - sys.c *N *sys.b <= -eps*eye(n) sys.b*m == P*sys.B P >= eps*eye(n); cvx_end sys.k = M\N % compute K matrix Stan Żak (Purdue University) ECE 680 Linear Matrix Inequalities October 11, 2017 42 / 42