FindMaxValue[f,x]
f の極大値を与える.
FindMaxValue[f,{x,x0}]
点 x=x0からスタートした検索で求まった,f の極大値を与える.
FindMaxValue[f,{{x,x0},{y,y0},…}]
複数の変数を持つ関数の極大値を与える.
FindMaxValue[{f,cons},{{x,x0},{y,y0},…}]
条件 cons に従って極大値を与える.
FindMaxValue[{f,cons},{x,y,…}]
条件で定義される範囲内の点からスタートする.
FindMaxValue
FindMaxValue[f,x]
f の極大値を与える.
FindMaxValue[f,{x,x0}]
点 x=x0からスタートした検索で求まった,f の極大値を与える.
FindMaxValue[f,{{x,x0},{y,y0},…}]
複数の変数を持つ関数の極大値を与える.
FindMaxValue[{f,cons},{{x,x0},{y,y0},…}]
条件 cons に従って極大値を与える.
FindMaxValue[{f,cons},{x,y,…}]
条件で定義される範囲内の点からスタートする.
詳細とオプション
- FindMaxValue[…]は事実上First[FindMaximum[…]]に等しい.
- 変数の始点がリストで与えられた場合,変数の値は同じ時点のリストであるとみなされる.
- cons は方程式,不等式およびこれらの論理結合を含むことができる.
- 制約条件 cons は以下の論理結合でよい.
-
lhs==rhs 方程式 lhs>rhs または lhs>=rhs 不等式 {x,y,…}∈reg 領域指定 - FindMaxValueは,まずすべての変数の値を局所化し,次に記号的な変数で f を評価し,次に結果を繰返し数値的に評価する.
- FindMaxValueは属性HoldAllを有し,事実上Blockを使って変数を局所化する.
- FindMaxValue[f,{x,x0,x1}]は x0と x1を x の最初の2つの値として使って導関数の使用を避けて f 中の極大値を検索する.
- FindMaxValue[f,{x,x0,xmin,xmax}]は極大値を検索し,x が xminから xmaxまでの範囲外に出たところで検索を中止する.
- f と cons が両方とも線形である場合を除き,FindMaxValueによって求まった結果は極大値のみに対応し,最大値には対応しない場合がある.
- デフォルトで,すべての変数は実数であるとみなされる.
- 線形の f と cons について,x∈Integersを使って変数が整数値のみを取るように指定することができる.
- FindMaxValueは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)
FindMaxValue[-2x ^ 2 - 3x + 5, x]FindMaxValue[Sin[x]Sin[2y], {x, y}]FindMaxValue[{x - 2y, x ^ 2 + y ^ 2 ≤ 1}, {x, y}]FindMaxValue[{x + y, {x, y}∈Disk[]}, {x, y}]スコープ (12)
FindMaxValue[x Cos[x], {x, 5}]FindMaxValue[x Cos[x], {x, 10}]FindMaxValue[Sin[x]Sin[2y], {{x, 2}, {y, 2}}]FindMaxValue[{Sin[x]Sin[2y], x ^ 2 + y ^ 2 < 3}, {{x, 2}, {y, 2}}]FindMaxValue[{Sin[x]Sin[2y], x ^ 2 + y ^ 2 < 3}, {x, y}]線形目的および制約について,整数の制約条件を課すことができる:
FindMaxValue[{-x - y, 3x + 2y ≥ 7 && x ≥ 0 && y ≥ 0}, {x, y}]FindMaxValue[{-x - y, 3x + 2y ≥ 7 && x ≥ 0 && y ≥ 0 && x∈Integers}, {x, y}]Or制約を指定することができる:
FindMaxValue[{-x - y, x ^ 2 + y ^ 2 ≤ 1 || (x + 2) ^ 2 + (y + 2) ^ 2 ≤ 1}, {x, y}]ℛ = Cylinder[{{-1, 0, 1}, {1, 0, -1}}, 1];FindMaxValue[{z, {x, y, z}∈ℛ}, {x, y, z}]Graphics3D[{Opacity[0.5], {Green, ℛ}, {Red, InfinitePlane[{{0, 0, %}, {1, 0, %}, {0, 1, %}}]}}]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)}}];FindMaxValue[{(x - u)^2 + (y - v)^2, {{x, y}∈Subscript[ℛ, 1], {u, v}∈Subscript[ℛ, 2]}}, {x, y, u, v}]Subscript[ℛ, 1] = Rectangle[];
Subscript[ℛ, 2] = Circle[{(1/3), (1/3)}, {2 r, r}];FindMaxValue[{r, {x, y}∈Subscript[ℛ, 1] && {x, y}∈Subscript[ℛ, 2]}, {r, x, y}]Graphics[{{LightBlue, Subscript[ℛ, 1]}, {Green, Subscript[ℛ, 2]} /. r -> %}]Subscript[ℛ, 3] = Disk[{a, b}, {r, 2 - r}];FindMaxValue[{r, ({0, 0} | {1, 0} | {0, 1})∈Subscript[ℛ, 3]}, {a, b, r}]ℛ = Sphere[];FindMaxValue[{x.{1, 2, 3}, x∈ℛ}, x]Subscript[ℛ, 1] = Triangle[{{0, 0}, {1, 0}, {0, 1}}];
Subscript[ℛ, 2] = Disk[{2, 2}, 1];FindMaxValue[{EuclideanDistance[x, y], {x∈Subscript[ℛ, 1], y∈Subscript[ℛ, 2]}}, {x, y}]オプション (7)
AccuracyGoalとPrecisionGoal (2)
FindMaxValue[Sin[x / 2], {x, 1}, AccuracyGoal -> 9, PrecisionGoal -> 8]FindMaxValue[Sin[x / 2], {x, 1}, AccuracyGoal -> 20, PrecisionGoal -> 18]
WorkingPrecisionを高く設定するとプロセスが収束する:
FindMaxValue[Sin[x / 2], {x, 1}, AccuracyGoal -> 20, PrecisionGoal -> 18, WorkingPrecision -> 40]EvaluationMonitor (1)
Gradient (1)
FindMaxValue[Sin[x]Sin[2 y], {x, y}, Gradient -> {Cos[x] Sin[2 y], 2 Cos[2 y] Sin[x]}, Method -> "Newton"]FindMaxValue[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)
この場合,デフォルトの導関数に基づくメソッドには無理がある:
FindMaxValue[-Abs[x + 1] - Abs[x + 1.01] - Abs[y + 1], {x, y}]FindMaxValue[-Abs[x + 1] - Abs[x + 1.01] - Abs[y + 1], {x, y}, Method -> "ConjugateGradient"]
FindMaxValue[-Abs[x + 1] - Abs[x + 1.01] - Abs[y + 1], {x, y}, Method -> "PrincipalAxis"]NMaximizeもまた,さまざまな直接探索法を使う:
NMaximize[{-Abs[x + 1] - Abs[x + 1.01] - Abs[y + 1]}, {x, y}]StepMonitor (1)
FindMaxValueが関数の最大を求める際に取るステップ:
pts = Reap[FindMaxValue[-(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は
に設定される:
FindMaxValue[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)
FindMaxValue[{x + y, x ^ 2 + y ^ 2 ≥ 2 && x ^ 2 + y ^ 2 ≤ 1}, {x, y}]FindMaxValue[Tan[x], {x, 2}]FindMaxValue[{x ^ 2 + y ^ 2, x ^ 2 + y ^ 2 > 10}, {x, y}]FindMaxValue[{-x - y, x + 2y ≥ 3 && x > 1 && y > 1 && x∈Integers}, {x, y}, WorkingPrecision -> 20]適切な始点を与えることでアルゴリズムの収束が助けられることがある:
FindMaxValue[{-Cos[x] + Exp[(x - 0.5) y], x ^ 2 + y ^ 2 < 1}, {x, y}]FindMaxValue[{Cos[x] - Exp[(x - 0.5) y], x ^ 2 + y ^ 2 < 1}, {{x, -1}, {y, -1}}]関連するガイド
-
▪
- 最適化 ▪
- 凸最適化 ▪
- 記号的なベクトル,行列,配列
テキスト
Wolfram Research (2008), FindMaxValue, Wolfram言語関数, https://reference.wolfram.com/language/ref/FindMaxValue.html (2014年に更新).
CMS
Wolfram Language. 2008. "FindMaxValue." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/FindMaxValue.html.
APA
Wolfram Language. (2008). FindMaxValue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindMaxValue.html
BibTeX
@misc{reference.wolfram_2026_findmaxvalue, author="Wolfram Research", title="{FindMaxValue}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/FindMaxValue.html}", note=[Accessed: 28-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_findmaxvalue, organization={Wolfram Research}, title={FindMaxValue}, year={2014}, url={https://reference.wolfram.com/language/ref/FindMaxValue.html}, note=[Accessed: 28-November-2026]}