I am trying to maximize a function of two endogenous variables (Lf and Lo), where I have two exogenous parameters (T and p), which are positive. All variables should be real. I do it as following:
maxFo = Maximize[{Sqrt[24 - Lf - Lo] + Lo + Sqrt[Lf] p Sqrt[T],
{Lf >= 0, Lf + Lo <= 24, 0 <= Lo <= 5, T> 0, p > 0}},
{Lf, Lo},
Reals];
I have a difficulties understanding several points:
Maximize[]
returns a piecewise function that contains assumptions likep>0
, but I've already specified this was indeed the case inMaximize[..., {..., p>0},...]
. Why then does it still contain assumptions likep>0
?
I then use the FullSimplify
function to re-enter my constraints:
FullSimplify[maxFo, {T > 0, p > 0,
Element[p, Reals], Element[T, Reals], Element[Lf, Reals]}]
And then, I face the issue:
- The answer for Lf seems to contain a complex number (
...2 i p...
)? Why? I thought I specified both inMaximize
and inFullSimplify
I wanted real numbers? Is it wrong how I specify this inFullSimplify
?
Thanks!