I’m trying to use nested numeric optimization, where the condition of the inner function is a variable we optimize over the in the outer function. It seems like that Mathematica can’t substitute the variable in the condition properly. Here is a very simple example of this
NMaxValue[{NMaxValue[{x, x <= y}, x], y <= 10}, y]
Is this intentional? Is there an angle I’m not seeing, why there is a problem with the above? Or is it a bug/missing feature? How can I circumvent this?
I guess the problem arises because the inner function is not a numerical optimization. I would do it like so:
NMaxValue[{MaxValue[{x, x <= y}, x], y <= 10}, y]
I’m aware that changing the inner optimization to exact gives the correct solution. My problem is more about the nested usage of the numerical optimization, the example I provided is just an illustration of this. Just by looking at it, one can find the optimal value.
Yes, I am aware that just by looking at it, one can find the result, too. This was not my point. According to my understanding the output of NMaxValue (in contrast to MaxValue) is just a number. When you write
NMaxValue[{x, x <= y}, x]
what number do you expect as the output?