Originally posted by: SystemAdmin
Hi,
I have a code of form:
IloCplex model = null;
IloNumVar X[] = null;
IloNumVar E[] = null;
IloNumVar E_abs = model.numVarArray(noOfRev, 0, 10);
X = model.numVarArray(noOfVar, -5, 5);
E = model.numVarArray(noOfRev, -10, 10);
After this I have numerous constraint for both X and E
my optimization (minimization) expression should be of the form
model.addMinimize(model.scalProd(E_abs, cost));
where
E_abs[i]=|E[i]| for all i,
i.e the absolute value.
For this i cannot apply the abs() method since it will make the equation linear num expression, which will make it impossible to add it to optimization equation.
So, I need some constraints which ensures that E_abs[i]=Abs(E[i]).
And also the value of E[i] should determine E_abs[i] not the other way around. i.e I need the value of E[i] first and then only get its absolute value to put in the optimization equation..
Been stuck with this for quite a while, looked into some other post for absolute value but somehow could not implement it write......
Any help will be highly appreciated.
I am using the Java concert for CPLEX 12 academic edition
Regards
#CPLEXOptimizers#DecisionOptimization