MathGroup Archive 2007

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

Search the Archive

Re: Minimize[] Problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76381] Re: Minimize[] Problem
  • From: dimitris <dimmechan at yahoo.com>
  • Date: Sun, 20 May 2007 02:45:06 -0400 (EDT)
  • References: <f2mfj4$mh1$1@smc.vnet.net>

It seems there is a problem.

Note however (I copy from Help Browser)

"Even if the same minimum is achieved at several points, only one is
returned."

"An important feature of Minimize and Maximize is that they always
find global minima and maxima. Often functions will have various
local
minima and maxima at which derivatives vanish. But Minimize and
Maximize use global methods to find absolute minima or maxima, not
just local extrema. "

Anyway my goal is not to explain the problem but rather to offer a
simple
workaround.

(See also this thread

http://groups.google.gr/group/comp.soft-sys.math.mathematica/browse_thread/thread/6c5791d7ee1ce693/a46f9583bb18c141?lnk=gst&q=Minimize&rnum=7&hl=el#a46f9583bb18c141

)

In[105]:=
f[x_] := (x^4 - 6*x^2 + 1)^2

In[114]:=
Plot[f[x], {x, -3, 3}]

In[116]:=
Plot[Derivative[1][f][x], {x, -3, 3}]

In[108]:=
Plot[Derivative[2][f][x], {x, -3, 3}]

In[120]:=
Off[General::spell1]
Print["Position of local extrema"]
ex = x /. (Reduce[f'[x] == 0, x] // {ToRules[#]} &)
Print["number of local extrema"]
Length[%%]
Print["criterion of second derivative"]
crit = {#, f''[x] /. x -> #} & /@ ex // Simplify
Print["local minima"]
min = Cases[crit, {a_, x_?Positive} -> a]
Print["local maxima"]
max = Cases[crit, {a_, x_?Negative} -> a]
On[General::spell1]

Regards
Dimitris

 /  anguzman at ing.uchile.cl       :
> Hello.
>
> Why do I get?
>
> In[4]:=
> Minimize[(x^4-6 x^2+1)^2,{x}]
> Out[4]=
> {1,{x->0}}
>
> when..
>
> In[3]:=
> (x^4-6 x^2+1)^2/.x->1-Sqrt[2]//Simplify
> Out[3]=
>
>
> x=0 is actually a local maximum.
> Any answer will be appreciated.
>
> Atte Andres Guzman
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.



  • Prev by Date: Re: Number of Differing Digits & Another Problem (want to see different ways it can be done)
  • Next by Date: Re: Re: 64-bit again
  • Previous by thread: Re: Minimize[] Problem
  • Next by thread: Re: Minimize[] Problem