You have NaNs in your constraints!

37 views
Skip to first unread message

Chokri Sandy

unread,
Mar 16, 2021, 4:31:37 PM3/16/21
to YALMIP
Dear all, I am posting my matlab code looking for some  help with the following error

Error using compileinterfacedata (line 1076)
You have NaNs in your constraints!. Read more: https://yalmip.github.io/naninmodel/

I tried to debug but no success. Any help is appreciated
Yalmip.zip

Johan Löfberg

unread,
Mar 16, 2021, 4:51:19 PM3/16/21
to YALMIP
this looks crazy
Z >=100000*eye(5)

I suspect these are supposed to be symmetric
K>> V23
Linear matrix variable 15x15 (full, real, 45 variables)
Coeffiecient range: 1e-06 to 1061694.9153
K>> V24
Linear matrix variable 15x15 (full, real, 45 variables)
Coeffiecient range: 1e-06 to 1061694.9153


there is no official command in yalmip called solvesdp, it was declared obsolete 15 years ago

you are solving without checking feasibility or any diagnostics. the first time you solve it, it is infeasible (maybe because of your bugs with V23 etc)

double is obsolete. it is called value


after a few iterations x becomes imaginary, and you have
K>> solvesdp(Constraints(3))
Error using compileinterfacedata
(line 1076)
You have NaNs in your

so U11 is broken which is because MatrixA is Nan, which probably is because you've let things run without checking solutions and just returned garbage when you get infeasibility

 MatrixA{:}

ans =

   1.0e+05 *

  Columns 1 through 3

         0         0    0.0000
         0         0         0
   -0.0000    0.0000       NaN
    2.6542   -2.6542    0.0051
         0         0         0

  Columns 4 through 5

         0         0
    0.0000         0
    0.0000       NaN
   -0.0051         0
         0   -0.0001


ans =

   1.0e+05 *

  Columns 1 through 3

         0         0    0.0000
         0         0         0
   -0.0000    0.0000       NaN
    2.6542   -2.6542    0.0051
         0         0         0

  Columns 4 through 5

         0         0
    0.0000         0
    0.0000       NaN
   -0.0051         0
         0   -0.0001


ans =

   1.0e+05 *

  Columns 1 through 3

         0         0    0.0000
         0         0         0
   -0.0000    0.0000       NaN
    2.6542   -2.6542    0.0051
         0         0         0

  Columns 4 through 5

         0         0
    0.0000         0
    0.0000       NaN
   -0.0051         0
         0   -0.0001


ans =

   1.0e+05 *

  Columns 1 through 3

         0         0    0.0000
         0         0         0
   -0.0000    0.0000       NaN
    2.6542   -2.6542    0.0051
         0         0         0

  Columns 4 through 5

         0         0
    0.0000         0
    0.0000       NaN
   -0.0051         0
         0   -0.0001






Chokri Sandy

unread,
Mar 16, 2021, 7:00:45 PM3/16/21
to YALMIP
thank you for your reply, how to check for feasibility or to do diagnostics, is it by looking at the termination code of yalmip ? 

Johan Löfberg

unread,
Mar 17, 2021, 2:07:47 AM3/17/21
to YALMIP
yes. you currently run optimize (i.e. solvesdp) without looking at the diagnostic code and have just proceeded despite the solver has told you the problem is infeasible and thus returned garbage. Very predictable that it is infeasible due to your symmetry bugs V23 and V24 (and that weird constraint on Z)
Reply all
Reply to author
Forward
0 new messages