2
$\begingroup$

The documentation for Maximize says that it returns Indeterminate and minus infinity if the constraints cannot be satisfied. I'm puzzled when I try to solve the following (power equation for a pair of resistors with voltage == 1):

ClearAll[rS,rL]
Maximize[{rL/(rS + rL)^2, rL > 0 && rS > 0}, rL]

I've told Maximize that rL>0 and rS>0 so I expect only the first solution. Why do I get the indeterminate condition?

This is v12.1 on Mac OS if that matters. The solution should set rL to rS so the first solution is the expected solution. I have also tried specifying the domain of Reals for rL and rS and that doesn't change the returned value.

$\endgroup$
3
  • 2
    $\begingroup$ I think Maximize is being extra cautious on you behalf, by providing a result that would be valid in general, even outside of the context of your constraints, so you can use it safely elsewhere where those constraints may not be respected. If you do want only the solution for rS > 0, you can use Refine or Simplify on the result, together with the appropriate condition, e.g. Refine[Maximize[{rL/(rS + rL)^2, rL > 0 && rS > 0}, rL], rS > 0]. $\endgroup$
    – MarcoB
    Commented Jun 4, 2020 at 20:43
  • $\begingroup$ Thanks for the explanation. Please write this up as an answer and I'll happily accept it. $\endgroup$
    – Mark R
    Commented Jun 5, 2020 at 2:00
  • $\begingroup$ Will do! Glad it helped. $\endgroup$
    – MarcoB
    Commented Jun 5, 2020 at 3:14

1 Answer 1

3
$\begingroup$

I think Maximize is being extra cautious on your behalf, by providing a result that would be valid in general, even outside of the context of your constraints, so you can use it safely elsewhere where those constraints may not be respected.

If you want only the solution for $r_S > 0$, you can use Refine or Simplify on the result, together with the appropriate condition:

Refine[
  Maximize[{rL/(rS + rL)^2, rL > 0 && rS > 0}, rL], 
  rS > 0
]
$\endgroup$

Your Answer

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

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