Vous êtes sur la page 1sur 4

# LMI’s and the LMI Toolbox

Siep Weiland∗

## DISC course “LMI’s in Systems and Control”

1st December 2004

## 1 LMI’s and the LMI toolbox

A most efficient way to implement LMI’s in Matlab° c
is by means of the YALMIP interface. See the slides and
the course site. This document only describes the implementation of LMI’s in the LMI control toolbox and in the
LMI-lab.

1.1 Implementation

In the LMI toolbox, the data for the description of a linear matrix inequality is internally represented in one vector.
This vector encodes the structure and dimension of the LMI, the structure and dimension of the unknown variables
and a description of all terms which occur in the inequality. The toolbox can handle any system of LMI’s which
take the form

## N > L(X1 , . . . , XK )N ≺ M > R(X1 , . . . , XK )M (1)

where the Xi ’s are the (unknown) matrix variables, possibly with some prescribed structure, N and M are (known)
square matrices of identical dimensions and L(·) and R(·) are symmetric block matrices with identical block
structures. Each block of L(·) and R(·) is an affine expression in the matrix variables X1 , . . . , XK and their
transposes and consists of the sum of elementary terms. A term is constant when it does not depend on either of
the decision variables, otherwise it is variable.
An LMI of this type can be specified in Matlab°
c
in either of the following ways:

1. by means of the interface lmiedit, an interactive graphical LMI editor to symbolically enter a system of
LMI’s.
2. by means of the more powerful command-line routines lmivar and lmiterm to incrementally define a
system of LMI’s.

For beginners, the simplest way to specify an LMI is by typing lmiedit at the Matlab° c
prompt. This will
give you a graphical user interface in which all data for the specification of an LMI can be entered in symbolic
expressions. For more experienced and more demanding users, the command line routines lmivar and lmiterm
allow for an incremental specification of a system of LMI’s. The usage of the latter is described as follows.

Initialization step To initialize a void structure, first give the command setlmis([]), possibly followed by
lmi1=newlmi to attach an identifying tag to the LMI you wish to specify.
∗ Department of Electrical Engineering, Eindhoven University of Technology, P.O. Box 513, 5600 MB Eindhoven, E-mail:

s.weiland@tue.nl.

1
Variable definition For each of the unknown matrix variables X1 , . . . , XK in (1), invoke the routine lmivar to
define its structure and dimension. It turns out handy to respect the index-ordering 1, . . . , K in doing so.
The syntax is X=lmivar(type,struc), where
• type=1 for symmetric block diagonal matrices of the form
X = diag(S1 , . . . , SJ ),
where each of the Sj is either a full symmetric matrix, a scalar multiple of the identity matrix, or
identically zero. In this case, struc is a J × 2 matrix whose jth row is set as [sj,tj] where sj is
the size of Sj and

1 if Sj is full symmetric
tj = 0 if Sj = sj I or

-1 if Sj = 0
• type=2 to specify a full m × n rectangular matrices. In this case struc=[m,n].
• type=3 for a-typical structures in which each entry of X can be specified as zero or non-zero. In
this case struc has the dimension of X and struc(i,j)=0 if X(i, j) = 0; struc(i,j)=n if
X(i, j) = xn ; struc(i,j)=-n if X(i, j) = −xn .
term specification The term content of an LMI is specified with lmiterm. The syntax is
lmiterm(id,A,B)
where A and B are real matrices, id=[lmi1,i,j,k] refers to the (i, j)th block of L(·) in (1) and k is an
integer between −K and K. The command
lmiterm([lmi1,i,j,k],A,B)
adds the term AXk B, AXk> B or A to the (i, j)th block of L(·) in lmi1, depending on whether k is positive,
negative or zero, respectively. Here, k will refer to the matrix variable Xk provided that Xk has been defined
as the kth call of lmivar. The ‘outer-matrix’ N in (1) is an identity matrix by default, but can be set as A by
taking id=[lmi1 0 0 0]. The right-hand side of (1) is zero be default, but can be similarly specified by
replacing the first entry lmi1 in id by -lmi1. When describing an LMI with several blocks, it is important
that
only the terms of the blocks on and above the diagonal need to be specified this way.
As a further comment, if A and/or B is a scalar matrix i.e., a matrix of the form λI with λ ∈ R, then A or B
may be set equal to the scalar λ. Zero matrices need not be specified in the term contents.
final step The specification is completed with the command lmisys=getlmis;. This returns the internal
Matlab° c
representation of (1) in the variable lmisys. Don’t forget the semicolon as you do not want to
see or understand the entries of this variable.

## 1.2 The LMI solvers

The basic routines for numerically solving the two generic problems formulated in the lecture notes are the follow-
ing

## • feasp to compute a solution to the feasibility problem

• mincx to compute a solution to the optimization problem

## Each of these routines is implemented as a .mex file in Matlab° c

