0
$\begingroup$

I am trying to maximize a function (involving several Max and Min) in two variables and one parameter with some constraints. After struggling with it, I am trying with smaller examples to understand what I am doing wrong. I write here the three small examples I am working on:

1) 2 variables and 1 parameter:

    Maximize[100 g x - 1/6 y + x, 0 < y < 10 && 0 < x < 10 && g > 0, {x, y}]

which gives the solution:

    10 (1 + 100 g), g>0 
    -\[Infinity], True 

{x -> Indeterminate, y -> Indeterminate}}

2) 2 variables and a Max:

    Maximize[100  x - 1/6 y + Max[0, x], 0 < y < 10 && 0 < x < 10 , {x, y}]

which gives the solution:

   1010, {x -> 10, y -> 0}

3) 2 variables, 1 parameter and a Max:

   Maximize[100 g x - 1/6 y + Max[0, x], g > 0 && 0 < y < 10 && 0 < x < 10 , {x,y}]

which does not solve the problem; just gives this solution:

    Maximize[100 g x - 1/6 y + Max[0, x], g > 0 && 0 < y < 10 && 0 < x < 10 ,{x,y}].

Now my question is: why the combination of case 1) and 2) together does not work?

Thank you very much!

$\endgroup$
  • $\begingroup$ I don't understand. If you assume x>0, then Max[x, 0]=x. Why you need Max function? $\endgroup$ – OkkesDulgerci Apr 4 '18 at 2:23
1
$\begingroup$

Make the intervals half-closed (or closed)

Assuming[g > 0, 
 Maximize[{100 g x - 1/6 y + x, 0 <= y < 10, 0 < x <= 10}, {x, y}] // 
  Simplify]

(* {10 + 1000 g, {x -> 10, y -> 0}} *)

EDIT:

Assuming[{g > 0, x > 0}, 
 Maximize[{100 g x - 1/6 y + Max[x, 0], 0 <= y <= 10, 
    0 < x <= 10}, {x, y}] // Simplify]

(* {10 + 1000 g, {x -> 10, y -> 0}} *)
$\endgroup$
  • $\begingroup$ Hi, thank you for your answer. However, this suggestion still does not work when I have to maximize a function containing a Max, e.g.: Assuming[g > 0, Maximize[{100 g x - 1/6 y + Max[x, 0], 0 <= y <= 10, 0 < x <= 10}, {x, y}] // Simplify], which cannot be solved.. $\endgroup$ – Mary Apr 3 '18 at 7:27
  • $\begingroup$ The OP contains both the constraints and the use of Max. I agree that the Max is redundant. Reiterating part of the constraint is necessary to help the Simplify deal with the Piecewise. $\endgroup$ – Bob Hanlon Apr 4 '18 at 2:35

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.