Hope you have a great day.

Original Message:

Sent: Wed March 08, 2023 11:08 AM

From: Paul Rubin

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

CPLEX can contend with the nonlinear objective (although it may not find a guaranteed optimal solution), but it cannot contend with the nonlinear constraint. Unfortunately, I do not know of any learning materials specific to linearization of nonlinear constraints, but I can say that versions of the question occur regularly on Operations Research Stack Exchange. If your n variable is integer, I suggest searching there using the keywords "linearize" and "product". If n is not integer-valued, then you can ask there for recommendations regarding NLP solvers.

------------------------------

Paul Rubin

Professor Emeritus

Michigan State University

Original Message:

Sent: Wed March 08, 2023 12:43 AM

From: Hang Vu

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

Thank you professor Rubin for the advice!

My objective function contains non-linear part too. Is it fine to go with either two ways that you recommended?

I am too new to this problem. Could you please kindly share to me the related materials or textbook about converting them to linear?

Thank you again, professor Rubin!

------------------------------

Hang Vu

Original Message:

Sent: Mon March 06, 2023 11:08 AM

From: Paul Rubin

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

Your first constraint, in which you multiply the decision variables n and Q, makes the feasible region nonconvex, which leads to the error. If n is actually a decision variable, as opposed to a parameter, and is actually continuous rather than integer, then you will have to find a different solver. If n is an integer decision variable, then it would be possible (but cumbersome) to linearize the first constraint by converting n to a bunch of binary variables.

------------------------------

Paul Rubin

Professor Emeritus

Michigan State University

Original Message:

Sent: Mon March 06, 2023 04:25 AM

From: Hang Vu

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

Hi everyone,

I am currently trying to solve this problem but I always got error. Could anyone please help me to solve the problem! I added the initualize n[i][j]==1 but it also didn't work. Thank you!

`// Setsrange A = 1..2;range B = 1..2;// Parametersfloat S[A] = [10, 12];float K[A] = [200, 300];float u[A]= [1,1.5];float hp = 0.5;float D = 2000;// Variablesdvar float+ Q[A][B];dvar float n[A][B] in 0..100;// Objectiveminimizesum(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];// Constraintssubject 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

------------------------------