Mosek warning 710

1,050 views
Skip to first unread message

Felix Kong

unread,
Nov 14, 2016, 7:45:07 PM11/14/16
to YALMIP
Hi Johan/everyone,

Has anyone seen, or have any experience with MOSEK warning 710? I'm using YALMIP to solve a SOS program, and getting this at the top of my MOSEK output:

MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (12) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (13) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (14) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (16) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (18) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (20) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (22) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (23) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (24) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (26) of matrix 'A'.
Warning number 710 is disabled.

I'm concerned that it might be affecting my results numerically (my residuals aren't great, and the norm of the problem is quite large), but I can't figure out how to fix the problem, or where to start. 

I do have an 'A' matrix, but it's 4x4, so it can't have a 26th element. I thought it might also be the way YALMIP is passing the equality constraints (as in Ax = b) to MOSEK, but I dug through the code for a while and haven't found anything yet.

Does anyone know where this might be coming from, and/or how I can fix it?

yikui liu

unread,
Nov 14, 2016, 8:10:54 PM11/14/16
to YALMIP
 Hi Felix

I met this problem before. I think it is because that one or some coefficients in front of the variables are to much smaller comparing with others and close to zero. 

However, it is also possible that your code has minor bugs.

You may can rescale the problem and eliminate the warning. The warning may cause numerical problem in Mosek and provide you UNKNOWN solution.

If Mosek can solve the problem successfully, I think you can ignore it as what I did in my case.

By the way, I strongly suggest you to use Mosek 8 which has been improved greatly.
 


Joachim Dahl

unread,
Nov 15, 2016, 1:07:07 AM11/15/16
to YALMIP
As suggested, you should upgrade to version 8.  

To improve numerical stability, try to normalize you SOS program. For example by normalizing the largest coefficient to 0. 

Felix Kong

unread,
Nov 15, 2016, 1:11:17 AM11/15/16
to YALMIP
Yeah, I've got version 8, it's a huge improvement over 7.

By "normalize", do you mean to divide each variable by its maximum allowed norm?

Joachim Dahl

unread,
Nov 15, 2016, 1:22:48 AM11/15/16
to YALMIP
You could divide each monomial by the largest coefficient in your problem.

Felix Kong

unread,
Nov 15, 2016, 1:31:34 AM11/15/16
to YALMIP
Hmm, would similar logic apply to very small coefficients? My coefficients range from about 1E-6 to 50. 

Joachim Dahl

unread,
Nov 15, 2016, 2:06:05 AM11/15/16
to YALMIP
I don't think so.  A coefficient of 50 may not sound large, but in the SOS relaxation it is squared (or quadrupled depending on the order of the relaxation), so normalizing coefficients is important in practice.

But a polynomial problem with coefficents ranging from 1e-6 to 50 sounds difficult to solve reliably.

Felix Kong

unread,
Nov 15, 2016, 5:06:05 AM11/15/16
to YALMIP
Ok right. Thanks for the advice. I'm thinking that I might be (for some reason or another) trying to solve an infeasible problem here...

Milad Dehnamaki

unread,
Mar 5, 2020, 9:28:28 AM3/5/20
to YALMIP
LMI.rar

Johan Löfberg

unread,
Mar 5, 2020, 9:44:25 AM3/5/20
to yal...@googlegroups.com
First, there is no command in YALMIP called solvesdp

Secondly, don't you get a lot of crying kittens upset about the fact that you are trying to use strict inequalities? If not, you are not using the most recent version of YALMIP, but in any case you should fix that.

