3
$\begingroup$

(I saw: Unable to evaluate reasonable max expression but this seems an even easier case an I thought it worth posting)

See the following simplifications of Max operators, which are all very straightforward:

Assuming[b/g >= l n (1 - t), Max[b/g, l n (1 - t)] // FullSimplify]
(* Doesn't simplify *)

Assuming[b >= l n (1 - t), Max[b, l n (1 - t)] // FullSimplify]
(* Simplifies when I remove the /g *)

Assuming[b >= g l n (1 - t), Max[b, g l n (1 - t)] // FullSimplify]
(* Doesn't simplify.  Added an additional 'g' was enough*)

Assuming[b/g >= l n, Max[b/g, l n] // FullSimplify] 
(* Simplifies, even with the /g on both sides, but had to remove the (1-t)*)

Basically, the cases with which it works are very trivial, for seamingly trivial expressions. Any ideas on how to tell mathematica to work harder on the simplifications (the trick in Unable to evaluate reasonable max expression didn't seem to work here).

While I have tried to get things down to a minimal working example, my setup is slightly more complicated, but of this pattern. Adding additional parameter assumptions didn't seem to help. Here is my full test, adding an If version since it is equivalent here.:

Assuming[(lh η (1 - θ) Λ)/(1 + η) <= b/(1 + g ), 
  Max[b/(1 + g), (lh η (1 - θ) Λ)/(1 + η)] // FullSimplify]

Assuming[(lh η (1 - θ) Λ)/(1 + η) <= b/(1 + g), 
  If[b/(1 + g) >= (lh η (1 - θ) Λ)/(1 + η),
    b/(1 + g), (Λ (1 - θ) η lh)/(1 + η)] // FullSimplify]
$\endgroup$
  • 1
    $\begingroup$ Is this sufficient? It seems to work for the examples you showed. simpMax[u_, v_] := Simplify[If[u >= v, u, v]]; {Assuming[b/g >= l n (1 - t), simpMax[b/g, l n (1 - t)]], Assuming[b >= l n (1 - t), simpMax[b, l n (1 - t)]], Assuming[b >= g l n (1 - t), simpMax[b, g l n (1 - t)]], Assuming[b/g >= l n, simpMax[b/g, l n]]} $\endgroup$ – Bill Jul 7 '17 at 20:47
  • $\begingroup$ @bill Thanks so much for the response! The If formulation seems to work much better for simplifications, and this passes my more advanced test above. If you create an answer, I can mark it as complete. $\endgroup$ – jlperla Jul 7 '17 at 21:02
4
$\begingroup$
SetSystemOptions["SimplificationOptions" -> "AssumptionsMaxNonlinearVariables" -> 15]

Default value of this suboption is 4.

Assuming[b/g >= l n (1 - t), Max[b/g, l n (1 - t)] // FullSimplify]

b/g

Assuming[b >= g l n (1 - t), Max[b, g l n (1 - t)] // FullSimplify]

b

Assuming[(lh η (1 - θ) Λ)/(1 + η) <= b/(1 + g), 
    Max[b/(1 + g), (lh η (1 - θ) Λ)/(1 + η)] // FullSimplify]

b/(1 + g)

To reset the suboption to its original value:

SetSystemOptions["SimplificationOptions" -> "AssumptionsMaxNonlinearVariables" -> 4]
$\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.