This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Interpolation

Interpolation
constructs an interpolation of the function values , assumed to correspond to x values 1, 2, ... .
Interpolation
constructs an interpolation of the function values corresponding to x values .
Interpolation
constructs an interpolation of multidimensional data.
Interpolation
constructs an interpolation that reproduces derivatives as well as function values.
Interpolation
find an interpolation of data at the point x.
  • 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.
  • Partial derivatives not specified explicitly can be given as Automatic.
  • Interpolation works by fitting polynomial curves between successive data points.
  • 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.
Construct an approximate function that interpolates the data:
Apply the function to find interpolated values:
Plot the interpolation function:
Compare with the original data:
Find the interpolated value immediately:
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]=
Interpolate between points at arbitrary values:
Create data with Table:
Form the interpolation:
Plot the interpolated function:
Create a list of multidimensional data:
Create an approximate interpolating function:
Plot the interpolating function:
Create data that includes derivatives at each point:
Construct an interpolation:
Plot the interpolation:
Create 2D data that includes a gradient vector at each point:
Compare with data that does not include gradients:
Also include tensors of second derivatives:
Make a zeroth-order interpolation:
Make a linear interpolation:
Make a quadratic interpolation:
Compare splines with piecewise Hermite interpolation for random data:
The curves appear close, but the spline has a continuous derivative:
Make an interpolating function that repeats periodically:
Interpolate random data:
Find a continuous interpolation of the GCD function:
The interpolating function always goes through the data points:
Find the integral of an interpolating function:
Plot the interpolating function and its integral:
Extrapolation is attempted to go beyond the original data:
With the default choice of order, at least 4 points are needed in each dimension:
With a lower order, fewer points are needed:
The interpolation function will always be continuous, but may not be differentiable:
Interpolate the sequence of primes:
New in 2 | Last modified in 7