If you Solve
an equation, you obtain all solutions.
But If you NMinimize
a function, you only get one minimum.
The question is: is there a way to obtain all minima of a given function?
Example:
Solve[((x - 2) (x + 2))^2 == 0, x]
Print["____________"]
NMinimize[((x - 2) (x + 2))^2, x]
NMinimize[ {((x - 2) (x + 2))^2, x >= 0}, x]
yields
{{x -> -2}, {x -> -2}, {x -> 2}, {x -> 2}}
____________
{0., {x -> -2.}}
{0., {x -> 2.}}
You can see that for Solve
you obtain all solutions, even with their multiplicity, but in the minimization, you only obtain one solution.
NMinimize
does not perform a global optimization, and will return only one (quite possibly local) minimum. You can tryMinimze
which will return a global minimum for polynomial functions, but not other (local) ones. $\endgroup$ – Yves Klett Mar 25 '14 at 10:32Solve
forf' == 0 && f'' >0
. $\endgroup$ – Kuba♦ Mar 25 '14 at 10:35