1
$\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 Jun 4 '20 at 20:43
  • $\begingroup$ Thanks for the explanation. Please write this up as an answer and I'll happily accept it. $\endgroup$ – Mark R Jun 5 '20 at 2:00
  • $\begingroup$ Will do! Glad it helped. $\endgroup$ – MarcoB Jun 5 '20 at 3:14
2
$\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, privacy policy and cookie policy

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