The constraint you call main looks like something you want to be an LMI, but that is not the case since the matrix isn't symmetric
>> [phE1_1 phE1_2 phE1_3 phE1_4 phE1_5 phE1_6 phE1_7 phE1_8 phE1_9 phE1_10 phE1_11 phE1_12;(phE1_2)' phE2_2 phE2_3 phE2_4 phE2_5 phE2_6 phE2_7 phE2_8 phE2_9 phE2_10 phE2_11 phE2_12;(phE1_3)' (phE2_3)' phE3_3 phE3_4 phE3_5 phE3_6 phE3_7 phE3_8 phE3_9 phE3_10 phE3_11 phE3_12;(phE1_4)' (phE2_4)' (phE3_4)' phE4_4 phE4_5 phE4_6 phE4_7 phE4_8 phE4_9 phE4_10 phE4_11 phE4_12;(phE1_5)' (phE2_5)' (phE3_5)' (phE4_5)' phE5_5 phE5_6 phE5_7 phE5_8 phE5_9 phE5_10 phE5_11 phE5_12;(phE1_6)' (phE2_6)' (phE3_6)' (phE4_6)' (phE5_6)' phE6_6 phE6_7 phE6_8 phE6_9 phE6_10 phE6_11 phE6_12;(phE1_7)' (phE2_7)' (phE3_7)' (phE4_7)' (phE5_7)' (phE6_7)' phE7_7 phE7_8 phE7_9 phE7_10 phE7_11 phE7_12;(phE1_8)' (phE2_8)' (phE3_8)' (phE4_8)' (phE5_8)' (phE6_8)' (phE7_8)' phE8_8  phE8_9 phE8_10 phE8_11 phE8_12;(phE1_9)' (phE2_9)' (phE3_9)' (phE4_9)' (phE5_9)' (phE6_9)' (phE7_9)' (phE8_9)'  phE9_9 phE9_10 phE9_11 phE9_12;(phE1_10)' (phE2_10)' (phE3_10)' (phE4_10)' (phE5_10)' (phE6_10)' (phE7_10)' (phE8_10)'  (phE9_10)' phE10_10 phE10_11 phE10_12;(phE1_11)' (phE2_11)' (phE3_11)' (phE4_11)' (phE5_11)' (phE6_11)' (phE7_11)' (phE8_11)'  (phE9_11)' (phE10_11)'  phE11_11 phE11_12;(phE1_12)' (phE2_12)' (phE3_12)' (phE4_12)' (phE5_12)' (phE6_12)' (phE7_12)' (phE8_12)' (phE9_12)' (phE10_12)' (phE11_12)' phE12_12]
Linear matrix variable 33x33 (full, real, 48 variables)
Coeffiecient range: 0.0028389 to 3142.5425

and you get nans as you haven't solved the problem since it is infeasible (which is reasonable as you currently require the matrix main to have all elements non-negative which probably is compeltely impossible)

optimize((constraints(1:512)))
ans = 
  struct with fields:

    yalmipversion: '20200116'
       yalmiptime: 2.9931
       solvertime: 0.1769
             info: 'Infeasible problem (MOSEK)'
          problem: 1



Milad Dehnamaki

unread,
Mar 5, 2020, 10:04:28 AM3/5/20
to YALMIP
I want to express my appreciation to your answer. I have got two questions
. why do you say that the constraint I call main  is not  symmetric????
how I can find which of inequalities are strict ?

Johan Löfberg

unread,
Mar 5, 2020, 11:20:47 AM3/5/20
to YALMIP
because it says it is full when I display it

Linear matrix variable 33x33 (full, real, 48 variables)

or if you simply take main-main' you see it isn't 0

X = [phE1_1 phE1_2 phE1_3 phE1_4 phE1_5 phE1_6 phE1_7 phE1_8 phE1_9 phE1_10 phE1_11 phE1_12;(phE1_2)' phE2_2 phE2_3 phE2_4 phE2_5 phE2_6 phE2_7 phE2_8 phE2_9 phE2_10 phE2_11 phE2_12;(phE1_3)' (phE2_3)' phE3_3 phE3_4 phE3_5 phE3_6 phE3_7 phE3_8 phE3_9 phE3_10 phE3_11 phE3_12;(phE1_4)' (phE2_4)' (phE3_4)' phE4_4 phE4_5 phE4_6 phE4_7 phE4_8 phE4_9 phE4_10 phE4_11 phE4_12;(phE1_5)' (phE2_5)' (phE3_5)' (phE4_5)' phE5_5 phE5_6 phE5_7 phE5_8 phE5_9 phE5_10 phE5_11 phE5_12;(phE1_6)' (phE2_6)' (phE3_6)' (phE4_6)' (phE5_6)' phE6_6 phE6_7 phE6_8 phE6_9 phE6_10 phE6_11 phE6_12;(phE1_7)' (phE2_7)' (phE3_7)' (phE4_7)' (phE5_7)' (phE6_7)' phE7_7 phE7_8 phE7_9 phE7_10 phE7_11 phE7_12;(phE1_8)' (phE2_8)' (phE3_8)' (phE4_8)' (phE5_8)' (phE6_8)' (phE7_8)' phE8_8  phE8_9 phE8_10 phE8_11 phE8_12;(phE1_9)' (phE2_9)' (phE3_9)' (phE4_9)' (phE5_9)' (phE6_9)' (phE7_9)' (phE8_9)'  phE9_9 phE9_10 phE9_11 phE9_12;(phE1_10)' (phE2_10)' (phE3_10)' (phE4_10)' (phE5_10)' (phE6_10)' (phE7_10)' (phE8_10)'  (phE9_10)' phE10_10 phE10_11 phE10_12;(phE1_11)' (phE2_11)' (phE3_11)' (phE4_11)' (phE5_11)' (phE6_11)' (phE7_11)' (phE8_11)'  (phE9_11)' (phE10_11)'  phE11_11 phE11_12;(phE1_12)' (phE2_12)' (phE3_12)' (phE4_12)' (phE5_12)' (phE6_12)' (phE7_12)' (phE8_12)' (phE9_12)' (phE10_12)' (phE11_12)' phE12_12];
X
- X'

