CPLEX OPL错误5002:即使设置了optimitytarget = 3,约束也不会凸出

问题描述

我对CPLEX Optimization Studio有问题。我想解决以下二次约束问题,但出现“ CPLEX错误5002:'qconstraint1'不是凸面的->'。最初,我认为这是因为最佳化目标不会自动设置为3,而是即使我明确地将错误设置为继续。一个有趣的事实是,该问题通常可以在AMPL或MATLAB环境中解决

我该如何解决这个问题?

/*********************************************
 * OPL 12.10.0.0 Model
 * Author: johnm
 * Creation Date: Oct 16,2020 at 6:29:33 PM
 *********************************************/
execute{
  cplex.optimalitytarget=3;
}
range R=1..6;
dvar float x[R];

minimize x[1] + x[2] + x[3] + x[4] + x[5] + x[6];
subject to{
  constraint1: x[1] +  x[2] + x[5] == 8;
  constraint2: x[3] + x[5] + x[6] == 10;
  qconstraint1: -x[1]^2 + x[2]^2 + x[3]^2 <= 0;
  qconstraint2: -x[4]^2 + x[5]^2 <= 0;
  bound_x1:   x[1] >= 0;
  bound_x4:   x[4] >= 0;
  bound_x6:   x[6] >= 0;
}  

解决方法

execute{
  cplex.optimalitytarget=3;
}
range R=1..6;
dvar float x[R] in 0..100;

minimize x[1] + x[2] + x[3] + x[4] + x[5] + x[6];
subject to{
  constraint1: x[1] +  x[2] + x[5] == 8;
  constraint2: x[3] + x[5] + x[6] == 10;
  qconstraint1: x[1]^2 - x[2]^2 - x[3]^2 >= 0;
  qconstraint2: -x[4]^2 + x[5]^2 <= 0;
  bound_x1:   x[1] >= 0;
  bound_x4:   x[4] >= 0;
  bound_x6:   x[6] >= 0;
} 

工作正常