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

MathGroup Archive 2013

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

Search the Archive

Re: Minimize Headscratcher

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130723] Re: Minimize Headscratcher
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Mon, 6 May 2013 04:23:53 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20130504071841.76B2C6A16@smc.vnet.net>

$Version

9.0 for Mac OS X x86 (64-bit) (January 24, 2013)

Minimize is not guaranteed to find a global minimum. In your example, it
finds a local minimum. Adding the constraints results in a different
minimum which may or may not be global (i.e., perhaps the function is
negative somewhere). Interestingly, the solution for the constrained
minimization can be rationalized/rounded to very simple forms that evaluate
to a minimum of exactly zero for a rationalized f.

f=4308.87-2.2 \[Phi]-6.4` \[Gamma] \[Phi]-28.6` \[Gamma]^2
\[Phi]+\[Phi]^2+\[Gamma]^2 \[Phi]^2+\[Gamma]^4 \[Phi]^2-28.6` \[Psi]+2
\[Gamma]^2 \[Phi] \[Psi]+\[Psi]^2-28.6` \[Theta][1]+2 \[Gamma]^2 \[Phi]
\[Theta][1]+2 \[Psi] \[Theta][1]+\[Theta][1]^2-110.8`
\[Theta][2]+\[Theta][2]^2-7.4` \[Theta][3]+\[Theta][3]^2-2.2` \[Theta][4]+2
\[Phi] \[Theta][4]+\[Theta][4]^2+12.8` \[Gamma] \[Phi] \[Lambda][1]+55.2`
\[Gamma]^2 \[Phi] \[Lambda][1]+55.2` \[Psi] \[Lambda][1]-110.8` \[Gamma]^2
\[Phi] \[Lambda][1]^2+\[Gamma]^2 \[Phi]^2 \[Lambda][1]^2+\[Gamma]^4
\[Phi]^2 \[Lambda][1]^2-110.8` \[Psi] \[Lambda][1]^2+2 \[Gamma]^2 \[Phi]
\[Psi] \[Lambda][1]^2+\[Psi]^2 \[Lambda][1]^2+2 \[Gamma]^2 \[Phi]
\[Theta][2] \[Lambda][1]^2+2 \[Psi] \[Theta][2] \[Lambda][1]^2+\[Gamma]^4
\[Phi]^2 \[Lambda][1]^4+2 \[Gamma]^2 \[Phi] \[Psi] \[Lambda][1]^4+\[Psi]^2
\[Lambda][1]^4-3.2` \[Phi] \[Lambda][2]-12.8`\[Gamma] \[Phi]
\[Lambda][2]+25.6` \[Gamma] \[Phi] \[Lambda][1] \[Lambda][2]-7.4` \[Phi]
\[Lambda][2]^2+\[Phi]^2 \[Lambda][2]^2+\[Gamma]^2 \[Phi]^2 \[Lambda][2]^2+2
\[Phi] \[Theta][3] \[Lambda][2]^2+\[Gamma]^2 \[Phi]^2 \[Lambda][1]^2
\[Lambda][2]^2+\[Phi]^2 \[Lambda][2]^4;

unknowns={\[Lambda][1],\[Lambda][2],\[Gamma],\[Phi],\[Psi],\[Theta][1],\[Theta][2],\[Theta][3],\[Theta][4]};

min=Minimize[
{f,\[Theta][1]>=0,\[Theta][2]>=0,\[Theta][3]>=0,
\[Theta][4]>=0,\[Phi]>=0,\[Psi]>=0},
unknowns,Reals]

{9.09495*10^-13,{\[Lambda][1]->-2.,\[Lambda][2]->2.,\[Gamma]->4.,\[Phi]->0.8,\[Psi]->1.,\[Theta][1]->0.5,\[Theta][2]->0.200001,\[Theta][3]->0.5,\[Theta][4]->0.3}}

