"NaN"

276 views
Skip to first unread message

soukaina zahoud

unread,
Mar 3, 2015, 7:31:05 AM3/3/15
to yal...@googlegroups.com
Hi, 

I am using Yalmip to solve an MPC problem. Since I installed some solvers for quadratic optimization, I always get "NaN" as solution of my problems. When I test the codes in other computers, it works fine. 

I reinstalled MPT and Yalmip toolbox 4 times, but it still doesn't work. 

Can you please help me? 

Thank you in advance.

Soukaina

Johan Löfberg

unread,
Mar 3, 2015, 9:30:28 AM3/3/15
to yal...@googlegroups.com
So what is the result returned from optimize? You have to show us the error code, as apparently the problem was never solved (missing solver, crashing solver, etc)

soukaina zahoud

unread,
Mar 3, 2015, 9:53:15 AM3/3/15
to yal...@googlegroups.com
The result I get is : 
ans = 

    yalmiptime: 0.6643
    solvertime: 7.2896e-04
          info: 'Unknown error (SCIP)'
       problem: -1


P =

   NaN   NaN   NaN   NaN   NaN   NaN
   NaN   NaN   NaN   NaN   NaN   NaN


Johan Löfberg

unread,
Mar 3, 2015, 9:54:42 AM3/3/15
to yal...@googlegroups.com
So apparantly scip crashed

optimize(constraints,objective,sdpsettings('debug',1))

tells you why/how

soukaina zahoud

unread,
Mar 3, 2015, 10:02:06 AM3/3/15
to yal...@googlegroups.com
It doesn't seem to work.. I keep getting the same result

soukaina zahoud

unread,
Mar 3, 2015, 10:07:34 AM3/3/15
to yal...@googlegroups.com
It doesn't tell me how/why.

Johan Löfberg

unread,
Mar 3, 2015, 10:10:51 AM3/3/15
to yal...@googlegroups.com
And solver doesn't display any information?

Extract everything solver returns with 'savesolveroutput' set to 1, and then

sol = optimize...
sol.solveroutput

soukaina zahoud

unread,
Mar 3, 2015, 10:14:27 AM3/3/15
to yal...@googlegroups.com
sol = 

      yalmiptime: 0.4482
      solvertime: 8.2918e-04
            info: 'Unknown error (SCIP)'
         problem: -1
    solveroutput: [1x1 struct]


ans = 

         x: []
      FMIN: []
    STATUS: -1
      INFO: []

Johan Löfberg

unread,
Mar 3, 2015, 10:56:43 AM3/3/15
to yal...@googlegroups.com
That doesn't even look like the output YALMIP would expect from SCIP. What SCIP version do you have

which scip -all


soukaina zahoud

unread,
Mar 3, 2015, 11:01:14 AM3/3/15
to yal...@googlegroups.com
The result I get is : 'scip' not found
I guess I don't even have scip..

soukaina zahoud

unread,
Mar 3, 2015, 11:03:14 AM3/3/15
to yal...@googlegroups.com
I deleted the Optitoolbox and it works fine now.. Thank you Johan. 

Johan Löfberg

unread,
Mar 3, 2015, 11:18:19 AM3/3/15
to yal...@googlegroups.com
You must have had some scip, otherwise the call would not have happened. However, looking closer at the call in YALMIP, you can get the reported output when scip crashes silently (i.e, nothing displayed, nothing returned)

You must thus have some scip installed, but it crashes on this particular problem. Have you tried other problems, and have you tried calling it manually
 scip([],1,sparse(1),-1,1,[],[])

ans
=

   
-1


soukaina zahoud

unread,
Mar 4, 2015, 5:06:09 AM3/4/15
to yal...@googlegroups.com
Hi Johan,

Thank you for your help. The optimization works fine now. In fact I had installed the Optitoolbox to solve a quadratic problem, and now by deleting it the optimization works. 
I had also some warnings when I launch Matlab, "warning name is nonexistent or not a directory matlab start". I deleted the path from "pathdef.m". 

However I have a problem when I execute my quadratic problem. It tells me : 
Error using solvesdp_multiple (line 8)
Parts of your matrix objective is not linear (multiple solutions can currently only be obtained for linear
objectives)

My objective is given by:

objective=objective+1/2*(C*(x{k}-xref(:,k)))'*Q*(C*(x{k}-xref(:,k)))+1/2*((u{k}-uref(:,k))'*R*(u{k}-uref(:,k)));

Which solver should I specify for this type of problem? 

Johan Löfberg

unread,
Mar 4, 2015, 5:13:10 AM3/4/15
to yal...@googlegroups.com
My guess is that you installed an incorrect version of opti toolbox (PC version on a Linux system etc)

Regarding your current problem, you have defined an incorrect objective function. It is not a scalar but a vector or matrix, which makes no sense

soukaina zahoud

unread,
Mar 4, 2015, 8:23:27 AM3/4/15
to yal...@googlegroups.com
That's right. Thank you again. 
Reply all
Reply to author
Forward
0 new messages