# Documentation

## Modify a System of LMIs

Once specified, a system of LMIs can be modified in several ways with the functions `dellmi`, `delmvar`, and `setmvar`.

### Deleting an LMI

The first possibility is to remove an entire LMI from the system with `dellmi`. For instance, suppose that the LMI system of Specifying LMI System is described in `LMISYS` and that we want to remove the positivity constraint on X. This is done by

```NEWSYS = dellmi(LMISYS,2) ```

where the second argument specifies deletion of the second LMI. The resulting system of two LMIs is returned in `NEWSYS`.

The LMI identifiers (initial ranking of the LMI in the LMI system) are not altered by deletions. As a result, the last LMI

S > I

remains known as the third LMI even though it now ranks second in the modified system. To avoid confusion, it is safer to refer to LMIs via the identifiers returned by `newlmi`. If `BRL`, `Xpos`, and `Slmi` are the identifiers attached to the three LMIs, Equation 4-6Equation 4-8, `Slmi` keeps pointing to S > I even after deleting the second LMI by

```NEWSYS = dellmi(LMISYS,Xpos) ```

### Deleting a Matrix Variable

Another way of modifying an LMI system is to delete a matrix variable, that is, to remove all variable terms involving this matrix variable. This operation is performed by `delmvar`. For instance, consider the LMI

ATX + XA + BW + WTBT + I < 0

with variables X = XTR4×4 and WR2×4. This LMI is defined by

```setlmis([]) X = lmivar(1,[4 1]) % X W = lmivar(2,[2 4]) % W lmiterm([1 1 1 X],1,A,'s') lmiterm([1 1 1 W],B,1,'s') lmiterm([1 1 1 0],1) LMISYS = getlmis ```

To delete the variable `W`, type the command

```NEWSYS = delmvar(LMISYS,W) ```

The resulting `NEWSYS` now describes the Lyapunov inequality

ATX + XA + I < 0

Note that `delmvar` automatically removes all LMIs that depended only on the deleted matrix variable.

The matrix variable identifiers are not affected by deletions and continue to point to the same matrix variable. For subsequent manipulations, it is therefore advisable to refer to the remaining variables through their identifier. Finally, note that deleting a matrix variable is equivalent to setting it to the zero matrix of the same dimensions with `setmvar`.

### Instantiating a Matrix Variable

The function `setmvar` is used to set a matrix variable to some given value. As a result, this variable is removed from the problem and all terms involving it become constant terms. This is useful, for instance, to fix`setmvar` some variables and optimize with respect to the remaining ones.

Consider again Specifying LMI System and suppose we want to know if the peak gain of G itself is less than one, that is, if

G < 1

This amounts to setting the scaling matrix D (or equivalently, S = DTD) to a multiple of the identity matrix. Keeping in mind the constraint S > I, a legitimate choice is S = 2-βψ-I. To set S to this value, enter

```NEWSYS = setmvar(LMISYS,S,2) ```

The second argument is the variable identifier `S`, and the third argument is the value to which S should be set. Here the value 2 is shorthand for 2-by-I. The resulting system `NEWSYS` reads

$\begin{array}{c}\left(\begin{array}{cc}{A}^{T}X+XA+2{C}^{TC}& XB\\ {B}^{T}X& -2I\end{array}\right)<0\\ X>0\\ 2I>I.\end{array}$

Note that the last LMI is now free of variable and trivially satisfied. It could, therefore, be deleted by

```NEWSYS = dellmi(NEWSYS,3) ```

or

```NEWSYS = dellmi(NEWSYS,Slmi) ```

if `Slmi` is the identifier returned by `newlmi`.