+ All Categories
Home > Documents > Lec10_NC_Matlab_12

Lec10_NC_Matlab_12

Date post: 15-Dec-2015
Category:
Upload: freddy-veloza
View: 213 times
Download: 1 times
Share this document with a friend
Description:
matlab
Popular Tags:
27
Introduction LMI problem Solver Linear Matrix Inequality Teaching Assistant: Yousof Koohmaskan Nonlinear Control - Lecture 10 Instructor: Dr. A. Vali Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 1 / 27
Transcript

Introduction LMI problem Solver

Linear Matrix Inequality

Teaching Assistant:Yousof Koohmaskan

Nonlinear Control - Lecture 10

Instructor: Dr. A. Vali

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 1 / 27

Introduction LMI problem Solver

1 IntroductionPreface

2 LMI problemLMI example 1LMI example 2LMI example 3

3 SolverUsing SolverExamples

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 2 / 27

Introduction LMI problem Solver

Preface

n A hermitian n × n matrix P is positive definite iff ∀x ∈ Rn andx 6= 0,

xT Px > 0

n Thus1

xT Px > 0 ⇔ P � 0

n for a positive definite matrix P- all eigenvalues are positive- all sub-determinants are positive- all the diagonal components are positive

1In this lecture we use the character � to display positive definiteness ofmatrix and � to show semi-positive definiteness.

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 3 / 27

Introduction LMI problem Solver

Preface

n LMI stands for Linear Matrix Inequalityn Historically, first LMIs appeared around 1890 when Lyapunov

showed that the ODE:

ddt

x(t) = Ax(t)

is exponentially asymptotically stable iff there exists a solution tothe matrix inequalities:

PA + AT P ≺ 0, P = PT � 0

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 4 / 27

Introduction LMI problem Solver

Preface

F (x) = F0 +n∑

i=1

xiFi � 0

Fi Symmetric matricesxi Decision variables

n Constraint � means positive semidefinite e.g.(real) nonnegativeeigenvalues

n Strict version e.g. Fi � 0 means strictly positive eigenvalues

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 5 / 27

Introduction LMI problem Solver

Preface

n The main strength of LMI formulations is the ability to combinevarious design constraints or objectives in a numerically tractablemanner.

n solution set of systems of n individual LMI’s:

F1(x) ≺ 0,F2(x) ≺ 0, . . . ,Fn(x) ≺ 0,

It can be shown as one single LMI: (LMI formalism)

F (x) =

F1(x) 0 · · · 0

0 F2(x) · · · 0

......

. . ....

0 0 · · · Fn(x)

≺ 0

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 6 / 27

Introduction LMI problem Solver

Preface

n Non-linear matrix inequalities can be converted to linear matrixinequalities by Schur Complement: (LMI formalism)

F (x) =

[A BC D

]� 0

