NMinimize

NMinimize[f, x]
minimizes f numerically with respect to x.

NMinimize[f, {x, y, ...}]
minimizes f numerically with respect to x, y, ....

NMinimize[{f, cons}, {x, y, ...}]
minimizes f numerically subject to the constraints cons.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Find the global minimum of an unconstrained problem:

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

Extract the minimizing argument:

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

Find the global minimum of problems with constraints:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 5 | Last modified in 6
New to Mathematica? Find your learning path »
Have a question? Ask support »