Interpolation - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics and Data Analysis : Interpolation and Curve Fitting : Interpolation Package : Interpolation/InverseDistanceWeightedInterpolation

Interpolation

  

InverseDistanceWeightedInterpolation

  

interpolate N-D scattered data using the inverse distance weighted interpolation method

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

InverseDistanceWeightedInterpolation(points,values)

InverseDistanceWeightedInterpolation(points,values,r)

f:=InverseDistanceWeightedInterpolation(...)

f(x1,...,xn)

f(M)

Parameters

points

-

listlist, Array, Matrix, Vector, or list of m n-dimensional sample points where each inner list or row represents one point. For a Vector or plain list, n is 1.

values

-

list, Array, or Vector of sample values

r

-

(optional) the radius parameter; the default is infinity

x1,...,xn

-

evaluate f at (x1,...,xn)

M

-

a k x n Matrix of points at which to evaluate f

Description

• 

The InverseDistaneWeightedInterpolation command creates a function fx1,...,xn=value which can then be evaluated at arbitrary points in Rn.

• 

This interpolant is defined at the point x as the weighted average of the values valuesi, where each value is weighted by the inverse of the distance between pointsi and x, and only points at distance at most r of x are used.

• 

By default, r is infinity, so all sample points will be used to interpolate a query point.

• 

If no points lie within distance r, the interpolated value will be Floatundefined.

• 

For sufficiently large r, this interpolation method produces a C1 continuous interpolant.

• 

This interpolation method does not introduce local minima or maxima which are not already present in the input data.

• 

f can be evaluated at every point in Rn, but results for points far away from the sample points may not be meaningful.

• 

As with all interpolation methods, the interpolant f always passes through all of the sample values.

• 

Input sample points must not contain duplicates. The presence of duplicate points can lead to unexpected results.

• 

In order to evaluate f at k points, you can put each point in a row of a Matrix M and call f(M) to obtain the k values of f in a k-element Vector. This will be most efficient if M's options are such that its datatype is float[8], its order is C_order, and its storage is rectangular.

Examples

XY0,0,1,0,2,0,0,1,1,1,2,1,0,2,1,2,2,2

XY0,0,1,0,2,0,0,1,1,1,2,1,0,2,1,2,2,2

(1)

Z0,0,0,0,1,0,0,0,0

Z0,0,0,0,1,0,0,0,0

(2)

fInterpolation:-InverseDistanceWeightedInterpolationXY,Z,1.5

fInvⅇrsⅇ Dⅈstancⅇ Wⅇⅈghtⅇⅆ ⅈntⅇrpolatⅈon obȷⅇct wⅈth 9 samplⅇ poⅈntsRaⅆⅈus of ⅈnfluⅇncⅇ: 1.5

(3)

f can be polled at specific points.

f0.5,0.5

0.250000000000000000

(4)

MMatrix1.5,0.3,0.7,1.4,1.2,1.8,datatype=float8,order=C_order

M1.500000000000000.3000000000000000.7000000000000001.400000000000001.200000000000001.80000000000000

(5)

fM

0.09139916994783180.5991095777352200.0335025560440729

(6)

Use plot3d to plot the interpolated surface.

plot3dx,yfx,y,0..2,0..2,labels=x,y,z

Compatibility

• 

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

• 

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

See Also

Interpolation