This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
 Built-in Mathematica Symbol Tutorials »| See Also »| More About »

# NMaximize

 NMaximize[f, {x, y, ...}]maximizes f numerically with respect to x, y, .... NMaximize[{f, cons}, {x, y, ...}]maximizes f numerically subject to the constraints cons.
• NMaximize returns a list of the form {fmax, {x->xmax, y->ymax, ...}}.
• cons can contain equations, inequalities or logical combinations of these.
• NMaximize always attempts to find a global maximum of f subject to the constraints given.
• By default, all variables are assumed to be real.
• can be used to specify that a variable can take on only integer values.
• If f and cons are linear, NMaximize can always find global maxima, over both real and integer values.
• Otherwise, NMaximize may sometimes find only a local maximum.
• The following options can be given:
 AccuracyGoal Automatic number of digits of final accuracy sought EvaluationMonitor None expression to evaluate whenever f is evaluated MaxIterations 100 maximum number of iterations to use Method Automatic method to use PrecisionGoal Automatic number of digits of final precision sought StepMonitor None expression to evaluate whenever a step is taken WorkingPrecision MachinePrecision the precision used in internal computations
• The settings for AccuracyGoal and PrecisionGoal specify the number of digits to seek in both the value of the position of the maximum, and the value of the function at the maximum.
• Possible settings for the Method option include "NelderMead", "DifferentialEvolution", "SimulatedAnnealing" and "RandomSearch".
Find the global maximum of an unconstrained problem:
 Out[1]=
Extract the maximizing argument:
 Out[2]=

Find the global maximize of problems with constraints:
 Out[1]=
 Out[2]=
 Scope   (3)
 Options   (6)
New in 5 | Last modified in 6