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

MathGroup Archive 2010

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

Search the Archive

FindMinimum numerical constraint functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110854] FindMinimum numerical constraint functions
  • From: "Stuart Nettleton" <Stuart.Nettleton at uts.edu.au>
  • Date: Thu, 8 Jul 2010 07:41:34 -0400 (EDT)
  • Organization: University of Technology, Sydney

Hi, I am experimenting with external numerical constraint functions in  
FindMinimum. Would anyone understand how the second FindMinimum might be  
made to work in the way of the first?

FindMinimum[{Sin[x ] Sin[2 y], {x^2 + y^2 < 3, -x < 0, -y < 0}}, {x,
   y}]
Clear[obj, con];
vars = {x, y};
lenvars = Length[vars];
obj[vars1_] := Module[{subst = Thread[Array[m, lenvars] -> vars1]},
     ReplaceAll[Sin[m[1]] Sin[m[2]], subst]
     ] /; VectorQ[vars1, NumberQ];
con[vars2_] := Module[{subst = Thread[Array[n, lenvars] -> vars2]},
     ReplaceAll[{n[1]^2 + n[2]^2, -n[1], -n[2]}, subst]
     ] /; VectorQ[vars2, NumberQ];
FindMinimum[{obj, Thread[con[vars] < {3, 0, 0}]}, vars]


Thanks,
Stuart

--
UTS CRICOS Provider Code:  00099F
DISCLAIMER: This email message and any accompanying attachments may contain
confidential information.  If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments.  If
you have received this message in error, please notify the sender
immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly, and
with authority, states them to be the views the University of Technology,
Sydney. Before opening any attachments, please check them for viruses and
defects.


  • Prev by Date: Re: More flexibility in placement of ChartLegend
  • Next by Date: Re: Problem with a diagram
  • Previous by thread: Re: First nonzero in list
  • Next by thread: Re: FindMinimum numerical constraint functions