You are on page 1of 34

Dep.

of Information Engineering

University of Pisa (Italy)

From Convex Optimization to


Linear Matrix Inequalities
eng. Sergio Grammatico
grammatico.sergio@gmail.com

Class of Identification of Uncertain Systems 2012/13


held by prof. Andrea Caiti
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

1 / 30

Outline
1
2

Introduction
Semi-Definite Programming
From Convex Optimization to Semi-Definite
Programming
Linear Matrix Inequalities
Definition
Brief Historical Perspective
First simple problems
Software
SeDuMi and CVX
Examples
Conclusion
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

2 / 30

Outline
1
2

Introduction
Semi-Definite Programming
From Convex Optimization to Semi-Definite
Programming
Linear Matrix Inequalities
Definition
Brief Historical Perspective
First simple problems
Software
SeDuMi and CVX
Examples
Conclusion
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

3 / 30

Convex Optimization and Linear Matrix Inequalities


(LMIs)
Thanks to Stephen Boyd, Carsten Scherer et al.

This presentation is mainly based on


S. Boyd and Lieven Vandenberghe, Convex Optimization,
Cambridge University Press, 2004.
S. Boyd, L. El Ghaoui, E. Feron and V. Balakrishnan,
Linear Matrix Inequalities in System and Control Theory,
Society for Industrial and Applied Mathematics (SIAM), 1994.
S. Boyd, Lecture notes in Convex Optimization,
Standford University.

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

4 / 30

Outline
1
2

Introduction
Semi-Definite Programming
From Convex Optimization to Semi-Definite
Programming
Linear Matrix Inequalities
Definition
Brief Historical Perspective
First simple problems
Software
SeDuMi and CVX
Examples
Conclusion
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

5 / 30

Convex Optimization
General problem

Convex Optimization Problem


min f (x)

xRn

sub. to

gi (x) 0, i = 1, 2, ..., m
Ax = b

(1)

f , g1 , ..., gm convex functions, A Rpn , b Rp .


Global Optimality
Any local optimal point of a convex problem is globally optimal

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

6 / 30

Special Case
Linear Programming (LP)

Linear Programming
min c> x

xRn

sub. to

S. Grammatico (DEI UNIPI)

(2)
Gx h, Ax = b

Introduction to LMIs

Identification of Uncertain Systems

7 / 30

Special Case
Quadratic Programming (QP)

Quadratic Programming
min x> P x + q > x

xRn

sub. to

(3)
Gx h, Ax = b

P positive semi-definite P < 0 (P = P > , eig(P ) 0).

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

8 / 30

Another Special Case


Semi-Definite Programming (SDP)

Semi-Definite Programming
min c> x

xRn

sub. to

F0 + x1 F1 + x2 F2 + ... + xn Fn 4 0,

(4)

Ax = b
Fi = Fi> Rnn

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

9 / 30

Outline
1
2

Introduction
Semi-Definite Programming
From Convex Optimization to Semi-Definite
Programming
Linear Matrix Inequalities
Definition
Brief Historical Perspective
First simple problems
Software
SeDuMi and CVX
Examples
Conclusion
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

10 / 30

Linear Matrix Inequalities


Definition

Standard LMI
F (x) := F0 +

n
X

xi F i 4 0

(5)

i=1

The inequality constraint of an SDP is an LMI.


Multiple LMIs as a unique LMI:






F0 0
F1 0
Fn 0
+ x1
+ ... + xn
4 0
0 F0
0 F1
0 Fn

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

(6)

11 / 30

Linear Matrix Inequalities


Feasibility and Optimization

Feasibility LMI Problem


Find x Rn such that F (x) < 0
Strict Feasibility LMI Problem
Find x Rn and R>0 such that
F (x) < In
LMI Optimization Problem
Find x Rn such that
F (x) < 0
c> x is minimized
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

12 / 30

Linear Matrix Inequalities


A trick for NonLinear MIs

Schur Complement
Given Q(x) = Q(x)> , R(x)  0, S(x) affinely dependent on x,
the NonLinear MI
Q(x) S(x)R(x)1 S(x)> < 0
is equivalent to the LMI


Q(x) S(x)
S(x)> R(x)

S. Grammatico (DEI UNIPI)

Introduction to LMIs

(7)


< 0.

(8)

Identification of Uncertain Systems

13 / 30

Brief Historical Perspective


Back to Lyapunov

First LMI in Control Theory (A.M. Lyapunov)

Lyapunov Inequality (1890)


x = Ax A.S. P  0 : A> P + P A 0

(9)

Lyapunov equality: A> P + P A = Q, P , Q  0


Matrices as variables

Further contributions
Lure (Stability under Saturations via LMIs);
Kalman, Yakubovich, Popov (Positive Real Lemma); ...
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

14 / 30

Brief Historical Perspective


Riccati revisited

On the LQ Optimal Control (J.C. Willems)

Algebraic Riccati (LM)Inequality (1971)



>
A> P + P A + Q P B + C > R1 P B + C > < 0

(10)

is equivalent (by Schur Complement) to




A> P + P A + Q P B + C >
>
P B + C>
R


< 0.

(11)

Interior-point algorithms for LMIs


(Y.E. Nesterov and A. Nemirovski)
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

15 / 30

Brief Historical Perspective


Today

LMIs are used for:


1

Stability analysis of uncertain systems

Robust control design for uncertain systems

Robust optimization

System identification

...

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

16 / 30

Simple LMI problems


Stability Analysis of Uncertain Linear Systems

Linear Differential Inclusions (Time-varying Uncertain Linear Systems)


x conv {Ai x | i [1, s]}

(12)

Quadratic Stability (Sufficient Condition)


