Minimize

Minimize[f,x]

minimizes f with respect to x.

Minimize[f,{x,y,}]

minimizes f with respect to x, y, .

Minimize[{f,cons},{x,y,}]

minimizes f subject to the constraints cons.

Minimize[,xreg]

constrains x to be in the region reg.

Minimize[,,dom]

constrains variables to the domain dom, typically Reals or Integers.

Details and Options

  • Minimize returns a list of the form {fmin,{x->xmin,y->ymin,}}.
  • cons can contain equations, inequalities, or logical combinations of these.
  • The constraints cons can be any logical combination of:
  • lhs==rhsequations
    lhs!=rhsinequations
    lhs>rhs or lhs>=rhs inequalities
    {x,y,}regregion specification
    Exists[x,cond,expr]existential quantifiers
  • If f and cons are linear or polynomial, Minimize will always find a global minimum.
  • Minimize[{f,cons},xreg] is effectively equivalent to Minimize[{f,consxreg},x].
  • For xreg, the different coordinates can be referred to using Indexed[x,i].
  • Minimize will return exact results if given exact input.
  • If Minimize is given an expression containing approximate numbers, it automatically calls NMinimize.
  • If the minimum is achieved only infinitesimally outside the region defined by the constraints, or only asymptotically, Minimize will return the infimum and the closest specifiable point.
  • If no domain is specified, all variables are assumed to be real.
  • xIntegers can be used to specify that a particular variable can take on only integer values.
  • If the constraints cannot be satisfied, Minimize returns {+Infinity,{x->Indeterminate,}}.
  • Even if the same minimum is achieved at several points, only one is returned.
  • N[Minimize[]] calls NMinimize for optimization problems that cannot be solved symbolically.
  • Minimize[f,x,WorkingPrecision->n] uses n digits of precision while computing a result. »

Examples

open allclose all

Basic Examples  (5)

Minimize a univariate function:

In[1]:=
Click for copyable input
Out[1]=

Minimize a multivariate function:

In[1]:=
Click for copyable input
Out[1]=

Minimize a function subject to constraints:

In[1]:=
Click for copyable input
Out[1]=

A minimization problem containing parameters:

In[1]:=
Click for copyable input
Out[1]=

Minimize a function over a geometric region:

In[1]:=
Click for copyable input
Out[1]=

Plot it:

In[2]:=
Click for copyable input
Out[2]=

Scope  (21)

Options  (1)

Applications  (10)

Properties & Relations  (6)

Possible Issues  (1)

See Also

MinValue  ArgMin  Maximize  NMinimize  FindMinimum  Min  MinimalBy  D  FindInstance  LinearProgramming  LeastSquares  RegionDistance

Tutorials

Introduced in 2003
(5.0)
| Updated in 2014
(10.0)