Hello,

I have the following equations;

Y = -2077.77932456644 +16.7872794266809*BF1 +33.2218328714858*BF2 +8.52627498031323*BF3 +19.0514813801442*BF4 -17.7108695638677*BF5 +8.03819569742098*BF6 -28.8378291473933*BF7 -19.4689953875162*BF8 -17.7390853424783*BF9 +71.6404109074202*BF10 +11.8387402541357*BF11 -8.36665433654147*BF12 +10.680112178894*BF13 +22.8456570257402*BF14 -89.5565023342891*BF15

Given that;

BF1 = max(0, x5 -5)

BF2 = max(0,5 -x5)

BF3 = max(0, x1 -3)

BF4 = max(0, x8 -3)

BF5 = max(0,7 -x10)

BF6 = max(0, x11 -2)

BF7 = max(0,2 -x11)

BF8 = max(0,7 -x6)

BF9 = max(0,7 -x2)

BF10 = max(0,3 -x3)

BF11 = max(0, x4 -3)

BF12 = max(0,6 -x9)

BF13 = max(0, x7 -2)

BF14 = max(0,2 -x7)

BF15 = max(0,1 -x1)

I entered this in to Matlab using the following code;

cvx_begin

cvx_solver gurobi

variable x1 integer;

variable x2 integer;

variable x3 integer;

variable x4 integer;

variable x5 integer;

variable x6 integer;

variable x7 integer;

variable x8 integer;

variable x9 integer;

variable x10 integer;

variable x11 integer;

variable BF1 integer;

variable BF2 integer;

variable BF3 integer;

variable BF4 integer;

variable BF5 integer;

variable BF6 integer;

variable BF7 integer;

variable BF8 integer;

variable BF9 integer;

variable BF10 integer;

variable BF11 integer;

variable BF12 integer;

variable BF13 integer;

variable BF14 integer;

variable BF15 integer;

BF1==max(0,x5-5);

BF2==max(0,5-x5);

BF3==max(0, x1 -3);

BF4==max(0, x8 -3);

BF5==max(0,7 -x10);

BF6==max(0, x11 -2);

BF7==max(0,2 -x11);

BF8==max(0,7 -x6);

BF9==max(0,7 -x2);

BF10==max(0,3 -x3);

BF11==max(0, x4 -3);

BF12==max(0,6 -x9);

BF13==max(0, x7 -2);

BF14==max(0,2 -x7);

BF15==max(0,1 -x1);

minimize (-2077.77932456644 +16.7872794266809*BF1 +33.2218328714858*BF2 +8.52627498031323*BF3 +19.0514813801442*BF4 -17.7108695638677*BF5 +8.03819569742098*BF6 -28.8378291473933*BF7 -19.4689953875162*BF8 -17.7390853424783*BF9 +71.6404109074202*BF10 +11.8387402541357*BF11 -8.36665433654147*BF12 +10.680112178894*BF13 +22.8456570257402*BF14 -89.5565023342891*BF15);

cvx_end

However it gave me the error saying;

"Error using cvxprob/newcnstr (line 192)

Disciplined convex programming error:

Invalid constraint: {real affine} == {convex}

Error in == (line 12)

b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘[]’ ), x, y, ‘==’ );

Error in TestOb (line 42)

BF1==max(0,x5-5);"

My objective is to minimize the equation to get the best possible x’s. I have all the cvx solvers. Any help would be appreciated. Thank you in advance!