minimizing condition number of a matrix

301 views
Skip to first unread message

mar sag

unread,
Apr 11, 2016, 5:41:24 PM4/11/16
to YALMIP
Dear Johan, 

I'm starting to use Yalmip, and I'd like to implement an example taken from the book of Prof. Boyd "Linear Matrix Inequalities in System and Control Theory". Specifically, I'd like to implement an example of what illustrated in Sec. 3.1 (pag 37) of the book, about the scaling of a rectangular matrix M via diagonal, PSD matrices. 

I just would like to know whether I'm doing anything wrong, because according to the syntax of Yalmip, it should be ok. 

since I want to minimize gamma^2, I defined a variable gam2 > 1, which should be equivalent. For the rest I´m using the same nomenclature of the book. Am I doing anything weird here? Thanks a lot, 

Marco

my code is

yalmip('clear');

% defining the matrix to scale
M = [100 23 2; 40 1 8; 6 .0004 1; 5000 2 1];
% check the condition number
cond(M);
% define the dimensions of the matrices P and Q
dim = size(M);
p = dim(1);
q = dim(2);

% define in Yalmip the matrices P and Q, theymust be PSD matrices
P = sdpvar(p,p,'diagonal');
Q = sdpvar(q,q,'diagonal');

% define the scalar gamma^2. Since it is a condition number, it has to be equal or greater than 1
gam2 = sdpvar(1,1);

% assign the LMI conditions: P, Q PSD, and Q<=M' P M <= gamma^2*Q
F = [P>0, Q>0, gam2>1,Q<=M'*P*M,M'*P*M<=gam2*Q];

% solve
optimize(F,gam2)

% check the values
value(gam2)
value(Q)
value(P)

% extract the matrices L and R
L = chol(value(P),'lower');
R = chol(Qi,'lower');

% check the new condition number
cond(L*M*R)

what I get is

ans = 

    solvertime: 0
          info: 'No suitable solver'
       problem: -2
    yalmiptime: 1.222

any suggestion? thanks!

Johan Löfberg

unread,
Apr 12, 2016, 2:12:57 AM4/12/16
to YALMIP
You multiply gam2 and Q, hence it is not an LMI, and thus you most likely don't have any solver.

However, the problem is quasi-convex and easily solved using bisection in gam2. See the example decay-rate minimization on the wiki, and the lazy-mans command bisection.

BTW, you cannot use strict inequalities. YALMIP is screaming at you about this.

mar sag

unread,
Apr 12, 2016, 2:56:38 AM4/12/16
to YALMIP
Dear Johan, 

thanks for your reply. So, formally not all the GEVPs are LMIs? or my problem is not a GEVP?

P.S. Yes, Yalmip was screaming about strict inequalities, so I changed them :)

Kind Regards,

Marco

Johan Löfberg

unread,
Apr 12, 2016, 2:59:37 AM4/12/16
to YALMIP
No GEVP is an LMI, by definition. LMI stands for LINEAR matrix inequality. In a GEVP, you have a bilinear product. They can easily be solved through a small number of LMIs though, by bisection as illustrated.

mar sag

unread,
Apr 12, 2016, 11:35:26 AM4/12/16
to YALMIP
Thanks! One last question. Is there an updated Yalmip user manual I can download and print? or do I have to use the website? I found a user manual written by you, but I think it is obsolete, as it contains still commands like "addlmi", which are now recognized by yalmip as obsolete. Any new version? thanks again, 

Regards,

Marco

Johan Löfberg

unread,
Apr 13, 2016, 6:17:41 AM4/13/16
to yal...@googlegroups.com
No, Wiki is the only manual

mar sag

unread,
Apr 13, 2016, 11:26:41 AM4/13/16
to YALMIP
Ok, many thanks!
Reply all
Reply to author
Forward
0 new messages