NMaxValue

NMaxValue[f,x]
gives the maximum value of f with respect to x.

NMaxValue[f,{x,y,}]
gives the maximum value of f with respect to x, y, .

NMaxValue[{f,cons},{x,y,}]
gives the maximum value of f subject to the constraints cons.

NMaxValue[,xreg]
constrains x to be in the region reg.

Details and OptionsDetails and Options

  • NMaxValue[] is effectively equivalent to First[NMaximize[]].
  • cons can contain equations, inequalities or logical combinations of these.
  • The constraints cons can be any logical combination of:
  • lhs==rhsequations
    or inequalities
    {x,y,}regregion specification
  • NMaxValue[{f,cons},xreg] is effectively equivalent to NMaxValue[{f,consxreg},x].
  • For , the different coordinates can be referred to using Indexed[x,i].
  • NMaxValue always attempts to find a global maximum 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, NMaxValue can always find global maxima, over both real and integer values.
  • Otherwise, NMaxValue may sometimes find only a local maximum.
  • If NMaxValue determines that the constraints cannot be satisfied, it returns -Infinity.
  • NMaxValue takes the same options as NMaximize.

ExamplesExamplesopen allclose all

Basic Examples  (5)Basic Examples  (5)

Find the maximum value of a univariate function:

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

Find the maximum value of a multivariate function:

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

Find the maximum value of a function subject to constraints:

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

Find the maximum value of a function over a geometric region:

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

Find the maximum value of a function over a geometric region:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2008
(7.0)
| Updated in 2014
(10.0)