Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NMinimize Bug in Mathematica 7.0?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96248] Re: [mg96197] NMinimize Bug in Mathematica 7.0?
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 10 Feb 2009 05:50:52 -0500 (EST)
  • Reply-to: hanlonr at cox.net

poly = x^4 - 3 x^2 + x;

Plot[poly, {x, -2, 2}, PlotRange -> {-3.6, .5}]

NMinimize[poly, x]

{-1.07023,{x->1.1309}}

Use Minimize

Minimize[poly, x] // N

{-3.51391,{x->-1.30084}}

A constraint

NMinimize[{poly, x < 0}, x]

{-3.51391,{x->-1.30084}}

Or a starting interval

NMinimize[poly, {x, -2, 1}]

{-3.51391,{x->-1.30084}}


Bob Hanlon

---- appris at att.net wrote: 

=============
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.




  • Prev by Date: OpenSQLConnection too many times causes complete hang.
  • Next by Date: Problem importing HTML with Mathematica
  • Previous by thread: Re: NMinimize Bug in Mathematica 7.0?
  • Next by thread: Re: NMinimize Bug in Mathematica 7.0?