LMITOOL: a Package for LMI Optimization - CiteSeerX

15 downloads 49071 Views 209KB Size Report
matlab-like scienti c software package Scilab). that allows the user to ..... Bu. Cq Dqp Dqu. 2. 4 x p u. 3. 5; p = (t)q; where A is n n, Bp (resp. CT q ) is n N, Bu is ...
LMITOOL:

a Package for LMI Optimization

L. EL GHAOUI Ecole Nationale Superieure de Techniques Avancees 32, Bd. Victor, 75739 Paris, France e-mail: [email protected]

ABSTRACT

Many problems in systems and control can be formulated as \Linear Matrix Inequality" (LMI) problems. Recently, ecient algorithms have been developed for solving LMI's of reasonable size. Using these programs for solving control problems however requires a reformulation of the problem, which often implies a great deal of tedious algebraic manipulations. In this paper, we present a complete package (toolbox) for Matlab (a version of which is available in the free matlab-like scienti c software package Scilab). that allows the user to solve his control problem using LMI methods with very little e ort. Applications of LMIs in systems and control, and the use of LMITOOL are illustrated by a number of examples.

1. Introduction Many problems in systems and control can be formulated as the following optimization problem (see [1]) referred to as a  problem: minimizef (X1 ; : : :; XM ) subject to: Gi(X1 ; : : :; XM ) = 0; i = 1; 2; :::; p; Hj (X1 ; : : :; XM )  0; j = 1; 2; ::; q: where  X1 ; : : :; XM are unknown real matrices, referred to as the unknown matrices,  f is a real linear scalar function of the entries of the unknown matrices X1 ; : : :; XM ; it is referred to as the objective function,  Gi 's are real matrices with entries which are ane functions of the entries of the unknown matrices, X1 ; : : :; XM ; they are referred to as \Linear Matrix Equality" (LME) functions,  Hj 's are real symmetric matrixces with entries which are ane functions of the entries of the unknown matrices X1 ; : : :; XM ; they are referred to as \Linear Matrix Inequality" (LMI) functions. (In this paper, V  0 stands for V positive semi-de nite unless stated otherwise).

R. NIKOUKHAH and F. DELEBECQUE INRIA, Rocquencourt, 78153 Le Chesnay Cedex, France e-mail: [email protected] The purpose of LMITOOL is to solve problem  in a user-friendly manner in Matlab. This package acts as an interface to the program Semide nite Programming SP [7]. This code is intended for small and moderate-sized problems (up to a few hundred variables).

2. Function lmisolver LMITOOL is built around the Matlab function lmisolver. This function computes the solution X1 ; : : :; XM of problem , given functions f , Gi and Hj . To solve , user must provide an evaluation function which \evaluates" f , Gi and Hj as a function the unknown matrices, as well as an initial guess on the values of the unknown matrices. User can either invoke lmisolver directly, by providing the necessary information in a special format or he can use the interactive function lmitool described in Section 3.

2.1 Syntax xvar = lmisolver(evalfcn,xdata,options)

where



evalfcn: string containing the name of an evaluation Matlab function. This function must have a special syntax, described in section 2.2.  xdata: a vector containing the data matrices, stored using stack.m, as follows: >> xdata = stack(D1,...,DN)

(For details about the function stack, see [8].)  options: a 51 vector containing optimization parameters Mbnd, abstol, nu, maxiters, and reltol. Ssee the user's guide of the SP package for details (Mbnd is a multiplicative coecient for M). This argument is optional, if omitted, default parameters are used. and  xvar: a vector containing the unknown matrices, stored using stack.m. The solution is recovered with

>> [X1,...,XM] = unstack(xvar)

If the problem is unfeasible, the returned matrices are empty. (For details about the function unstack, see [8].)

2.2 Format of the evaluation function

The evaluation function must be written by the user. In this le, the user speci es the initial guess on the matrix variables, and the LME, LMI and objective functions Gi ; Hj ; f of the problem. Its syntax is [LME,LMI,OBJ] = (xdata,xvar)

where



