Decision Optimization

 View Only
  • 1.  Exception from IBM ILOG CPLEX: CPLEX Error 5002: 'q1' is not convex.->.

    Posted Mon March 06, 2023 05:11 AM

    Hi everyone,

    I am currently trying to solve a QP, but it always showed error. Could you please help me to solve the problem. I tried to initialize n[i][j]==1 but it didn't work. Thank you!

    // Sets
    
    range A = 1..2;
    range B = 1..2;
    
    // Parameters
    float S[A] = [10, 12];
    float K[A] = [200, 300];
    float u[A]= [1,1.5];
    float hp = 0.5;
    float D = 2000;
    
    
    // Variables
    dvar float+ Q[A][B];
    dvar float n[A][B] in 0..100;
    
    
    // Objective
    minimize
    sum(i in A, j in B) n[i][j]*S[i] + (hp*sum(i in A, j in B) Q[i][j])/2 + sum(i in A, j in B)n[i][j]*Q[i][j]*u[i];
    
    // Constraints
    subject to {
      sum(i in A, j in B) n[i][j]*Q[i][j] <= D;
      forall(i in A)
        sum(j in B) Q[i][j] <= K[i];
    }
    


    ------------------------------
    Hang Vu
    ------------------------------


  • 2.  RE: Exception from IBM ILOG CPLEX: CPLEX Error 5002: 'q1' is not convex.->.

    IBM Champion
    Posted Mon March 06, 2023 10:56 AM

    Same question at https://community.ibm.com/community/user/ai-datascience/discussion/exception-from-ibm-ilog-cplex-cplex-error-5002-q1-is-not-convex-1.



    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------