Here the lmivar commands
define the two matrix variables X and S while
the lmiterm commands describe
the various terms in each LMI. Upon completion, getlmis returns the internal representation LMISYS of
this LMI system. The following subsections give more details on the
syntax and usage of these various commands:

Initializing the LMI System

The description of an LMI system should begin with setlmis and end with getlmis. The function setlmis initializes the LMI system description.
When specifying a new system, type

setlmis([])

To add on to an existing LMI system with internal representation LMIS0,
type

setlmis(LMIS0)

Specifying the LMI Variables

The matrix variables are declared one at a time with lmivar and are characterized by their
structure. To facilitate the specification of this structure, the
LMI Lab offers two predefined structure types along with the means
to describe more general structures:

Type 1

Symmetric block diagonal structure. This
corresponds to matrix variables of the form

X=(D10…00D2⋱⋮⋮⋱⋱00…0Dr)

where
each diagonal block Dj is
square and is either zero, a full symmetric matrix,
or a scalar matrix

Rectangular structure.
This corresponds to arbitrary rectangular matrices without any particular
structure.

Type 3

General structures.
This third type is used to describe more sophisticated structures
and/or correlations between the matrix variables. The principle is
as follows: each entry of X is specified independently
as either 0, xn, or –xn
where xn denotes the n-th
decision variable in the problem. For details on how to use Type 3,
see Structured Matrix Variables as well as the lmivar entry in the reference pages.

In Specifying LMI System,
the matrix variables X and S are
of Type 1. Indeed, both are symmetric and S inherits
the block-diagonal structure from Equation 4-5 of D. Specifically, S is
of the form

S=(s10000s10000s2s300s3s4).

After initializing the description with the command setlmis([]), these two matrix variables
are declared by

lmivar(1,[6 1]) % X
lmivar(1,[2 0;2 1]) % S

In both commands, the first input specifies the structure type
and the second input contains additional information about the structure
of the variable:

For a matrix variable X of Type
1, this second input is a matrix with two columns and as many rows
as diagonal blocks in X. The first column lists
the sizes of the diagonal blocks and the second column specifies their
nature with the following convention:

1: full symmetric block

0: scalar block

–1: zero block

In the second command, for instance,[2 0;2 1] means
that S has two diagonal blocks, the first one
being a 2-by-2 scalar block and the second one a 2-by-2 full block.

For matrix variables of Type 2, the second input of lmivar is a two-entry vector listing
the row and column dimensions of the variable. For instance, a 3-by-5
rectangular matrix variable would be defined by

lmivar(2,[3 5])

For convenience, lmivar also
returns a "tag" that identifies the matrix variable
for subsequent reference. For instance, X and S in Specifying LMI System could be
defined by

X = lmivar(1,[6 1])
S = lmivar(1,[2 0;2 1])

The identifiers X and S are
integers corresponding to the ranking of X and S in
the list of matrix variables (in the order of declaration). Here their
values would be X=1 and S=2.
Note that these identifiers still point to X and S after
deletion or instantiation of some of the matrix variables. Finally, lmivar can also return the total number
of decision variables allocated so far as well as the entry-wise dependence
of the matrix variable on these decision variables (see the lmivar entry in the reference pages for
more details).

Specifying Individual LMIs

After declaring the matrix variables with lmivar, we are left with specifying the
term content of each LMI. Recall that LMI terms fall into three categories:

The constant terms, i.e., fixed
matrices like I in the left side of the LMI S > I

The variable terms, i.e., terms
involving a matrix variable. For instance, ATX and CTSC in Equation 4-6. Variable terms
are of the form PXQ where X is
a variable and P, Q are given matrices called
the left and right coefficients, respectively.

The outer factors

The following rule should be kept in mind when describing the
term content of an LMI:

Note:
Specify only the terms in the blocks on or above the diagonal.
The inner factors being symmetric, this is sufficient to specify the
entire LMI. Specifying all blocks results in the duplication
of off-diagonal terms, hence in the creation of a different LMI. Alternatively,
you can describe the blocks on or below the diagonal.

LMI terms are specified one at a time with lmiterm. For instance, the LMI

These commands successively declare the terms ATX + XA, CTSC, XB,
and –S. In each command, the first argument
is a four-entry vector listing the term characteristics as follows:

The first entry indicates to which LMI the term belongs.
The value m means "left side of the m-th
LMI," and −m means "right
side of the m-th LMI."

The second and third entries identify the block to
which the term belongs. For instance, the vector [1 1 2 1]
indicates that the term is attached to the (1, 2) block.

The last entry indicates which matrix variable is
involved in the term. This entry is 0 for constant
terms, k for terms involving the k-th
matrix variable Xk,
and −k for terms involving XkT (here X and S are
first and second variables in the order of declaration).

Finally, the second and third arguments of lmiterm contain the numerical data (values
of the constant term, outer factor, or matrix coefficients P and Q for
variable terms PXQ or PXTQ).
These arguments must refer to existing MATLAB® variables and be real-valued.
See Complex-Valued LMIs for the specification of LMIs with complex-valued
coefficients.

Some shorthand is provided to simplify term specification. First,
blocks are zero by default. Second, in diagonal blocks the
extra argument 's' allows you to specify the conjugated
expression AXB + BTXTAT with
a singlelmiterm command.
For instance, the first command specifies ATX + XA as
the "symmetrization" of XA. Finally,
scalar values are allowed as shorthand for scalar matrices,
i.e., matrices of the form αI with α
scalar. Thus, a constant term of the form αI can
be specified as the "scalar" α. This also applies
to the coefficients P and Q of
variable terms. The dimensions of scalar matrices are inferred from
the context and set to 1 by default. For instance, the third LMI S > I in Example: Specifying Matrix Variable Structures is described
by

lmiterm([-3 1 1 2],1,1) % 1*S*1 = S
lmiterm([3 1 1 0],1) % 1*I = I

Recall that by convention S is considered
as the right side of the inequality, which justifies the –3
in the first command.

Finally, to improve readability it is often convenient to attach
an identifier (tag) to each LMI and matrix variable. The variable
identifiers are returned by lmivar and
the LMI identifiers are set by the function newlmi.
These identifiers can be used in lmiterm commands
to refer to a given LMI or matrix variable. For the LMI system of Specifying LMI System, this would
look like:

This returns the internal representation LMISYS of
this LMI system. This MATLAB description of the problem can be
forwarded to other LMI-Lab functions for subsequent processing. The
command getlmis must be used onlyonce and
after declaring all matrix variables and LMI
terms.

Here the identifiers X and S point
to the variables X and S while
the tags BRL, Xpos, and Slmi point
to the first, second, and third LMI, respectively. Note that –Xpos refers
to the right-hand side of the second LMI. Similarly, –X would
indicate transposition of the variable X.