此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

NIntegrateInterpolatingFunction

NIntegrateInterpolatingFunction[f, {x, xmin, xmax}]
gives a numerical approximation to an integral with InterpolatingFunction objects in the integrand.
NIntegrateInterpolatingFunction[f, {x, xmin, xmax}, {y, ymin, ymax}, ...]
gives a numerical approximation to a multidimensional integral.
  • NIntegrateInterpolatingFunction uses the function NIntegrate, but it breaks up the domain of integration into sections where the InterpolatingFunction objects are smooth.
  • The arguments of the InterpolatingFunction objects may themselves be univariate functions of the integration variables.
  • Numerically integrating a multidimensional integral using NIntegrateInterpolatingFunction with InterpolatingFunction objects containing a large number of nodes may take significantly longer than using NIntegrate.
  • NIntegrateInterpolatingFunction has the same options as NIntegrate.
Needs["FunctionApproximations`"]
A trapezoidal approximation to sin(x):
In[2]:=
Click for copyable input
Out[2]=
Since sin(x) is not smooth, NIntegrate will generate a warning message:
In[3]:=
Click for copyable input
Out[3]=
Using NIntegrateInterpolatingFunction produces a slightly more accurate answer without any error messages:
In[4]:=
Click for copyable input
Out[4]=
In this case the integrand is simply an interpolating function, so you can use Integrate to check:
In[5]:=
Click for copyable input
Out[5]=