Interpolation - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Information : Updates : Maple 2018 : updates/Maple2018/Interpolation

Interpolation

Maple 2018 contains a new package for interpolating structured and unstructured data in any dimension. The supported methods include Kriging, inverse distance weighted, natural neighbor, and more.

The Interpolate command provides an interface to all interpolation methods. It returns objects that behave like normal mathematical functions.

withInterpolation

CubicInterpolation,HighestNeighborInterpolation,Interpolate,InverseDistanceWeightedInterpolation,Kriging,LinearInterpolation,LinearTriangularInterpolation,LowestNeighborInterpolation,NaturalNeighborInterpolation,NearestNeighborInterpolation,RadialBasisFunctionInterpolation,SplineInterpolation

(1)

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

data  0,0,0,0,1,0,0,0,0: 

g  Interpolatepoints, 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

(2)

g1,0.5

0.520634529490956455

(3)

p1  plots:-pointplot3dseqpointsi,1,pointsi,2,datai,i=1..9,symbol=solidsphere,symbolsize=40,color=black:

p2plot3dg,0..2,0..2,color=SteelBlue:

Previous versions of Maple already included interpolation methods for 1-dimensional data and data given for a grid of points, like in the previous example. But Maple 2018 is the first version where you can interpolate data given for points in arbitrary, unstructured locations.

The kriging interpolation method supports some extra functionality backed by statistical theory. In particular, it allows one to generate random data that is spatially correlated according to a so-called variogram. The supported variograms are explained in the SetVariogram help page. Here is an example:

n  50:

points, data  KrigingGenerateSpatialDataRationalQuadratic0, 10, 1, n:

We can now define an interpolating object using the Kriging method, and tell it the variogram used for its input.

g  Krigingpoints, data:

SetVariogramg, RationalQuadratic0, 10, 1;

Krⅈgⅈng ⅈntⅇrpolatⅈon obȷⅇct wⅈth 50 samplⅇ poⅈntsVarⅈogram: RatⅈonalQuaⅆratⅈc(0,10,1)

(4)

The interpolating object can return function values as if it were a regular mathematical function:

g0.3, 0.8

−0.143204039288054363

(5)

It can also compute the variance associated with such function values - which gives a sense of the confidence in this value.

g0.3, 0.8, output=variance

0.361603843473117470

(6)

We can visualize this variance by colouring the interpolated surface according to it.

In this visualization, red areas have high confidence and yellow, green, and blue areas have less confidence.