Originally posted by: CMP-SFL
Hi,
Thanks for the answer.
I have never used CP optimizer. By looking at OPL examples, I added using CP; at the beginning of the model, and I got other errors. I think, the syntax must be changed!
The models I use are simple. I put again the gist of the models below. Do you know how to put the model in the right format in order to use sqrt and log functions? Thanks again!
// Begin of Model 1
float Parameter [Unit]=...;
dvar float+ varaiable1[Unit];
dvar float+ varaiable2[Unit];
minimize sum(m in Unit) varaiable2[m] ;
subject to
{
forall(m in Unit) varaiable2[m] >= (varaiable1[m] - Parameter[m])^(1/2) ;
}
main {
cplex.solve();
var UB = cplex.getObjValue();
var LB = cplex.getBestObjValue();
}
// End of Model 1
// Begin of Model 2
float Parameter [Unit]=...;
dvar float+ varaiable1[Unit];
dvar float+ varaiable2[Unit];
minimize sum(m in Unit) varaiable2[m] ;
subject to
{
forall(m in Unit) log(varaiable2[m]) >= log (varaiable1[m] - Parameter[m]) ;
}
main {
cplex.solve();
var UB = cplex.getObjValue();
var LB = cplex.getBestObjValue();
}
// End of Model 2
#DecisionOptimization#OPLusingCPLEXOptimizer