Re: Bug in NMaximize?
- To: mathgroup at smc.vnet.net
- Subject: [mg43496] Re: [mg43468] Bug in NMaximize?
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Thu, 18 Sep 2003 05:39:00 -0400 (EDT)
- References: <200309171200.IAA29785@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Guillermo Sanchez wrote:
>
> Using:
>
> NMaximize[{x^2 + y^2, x^2/9 + y^2/4 <= 1}, {x, y}]
>
> Mathematica 5 gives as solution:
>
> {9., {x -> -3., y -> 3.242576952529308*^-19}}.
>
> Becouse it is a simetric problem (x^2 and y^2 >= 0) the true solution
> should be: x -> -3 and x -> +3.
>
> What is wrong?
>
> Guillermo Sanchez
This is the expected and documented behavior. If you check the Help
Browser for NMinimize (which also contains that for NMaximize) you will
see that it only returns one minimizer or maximizer.
To find more information appropriate to the desired goal, look under
Numerical Computation > Optimization > NMinimize > Further Examples >
Finding Multiple Optima, Method 1 (and also Finding Multiple Optima,
Method 2).
For example, here is how the first method might be applied to your
optimization.
Table[NMaximize[{x^2 + y^2, x^2/9 + y^2/4 <= 1}, {x, y},
Method -> {"NelderMead", "RandomSeed" -> i}], {i, 10}]
I can recover both solutions in this way.
Daniel Lichtblau
Wolfram Research
- References:
- Bug in NMaximize?
- From: guillerm@aida.usal.es (Guillermo Sanchez)
- Bug in NMaximize?