and takes a variable which represents the data of
an LMI as its input. These routines do not return a feasible or optimal set of matrix variables X1 , . . . , XK , but a
vector x of decision variables x1 , . . . , xm which constitute the non-zero independent entries of X1 , . . . , XK . The
matrix variables X1 , . . . , XK are retrieved from x by the routine dec2mat. Specifically, Xk is obtained by the
command Xk=dec2mat(lmisys,x,k).

2
1.3 Information retrieval

The routine lmiinfo can be used to interactively retrieve information about a linear matrix inequality of the form
(1), its specific structure, block dimensions and term contents in the affine functions L(·) and R(·).

1.4 Validation

A solution X1 , . . . , XK of (1) can be validated with the routines evallmi and showlmi. We refer to the
corresponding help information of these routines for more details.

## 2 System interconnections in the LMI toolbox

System interconnections are the core of many problems in engineering and so it is of quite some interest to have
efficient routines to implement complex interconnections of dynamical systems. Simple interconnected structures
such as parallel, series and feedback interconnections are usually at the basis of large interconnected structures, but
it may be quite cumbersome to always resort to the primitive ‘building blocks’ for the implementation of larger,
complex interconnected systems. Especially in H∞ controller design, the introduction of a considerable number
of exogenous variables (disturbances, to-be-controlled variables, reference signals) and their dynamic weights may
easily lead to a complex configuration of interconnected subsystems. The purpose of this note is to discuss and
describe Matlab routines for the implementation of such structures. I realize that manuals of this type are utmost
boring to read, but some understanding of the intricate structure of at least one of these routines is unavoidable to
design controllers.

## 2.1 Making system interconnections in the LMI toolbox

The routine sconnect specifies general interconnections of a finite set of linear time-invariant dynamical systems
in the LMI toolbox. When referring to system matrices, we will mean a dynamical system represented in the
internal format for the LMI toolbox. (See ltisys to create such objects).

Syntax

[G,r] = sconnect(inputs,outputs,Kin,G1in,g1,G2in,g2,...

Description

sconnect is useful in loop-shaping problems to turn general control structures into the standard linear-fractional
interconnection. In this context, sconnect returns

## 1. the system matrix G of an augmented plant G(s)

2. the vector r=[nu ny] consisting of the number of input and output variables of the controller, respectively.

General control loops or system interconnections are described in terms of signal flows. It is for this reason that
you must specify

## 1. the exogenous inputs, i.e., what signals enter the interconnection.

2. the output signals, i.e., the signals generated by the loop or the interconnection.
3. how the inputs of each dynamical system in the structure relate to the exogenous inputs and to the outputs
of the (sub-)systems.

3
The outputs of a system with name G are collectively denoted by G. To refer to particular outputs, e.g., the second
and third, use the syntax G(2:3). The arguments for sconnect are as follows:

1. inputs is a string variable (and hence specified between single quotes ’...’) which lists the exogenous
inputs. For instance, inputs=’r(2);d’ specifies two inputs, a vector r of size 2 and a scalar input d.
2. outputs is a string listing the outputs generated by the interconnection. Outputs are defined as linear
combinations of exogenous inputs and outputs of dynamical systems. For instance, outputs = ’e=r-S
; S+d’ defines two outputs e = r − y and y + d where y is the output of the system named S. (The name
of a system may be different from the system matrix that represents S in the LMI toolbox).
3. Kin is a rather strange obligatory argument that specifies the controller in the interconnection. For instance,
Kin=’K:e’ inserts a controller of name K and input e. If no controller is present in the interconnection
you have to set Kin = [].
4. The remaining arguments come in pairs and specify, for each known LTI system Gk in your configuration,
its input list Gkin and its LMI system matrix representation gk. The input list Gkin is a string of the form
Gkin = ’Gk: input1; input2; input3; ... ; inputn’
For instance Gkin=’Gk:Plant(2);d’ specifies the LTI system Gk with name Gk whose inputs are,
respectively, the second output of the system with name Plant and the input signal d. Note that the names
given to the components in your configuration are immaterial provided they are used consistently throughout
the definitions.

2.2 Example
Consider the interconnection of Figure 1 where P is a plant, C a controller and W1 , W2 denote weighting filters.
Suppose that P , W1 and W2 are specified by the system matrices plant, w1 and w2, respectively. The controller
C needs to be designed and is not part of the known components in the interconnection. We define an ‘augmented’
plant G for this system, which takes r and u as its inputs and outputs the outputs of W1 and W2 together with e.
Doing so, the controller (which needs to be designed) defines a mapping C : e 7→ u in this example.

6 6

W1 W2

6 6
r + e u y
-e - C - P -
6−

## The augmented plant G is then specified as follows

inputs = ’r;u’;
outputs = ’W1;W2;e’;
G = sconnect(inputs,outputs,[],’P:u’,plant,’W1:e’,w1,’W2:u’,w2);

Siep Weiland