Different formulations lead to different results

95 views
Skip to first unread message

Liting Lu

unread,
Nov 10, 2014, 5:11:58 AM11/10/14
to yal...@googlegroups.com

Hello Johan and everyone,

 

I formulated the problem with 2 different forms, but the solver returned 2 different results. For example, when I wrote the Item in the cost function as following:

objective = objective +((c_p1*z{k} + c_p2 + c_n1*(u{k}(1)-z{k})*0.3108 - vp_inv{k}*u{k}(2))*d1 + d0{k})^2;

The programming ran without any error. But when I wrote the code as following:

objective = objective + mf{k}^2;

with constraint as:

constraints = [constraints, mf{k} >= (c_p1*z{k} + c_p2 + c_n1*(u{k}(1)-z{k})*0.3108 - vp_inv{k}*u{k}(2))*d1 + d0{k}];

or even as:

constraints = [constraints, mf{k} == (c_p1*z{k} + c_p2 + c_n1*(u{k}(1)-z{k})*0.3108 - vp_inv{k}*u{k}(2))*d1 + d0{k}];

the solver reported that the problem was infeasible.

Is it because that the equality and inequality residuals made the problem tighter? Thx!

 Liting

Johan Löfberg

unread,
Nov 10, 2014, 5:15:08 AM11/10/14
to yal...@googlegroups.com
Should work. Which solver are you using? What is displayed when you run it
Message has been deleted

Liting Lu

unread,
Nov 10, 2014, 5:54:27 AM11/10/14
to yal...@googlegroups.com
I use 'mosek' as my solver. When another constraint was met, YALMIP reported the problem is infeasible.

Before there is already this kind information:


Interior-point optimizer terminated. Time: 0.84.

 

Optimizer terminated. Time: 0.94   

 

Interior-point solution summary

  Problem status  : UNKNOWN

  Solution status : UNKNOWN

  Primal.  obj: 1.9934448525e+008   Viol.  con: 1e+002   var: 0e+000

  Dual.    obj: 1.9934662024e+008   Viol.  con: 2e-009   var: 5e-007

Optimizer summary

  Optimizer                 -                        time: 0.94   

    Interior-point          - iterations : 128       time: 0.84   

      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   

        Clean primal-dual   - iterations : 0         time: 0.00   

    Simplex                 -                        time: 0.00   

      Primal simplex        - iterations : 0         time: 0.00   

      Dual simplex          - iterations : 0         time: 0.00   

      Primal-dual simplex   - iterations : 0         time: 0.00   

    Mixed integer           - relaxations: 0         time: 0.00   

 

Mosek error: MSK_RES_TRM_STALL ()



At the infeasible point, the display is:

Interior-point optimizer terminated. Time: 0.53.

 

 

MOSEK PRIMAL INFEASIBILITY REPORT.

 

Problem status: The problem is primal infeasible

 

 

Optimizer terminated. Time: 0.62   

 

Interior-point solution summary

  Problem status  : PRIMAL_INFEASIBLE

  Solution status : PRIMAL_INFEASIBLE_CER

  Dual.    obj: -2.1407929344e+008  Viol.  con: 8e-005   var: 4e-002

Optimizer summary

  Optimizer                 -                        time: 0.62   

    Interior-point          - iterations : 73        time: 0.53   

      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   

        Clean primal-dual   - iterations : 0         time: 0.00   

    Simplex                 -                        time: 0.00   

      Primal simplex        - iterations : 0         time: 0.00   

      Dual simplex          - iterations : 0         time: 0.00   

      Primal-dual simplex   - iterations : 0         time: 0.00   

    Mixed integer           - relaxations: 0         time: 0.00
Vollständigen Inhalt anzeigen

Johan Löfberg

unread,
Nov 10, 2014, 5:57:30 AM11/10/14
to yal...@googlegroups.com
You would have to supply reproducible code. Looks badly scaled to me

Liting Lu

unread,
Dec 9, 2014, 7:47:55 AM12/9/14
to yal...@googlegroups.com
Dear Johan,

I'm so sorry to answer so late. I was trying to formulate the problem in the matlab way, cause I have a such lage model in simulink, which is not easy to be run. But now this problem is given up, since I want adopt the nonlinear solver. I installed the OPTI Toolbox. And at this moment with "yalmiptest.m" matlab reports as following:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|                   Test|   Solution|                    Solver message|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|   Core functionalities|        N/A|      Successfully solved (YALMIP)|
|                     LP|        N/A|                     Unknown error|
|                     LP|        N/A|                     Unknown error|
|                     QP|        N/A|                     Unknown error|
|                     QP|        N/A|                     Unknown error|
|                   SOCP|    Correct|   Successfully solved (DSDP-OPTI)|
|                   SOCP|    Correct|   Successfully solved (DSDP-OPTI)|
|                   SOCP|    Correct|   Successfully solved (DSDP-OPTI)|
|                    SDP|    Correct|   Successfully solved (DSDP-OPTI)|
|                    SDP|    Correct|   Successfully solved (DSDP-OPTI)|
|                    SDP|    Correct|   Successfully solved (DSDP-OPTI)|
|                    SDP|    Correct|   Successfully solved (DSDP-OPTI)|
|                 MAXDET|    Correct|   Successfully solved (DSDP-OPTI)|
|                 MAXDET|    Correct|   Successfully solved (DSDP-OPTI)|
|          Infeasible LP|        N/A|                     Unknown error|
|          Infeasible QP|        N/A|                     Unknown error|
|         Infeasible SDP|        N/A|    Infeasible problem (DSDP-OPTI)|
|      Moment relaxation|    Correct|   Successfully solved (DSDP-OPTI)|
|         Sum-of-squares|    Correct|   Successfully solved (DSDP-OPTI)|
|           Bilinear SDP|        N/A|                No suitable solver|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> with LP and QP there are unknown problem. Is there any conflict with some other toolbox? How can I deal with it? Thank you very much!
Best regards,
Liting

Johan Löfberg

unread,
Dec 9, 2014, 9:23:54 AM12/9/14
to yal...@googlegroups.com
run yalmiptest(sdpsettings('debug',1)) and the error will be explicit

Or simply solve an LP and see how it crashes
sdpvar x
optimize
(x>=0,x,sdpsettings('debug',1))


Reply all
Reply to author
Forward
0 new messages