Linear matrix variable 33x33 (full, real, 10 variables)
Eigenvalues between [0,0]
Coeffiecient range: 2 to 97.2

also seen when applying spy clearly indicating a non-symmetric portion
spy(X-X')


You have strict inequalities on lambda and mue3

BTW, when you add 10^-3 >= (E(:,:,i)'*1*P1-F(:,:,i)*C>=-(10^-3), it looks to me like you simply want (E(:,:,i)'*1*P1-F(:,:,i)*C == 0 but don't understand that you can add equalities

Milad Dehnamaki

unread,
Mar 5, 2020, 1:26:52 PM3/5/20
to YALMIP
excuse me. why some of phEs such as (phE6_10)' are green in code?
do they showes anything ???

Johan Löfberg

unread,
Mar 5, 2020, 1:35:01 PM3/5/20
to YALMIP
no, that's just weird google groups formatting

Milad Dehnamaki

unread,
Mar 6, 2020, 4:05:47 AM3/6/20
to YALMIP
I have got a question.please answer me
there is any chance that the yalmip can not find any answer beacuse of themany zeros in my inequality?????

Johan Löfberg

unread,
Mar 6, 2020, 4:10:01 AM3/6/20
to YALMIP
YALMIP does not find any solution, that is the task of the solver.

A model with more zeros is typically easier to solve, since it is more sparse and thus numerically more efficient.

As I said, the problem is trivially infeasible as you've failed in defining your matrix called main, as it is supposed to be symmetric but you have a typo in the construction causing it to be full.

Johan Löfberg

unread,
Mar 6, 2020, 4:20:54 AM3/6/20
to YALMIP
for instance, phE3_3 is a diagonal block, but is not symmetric, hence clearly your model is not an LMI

Johan Löfberg

unread,
Mar 6, 2020, 4:26:55 AM3/6/20
to YALMIP
also note that you have a zero diagonal blocks phE4_4 in (what I suppose is intended to be an LMI)  constraint. That immediately implies that everything in that row/column must be zero, and for numerical reasons it is better to remove that part from the LMI and simply add equality constraints on those (to avoid a model which always is on the infeasibility border)

Milad Dehnamaki

unread,
Mar 6, 2020, 10:48:18 AM3/6/20
to YALMIP
I would like to thank you for your patience.
I used the Lemma Schur complement in obtaining the LMI. this Lemma said the X-YIY'<0 equivalent to [ X Y;Y' I]<0 then since you observe The matrix can not be symmetric.

Johan Löfberg

unread,
Mar 6, 2020, 12:31:43 PM3/6/20
to YALMIP
X - YY' <0 cannot be reformulated to an LMI. It is a nonconvex set. 

X - YY' > 0 is a convex set and equivalent to [X Y;Y' I] >0 (assuming X symmetric)

Milad Dehnamaki

unread,
Mar 9, 2020, 12:32:43 PM3/9/20
to YALMIP
I would like to thank you for your mental support. I have changed both phE3_3 and phE4_4. Unfortunately all of my constraints will be NAN. I am confused and don't know what shall I do. it's really kind of you if you guide ma
I have attached my code.
LMI.rar

Johan Löfberg

unread,
Mar 9, 2020, 12:50:11 PM3/9/20
to YALMIP
It makes no sense to run check on constraints before solving the problem

The problem is infeasible. Even worse already the very first constraint alone is infeasible...

optimize(constraints(1))

    yalmipversion: '20200116'
       yalmiptime: 2.6435
       solvertime: 0.4605
             info: 'Infeasible problem (MOSEK)'
          problem: 1

which is pretty obvious as you have phE6_6 positive 1e7 while trying to have a matrix where phE6_6 is a diagonal block to be negative definite which is trivially impossible

You always write things like  matrix <= -smallconstant, when you probably mean matrix <= -smallconstant*eye()

I hope you aren't still trying to convexify the nonconvex constraint X <= Y*Y' because that is simply impossible no matter how you shuffle around the matrices.

Milad Dehnamaki

unread,
Mar 9, 2020, 1:49:43 PM3/9/20
to YALMIP
I am trying to solve the Lyapunov stability problem in the form of LMI condition. then I would like to solve the [constraint<=0] so The
Lyapunov stability can be obtained. you mean to say to have a negative definite matrix,  the necessary condition is that all of elements in diagonal must be negative??? none of them can be positive???

Johan Löfberg

unread,
Mar 9, 2020, 2:12:33 PM3/9/20
to YALMIP
Yes, by definition

[a b';b c] <= 0 means [x;0]*[a b';b c]*[x;0] for all x, i.e. x'*a*x <= 0, i.e. a negative semidefinite
Reply all
Reply to author
Forward
0 new messages