Interpolation

Interpolation[{f1, f2, ...}]
constructs an interpolation of the function values , assumed to correspond to x values 1, 2, ... .

Interpolation[{{x1, f1}, {x2, f2}, ...}]
constructs an interpolation of the function values corresponding to x values .

Interpolation[{{{x1, y1, ...}, f1}, {{x2, y2, ...}, f2}, ...}]
constructs an interpolation of multidimensional data.

Interpolation[{{{x1, ...}, f1, df1, ...}, ...}]
constructs an interpolation that reproduces derivatives as well as function values.

Interpolation[data, x]
find an interpolation of data at the point x.

Details and OptionsDetails and Options

  • Interpolation returns an InterpolatingFunction object, which can be used like any other pure function.
  • The interpolating function returned by Interpolation[data] is set up so as to agree with data at every point explicitly specified in data.
  • The function values can be real or complex numbers, or arbitrary symbolic expressions.
  • The can be lists or arrays of any dimension.
  • The function arguments , , etc. must be real numbers.
  • Different elements in the data can have different numbers of derivatives specified.
  • For multidimensional data, the n^(th) derivative can be given as a tensor with a structure corresponding to D[f, {{x, y, ...}, n}].
  • Partial derivatives not specified explicitly can be given as Automatic.
  • Interpolation works by fitting polynomial curves between successive data points.
  • The degree of the polynomial curves is specified by the option InterpolationOrder.
  • The default setting is InterpolationOrder->3.
  • You can do linear interpolation by using the setting InterpolationOrder->1.
  • Interpolation[data] generates an InterpolatingFunction object which returns values with the same precision as those in data.
  • Interpolation allows any derivative to be given as Automatic, in which case it will attempt to fill in the necessary information from other derivatives or function values.
  • Interpolation supports a Method option. Possible settings include for spline interpolation and for Hermite interpolation.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Construct an approximate function that interpolates the data:

In[1]:=
Click for copyable input
Out[1]=

Apply the function to find interpolated values:

In[2]:=
Click for copyable input
Out[2]=

Plot the interpolation function:

In[3]:=
Click for copyable input
Out[3]=

Compare with the original data:

In[4]:=
Click for copyable input
Out[4]=

Find the interpolated value immediately:

In[1]:=
Click for copyable input
Out[1]=
New in 2 | Last modified in 7
New to Mathematica? Find your learning path »
Have a question? Ask support »