F (x) � 0⇔{

A � 0D − CA−1B � 0

F (x) � 0⇔{

D � 0A− BD−1C � 0

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 7 / 27

Introduction LMI problem Solver

LMI example 1

n Check Lyapunov stability of a linear system

x = Ax

using Lyapunov quadratic function

V (x) = xT Px

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 8 / 27

Introduction LMI problem Solver

LMI example 1

n Lyapunov stability condition

⇒ V (x) > 0⇒ V (x) < 0

means⇒ xT Px > 0 → P � 0

⇒ xT Px + xT Px < 0→ xT AT Px + xT PAx < 0→ xT (AT P + PA)x < 0→ AT P + PA ≺ 0

n Finally, an LMI is appeared,

P � 0, AT P + PA ≺ 0

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 9 / 27

Introduction LMI problem Solver

LMI example 2

n Design state-feedback that results in Lyapunov stability of alinear system

x = Ax + Bu, u = Kx

using Lyapunov quadratic function

V (x) = xT Px

n using state-feedback yields

x = (A + BK )x

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 10 / 27

Introduction LMI problem Solver

LMI example 2

n Lyapunov stability condition

⇒ V (x) > 0⇒ V (x) < 0

means

⇒ xT Px > 0 → P � 0

⇒ xT Px + xT Px < 0→ xT (A + BK )T Px + xT P(A + BK )x < 0

→ xT(

(A + BK )T P + P(A + BK )

)x < 0

→ (A + BK )T P + P(A + BK ) ≺ 0

n The last inequality isn’t an LMI, but applying change of variable,it can be converted to an LMI one.

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 11 / 27

Introduction LMI problem Solver

LMI example 2

n Assume Q = P−1

(A + BK )T P + P(A + BK ) ≺ 0⇒ (A + BK )T Q−1 + Q−1(A + BK ) ≺ 0

n multiplying above inequality by Q from left and right,

⇒ Q(A + BK )T + (A + BK )Q ≺ 0⇒ (AQ + BKQ)T + AQ + BKQ ≺ 0

n call Y = KQ,

⇒ (AQ + BY )T + AQ + BY ≺ 0

that is an LMI.

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 12 / 27

Introduction LMI problem Solver

LMI example 2

n Finally there is two inequalities

(AQ + BY )T + AQ + BY ≺ 0, Q � 0

n after finding Q and Y through numerical solver effort, thestate-feedback controller and Lyapunov function matrix isobtained as

K = YQ−1, P = Q−1

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 13 / 27

Introduction LMI problem Solver

LMI example 3

n Design state-feedback that results in Lyapunov stability of adiscrete time linear system

xi+1 = Axi + Bui , ui = Kxi

using Lyapunov quadratic function

V (xi) = xTi Pxi

n using state-feedback yields

xi+1 = (A + BK )xi

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 14 / 27

Introduction LMI problem Solver

LMI example 3

n Lyapunov stability condition in discrete time representation

⇒ V (xi) > 0⇒ ∆V (xi) = V (xi+1)− V (xi) < 0

means

⇒ xTi Pxi > 0 → P � 0

⇒ xTi+1Pxi+1 − xT

i Pxi < 0→ xT

i (A + BK )T P(A + BK )xi − xTi Pxi < 0

→ xTi

((A + BK )T P(A + BK )− P

)xi < 0

→ (A + BK )T P(A + BK )− P ≺ 0

n The last inequality isn’t an LMI, but applying change of variable,it can be converted to an LMI one.

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 15 / 27

Introduction LMI problem Solver

LMI example 3

n Using Schur complement

P − (A + BK )T P(A + BK ) � 0

⇒[

P (A + BK )T

(A + BK ) P−1

]� 0

n multiplying above inequality by diag{P−1, I} from left and right,

⇒[

P−1 P−1(A + BK )T

(A + BK )P−1 P−1

]� 0

n Assume Q = P−1,

⇒[

Q Q(A + BK )T

(A + BK )Q Q

]� 0

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 16 / 27

Introduction LMI problem Solver

LMI example 3

n or

⇒[

Q (AQ + BKQ)T

(AQ + BKQ) Q

]� 0

n call Y = KQ,

⇒[

Q (AQ + BY )T

(AQ + BY ) Q

]� 0

that is an LMI.n after finding Q and Y through numerical solver effort, the

state-feedback controller and Lyapunov function matrix isobtained as

K = YQ−1, P = Q−1

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 17 / 27

Introduction LMI problem Solver

Using Solver

n There are many solvers as computer programs and speciallyMATLAB toolbox, e.g., Yalmip, CVX, Sedumi,...

n CVX is a suitable and user friendly MATLAB toolbox. It is free andcan be downloaded by following address:

http://cvxr.com/cvx/

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 18 / 27

Introduction LMI problem Solver

Using Solver

n Add CVX folder in the toolboxes of MATLAB

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 19 / 27

Introduction LMI problem Solver

Using Solver

n Follow File -> Set Path... and click Add with Subfolders..., selectcvx and save it

n type cvx setup in the command line + Enter and that is readynow!

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 20 / 27

Introduction LMI problem Solver

Solution to analysis problem using cvx

n Analysis problem example; find Lyapunov function% stable exampleA=[-3 1; -2, -4];cvx begin sdpvariable P(2,2)minimize(0)subject toP>eye(2);A’*P+P*A<0;cvx end

n solution to P is as follows:

P =

[4.4250 −0.3048−0.3048 3.4727

]Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 21 / 27

Introduction LMI problem Solver

Solution to analysis problem (an unstable case)

n Since the matrix A has an unstable mode, there isn’t any solution% unstable exampleA=[3 1; -2, -4];cvx begin sdpvariable P(2,2)minimize(0)subject toP>eye(2);A’*P+P*A<0;cvx end

n following text is displayedStatus: InfeasibleOptimal value (cvx optval): +Inf

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 22 / 27

Introduction LMI problem Solver

Solution to design problem (continuous time)

n Finding state-feedback,% Design ExamplesA=[3 1; -2, -4];B=[0;1];cvx begin sdpvariables Q(2,2) Y(1,2)minimize(0)subject toQ>0.01*eye(2);(A*Q+B*Y)’+(A*Q+B*Y)<0;cvx endP=inv(Q);K=Y*inv(Q)

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 23 / 27

Introduction LMI problem Solver

Solution to design problem (continuous time)[cont’d]

n Solution that are obtained for P and K ,

P =

[48.9032 7.88917.8891 1.5687

]K =

[−88.1497 −10.7267

]

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 24 / 27

Introduction LMI problem Solver

Solution to design problem (discrete time)

n Finding state-feedback,% Discrete time state-feedback designA=[ 1.05, 0.02; -0.04, 0.95];B=[0;1];cvx begin sdpvariables Q(2,2) Y(1,2)minimize(0)subject toQ>0.01*eye(2);[Q, (A*Q+B*Y)’; (A*Q+B*Y), Q]>0;cvx endP=inv(Q);K=Y*inv(Q)

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 25 / 27

Introduction LMI problem Solver

Solution to design problem (discrete time) [cont’d]

n Solution that are obtained for P and K ,

P =

[12.6311 2.35592.3559 0.8317

]K =

[−3.7992 −1.3158

]

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 26 / 27

Introduction LMI problem Solver

NNNNNNNNNN

Any Question?

Yousof Koohmaskan (Nonlinear Control) Linear Matrix Inequality May 2012 27 / 27