NArgMin

NArgMin[f,x]

gives a position xmin at which f is numerically minimized.

NArgMin[f,{x,y,}]

gives a position {xmin,ymin,} at which f is numerically minimized.

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

gives a position at which f is numerically minimized subject to the constraints cons.

NArgMin[,xreg]

constrains x to be in the region reg.

Details and Options

  • NArgMin returns a list of the form {xmin,ymin,}.
  • NArgMin[,{x,y,}] is effectively equivalent to {x,y,}/.Last[NMinimize[,{x,y,},].
  • cons can contain equations, inequalities, or logical combinations of these.
  • The constraints cons can be any logical combination of:
  • lhs==rhsequations
    lhs>rhs or lhs>=rhs inequalities
    {x,y,}regregion specification
  • NArgMin[{f,cons},xreg] is effectively equivalent to NArgMin[{f,consxreg},x].
  • For xreg, the different coordinates can be referred to using Indexed[x,i].
  • NArgMin always attempts to find a global minimum of f subject to the constraints given.
  • By default, all variables are assumed to be real.
  • xIntegers can be used to specify that a variable can take on only integer values.
  • If f and cons are linear, NArgMin can always find global minima, over both real and integer values.
  • Otherwise, NArgMin may sometimes find only a local minimum.
  • If NArgMin determines that the constraints cannot be satisfied, it returns {Indeterminate,}.
  • NArgMin takes the same options as NMinimize.

Examples

open allclose all

Basic Examples  (4)

Find a minimizer point for a univariate function:

Find a minimizer point for a multivariate function:

Find a minimizer point for a function subject to constraints:

Find a minimizer point over a geometric region:

Plot it:

Scope  (9)

Or constraints can be specified:

Use NArgMin for linear objectives and constraints:

Integer constraints can be imposed:

Minimize over a region:

Plot it:

Find the minimum distance between two regions:

Plot it:

Find the minimum such that the triangle and ellipse still intersect:

Plot it:

Find the disk of minimum radius that contains the given three points:

Plot it:

Using Circumsphere gives the same result directly:

Use to specify that is a vector in :

Find the minimum distance between two regions:

Plot it:

Applications  (2)

Find the lengths of sides of a unit area rectangle with minimal perimeter:

Find the lengths of sides of a unit area triangle with minimal perimeter:

Properties & Relations  (2)

NMinimize gives both the value of the minimum and the minimizer point:

NArgMin gives the minimizer point:

NMinValue gives the minimum:

Use RegionNearest to compute a nearest point in the given region:

It can be computed using NArgMin:

Possible Issues  (2)

The objective function may be unbounded:

There may be no points satisfying the constraints:

Introduced in 2008
 (7.0)
 |
Updated in 2014
 (10.0)