sol=min[[-1]]//
Rationalize[#,10^-5]&

{\[Lambda][1]->-2,\[Lambda][2]->2,\[Gamma]->4,\[Phi]->4/5,\[Psi]->1,\[Theta][1]->1/2,\[Theta][2]->1/5,\[Theta][3]->1/2,\[Theta][4]->3/10}

or using Round

sol==(min[[-1]]/.
x_?NumericQ->Round[x,10^-1])

True

or using RootApproximant

sol==(min[[-1]]/.
x_?NumericQ:>RootApproximant[x])

True

(f//Rationalize)/.sol

0


Bob Hanlon



On Sat, May 4, 2013 at 3:18 AM, <bruce.colletti at gmail.com> wrote:

> Re 8.0.4 under Windows 7.
>
> f is a multivariate function in the variables found in "unknowns" below.
>  Although not shown, f is the dot product of a vector with itself.
>
> When I find the unconstrained minimum (over the reals) of f, Minimize
> returns an objective value of 902.528.
>
> Yet when I add constraints, Minimize returns zero!
>
> What is going on?  Thanks.
>
> Bruce
>
>
> f=4308.87\[VeryThinSpace]-2.2 \[Phi]-6.4` \[Gamma] \[Phi]-28.6` \[Gamma]^2
> \[Phi]+\[Phi]^2+\[Gamma]^2 \[Phi]^2+\[Gamma]^4 \[Phi]^2-28.6` \[Psi]+2
> \[Gamma]^2 \[Phi] \[Psi]+\[Psi]^2-28.6` \[Theta][1]+2 \[Gamma]^2 \[Phi]
> \[Theta][1]+2 \[Psi] \[Theta][1]+\[Theta][1]^2-110.8`
> \[Theta][2]+\[Theta][2]^2-7.4` \[Theta][3]+\[Theta][3]^2-2.2` \[Theta][4]+2
> \[Phi] \[Theta][4]+\[Theta][4]^2+12.8` \[Gamma] \[Phi] \[Lambda][1]+55.2`
> \[Gamma]^2 \[Phi] \[Lambda][1]+55.2` \[Psi] \[Lambda][1]-110.8` \[Gamma]^2
> \[Phi] \[Lambda][1]^2+\[Gamma]^2 \[Phi]^2 \[Lambda][1]^2+\[Gamma]^4
> \[Phi]^2 \[Lambda][1]^2-110.8` \[Psi] \[Lambda][1]^2+2 \[Gamma]^2 \[Phi]
> \[Psi] \[Lambda][1]^2+\[Psi]^2 \[Lambda][1]^2+2 \[Gamma]^2 \[Phi]
> \[Theta][2] \[Lambda][1]^2+2 \[Psi] \[Theta][2] \[Lambda][1]^2+\[Gamma]^4
> \[Phi]^2 \[Lambda][1]^4+2 \[Gamma]^2 \[Phi] \[Psi] \[Lambda][1]^4+\[Psi]^2
> \[Lambda][1]^4-3.2` \[Phi] \[Lambda][2]-12.8`\[Gamma] \[Phi]
> \[Lambda][2]+25.6` \[Gamma] \[Phi] \[Lambda][1] \[Lambda][2]-7.4` \[Phi]
> \[Lambda][2
>  ]^2+\[Phi]^2 \[Lambda][2]^2+\[Gamma]^2 \[Phi]^2 \[Lambda][2]^2+2 \[Phi]
> \[Theta][3] \[Lambda][2]^2+\[Gamma]^2 \[Phi]^2 \[Lambda][1]^2
> \[Lambda][2]^2+\[Phi]^2 \[Lambda][2]^4;
>
>
> unknowns={\[Lambda][1],\[Lambda][2],\[Gamma],\[Phi],\[Psi],\[Theta][1],\[Theta][2],\[Theta][3],\[Theta][4]};
>
> Chop@Minimize[f,unknowns,Reals]
>
>
> {902.528,{\[Lambda][1]->25.5724,\[Lambda][2]->2.0396,\[Gamma]->8.9358,\[Phi]->-0.0271413,\[Psi]->2.21744,\[Theta][1]->15.767,\[Theta][2]->21.4074,\[Theta][3]->2.26757,\[Theta][4]->1.28171}}
>
> Chop@Minimize
> [{f,\[Theta][1]>=0,\[Theta][2]>=0,\[Theta][3]>=0,\[Theta][4]>=0,\[Phi]>=0,\[Psi]>=0},unknowns,Reals]
>
>
> {0,{\[Lambda][1]->-2.,\[Lambda][2]->2.,\[Gamma]->4.,\[Phi]->0.8,\[Psi]->1.,\[Theta][1]->0.5,\[Theta][2]->0.200001,\[Theta][3]->0.5,\[Theta][4]->0.3}}
>
>


  • Prev by Date: Re: space between frame and plot on contourplot
  • Next by Date: Listable Attribute of Pure Function that returns a matrix
  • Previous by thread: Minimize Headscratcher
  • Next by thread: Re: Minimize Headscratcher