I get this error,"CPLEX(default) cannot extract expression",but when I delete the log function in object function, the error is solved. My code is as follow :
range k=1..4;
range n=1..4;
//inputs
float p[n][k]=...;
float M=...;
float B=...;
//variables
dvar boolean w[n];
//objective
maximize (sum(k in k) log(sum(n in n)(w[n]*exp((-1*p[n][k]))))) ;
//constraints
subject to
{
sum (n in n) w[n]<= 2 ;
}
It is confusing; I do not know what the problem is. Does anyone know the solution?