![]() |
INTERPOLATIONName:
Interpolation is related to, but distinct from, fitting a function to a series of points. In particular, an interpolated function goes through all the original points while a fitted function does not. There are various methods for performing interpolation. Chapter 3 of the Numerical Recipes book (see REFERENCE below) contains a nice discussion of various types of commonly used interpolation schemes (polynomial interpolation, rational function interpolation, cubic spline interpolation). Dataplot uses the cubic spline algorithm. Cubic splines have the advantage of being efficient to compute and being more stable than polynomials. Cubic spline interpolation is intended for the case when your data are "smooth". Specifically, it should be monotonically increasing (or decreasing) and not be "noisy". If your data is sufficiently noisy, cubic spline interpolation may not generate desirable interpolated values (e.g., it may not preserve the monotonicity). Hermite interpolation is an alternative to cubic spline interpolation that may work better when there is some noise in the data (although it still assumes monotonicity). Chapter 4 of Kahaner, Moler, and Nash gives a discussion of Hermite interpolation. Hermite interpolation also returns the derivative at the interpolated points. You can also compute a definite integral based on the Hermite interpolation.
<SUBSET/EXCEPT/FOR qualification> where <y1> is a variable containing the vertical axis data points; <x1> is a variable containing the horizontal axis data points; <x2> is a variable containing the horizontal points where the interpolation is to be performed; <y2> is a variable (same length as <x2>) where the interpolated values are stored; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax computes the cubic spline interpolation.
<SUBSET/EXCEPT/FOR qualification> where <y1> is a variable containing the vertical axis data points; <x1> is a variable containing the horizontal axis data points; <x2> is a variable containing the horizontal points where the interpolation is to be performed; <y2> is a variable (same length as <x2>) where the interpolated values are stored; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax computes the Hermite interpolation.
<SUBSET/EXCEPT/FOR qualification> where <y1> is a variable containing the vertical axis data points; <x1> is a variable containing the horizontal axis data points; <x2> is a variable containing the horizontal points where the interpolation is to be performed; <y2> is a variable (same length as <x2>) where the derivative of the interpolated values are stored; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax computes the derivative at the <x2> points based on the Hermite interpolation.
<SUBSET/EXCEPT/FOR qualification> where <y1> is a variable containing the vertical axis data points; <x1> is a variable containing the horizontal axis data points; <lowlim> is a number or parameter containing the lower limit of the integration; <upplim> is a number or parameter containing the upper limit of the integration; <a> is a parameter where the integral value is saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax computes the definite integral based on the Hermite interpolation.
LET Y2 = HERMITE INTERPOLATION Y1 X1 X2
LET Y2 = HERMITE DERIVATIVE Y1 X1 X2
LET A = HERMITE INTEGRATION Y1 X1 0 1
Press, Flannery, Teukolsky, and Vetterling (1989), "Numerical Recipes: The Art of Scientific Computing (FORTRAN Version)", Cambridge University Press, (chapter 3). Kahaner, Moler, and Nash (1989), "Numerical Methods and Software", Prentice-Hall, chapter 4. Fritsch and Carlson (1980), "Monotone Piecewise Cubic Interpolation", SIAM Journal of Numerical Analysis, Vol. 17, No. 2, pp. 238-246). Fritsch and Carlson (1982), "Piecewise Cubic Hermite Interpolation Package, Final Specifications", Lawrence Livermore National Laboratory, Computer Documentation UCID-30194.
2017/09: Support for Hermite interpolation and integration 2017/11: Support for Hermite derivative LET FUNCTION F1 = SIN(X1)*COS(X1) LET START = -PI/2 LET STOP = PI/2 LET X1 = SEQUENCE START 0.1 STOP LET Y1 = F1 LET X2 = DATA 0 0.05 0.15 0.25 0.35 0.45 . LET Y2 = INTERPOLATION Y1 X1 X2 . TITLE CASE ASIS LINES SOLID BLANK CHARACTER BLANK CIRCLE CHARACTER SIZE 1.5 ALL CHARACTER FILL OFF ON TITLE Cubic Spline Interpolation PLOT Y1 X1 AND PLOT Y2 X2 . LET Y3 = HERMITE INTERPOLATION Y1 X1 X2 . TITLE Hermite Cubic Interpolation PLOT Y1 X1 AND PLOT Y3 X2 ![]()
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 11/22/2017 |