P  0 : A>
i P + P Ai 0 i = (12) A.S.

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

(13)

17 / 30

Simple LMI problems


Robust Linear State-Feedback Control design (1)

Controlled Linear Differential Inclusions


x conv {Ai x + Bi u | i [1, s]} ,
1

u(x) = Kx

x conv {(Ai + Bi K)x}

NonLinear MI in P , K:
(Ai + Bi K)> P + P (Ai + Bi K) 0 i

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

(14)

(15)

18 / 30

Simple LMI problems


Robust Linear State-Feedback Control design (2)

Change of Variables for the LMI design of K:

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

19 / 30

Simple LMI problems


Robust Linear State-Feedback Control design (2)

Change of Variables for the LMI design of K:


4

Multiply (15) both on the left and on the right by P 1

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

19 / 30

Simple LMI problems


Robust Linear State-Feedback Control design (2)

Change of Variables for the LMI design of K:


4

Multiply (15) both on the left and on the right by P 1

Q := P 1

Y := KQ

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

19 / 30

Simple LMI problems


Robust Linear State-Feedback Control design (2)

Change of Variables for the LMI design of K:


4

Multiply (15) both on the left and on the right by P 1

Q := P 1

Y := KQ

LMI in Y , Q:
> >
Ai Q + QA>
i + Bi Y + Y Bi 0 i

(16)

P := Q1 , K := Y Q1
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

19 / 30

Outline
1
2

Introduction
Semi-Definite Programming
From Convex Optimization to Semi-Definite
Programming
Linear Matrix Inequalities
Definition
Brief Historical Perspective
First simple problems
Software
SeDuMi and CVX
Examples
Conclusion
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

20 / 30

Solver and Matlab interface


SeDuMi and CVX

Solver: SeDuMi (by J.F. Sturm)


http://sedumi.ie.lehigh.edu/

Matlab interface: CVX (by S. Boyd)


http://cvxr.com/cvx/
CVXOPT in Python
CVXGEN for C-code generation

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

21 / 30

Example 1
Variable Mass-Spring System as Uncertain Linear System (1)

m
x = kx bx
k [k, k]

kx

bx
m
x

1 := x, 2 := x,
w := k
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

22 / 30

Example 1
Variable Mass-Spring System as Uncertain Linear System (2)

Variable Mass-Spring System as Uncertain Linear System




0
1
=

w 1

(17)

w [0.1, 1]




0
1
0
1
A1 =
, A2 =
0.1 1
1 1
Robust LMI Analysis
A>
i P + P Ai 0, i = 1, 2

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

23 / 30

Example 1
Variable Mass-Spring System as Uncertain Linear System (3)

Matlab code using CVX


A{1} = [0 1; -0.1 -1]; A{2} = [0 1; -1 -1];
n = 2; s = 2;
cvx begin
variable P(n,n) symmetric
variable a
maximize(a)
P == semidefinite(n);
a >= 0;
for i=1:s
A{i}*P + P*A{i} + a*eye(n) == -semidefinite(n);
end
cvx end
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

24 / 30

Example 2
Quadratic Stabilizability is only Sufficient for Uncertain Linear Systems

Counterexample

x =

0
1

1
0


x+

w
1

w
1

(18)

w [w, w]

A1 = A2 = A, B1 =

w
1


, B2 =

Conservatism of Quadratics
(18) quadratic stabilizable (searching P, K) only if w [1, 1]

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

25 / 30

Example 2
Quadratic Stabilizability is only Sufficient for Uncertain Linear Systems

Counterexample

x =

0
1

1
0


x+

w
1

w
1

(18)

w [w, w]

A1 = A2 = A, B1 =

w
1


, B2 =

Conservatism of Quadratics
(18) quadratic stabilizable (searching P, K) only if w [1, 1]
(18) stabilizable w R
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

25 / 30

Example 3
Nonlinear Inverted Pendulum as Uncertain Linear System (1)

I = mgl sin() +

2l , I

mg

u = = x 2 = mgl sin(x1 ) x1 + 1 u
x1 := , x2 := ,
I
x1
I
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

26 / 30

Example 3
Nonlinear Inverted Pendulum as Uncertain Linear System (2)

Inverted Pendulum as Uncertain Linear System




 
0
1
0
x =
x+
u
aw(x) 0
b

(19)

w(0) = 1
x1 [ 4 , 4 ] w(x1 ) [0.9, 1]




0
1
0 1
A1 =
, A2 =
0.9 a 0
1a 0


0
B1 = B2 =
b2

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

27 / 30

Example 3
Nonlinear Inverted Pendulum as Uncertain Linear System (3)

Robust LMI Control design from (16)


> >
1
1
Ai Q + QA>
i + Bi Y + Y Bi 0, P = Q , K = Y Q

Matlab code using CVX


cvx begin
variable Q(n,n) symmetric
variable Y(m,n)
maximize(log det(Q))
Q == semidefinite(n);
for i=1:s
A{i}*Q + Q*A{i} + B{i}*Y + Y*B{i} == -semidefinite(n);
end
cvx end
P = Q^(-1); K = Y*P
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

28 / 30

Outline
1
2

Introduction
Semi-Definite Programming
From Convex Optimization to Semi-Definite
Programming
Linear Matrix Inequalities
Definition
Brief Historical Perspective
First simple problems
Software
SeDuMi and CVX
Examples
Conclusion
S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

29 / 30

Conclusion
LMIs in Systems and Control Theory

LMIs , Robust Analysis and Control design

LMIs , Uncertain Linear Systems

S. Grammatico (DEI UNIPI)

Introduction to LMIs

Identification of Uncertain Systems

30 / 30