setmvar
Instantiate matrix variable and evaluate all LMI terms involving this matrix variable
Syntax
mnewsys = setmvar(lmisys,X,Xval)
Description
setmvar
sets the matrix variableXwith identifierX
to the valueXval
. All terms involvingX一个re evaluated, the constant terms are updated accordingly, andXis removed from the list of matrix variables. A description of the resulting LMI system is returned innewsys
.
The integerX
is the identifier returned bylmivar
whenXis declared. InstantiatingXwithsetmvar
does not alter the identifiers of the remaining matrix variables.
The functionsetmvar
is useful to freeze certain matrix variables and optimize with respect to the remaining ones. It saves time by avoiding partial or complete redefinition of the set of LMI constraints.
Examples
Consider the system
x˙=Ax+Bu
一个nd the problem of finding a stabilizing state-feedback lawu=KxwhereKis an unknown matrix.
By the Lyapunov Theorem, this is equivalent to findingP> 0 andKsuch that
(A + BK)P+P(A + BKT) +I< 0.
With the change of variableY:=KP, this condition reduces to the LMI
AP+PAT+BY+YTBT+I< 0.
This LMI is entered by the commands
n = size(A,1) % number of states ncon = size(B,2) % number of inputs setlmis([]) P = lmivar(1,[n 1]) % P full symmetric Y = lmivar(2,[ncon n]) % Y rectangular lmiterm([1 1 1 P],A,1,'s') % AP+PA' lmiterm([1 1 1 Y],B,1,'s') % BY+Y'B' lmiterm([1 1 1 0],1) % I lmis = getlmis
To find out whether this problem has a solutionKfor the particular Lyapunov matrixP=I, setPtoIby typing
news = setmvar(lmis,P,1)
The resulting LMI systemnews
has only one variableY=K. Its feasibility is assessed by callingfeasp
:
[tmin,xfeas] = feasp(news) Y = dec2mat(news,xfeas,Y)
The computedYis feasible whenevertmin
< 0.