1
$\begingroup$

I am trying to optimize a linearly constrained Production Function. I have three inputs and want them all to be multiples of 150. I can make all the inputs to belong to the Integer Domain but is there a way to specify as a constraint that they be multiples of 150 as well? TIA.

Maximize[4 a + 8.75 b + 8.3333 c,a + b + c == 3000 && 600 a + 1600 b + 1500 c \[LessSlantEqual] 3500000 && 2 a + 1.3333 b + 3 c \[LessSlantEqual] 6000 && c >= 150 &&  a \[GreaterSlantEqual] 300  && (a \[Element] Integers) && (b\[Element]Integers) && (c \[Element] Integers) , {a, b, c}]
$\endgroup$
0
$\begingroup$

What about this approach?

objective = 4 a + 8.75 b + 8.3333 c;
constraints = a + b + c == 3000 && 600 a + 1600 b + 1500 c <= 3500000 && 2 a + 1.3333 b + 3 c <= 6000 && c >= 150 && a >= 300;
domain = (a ∈ Integers) && (b ∈ Integers) && (c ∈ Integers);
repo = {a -> 150 a, b -> 150 b, c -> 150 c};
sol = Maximize[
 objective /. repo,
 Join[constraints /. repo, domain],
 {a, b, c}];

If you like, you can retranslate into the solutions of originale problem as follows:

sol[[2, All , 2]] *= 150;
sol

{19775., {a -> 1350, b -> 1500, c -> 150}}

|improve this answer|||||
$\endgroup$
  • $\begingroup$ I think the question asked for multiples of 150. I think you have used multiples of 15. $\endgroup$ – mikado Dec 9 '18 at 20:06
1
$\begingroup$

I would tackle this by introducing 3 new variables a1, b1 and c1 as follows:

Maximize[4 a + 8.75 b + 8.3333 c, 
 a + b + c == 3000 && 
  600 a + 1600 b + 1500 c ⩽ 3500000 && 
  2 a + 1.3333 b + 3 c ⩽ 6000 && c >= 150 && 
  a ⩾ 
   300 && (a1 ∈ Integers) && (b1 ∈ 
    Integers) && (c1 ∈ Integers) && a == 150 a1 && 
  b == 150 b1 && c == 150 c1, {a, b, c, a1, b1, c1}]
(* {19775., {a -> 1350., b -> 1500., c -> 150., a1 -> 9, 
  b1 -> 10, c1 -> 1}} *)
|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.