Code: Select all
integer variable
x;
x.lo = 1;
x.up = 3;
scalar
p1 /5/
p2 /10/
p3 /15/;
variable cost, y;
equations con1_eqn;
con1_eqn..
y =e= (x-1)*(x-2)*p3 + (x-2)*(x-3)*p1 + (x-3)*(x-1)*p2;
model all_eqn /all/;
solve all_eqn maximize y using MINLP;