Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Documentation / Mathematica / The Mathematica Book / A Practical Introduction to Mathematica / Numerical Mathematics /

1.6.5 Numerical Optimization

Finding global minima and maxima.

This gives the maximum value, and where it occurs.

In[1]:= NMaximize[x/(1 + Exp[x]), x]

Out[1]=

This minimizes the function within the unit circle.

In[2]:= NMinimize[{Cos[x] - Exp[x y], x^2 + y^2 < 1}, {x, y}]

Out[2]=

NMinimize and NMaximize can find the absolute minima and maxima of many functions. But in some cases it is not realistic to do this. You can search for local minima and maxima using FindMinimum and FindMaximum.

Searching for local minima and maxima.

This searches for a local minimum of , starting at .

In[3]:= FindMinimum[x Cos[x], {x, 2}]

Out[3]=

With a different starting point, you may reach a different local minimum.

In[4]:= FindMinimum[x Cos[x], {x, 10}]

Out[4]=

This finds a local minimum of .

In[5]:= FindMinimum[Sin[x y], {{x, 2}, {y, 2}}]

Out[5]=



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information


 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy | [ja] |
Sign up for our newsletter: