FindMinimum
Usage
• FindMinimum[f, x,  ] 从点 x= 搜索 f 的局部最优解。
Notes
• FindMinimum 返回  , x->   形式的列表,其中  是找到的 f 的最小值,且  是要找的 x的值。 • FindMinimum[f, x, xstart, xmin, xmax ]搜索局部最优解,如果 x 超出了 xmin 到 xmax的范围,停止搜索。 • FindMinimum 有属性 HoldAll. • FindMinimum 从它达到的每个点的最速下降路径进行计算。它找到的最小值是局部的最小值,但未必是全局的。 • 可以给出下面的选项:
| "\!\(\*StyleBox[\"\\\"AccuracyGoal\\\"\", \"MR\"]\) " | "\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) " | 精确搜索函数最小值 | | "\!\(\*StyleBox[\"\\\"Compiled\\\"\", \"MR\"]\) " | "\!\(\*StyleBox[\"\\\"True\\\"\", \"MR\"]\) " | 是否函数应当被编译 | | "\!\(\*StyleBox[\"\\\"Gradient\\\"\", \"MR\"]\) " | "\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) " | 梯度函数列表{"\!\(\*StyleBox[\"\\\"D[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"f\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"x\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"],\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"D[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"f\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"y\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"],\\\"\", \"MR\"]\) ... "}" " | | "\!\(\*StyleBox[\"\\\"MaxIterations\\\"\", \"MR\"]\) " | "\!\(\*StyleBox[\"\\\"30\\\"\", \"MR\"]\) " | 使用的最大迭代数 | | "\!\(\*StyleBox[\"\\\"PrecisionGoal\\\"\", \"MR\"]\) " | "\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) " | 搜索函数最小值的精度 | | "\!\(\*StyleBox[\"\\\"WorkingPrecision\\\"\", \"MR\"]\) " | "\!\(\*StyleBox[\"\\\"Precision[1.]\\\"\", \"MR\"]\) " | 用在内部计算的数字数目 |
• AccuracyGoal 和 PrecisionGoal缺省设置是小于WorkingPrecision的10个数位。 • FindMinimum 继续直到由AccuracyGoal或PrecisionGoal指定的目标中的任何一个被达到。
Further Examples
This finds the value of x which minimizes , starting from x = 2.
In[1]:=
|
Out[1]=
|
Here is a function with many local minima. Evaluate the cell to see the graphic.
In[2]:=
|
FindMinimum finds the local minimum closest to x = 1. This is not the global minimum for the function.
In[3]:=
|
Out[3]=
|
This finds the local minimum of a function of two variables. As in FindRoot, it is a good idea to choose starting values that are not too special.
In[4]:=
|
Out[4]=
|
This finds a minimum, explicitly specifying a gradient to use.
In[5]:=
|
Out[5]=
|
Using the default setting, a different local minimum is found.
In[6]:=
|
Out[6]=
|
|