Message Boards Message Boards

0
|
2212 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Is this NMaxValue[ ] behavior intentional?

Posted 3 years ago

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?

POSTED BY: L B
3 Replies

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?

POSTED BY: Henrik Schachner

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]
POSTED BY: Henrik Schachner
Posted 2 years ago

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.

POSTED BY: L B
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract