0
$\begingroup$

I use Reduce to find conditions on some parameters such that certain inequalities are fulfilled. An additional condition is that all parameters are positive. The first problem is that I have to mention all those conditions when calling Reduce, and the second is that they appear in the result and make it less readable.

I tried to use Assumptions, but it doesn't change the result.

I wonder if it is possible to hide these trivial conditions or at least suppress them in the output?

$Assumptions = Flatten[{Thread[{r, p, h, K} > 0], Element[{r, p, h, K}, Reals]}]
Reduce[K*(r - h)/r > 0 && (p*h)/(r - h) < p && K >0 && p>0 && h>0 && r>0,h]
$\endgroup$
4
  • 2
    $\begingroup$ MemberQ[Keys[Options[Reduce]], Assumptions] returns False, so it is inappropriate to use $Assumptions with Reduce[]. $\endgroup$ Commented Jan 22, 2020 at 9:23
  • 1
    $\begingroup$ Dmitry, apply Simplify to the result of Reduce. $\endgroup$ Commented Jan 22, 2020 at 9:24
  • $\begingroup$ @HenrikSchumacher, this seems to be the most simple and efficient solution so far. Thank you! $\endgroup$ Commented Jan 22, 2020 at 9:38
  • $\begingroup$ You're welcome! $\endgroup$ Commented Jan 22, 2020 at 9:45

1 Answer 1

1
$\begingroup$

Here is one possibility:

conds = K > 0 && p > 0 && h > 0 && r > 0;
Complement[Reduce[K*(r - h)/r > 0 && (p*h)/(r - h) < p && conds, h, Reals], conds]
   0 < h < r/2
$\endgroup$
2
  • $\begingroup$ Unfortunately, it does not suppress the conditions from the output when inequalities get more complex, e.g., here: conds = K > 0 && p > 0 && h > 0 && r > 0 && [Rho] > 0; Complement[Reduce[K*(r - h)/r > 0 && (p*h)/(r - [Rho] - h) < p && conds, h, Reals], conds] $\endgroup$ Commented Jan 22, 2020 at 9:35
  • 1
    $\begingroup$ Then you can use Simplify[], which does take assumptions: With[{conds = K > 0 && p > 0 && h > 0 && r > 0 && ρ > 0}, Assuming[conds, Simplify[Reduce[K*(r - h)/r > 0 && (p*h)/(r - ρ - h) < p && conds, h, Reals]]]]. $\endgroup$ Commented Jan 22, 2020 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.