xdata: a vector containing the data matrices, stored using stack.m.  xvar: a vector containing the unknown matrices, stored using stack.m. The output values LME, LMI and OBJ depend on the number of calling arguments.  If is called with one argument xdata, { LME is a vector containing the initial guesses for optimization problem (), stored using stack as follows: LME = stack(X1init,...,XMinit)

These value of the initial guesses need not be feasible, i.e. they may not satisfy the LME and/or LMI constraints. However, the matrices X1init, : : : , XMinit must have correct sizes. { LMI, OBJ are empty in this case.  If is called with both arguments xdata and xvar, { LME contains the value of the LME functions Gi (D1 ; : : :; DN , X1 ; : : :; XM ). (For p > 1, G1; : : :; Gp must be stored using stack.m.) { LMI contains the value of the LMI functions Hj (D1 ; : : :; DN , X1 ; : : :; XM ). (For q > 1, H1; : : :; Hq must be stored using stack.m.) { OBJ is a scalar taking the value of the linear objective f (D1 ; : : :; DN , X1 ; : : :; XM ). For feasibility problems, OBJ is empty.

2.3 Example

Consider the linear system

x_ = Ax + Bu (1) where A is an n  n and B , an n  nu matrix. There exisis a stabilizing state feedback K for (1) such that for every initial condition x(0) with kx(0)k  1, the resulting control satis es ku(t)k for all t  0, if and only if there exist an n  n matrix Q and an nu  n matrix Y satisfying the equality constraint Q ? QT = 0 and the inequality constraints Q  0 T T ?AQ ? QA ? BY ? Y BT > 0 u2max I Y YT Q  0 in which case one such K can be constructed as K = Y Q?1. To solve this problem using lmisolver, we rst need to construct the evaluation function. function [LME,LMI,OBJ] = sf_sat_eval(xdata,xvar) [A,B,umax] = unstack(xdata); [n,nu] = size(B); if nargin == 1, Qinit = zeros(n); Yinit = zeros(nu,n); LME = stack(Qinit,Yinit); return, end [Q,Y] = unstack(xvar); LME = Q-Q'; lmi_lyap = -(A*Q+Q*A'+B*Y+Y'*B'); lmi_sat = [Q Y'; Y (umax^2)*eye(nu)]; lmi_x0 = Q-eye(n); LMI = stack(lmi_lyap,lmi_sat,lmi_x0); OBJ = [];

Note that OBJ=[] indicates that the problem considered is a feasibility problem, i.e., we are only interested in nding a set of Xi 's that satisfy LME and LMI functions. These commands can of course be encapsulated in a Matlab function, say sf_sat. Then, to solve this problem, all we need to do is type (assuming A, B and umax already exist in the environment): >> [Q,Y]=sf_sat(A,B,umax)

We call sf_sat.m the solver function for this problem.

3. The function lmitool.m

3.1 Description

The purpose of lmitool is to automate most of the steps required to invoke lmisolver. lmitool generates two les:  A solver function that invokes lmisolver.

 The skeleton of an evaluation function. The user must edit the evaluation function to de ne the LMI problem. Then the solver function can be invoked. The syntax of lmitool.m is lmitool(probname,varlist,datalist)

where



probname: a string that contains the name of the problem to be solved.  varlist: a string containing the names of unknown matrices (separated by commas if there are more than one). The maximum admissible number of unknown matrices is 15. (For problems with many unknown matrices, see x4.3.)  datalist: a string containing the names of data matrices (separated by commasif there are more than one). The maximumadmissible number of data matrices is 15. (For problems with many data matrices, see x4.3.) lmitool has no outputs. it just generates two Matlab functions: the solver, .m, and the skeleton of the evaluation function, _eval.m. When called with no inputs, lmitool asks the user to specify them interactively. In varlist and datalist, the use of some variable/data names are forbidden. An error results if the user chooses a forbidden name.

3.2 Solving the example using lmitool

To solve the example of section 2.3, we issue the following command at the Matlab prompt. >> lmitool('sf_sat','Q,Y','A,B,umax') lmitool generates the skeleton of the evaluation function, sf_sat_eval.m. This skeleton is

function [LME,LMI,OBJ] = sf_sat_eval(xdata,xvar) % function [LME,LMI,OBJ] = sf_sat_eval(xdata,xvar) % sf_sat_eval: evaluation function for lmisolver. % created by lmitool on 7-Feb-95 [A,B,C] = unstack(xdata); % INITIAL GUESS (need not be feasible) if nargin == 1, Qinit = ... Yinit = ... LME = stack(Qinit,Yinit); return, end % LME, LMI AND OBJECTIVE [Q,Y] = unstack(xvar); LME = ... % for multiple LMEs or LMIs, use stack.m LMI = ... OBJ = ...

It is easy to see how a small amount of editing can do the rest! lmitool has also generated a solver function, sf_sat.m:

function [Q,Y]=sf_sat(A,B,umax) % function [Q,Y]=sf_sat(A,B,umax) % created by lmitool on 4-Feb-95 % optimization parameters Mbnd=1e3; abstol=1e-5; nu=10; maxiters=100; reltol=1e-5; options = [Mbnd abstol nu maxiters reltol]; % stack data into one vector xdata = stack(A,B,umax); % invoke lmisolver xvar = lmisolver('sf_sat_eval',xdata,options); % unstack result [Q,Y] = unstack(xvar);

Once the editing of the evaluation function is completed, we can directly invoke the above solver function, with the command >> [Q,Y] = sf_sat(A,B,umax)

4. Examples

4.1 Stabilization of jump linear systems

We are given a linear system x_ = A(r(t))x + B (r(t))u; where A is n  n and B is n  nu . The scalar parameter r(t) is a continuous-time Markov process taking values in a nite set f1; : : :; N g. For each possible value of r(t) 2 f1; : : :; N g, we have A(r(t)) = Ai , B (r(t)) = Bi when r(t) = i. The transition probabilities of the process r are de ned by a \transition matrix"  = (ij ). Such systems, referred to as \jump linear systems", can be used to model linear systems subject to failures, see e.g. [2]. We seek a state-feedback control law such that the resulting closed-loop system is mean-square stable. That is, for every initial condition x(0), the resulting trajectory of the closed-loop system converges to zero in the mean-square sense. The control law we look for is a mode-dependent linear state-feedback, i.e. it has the form u(t) = K (r(t))x(t), where K (r(t)) = Ki when r(t) = i. Using the results of [2], it can be shown that the above problen has a solution if and only if there exist n  n matrices Q1 ; : : :; QN , such that Qi =0 QTi > 0; TrQ1 + : : : + Tr1QN = 1;

NiT @Ai Qi + Qi ATi +

N X j =1

jiQj A Ni < 0;

(2)

i = 1; : : :; N; where Ni is the matrix of maximal rank such that BiT Ni = 0. If (2) holds, a mode-dependent, stabilizing state-feedback can be easily computed from the matrices Qi. To solve the above problem, we have created an evaluation function, jump_sf_eval, using lmitool. The calling sequence was

>> lmitool('jump_sf','QQ','AA,BB,Pi')

In the above, we use the convention to store the matrices Ai in a single matrix AA = [A1 ... AN], and likewise for Bi ; Qi. The evaluation function is, after editing, function [LME,LMI,OBJ] = jump_sf_eval(xdata,xvar) % function [LME,LMI,OBJ] = jump_sf_eval(xdata,xvar) % jump_sf_eval: evaluation function for lmisolver. % created by lmitool on 2-Feb-95 [AA,BB,Pi] = unstack(xdata); [n,nN] = size(AA); N = nN/n; [n,nuN] = size(BB); nu = nuN/N; I = eye(nu,nu); if nargin == 1, % INITIAL GUESS QQinit = zeros(n,nN); LME = stack(QQinit); return, end % LME, LMI AND OBJECTIVE [QQ,YY] = unstack(xvar); LME = []; tr = 0; for i = 1:N, Qi = QQ(:,1+(i-1)*n:i*n); Ai = AA(:,1+(i-1)*n:i*n); Bi = BB(:,1+(i-1)*nu:i*nu); Ni = null(Bi'); lyapi = Ai*Qi+Qi*Ai'; for j = 1:N, Qj = QQ(:,1+(j-1)*n:j*n); lyapi = lyapi+Pi(j,i)*Qj; end LME = stack(LME,Qi-Qi'); LMI = stack(LMI,-Ni'*lyapi*Ni); LMI = stack(LMI,Qi); tr = tr+trace(Qi); end LME = stack(LME,tr-N); OBJ = [];

Note that an arbitrary (data-dependent) number of LMEs and LMIs can be \added" using stack.m, inside a loop. After editing the evaluation function jump_sf_eval, we can solve a given problem using the solver function generated by lmitool, with the command >> QQ = jump_sf(AA,BB,Pi)

n = max(size(A)); I = eye(n); if nargin == 1, % INITIAL GUESS Xinit = zeros(n); LME = Xinit; return, end % LME, LMI AND OBJECTIVE [X] = unstack(xvar); LME = E'*X-X'*E; LMI = stack(-A'*X-X'*A-I,E'*X); OBJ = [];

4.3 State-feedback controller for an uncertain system

Sometimes, the number of input matrices is so large it makes the use of a datalist cumbersome. This example shows how to cope with this case. Also, this example shows how to cope with matrix variables with structure, e.g. block-diagonal. We are given a time-varying system 2 x_ 3  2 x 3 A B B 4 q 5 = C D p D u 4 p 5 ; p = (t)q; q qp qu y u

where A is n  n, Bp (resp. CqT ) is n  N , Bu is n  nu , Dqp is N  N and Dqu is N  nu . The diagonal matrix (t) has the following diagonal structure: (t) = diag (1 (t)Ir1 ; : : :; L (t)IrL ) ; with r1; : : :; rL given indices, with r1 + : : : + rL = N (in the above, Ik stands for the identity matrix of size k  k). Systems of the above form arise in robust control of systems with (time-varying) parametric uncertainty (see e.g. [4]). We seek a constant, state-feedback controller such that the closed-loop system is stable whenever k(t)k  ?1 for every t, where > 0 is given. Denote by B(r) the set of N  N block-diagonal matrices of the form diag(B1 ; : : :; BL), with each block Bi of size ri  ri. In [4], it is shown that the system is robustly stabilizable if Q = QT > 0; T = T T > 0; H = ?H T ; T;h H 2 B(r); TriT = N; M11 M12 < 0; T M22 M12

4.2 Stability of descriptor linear systems

In the study of descriptor systems, it is sometimes necessary to nd (or nd out that it does not exist) an n  n matrix X satisfying

ET X

= XT E AT X + X T A + I

 0  0

where E and A are n  n matrices such that E; A is a regular pencil. In this problem, the LME functions play important role. The evaluation function can be written as function [LME,LMI,OBJ] = stab_des_eval(xdata,xvar) % function [LME,LMI,OBJ] = stab_des_eval(xdata,xvar) % stab_des_eval: evaluation function for lmisolver. % created by lmitool on 6-Feb-95 [E,A] = unstack(xdata);

(3)

hold for some matrices Q, T , H and Y of appropriate size, where M11 =

 AQ + QAT + Bp TBpT  BuTY + YTT BTuT  ;  +QC q + Y Dqu

M12 = +Bp TDT + Bp H T ? 2 Tqp+ Dqp H ? HDT M22 = Dqp TDqp qp

For every feasible matrices, a robustly stabilizing control law is u = Y Q?1x. We choose to store the data matrices as follows: >> >>

xsyst = stack(A,Bp,Bu,Cq); xsyst = stack(xsyst,Dqp,Dqu,gamma,r);

We then call lmitool: >>

lmitool('sfrob','Q,Y,T,H','xsyst')

In the evaluation le, we need to get the matrices A, Bu, etc, back from the vector xsyst. This must be done using unstack again, as follows: function [LME,LMI,OBJ] = sfrob_eval(xdata,xvar) % function [LME,LMI,OBJ] = sfrob_eval(xdata,xvar) % sfrob_eval: evaluation function for lmisolver. % created by lmitool on 7-Feb-95 [xsyst] = unstack(xdata); [xsyst,Dqp,Dqu,gamma,r] = unstack(xsyst); [A,Bp,Bu,Cq] = unstack(xsyst); [n,nu] = size(Bu); N = size(Dqp,1); % INITIAL GUESS (need not be feasible) if nargin == 1, Qinit = zeros(n); Yinit = zeros(nu,n); Tinit = zeros(N); Hinit = zeros(N); LME = stack(Qinit,Yinit,Tinit,Hinit); return, end % LME, LMI AND OBJECTIVE [Q,Y,T,H] = unstack(xvar); LME = stack(Q-Q',T-T',H+H',trace(T)-N); W = ones(N,N); for i = 1:length(r), indi = sum(r(1:i-1)); indi = 1+indi:indi+r(i); W(indi,indi) = zeros(r(i),r(i)); end LME = stack(LME,W.*T,W.*H); end lmi_ric = -[A*Q+Q*A'+Bu*Y+Y'*Bu'+Bp*T*Bp' ... Q*Cq'+Y'*Dqu'+Bp*T*Dqp'+Bp*H; ... (Q*Cq'+Y'*Dqu'+Bp*T*Dqp'+Bp*H)' ... Dqp*T*Dqp'-gamma^2*T+Dqp*H-H*Dqp']; LMI = stack(Q,T,lmi_ric); OBJ = [];

4.4 Robust static estimation

We consider an estimation problem. y = Hx + V w; where w is a unit-variance, zero-mean gaussian vector, and H is a tall matrix. All we know about H; V is that  H V  2 Co  H V  ; : : :;  H V  ; N N 1 1 where Hi ; Vi are given and Co denotes convex hull. We seek a linear estimate x^ of x in the form x^ = Ly; such that  the estimate is unbiased for every i,  the resulting variances are minimized, that is, maxi Ekxi ? x^ik2 is as small as possible. To solve the problem, we can minimize subject to  T T  I ? LHi = 0; Xi = XiT ; LVI ViXL > 0; i i i = 1; : : :; N;

> Xi (j; j ) for every j; j = 1; : : :; n:

The variables are: , L and X1 ; : : :; XN . We choose to store the Xi 's into one matrix XX = [X1...XN]. The command >> [L,XX,gamma]=mm_estim(HH,VV,N)

solves the problem.

4.5 Reduced-order output-feedback stabilization

We are given a linear system

x_ = Ax + Bu; y = Cx; where A is nn, B is nnu and C is ny n. We seek a dynamic, output-feedback controller of reduced-order, that stabilizes the system. Unfortunately, this problem is not convex and thus, not amenable directly to LMI methods. However, consider the following LMI problem. minimize ? Tr(P + Q ) subject to NBT ?AQ + QAT  NB < 0; NCT A T P + PA NC < 0; (4) P I  0: I Q (In the above, NB (resp. NC ) denotes the matrix of maximal rank such that B T NB = 0 (resp. C NC = 0).) We have observed [5] that solving the above LMI problem sometimes (but not always) results in feasible matrices P; Q that are inverse of each other. It can be shown [3] that when this is the case, there exists a stabilizing, static output-feedback controller. That is, the LMI problem (with P = Q?1 now xed) Find K such that (A + BKC )T P + P (A + BKC ) < 0;

(5)

is feasible. Solving problem (4) is actually the rst step of the more re ned algorithm described in [5] for reduced-order control. For solving problem (4) using LMITOOL, we have generated a solver function for problem (4), called of.m. This function has the syntax >> [P,Q] = of(A,B,C)

Once P and Q are found, a static output-feedback controller can be found by solving problem (5), with the command K = recov_contr(A,B,C,P)

(Of course, the returned matrix K is empty when the matrices P and Q found previously are not inverse of each other.)

Acknowledgments

The authors wish to thank Stephen Boyd and Lieven Vandenberghe for comments and help, and for making preliminary versions of their package available to us. We also thank Gerard Scorletti for conducting tests and making helpful comments.

5. References [1] [2] [3] [4] [5] [6] [7]

[8]

S. Boyd, L. El Ghaoui, E. Feron, and V. Balakrishnan. Linear matrix inequalities in systems and control theory. volume 15 of Studies in Appl. Math. SIAM, June 1994. L. El Ghaoui and M. Ait-Rami. Robust statefeedback stabilization of jump linear systems. Submitted to Int. Jour. Control, 1994. L. El Ghaoui and P. Gahinet. Rank minimization under LMI constraints: a framework for output feedback problems. In Proc. of the European Contr. Conf., July 1993. L. El Ghaoui and G. Scorletti. Control of rational systems using Linear-Fractional Representations and Linear Matrix Inequalities. Submitted to Automatica, September 1994. L. El Ghaoui, F. Oustry and M. Ait Rami. A Balancing Algorithm for Static OutputFeedback and Related Problems. In preparation. L. Vandenberghe and S. Boyd. Semide nite programming. SIAM Review, July 1994. To appear. L. Vandenberghe and S. Boyd. SP, Software for semide nite programming, user's guide, December 1994. Available via anonymous ftp to isl.stanford.edu under /pub/boyd/semidef_prog. L. El Ghaoui, F. Delebecque, and R. Nikoukhah. LMITOOL: A front-end for LMI optimization, user's guide, February 1995. Available via anonymous ftp to ftp.ensta.fr, under /pub/elghaoui/lmitool.

A. How to get LMITOOL

A.1 Required software

To use LMITOOL, the user must have:  Matlab version 4:0 or higher.  The SP package [7]. This package can be obtained via anonymous ftp to isl.stanford.edu, under /pub/boyd/semidef_prog.

A.2 Installing the package

To install LMITOOL, follow the steps below.

1. FTP to ftp.ensta.fr, and go under directory pub/elghaoui/lmitool. Transfer the les README and lmitool.tar.Z. (LMITOOL can also be obtained using netscape (http://www.ensta.fr/ gropco/.) 2. Move lmitool.tar.Z to the directory where you want the code to live. 3. At the Unix prompt, issue the command > zcat lmitool.tar.Z | tar xvf -

This creates a directory lmitool, with Matlab m- les and two subdirectories: lmitool/EXAMPLES (containing examples), and lmitool/DOC (containing a postscript le doc.ps with the user's guide.) Please send e-mail to [email protected] if you wish to be informed about future updates of this software.

A.3 Related software

LMITOOL is also available within the 2.1 version of the Matlab-like package Scilab. Scilab is available via anonymous ftp to ftp.inria.fr, under INRIA/projects/Meta2/Scilab. Another front-end to the SP package, called SDPSOL, is currently being developed by S. Boyd and coworkers. This front-end is written in C and is standalone.

Suggest Documents