Re: NMinimize Bug in Mathematica 7.0?
- To: mathgroup at smc.vnet.net
- Subject: [mg96225] Re: [mg96197] NMinimize Bug in Mathematica 7.0?
- From: "Jaccard Florian" <Florian.Jaccard at he-arc.ch>
- Date: Tue, 10 Feb 2009 05:46:41 -0500 (EST)
- References: <200902091033.FAA12301@smc.vnet.net>
Hello,
I would avoid to use numerical methods without looking at a graphic.
As you can see:
Plot[x - 3*x^2 + x^4,{x, -2, 2}]
Both answers are correct, they give approximations of local minimums.
You can ask for a minimal and maximal bound for the local minimums like =
this :
In[8]:= NMinimize[x - 3*x^2 + x^4,{x, -2, -1}]
Out[8]= {-3.513905038934789,
{x -> -1.3008395739047898}}
In[9]:= NMinimize[x - 3*x^2 + x^4,{x, 0.5, 1.5}]
Out[9]= {-1.0702301817761541,
{x -> 1.1309011226299863}}
If you want the absolute minimum, use a non-numeric method :
In[11]:= N[Minimize[x - 3*x^2 + x^4, x]]
Out[11]= {-3.5139050389347894,{x -> -1.3008395659415772}}
Jaccard Florian
-----Message d'origine-----
De : appris at att.net [mailto:appris at att.net]
Envoy=E9 : lundi, 9. f=E9vrier 2009 11:34
=C0 : mathgroup at smc.vnet.net
Objet : [mg96197] NMinimize Bug in Mathematica 7.0?
Here is an example from Mathematica's user's guide:
In[8]:= NMinimize[x^4 - 3 x^2 + x, x]
Out[8]= {-3.513905039, {x -> -1.300839566}}
however, trying to replicate it, I get the following:
In[2]:= NMinimize[x^4 - 3 x^2 + x, x]
Out[2]= {-1.070230182, {x -> 1.130901122}}
One way to find the global min, I had to use a constraint such as x<0.
Has anyone come across such a problem?
In[3]:= $Version
Out[3]= "7.0 for Microsoft Windows (32-bit) (November 10, 2008)"
Thanks.
- References:
- NMinimize Bug in Mathematica 7.0?
- From: appris@att.net
- NMinimize Bug in Mathematica 7.0?