Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: FindMinimum within a specific interval

  • To: mathgroup at
  • Subject: [mg32933] Re: FindMinimum within a specific interval
  • From: davidrschmidt at (Dave Schmidt)
  • Date: Wed, 20 Feb 2002 01:26:13 -0500 (EST)
  • References: <> <a3f0ka$b2v$>
  • Sender: owner-wri-mathgroup at

You already have two excellent answers to your question, and I realize
what I'm about to offer is probably less suited to your specific
problem than the other two.  However, this seemed like a good time to
share a trick I've learned to use when I want to impose constraints on
FindMinimum or FindRoot.  These techniques are probably obvious to
many of you, but I had not seen them suggested in any of the many
postings about constrained optimization in Mathematica, so here goes.

First, to impose a linear inequality constraint on a variable, do a
simple change of variable.  For instance, to
minimize f[x] subject to a+bx>0, 
where a and b are numbers, just use 
then the critical value of x is (Exp[y]-a)/b.  

Second, I frequently work with probabilities and probability
distributions.  A simple way to approach this is to use a logit
function.  For instance, if in the example above, I wanted to
constrain x to be in [0,1], I could use
Suppose I want to 
minimize f[p1,p2,p3] subject to p1+p2+p3=1 and pi>=0.  I could use 
f[p1,p2,1-p1-p2] to force the equation, but that would not help with
the non-negativity constraints.  An easy way to impose these
constraints is to define a function,
which is non-negative and satisfies
logit[b1,b1,b2]+logit[b2,b1,b2]+logit[1,b1,b2]=1 for any b1 and b2. 
Then use
 This can be generalized easily to impose any linear equation on a set
of non-negative variables.  However, this is not well suited to your
problem because it forces the equation to hold.

For the problems I work on, these change-of-variable techniques seem
to give me quicker convergence to an answer than any sort of penalty
function based method.

  • Prev by Date: RE: creating packages
  • Next by Date: Re: irritating little problem
  • Previous by thread: Re: FindMinimum within a specific interval
  • Next by thread: Simplify