InterpolatingFunction[domain,…]
補間によって値が見出される近似関数を表す.
InterpolatingFunction
InterpolatingFunction[domain,…]
補間によって値が見出される近似関数を表す.
詳細
- InterpolatingFunctionは,Functionのように機能する.
- InterpolatingFunction[…][x]は,特定の引数 x で,近似関数の値を見出す.
- 標準的な出力形式では,InterpolatingFunctionオブジェクトの domain 要素だけが明示的に表記される.その他の要素は<>によって記される. »
- domain は,InterpolatingFunctionが構成されるもとになったデータの領域を指定する.
- 領域外の引数を加えると,警告が与えられ,外挿値が返される.
- 任意数の実数型の引数を取るInterpolatingFunctionオブジェクトを構成することができる.
- DやDerivativeを使って,InterpolatingFunctionオブジェクトの導関数を得られる.
- NDSolveはInterpolatingFunctionオブジェクトとして結果を返す.
- InterpolationまたはListInterpolationを使ってInterpolatingFunctionオブジェクトを作ることができる.
- InterpolatingFunction[…][prop]は,InterpolatingFunctionオブジェクトの特性 prop を与える.以下は,与えることができる特性である.
-
"Coordinates" 各テンソル積の次元の格子座標 "DerivativeOrder" 評価時に補間関数のどの導関数が計算されるか "Domain" InterpolatingFunctionの定義域の境界ボックス "ElementMesh" 空間メッシュ(もしあれば) "InterpolationMethod" 補間に使うメソッド "InterpolationOrder" 補間値の計算に使われる多項式次数 "Periodicity" 補間関数がそれぞれの次元で周期的かどうか "QuantityUnits" 横軸および縦軸に関連付けられた数量単位 "ValuesOnGrid" 各メッシュ座標における関数の値を与える
例題
すべて開く すべて閉じる例 (2)
与えられた点を通るInterpolatingFunctionオブジェクトを作る:
points = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};ifun = Interpolation[points]ifun[2.5]Plot[ifun[x], {x, 0, 5}, Epilog -> Point[points]]微分方程式の解を近似するInterpolatingFunctionオブジェクトを得る:
ifun = First[u /. NDSolve[{u''[t] + u[t] == 0, u[0] == 0, u'[0] == 1}, u, {t, 0, π}]]Plot[{ifun[t], ifun'[t]}, {t, 0, π}]Integrate[ifun[t], t]Plot[%, {t, 0, π}]スコープ (5)
基本的な用法 (5)
厳密データでInterpolatingFunctionを作る:
points = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};ifun = Interpolation[points]ifun[5 / 2]ifun[N[5 / 2]]ifun[N[5 / 2, 20]]全データの数値で新たなInterpolatingFunctionを作る:
nifun = N[ifun]このInterpolatingFunctionを使うと値は機械演算で計算される:
nifun[5 / 2]InterpolatingFunctionを積分する:
ifun = Interpolation[{{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}}];Integrate[ifun[x], {x, 0, 5}]不定積分である新たなInterpolatingFunctionを作る:
indef[x_] = Integrate[ifun[x], x]Plot[{ifun[x], indef[x]}, {x, 0, 5}]InterpolatingFunctionの導関数は別のInterpolatingFunctionである:
ifun = Interpolation[{{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}}];difun = ifun'Plot[{ifun[x], difun[x]}, {x, 0, 5}]InterpolatingFunctionの偏微分を使って偏微分方程式の剰余をチェックする:
ifun = NDSolveValue[{D[u[t, x], t] == D[u[t, x], x, x], u[0, x] == Exp[-100x ^ 2], u[t, 0] == 1, u[t, 1] == 0}, u, {t, 0, 1}, {x, 0, 1}];Plot[Derivative[1, 0][ifun][1, x] - Derivative[0, 2][ifun][1, x], {x, 0, 1}]引数を4つ取るInterpolatingFunctionを作る:
ifun = ListInterpolation[RandomReal[1, {5, 5, 5, 5}], {{0, 1}, {0, 2}, {0, 3}, {0, 4}}]integ = Integrate[ifun[x1, x2, x3, x4], {x1, 0, 1}, {x4, 0, 4}]Plot3D[integ, {x2, 0, 2}, {x3, 0, 3}]特性と関係 (1)
InterpolatingFunctionはPiecewiseの多項式の補間を行う:
points = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};ifun = Interpolation[points]pf[x_] = Piecewise[{{InterpolatingPolynomial[Take[points, {1, 4}], x], x < 2},
{InterpolatingPolynomial[Take[points, {2, 5}], x], 2 ≤ x < 3},
{InterpolatingPolynomial[Take[points, {3, 6}], x], x ≥ 3}}]Plot[pf[x] - ifun[x], {x, 0, 5}, PlotRange -> All]テクニカルノート
関連するガイド
-
▪
- 曲線のフィットと近似の関数 ▪
- 微分方程式
履歴
1991 で導入 (2.0) | 1996 で更新 (3.0)
テキスト
Wolfram Research (1991), InterpolatingFunction, Wolfram言語関数, https://reference.wolfram.com/language/ref/InterpolatingFunction.html (1996年に更新).
CMS
Wolfram Language. 1991. "InterpolatingFunction." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/InterpolatingFunction.html.
APA
Wolfram Language. (1991). InterpolatingFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InterpolatingFunction.html
BibTeX
@misc{reference.wolfram_2026_interpolatingfunction, author="Wolfram Research", title="{InterpolatingFunction}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/InterpolatingFunction.html}", note=[Accessed: 15-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_interpolatingfunction, organization={Wolfram Research}, title={InterpolatingFunction}, year={1996}, url={https://reference.wolfram.com/language/ref/InterpolatingFunction.html}, note=[Accessed: 15-November-2026]}