test_interp
test_interp,
a MATLAB code which
defines data that may be used to test interpolation algorithms.
The following sets of data are available:
-
p01_plot.png,
18 data points, 2 dimensions.
This example is due to Hans-Joerg Wenz.
It is an example of good data, which is dense enough in areas
where the expected curvature of the interpolant is large.
Good results can be expected with almost any reasonable
interpolation method.
-
p02_plot.png,
18 data points, 2 dimensions. This example is due to ETY Lee of Boeing.
Data near the corners is more dense than in regions of small curvature.
A local interpolation method will produce a more plausible
interpolant than a nonlocal interpolation method, such as
cubic splines.
-
p03_plot.png,
11 data points, 2 dimensions. This example is due to Fred Fritsch and Ralph Carlson.
This data can cause problems for interpolation methods.
There are sudden changes in direction, and at the same time,
sparsely-placed data. This can cause an interpolant to overshoot
the data in a way that seems implausible.
-
p04_plot.png,
8 data points, 2 dimensions. This example is due to Larry Irvine, Samuel Marin and Philip Smith.
This data can cause problems for interpolation methods.
There are sudden changes in direction, and at the same time,
sparsely-placed data. This can cause an interpolant to overshoot
the data in a way that seems implausible.
-
p05_plot.png,
9 data points, 2 dimensions. This example is due to Larry Irvine, Samuel Marin and Philip Smith.
This data can cause problems for interpolation methods.
There are sudden changes in direction, and at the same time,
sparsely-placed data. This can cause an interpolant to overshoot
the data in a way that seems implausible.
-
p06_plot.png,
49 data points, 2 dimensions. The data is due to deBoor and Rice.
The data represents a temperature dependent property of titanium.
The data has been used extensively as an example in spline
approximation with variably-spaced knots.
DeBoor considers two sets of knots:
(595,675,755,835,915,995,1075)
and
(595,725,850,910,975,1040,1075).
-
p07_plot.png,
4 data points, 2 dimensions. The data is a simple symmetric set of 4 points,
for which it is interesting to develop the Shepard interpolants
for varying values of the exponent p.
-
p08_plot.png,
12 data points, 2 dimensions. This is equally spaced data for y = x^2,
except for one extra point whose x value is close to another, but whose
y value is not so close. A small disagreement in nearby data can
become a disaster.
TEST_INTERP requires access to a compiled copy of the R8LIB library.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the MIT license
Languages:
test_interp is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
divdif,
a MATLAB code which
includes many routines to construct and evaluate divided difference
interpolants.
hermite_interpolant,
a MATLAB code which
computes the Hermite interpolant, a polynomial that matches function values
and derivatives.
interp,
a MATLAB code which
can be used for parameterizing and interpolating data;
interpolation,
a dataset directory which
contains datasets to be interpolated.
lagrange_interp_1d,
a MATLAB code which
defines and evaluates the lagrange polynomial p(x)
which interpolates a set of data, so that p(x(i)) = y(i).
newton_interp_1d,
a MATLAB code which
finds a polynomial interpolant to data using newton divided differences.
r8lib,
a MATLAB code which
contains many utility routines using double precision real (r8) arithmetic.
rbf_interp_1d,
a MATLAB code which
defines and evaluates radial basis function (rbf) interpolants to 1d data.
shepard_interp_1d,
a MATLAB code which
defines and evaluates shepard interpolants to 1d data,
which are based on inverse distance weighting.
spline,
a MATLAB code which
includes many routines to construct and evaluate spline
interpolants and approximants.
test_interp_test
test_interp_2d,
a MATLAB code which
defines test problems for interpolation of data z(x,y)),
depending on a 2d argument.
vandermonde_interp_1d,
a MATLAB code which
finds a polynomial interpolant to a function of 1d data
by setting up and solving a linear system for the polynomial coefficients,
involving the vandermonde matrix.
Reference:
-
Carl DeBoor, John Rice,
Least-squares cubic spline approximation II - variable knots.
Technical Report CSD TR 21,
Purdue University, Lafayette, Indiana, 1968.
-
Carl DeBoor,
A Practical Guide to Splines,
Springer, 2001,
ISBN: 0387953663,
LC: QA1.A647.v27.
-
Fred Fritsch, Ralph Carlson,
Monotone Piecewise Cubic Interpolation,
SIAM Journal on Numerical Analysis,
Volume 17, Number 2, April 1980, pages 238-246.
-
Larry Irvine, Samuel Marin, Philip Smith,
Constrained Interpolation and Smoothing,
Constructive Approximation,
Volume 2, Number 1, December 1986, pages 129-151.
-
ETY Lee,
Choosing Nodes in Parametric Curve Interpolation,
Computer-Aided Design,
Volume 21, Number 6, July/August 1989, pages 363-370.
-
Hans-Joerg Wenz,
Interpolation of Curve Data by Blended Generalized Circles,
Computer Aided Geometric Design,
Volume 13, Number 8, November 1996, pages 673-680.
Source Code:
-
p00_data.m,
returns the data for any problem.
-
p00_data_num.m,
returns the number of data points for any problem.
-
p00_dim_num.m,
returns the spatial dimension for any problem.
-
p00_plot.m,
creates a plot of any problem.
-
p00_prob_num.m,
returns the number of test problems.
-
p00_story.m,
prints the "story" for any problem.
-
p01_data.m,
returns the data for problem p01.
-
p01_data_num.m,
returns the number of data points for problem p01.
-
p01_dim_num.m,
returns the spatial dimension for problem p01.
-
p01_story.m,
prints the "story" for problem p01.
-
p02_data.m,
returns the data for problem p02.
-
p02_data_num.m,
returns the number of data points for problem p02.
-
p02_dim_num.m,
returns the spatial dimension for problem p02.
-
p02_story.m,
prints the "story" for problem p02.
-
p03_data.m,
returns the data for problem p03.
-
p03_data_num.m,
returns the number of data points for problem p03.
-
p03_dim_num.m,
returns the spatial dimension for problem p03.
-
p03_story.m,
prints the "story" for problem p03.
-
p04_data.m,
returns the data for problem p04.
-
p04_data_num.m,
returns the number of data points for problem p04.
-
p04_dim_num.m,
returns the spatial dimension for problem p04.
-
p04_story.m,
prints the "story" for problem p04.
-
p05_data.m,
returns the data for problem p05.
-
p05_data_num.m,
returns the number of data points for problem p05.
-
p05_dim_num.m,
returns the spatial dimension for problem p05.
-
p05_story.m,
prints the "story" for problem p05.
-
p06_data.m,
returns the data for problem p06.
-
p06_data_num.m,
returns the number of data points for problem p06.
-
p06_dim_num.m,
returns the spatial dimension for problem p06.
-
p06_story.m,
prints the "story" for problem p06.
-
p07_data.m,
returns the data for problem p07.
-
p07_data_num.m,
returns the number of data points for problem p07.
-
p07_dim_num.m,
returns the spatial dimension for problem p07.
-
p07_story.m,
prints the "story" for problem p07.
-
p08_data.m,
returns the data for problem p08.
-
p08_data_num.m,
returns the number of data points for problem p08.
-
p08_dim_num.m,
returns the spatial dimension for problem p08.
-
p08_story.m,
prints the "story" for problem p08.
-
r8mat_transpose_print.m,
prints the transpose of an R8MAT;
-
r8mat_transpose_print_some.m,
prints some of the transpose of an R8MAT;
Last revised on 28 March 2019.