       Re: Optimization

• To: mathgroup at smc.vnet.net
• Subject: [mg35284] Re: [mg35273] Optimization
• From: Brett Champion <brettc at wolfram.com>
• Date: Sat, 6 Jul 2002 05:44:32 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```On Fri, 5 Jul 2002, Etienne wrote:

> Is there a Mathematica package that minimizes a constrained non-linear
> function containing Min and Max. For example,  f[x_,y_] :=  Min[ Cos[x-y]
> Sin[2 x] Cos[y] - Cos[x y]  , Cos[x]].

NMinimize in Mathematica 4.2 will do this.

In:= <<NumericalMath`NMinimize`

In:= f[x_,y_]:=Min[Cos[x - y] Sin[2 x] Cos[y] - Cos[x y], Cos[x]]

In:= NMinimize[f[x,y],{x,y}]

Out= {-1.78936, {x -> -2.5056, y -> 0.0722398}}

In:= NMinimize[f[x,y], {x,y}, Method->"DifferentialEvolution"]

Out= {-1.84785, {x -> -0.668632, y -> -0.271995}}

Out= {-1.84785, {x -> -0.668632, y -> -0.272001}}

With the default method (NelderMead) NMinimize was trapped by a local
minimum.  DifferentialEvolution did much better, as did NelderMead with a
non-default random seed.  Looking at a contour plot of the function, this
appears to be the correct minimum.

Brett Champion

```

• Prev by Date: AppendTo VERY slow
• Next by Date: Re: Art Graphics in Mathematica
• Previous by thread: Re: Optimization
• Next by thread: Optimization package