Interpolate - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Interpolation

  

Interpolate

  

a general-purpose command for interpolation

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

f := Interpolate(points, data)

f := Interpolate(points, data, method, methodargs)

f(x1, ..., xn)

f(pts)

Parameters

points

-

a list, listlist, Array, Vector, or Matrix containing the numeric coordinates of the independent points corresponding to data values. If points is a listlist, each inner list must contain n entries, where n is the dimension of the data. If points is an Array or Matrix, then there must be n columns, with each row corresponding to one point. If points is a list or Vector of numeric values, then n is 1 and each value is a separate point.

data

-

a list, Array, or Vector containing the data, which must be arranged in the same order as the corresponding coordinates appear in points.

method

-

an optional keyword option of the form method=m, where m is one of inversedistanceweighted, lineartriangular, radialbasisfunction, kriging, naturalneighbor, nearest, lowest, highest, linear, cubic, or spline.

methodargs

-

(optional) the same optional arguments available when calling a specific interpolation method are available through this Interpolate command. For details, see the help page for the specific method being used.

Description

• 

The Interpolate command is a general-purpose command used for interpolation. To perform the interpolation, a variety of different methods can be used as specified by the method option. This command will return an interpolation object which can then be used as a procedure, taking the coordinates of a point as parameters and giving the interpolated result as the return value.

• 

The values for the method option correspond to the following interpolation methods, and the supported dimensions for the independent points in points:

Value for 'method'

Interpolation Method

Dimension

radialbasisfunction

Radial Basis Function Interpolation

any

inversedistanceweighted

Inverse Distance Weighted Interpolation

any

kriging

Kriging Interpolation

any

naturalneighbor

Natural Neighbor Interpolation

2

lineartriangular

Linear Triangular Interpolation

2

spline

Spline Interpolation

1

nearest

Nearest Neighbor Interpolation

1

lowest

Lowest Neighbor Interpolation

1

highest

Highest Neighbor Interpolation

1

linear

Linear Interpolation

1

cubic

Cubic Interpolation

1

• 

The default method is spline if the input points are one-dimensional, naturalneighbor if the input points are two-dimensional, and radialbasisfunction otherwise.

• 

The methods that are listed as supporting only dimension 1, above, do support higher dimensions, but only for independent points that are arranged in a grid. The way such points are then specified is not compatible with the way points are specified for the other commands, so the Interpolate command doesn't support this. However, you can make use of this functionality by calling the corresponding commands (linked in the table above) directly.

Examples

withInterpolation:

points0,0,1,0,2,0,0,1,1,1,2,1,0,2,1,2,2,2

points0,0,1,0,2,0,0,1,1,1,2,1,0,2,1,2,2,2

(1)

data0,0,0,0,1,0,0,0,0

data0,0,0,0,1,0,0,0,0

(2)

fInterpolatepoints,data

fNatural Neighbor interpolation object with 9 sample points

(3)

f can be polled at specific points.

f0.5,0.5

0.250000000000000

(4)

We do the same with a different method. We supply two parameters to this method (explained on the Radial Basis Function Interpolation help page).

gInterpolatepoints,data,method=radialbasisfunction,gaussian,1.5

gRaⅆⅈal Basⅈs Functⅈon ⅈntⅇrpolatⅈon obȷⅇct wⅈth 9 samplⅇ poⅈntsRaⅆⅈal Basⅈs Functⅈon: gaussⅈan

(5)

g0.5,0.5

0.271060313298269628

(6)

Use the plot3d command to plot the interpolated surface.

plot3df,g,0..2,0..2,transparency=0.5,color=red,blue

A 1-dimensional example.

points0,1,3,4,6

points0,1,3,4,6

(7)

values1,0,4,4,5

values1,0,4,4,5

(8)

fInterpolatepoints,values

fa spline interpolation objectwith 5 points in 1-D

(9)

f2

1.84677419354839

(10)

plotf,0..6

Compatibility

• 

The Interpolation[Interpolate] command was introduced in Maple 2018.

• 

For more information on Maple 2018 changes, see Updates in Maple 2018.

See Also

Cubic Interpolation

Highest Neighbor Interpolation

Inverse Distance Weighted Interpolation

Kriging Interpolation

Linear Interpolation

Linear Triangular Interpolation

Lowest Neighbor Interpolation

Natural Neighbor Interpolation

Nearest Neighbor Interpolation

Radial Basis Function Interpolation

Spline Interpolation