1

I have a little confusion in the optimization model I trying to solve. Its a small model to minimize the cost of two units. I have just started with the optimization and I am not sure if I am interpreting the problem very well into AMPL. Especially regarding the minimization constraints and their bounds.

I have to two decision variables as Units in my models. Cost of u1 is 10 and u2 is 13. And the limit on the u1 is that you can not make more than 100 units and for u2 is 50 units. I got different results by reversing the bounds of this minimization problem. Can anyone help me interpret whats happening?


var u1 >=0; var u2 >=0;

minimize costofunits: 10*u1 +13*u2;

subject to unit1: 0 <= u1 <= 100; subject to unit2: 0 <= u2 <= 50;


With above constraints I have output as:

CPLEX 12.8.0.0: optimal solution; objective 0 0 dual simplex iterations (0 in phase I) Objective is: 0.000000 : _varname _var := 1 u1 0 2 u2 0 ;

: _objname _obj := 1 costofunits 0 ;

: _conname _con := 1 unit1 0 2 unit2 0

;

Reversing the Constraints:

subject to unit1: 100 <= u1 <= 0; subject to unit2: 50 <= u2 <= 0;

OUTPUT AS:

inconsistent bounds for constraint unit1: lower bound = 100 > upper bound = 0

inconsistent bounds for constraint unit2: lower bound = 50 > upper bound = 0 Infeasible constraints determined by presolve. Objective is: 825.000000 : _varname _var := 1 u1 50 2 u2 25 ;

: _objname _obj := 1 costofunits 825 ;

: _conname _con := 1 unit1 10 2 unit2 13 ;

Abi
  • 13
  • 2
  • What did you expect to see when you say `100 ≤ x ≤ 0` ? – Erwin Kalvelagen Jan 25 '18 at 14:48
  • This is wrong for sure. Erwin, i just want to minimize the cost but i dont want to have 0 cost. The problem is that whatever I set as a lower bound in my constraints, it comes as a optimal values for respective variables. How can I get rid of this situation? – Abi Jan 26 '18 at 09:50

1 Answers1

0

For your first problem: as you've defined the problem, the objective is to minimize costs, and the easiest solution is simply to make zero of everything, for zero cost.

For your second problem, the error message explains the problem. You have set a lower bound of 100 for u1 (100 <= u1) and also an upper bound of 0 (u1 <= 0). Obviously there is no possible number that would satisfy both of these requirements at once. Instead of "<=" in your constraints, you should be using ">=" here, assuming you want to bound u1 between 100 and 0.

Same issue for unit2 constraint.

  • Good Morning Geoffery, Thank you for your response. I want to minimize the cost. So what do you think my constraints should minimize it? I am new in this problem and i have just started learning. I will appreciate your response. – Abi Jan 26 '18 at 09:46
  • The problem is that whatever I set as a lower bound in my constraints, it comes as a optimal values for respective variables. How can I get rid of this situation? – Abi Jan 26 '18 at 09:50
  • If all your production costs money, and you're trying to minimise your costs, then the cheapest solution will be to build as little as possible - i.e. the lower bound. This is the correct solution for the problem you've specified; you might want to think about whether the scenario you're trying to optimise has any other constraints or objectives that aren't covered in the model so far. – GB supports the mod strike Jan 26 '18 at 12:54
  • thank you Geoffery for your comments. I got the idea with your words. – Abi Feb 05 '18 at 17:13