Skip to main content

Different optimization results between Yalmip and Mathematica

Answered

Comments

3 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Could you please share a model file? Please refer to How do I write an MPS model file from a third-party API? for all information about how to generate a model file out of Yalmip.

    Note that uploading files in the Community Forum is not possible but we discuss an alternative in Posting to the Community Forum.

    Best regards, 
    Jaromił

    0
  • Jiayu Mi
    Gurobi-versary
    First Comment
    First Question
    NAME matlab
    ROWS
     N  OBJ
     L  R0      
     L  R1      
     L  R2      
     L  R3      
     E  qc0     
     E  qc1     
     E  qc2     
     E  qc3     
     E  qc4     
    COLUMNS
        C0        R1        7.9616306954436444e+00
        C0        R2        -1
        C0        R3        1
        C1        R0        -1
        C1        R1        1
        C2        OBJ       5.5333333333333329e+01
        C2        qc0       1
        C3        OBJ       0
        C3        qc1       1
        C4        OBJ       1.7245559593413333e+15
        C4        qc4       1.6571226666666666e+08
        C5        OBJ       0
        C5        qc2       1
        C6        OBJ       0
        C6        qc3       1
    RHS
        RHS1      OBJ       10406930
        RHS1      R1        3.6711079136690646e+03
        RHS1      R2        -3.5912806888485625e+02
        RHS1      R3        461.1
        RHS1      qc4       1
    BOUNDS
     FR BND1      C0      
     FR BND1      C1      
     FR BND1      C2      
     FR BND1      C3      
     FR BND1      C4      
     FR BND1      C5      
     FR BND1      C6      
    QUADOBJ
        C2        C4        -9.1694120888888874e+09
        C4        C6        -2.3034005066666665e+09
    QCMATRIX   qc0     
        C0        C0        -1
    QCMATRIX   qc1     
        C1        C1        -1
    QCMATRIX   qc2     
        C2        C3        -0.5
        C3        C2        -0.5
    QCMATRIX   qc3     
        C0        C1        -0.5
        C1        C0        -0.5
    QCMATRIX   qc4     
        C3        C4        6.95
        C4        C3        6.95
    ENDATA
    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Thank you for sharing the model.

    The issue are the huge coefficients and infinite bounds for variables used in the optimization model. When you only plot a function, you just have to evaluate some function values to get a well scaled plot even for very big coefficients and variable values. This does not apply to optimization algorithms. Optimization algorithms are sensitive to bad scaling, i.e., huge/tiny coefficient values and unbounded variables in nonlinear terms.

    In order to properly solve your model, you have to re-scale it. In particular, you have to reduce the coefficient values and provide tight finite bounds for every variable participating in a bilinear term. Please refer to our Guidelines for Numerical Issues for more information.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.