FindArgMax[f,x]
给出 f 的一个局部最大值的坐标 xmax.
FindArgMax[f,{x,x0}]
给出 f 的一个局部最大值的坐标 xmax,通过从点 x=x0 开始搜索求出.
FindArgMax[f,{{x,x0},{y,y0},…}]
给出多元函数的一个局部最大值的坐标 {xmax,ymax,…}.
FindArgMax[{f,cons},{{x,x0},{y,y0},…}]
给出约束 cons 下的一个局部最大值的坐标.
FindArgMax[{f,cons},{x,y,…}]
在约束定义的区域内的一个点开始.
FindArgMax
FindArgMax[f,x]
给出 f 的一个局部最大值的坐标 xmax.
FindArgMax[f,{x,x0}]
给出 f 的一个局部最大值的坐标 xmax,通过从点 x=x0 开始搜索求出.
FindArgMax[f,{{x,x0},{y,y0},…}]
给出多元函数的一个局部最大值的坐标 {xmax,ymax,…}.
FindArgMax[{f,cons},{{x,x0},{y,y0},…}]
给出约束 cons 下的一个局部最大值的坐标.
FindArgMax[{f,cons},{x,y,…}]
在约束定义的区域内的一个点开始.
更多信息和选项
- FindArgMax[…,{x,y,…}] 实际上等价于 {x,y,…}/.Last[FindMaximum[…,{x,y,…},…]].
- 如果一个变量的起点以列表形式给出,则变量值采用有相同维数的列表.
- 约束条件 cons 可以包含方程、等式或这些表达式的逻辑组合.
- 约束条件 cons 可以是下列任意的逻辑组合:
-
lhs==rhs 方程 lhs>rhs 或者 lhs>=rhs 不等式 {x,y,…}∈reg 范围指定 - FindArgMax 首先局部化所有变量值,然后计算符号变量 f,然后重复进行计算数值结果.
- FindArgMax 有属性 HoldAll,并实际上用 Block 局部化变量.
- FindArgMax[f,{x,x0,x1}] 用 x0 和 x1 作为 x 的前 2 个值搜索 f 的局部最大值,避免使用导数.
- FindArgMax[f,{x,x0,xmin,xmax}] 搜索局部最大值,如果 x 超出了 xmin 到 xmax 的范围,停止搜索.
- 除了当 f 和 cons 都是线性的, FindArgMax 求得的结果可能是局部的,但不是全局的最大数.
- 在默认情况下,所有变量都假定为实数.
- 对于线性 f 和 cons,x∈Integers 可以用来指定一个变量仅采用整数值.
- FindArgMax 具有和 FindMaximum 相同的选项.
-
AccuracyGoal Automatic 精确查询 EvaluationMonitor None 当计算 f 值时,运行的表达式 Gradient Automatic 梯度函数列表 {D[f,x],D[f,y],…} MaxIterations Automatic 使用迭代的最大数 Method Automatic 使用的方法 PrecisionGoal Automatic 查询的精度 StepMonitor None 对表达式求值时采取的步长 WorkingPrecision MachinePrecision 内部计算中的精度
所有选项的列表
范例
打开所有单元 关闭所有单元基本范例 (4)
求出点 {x},在该点一元函数 -2x^2-3x+5 有一个最大值:
FindArgMax[-2x ^ 2 - 3x + 5, x]求出点 {x,y},在该点函数 Sin[x]Sin[2y] 有一个最大值:
FindArgMax[Sin[x]Sin[2y], {x, y}]FindArgMax[{x - 2y, x ^ 2 + y ^ 2 ≤ 1}, {x, y}]FindArgMax[{x + y, {x, y}∈Disk[]}, {x, y}]Show[ContourPlot[x + y, {x, y}∈Disk[]], Graphics[{Red, PointSize[Large], Point[%]}]]范围 (12)
FindArgMax[x Cos[x], {x, 5}]FindArgMax[x Cos[x], {x, 10}]从 x=2、y=2 点开始,二元变量函数的一个局部最大值的坐标:
FindArgMax[Sin[x]Sin[2y], {{x, 2}, {y, 2}}]FindArgMax[{Sin[x]Sin[2y], x ^ 2 + y ^ 2 < 3}, {{x, 2}, {y, 2}}]FindArgMax[{Sin[x]Sin[2y], x ^ 2 + y ^ 2 < 3}, {x, y}]FindArgMax[{-x - y, 3x + 2y ≥ 7 && x ≥ 0 && y ≥ 0}, {x, y}]FindArgMax[{-x - y, 3x + 2y ≥ 7 && x ≥ 0 && y ≥ 0 && x∈Integers}, {x, y}]可以指定 Or 约束:
FindArgMax[{x + y, x ^ 2 + y ^ 2 ≤ 1 || (x + 2) ^ 2 + (y + 2) ^ 2 ≤ 1}, {x, y}]ℛ = Cylinder[{{-1, 0, 1}, {1, 0, -1}}, 1];FindArgMax[{z, {x, y, z}∈ℛ}, {x, y, z}]Graphics3D[{{Opacity[0.5], Green, ℛ}, {Red, PointSize[Large], Point[%]}}]Subscript[ℛ, 1] = Disk[];
Subscript[ℛ, 2] = Line[{{-(1/2), -(1/2)}, {-(1/2), (1/2)}, {(1/2), (1/2)}, {(1/2), -(1/2)}, {-(1/2), -(1/2)}}];FindArgMax[{(x - u)^2 + (y - v)^2, {{x, y}∈Subscript[ℛ, 1], {u, v}∈Subscript[ℛ, 2]}}, {x, y, u, v}]Graphics[{{LightBlue, Subscript[ℛ, 1]}, {Green, Subscript[ℛ, 2]}, {Red, Point[Partition[%, 2]]}}]Subscript[ℛ, 1] = Rectangle[];
Subscript[ℛ, 2] = Circle[{(1/3), (1/3)}, {2 r, r}];FindArgMax[{r, {x, y}∈Subscript[ℛ, 1] && {x, y}∈Subscript[ℛ, 2]}, {r, x, y}]Graphics[{{LightBlue, Subscript[ℛ, 1]}, {Green, Subscript[ℛ, 2]}, {Red, Point[{x, y}]}} /. Thread[{r, x, y} -> %]]Subscript[ℛ, 3] = Disk[{a, b}, {r, 2 - r}];FindArgMax[{r, ({0, 0} | {1, 0} | {0, 1})∈Subscript[ℛ, 3]}, {a, b, r}]Graphics[{{LightBlue, Subscript[ℛ, 3]} /. Thread[{a, b, r} -> %], {Red, Point[{{0, 0}, {1, 0}, {0, 1}}]}}]ℛ = Sphere[];FindArgMax[{x.{1, 2, 3}, x∈ℛ}, x]Subscript[ℛ, 1] = Triangle[{{0, 0}, {1, 0}, {0, 1}}];
Subscript[ℛ, 2] = Disk[{2, 2}, 1];FindArgMax[{EuclideanDistance[x, y], {x∈Subscript[ℛ, 1], y∈Subscript[ℛ, 2]}}, {x, y}]Graphics[{{LightBlue, Subscript[ℛ, 1], Subscript[ℛ, 2]}, {Red, Point[%]}}]选项 (7)
AccuracyGoal 和 PrecisionGoal (2)
FindArgMax[Sin[x / 2], {x, 1}, AccuracyGoal -> 9, PrecisionGoal -> 8]FindArgMax[Sin[x / 2], {x, 1}, AccuracyGoal -> 20, PrecisionGoal -> 18]提高 WorkingPrecision,将使得过程收敛:
FindArgMax[Sin[x / 2], {x, 1}, AccuracyGoal -> 20, PrecisionGoal -> 18, WorkingPrecision -> 40]EvaluationMonitor (1)
Gradient (1)
FindArgMax[Sin[x]Sin[2 y], {x, y}, Gradient -> {Cos[x] Sin[2 y], 2 Cos[2 y] Sin[x]}, Method -> "Newton"]FindArgMax[Sin[x]Sin[2y], {x, y}, Gradient -> {Cos[x] Sin[2 y], 2 Cos[2 y] Sin[x]}, Method -> {"Newton", Hessian -> {{-Sin[x] Sin[2 y], 2 Cos[x] Cos[2 y]}, {2 Cos[x] Cos[2 y], -4 Sin[x] Sin[2 y]}}}]Method (1)
FindArgMax[-RealAbs[x + 1] - RealAbs[x + 1.01] - RealAbs[y + 1], {x, y}]FindArgMax[-RealAbs[x + 1] - RealAbs[x + 1.01] - RealAbs[y + 1], {x, y}, Method -> "ConjugateGradient"]FindArgMax[-RealAbs[x + 1] - RealAbs[x + 1.01] - RealAbs[y + 1], {x, y}, Method -> "PrincipalAxis"]NMaximize 也可以使用直接搜索方式的范围:
NMaximize[{-RealAbs[x + 1] - RealAbs[x + 1.01] - RealAbs[y + 1]}, {x, y}]StepMonitor (1)
在求函数的最大值过程中,FindArgMax 采用的步长:
pts = Reap[FindArgMax[-(1 - x) ^ 2 - 100(-x ^ 2 - y) ^ 2 - 1, {{x, -1.2}, {y, 1}}, StepMonitor :> Sow[{x, y}]]][[2, 1]];
pts = Join[{{-1.2, 1}}, pts];ContourPlot[-(1 - x) ^ 2 - 100(-x ^ 2 - y) ^ 2 - 1//Minus//Log, {x, -1.3, 1.5}, {y, -1.5, 1.4}, Epilog -> {Red, Line[pts], Point[pts]}]WorkingPrecision (1)
设置工作精度为
;默认情况下 AccuracyGoal 和 PrecisionGoal 设置为
:
FindArgMax[Cos[x ^ 2 - 3 y] + Sin[x ^ 2 + y ^ 2], {x, y}, Method -> "Newton", WorkingPrecision -> 20]属性和关系 (1)
FindMaximum 给出最大点和最小点的值:
FindMaximum[{x - 2y, x ^ 2 + y ^ 2 ≤ 1}, {x, y}]FindArgMax 给出最大值的坐标:
FindArgMax[{x - 2y, x ^ 2 + y ^ 2 ≤ 1}, {x, y}]FindMaxValue 给出最大点的值:
FindMaxValue[{x - 2y, x ^ 2 + y ^ 2 ≤ 1}, {x, y}]可能存在的问题 (4)
FindArgMax[{x + y, x ^ 2 + y ^ 2 ≥ 2 && x ^ 2 + y ^ 2 ≤ 1}, {x, y}]FindArgMax[Tan[x], {x, 2}]FindArgMax[{x ^ 2 + y ^ 2, x ^ 2 + y ^ 2 > 10}, {x, y}]FindArgMax[{-x - y, x + 2y ≥ 3 && x > 1 && y > 1 && x∈Integers}, {x, y}, WorkingPrecision -> 20]FindArgMax[-x * Sin[1 / x] ^ 2, {x}]FindArgMax[-x * Sin[1 / x] ^ 2, {x, .3}]相关指南
-
▪
- 最优化 ▪
- 凸优化 ▪
- 符号向量、矩阵和数组
文本
Wolfram Research (2008),FindArgMax,Wolfram 语言函数,https://reference.wolfram.com/language/ref/FindArgMax.html (更新于 2014 年).
CMS
Wolfram 语言. 2008. "FindArgMax." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2014. https://reference.wolfram.com/language/ref/FindArgMax.html.
APA
Wolfram 语言. (2008). FindArgMax. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/FindArgMax.html 年
BibTeX
@misc{reference.wolfram_2026_findargmax, author="Wolfram Research", title="{FindArgMax}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/FindArgMax.html}", note=[Accessed: 17-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_findargmax, organization={Wolfram Research}, title={FindArgMax}, year={2014}, url={https://reference.wolfram.com/language/ref/FindArgMax.html}, note=[Accessed: 17-June-2026]}