feasibility flags

159 views
Skip to first unread message

Leo Luo

unread,
Sep 22, 2017, 7:31:29 AM9/22/17
to YALMIP
Dear Professor Lofberg, 
I would like to sweep  a variable over a interval to check whether a system is stable. How can I retrieve the feasibility information from a solver. For example, Sedumi use infro.feasratio to indicate feasibility,  lmilab using negative t to indicate feasibility. But I am not able to get these values directly when call optimize function.

Johan Löfberg

unread,
Sep 22, 2017, 7:36:06 AM9/22/17
to YALMIP
First, you never use lmilab + yalmip. Never.

Feasibility is reported in the field 'problem'

Johan Löfberg

unread,
Sep 22, 2017, 7:37:26 AM9/22/17
to YALMIP
and the meaning of the different codes is listed in

Leo Luo

unread,
Sep 22, 2017, 7:51:36 AM9/22/17
to YALMIP
Thanks for your prompt response. The reason I use lmilab is that when I sweep a value close to a analytic value. mosek normally suggests a status of ill posed. In contrast, using lmilab, I can approach to an analytic value. 

Johan Löfberg

unread,
Sep 22, 2017, 7:55:49 AM9/22/17
to YALMIP
it would be interesting to see that model, as mosek typically has very good numerics

Leo Luo

unread,
Sep 22, 2017, 7:58:30 AM9/22/17
to YALMIP
And in this case. the 'problem' field returns -1 meaning 'unknown error'.

Leo Luo

unread,
Sep 22, 2017, 8:15:49 AM9/22/17
to YALMIP
It seems that my last post wasn't delivered. I post it again.

In this code, using 'mosek' and check the problem filed, return -1. using 'lmilab', return 0.
stable_analysis_recheck3.m

Johan Löfberg

unread,
Sep 22, 2017, 8:19:40 AM9/22/17
to YALMIP
are you using an old version of Mosek? Solved without issues here

Interior-point solution summary
  Problem status  : PRIMAL_AND_DUAL_FEASIBLE
  Solution status : OPTIMAL
  Primal.  obj: 0.0000000000e+00    nrm: 1e+00    Viol.  con: 5e-08    var: 0e+00    barvar: 0e+00  
  Dual.    obj: 0.0000000000e+00    nrm: 5e+00    Viol.  con: 0e+00    var: 1e-25    barvar: 4e-10  
Optimizer summary
  Optimizer                 -                        time: 0.47    
    Interior-point          - iterations : 14        time: 0.25    
      Basis identification  -                        time: 0.00    
        Primal              - iterations : 0         time: 0.00    
        Dual                - iterations : 0         time: 0.00    
        Clean primal        - iterations : 0         time: 0.00    
        Clean dual          - iterations : 0         time: 0.00    
    Simplex                 -                        time: 0.00    
      Primal simplex        - iterations : 0         time: 0.00    
      Dual simplex          - iterations : 0         time: 0.00    
    Mixed integer           - relaxations: 0         time: 0.00    


result = 

  struct with fields:

    yalmiptime: 0.188759144098891
    solvertime: 0.587240855901113
          info: 'Successfully solved (MOSEK)'
       problem: 0


Leo Luo

unread,
Sep 22, 2017, 8:22:36 AM9/22/17
to YALMIP
MOSEK Version 8.0.0.81 and MATLAB R2017a in Windows system. I don't think they are old versions.

Johan Löfberg

unread,
Sep 22, 2017, 8:24:06 AM9/22/17
to YALMIP
btw, I hope you're not tweaking margin by simply increasing it to, e.g., 1e-6$or something like that. For non-zero margin, you want margin*eye() in your code

Johan Löfberg

unread,
Sep 22, 2017, 8:29:15 AM9/22/17
to YALMIP
Latest version is 8.1+, so I would advice you to update.

Leo Luo

unread,
Sep 22, 2017, 8:40:50 AM9/22/17
to YALMIP
Thanks. I am installing it right now. I felt that the solution received form mosek seems not reliable  comparing with lmilab. the result received using lmilab is consistent with Sedumi but not mosek.

Johan Löfberg

unread,
Sep 22, 2017, 8:42:01 AM9/22/17
to YALMIP
mosek is typically  more numerically stable than sedumi so that is odd

Leo Luo

unread,
Sep 22, 2017, 8:57:38 AM9/22/17
to YALMIP
Thanks Professor. After update to the new version and it works fine now. 

I am new to matlab and yalmip etc. Based on my little experience. I found that mosek seems not reliable at all, it frequently give wrong indications. This's why I use lmilab. But the lmilab is unbearable slow.  I try SeDuMi today, and it seems very good even it is really old.

What is your suggestion for the solver I should stick with? By the way, I am a PhD student working on time delay systems.

Johan Löfberg

unread,
Sep 22, 2017, 9:04:02 AM9/22/17
to YALMIP
well, if sedumi works best for you then you should use it. However, it might be that the solution from sedumi simply is wrong in another way than the solution from mosek (i.e, sedimi doesn't tell you that it has an incorrect solution, while mosek tells you that it struggles. Just because an answer is returned without any warnings, does not mean that the solution is good or better than a solution that was delivered with warnings)

if you post an example where mosek is wrong and sedumi is right, it would be interesting

Leo Luo

unread,
Sep 22, 2017, 9:18:48 AM9/22/17
to YALMIP
Mosek suggest a primal and dual feasible solution as follow and the problem field returns 0.

Interior-point solution summary
  Problem status  : PRIMAL_AND_DUAL_FEASIBLE
  Solution status : OPTIMAL
  Primal.  obj: 0.0000000000e+00    nrm: 8e+00    Viol.  con: 1e-05    var: 0e+00    barvar: 0e+00  
  Dual.    obj: 0.0000000000e+00    nrm: 7e+00    Viol.  con: 0e+00    var: 5e-10    barvar: 6e-10 

In my constraint t is negative, however, the value of t  is positive. How can I get rid of this kind of error. It will be impossible if I need to sweep some variable with incorrect indications. 
Time_varying_a2c_1019.m

Leo Luo

unread,
Sep 22, 2017, 9:24:09 AM9/22/17
to YALMIP
I don't know which solver is better to suit my purpose. I just do trial and error. I haven't figured out a satisfied one yet.

Johan Löfberg

unread,
Sep 22, 2017, 11:11:58 AM9/22/17
to YALMIP
Well, the solution returned is marginally infeasible (a couple of them infeasible around -10^-8), so thus you know it isn't a strict certificate

Same thing with lmilab, the solution returned is marginally infeasible with infeasibilities 10^-14 which is zero in a numerical world (solver prints it struggles)

You are on the border of feasibility, and numerical solvers will not be able to make a perfect statement, as the general distance to feasiiblity drowns in the numerical precision of floating-point numbers

You simply cannot reason on stability certificates in a numerical fashion when you are down to these numbers. It like trying to figure out if a car will pass a bridge that is built for at most 1000kg and  say no problems because the car only weighs 999.99999999999999 kilos according to your scale. You don't want to draw conclusions based on such sensitive numerical certificates.

Leo Luo

unread,
Sep 22, 2017, 6:24:03 PM9/22/17
to YALMIP
Thanks again for your help. How can I retrieve the marginally feasibility indexing values and use them in my code?

Johan Löfberg

unread,
Sep 23, 2017, 2:50:58 AM9/23/17
to YALMIP
Reply all
Reply to author
Forward
0 new messages