Browse Prior Art Database

# Dynamic Interpolation

IP.com Disclosure Number: IPCOM000083557D
Original Publication Date: 1975-Jun-01
Included in the Prior Art Database: 2005-Mar-01
Document File: 3 page(s) / 25K

IBM

## Related People

Scott, TR: AUTHOR [+2]

## Abstract

Frequently it is necessary to perform linear interpolation of data. The usual procedure is to scan the tabular data to bracket the independent variable, and then to calculate the dependent variable using: Y - Yi + (X - Xi) (Yi+1 - Yi) over (Xi+1 - Xi) Xi

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 3

Dynamic Interpolation

Frequently it is necessary to perform linear interpolation of data. The usual procedure is to scan the tabular data to bracket the independent variable, and then to calculate the dependent variable using: Y - Yi + (X - Xi) (Yi+1 - Yi) over (Xi+1 - Xi) Xi </- X - Xi+1 [Ref. 1].

It is possible in programming applications to avoid searching the table to bracket the independent variable, by the judicious use of the minimum and maximum function. [Ref. 2] Consider: Y - Y1 + DMAX (DMIN(X, X2) - X1, 0)* (Y2 - Y1) over (X2 - X1) + (DMIN(X,X3) - X2,0)* (Y3 - Y2) over (X3 - X2) + DMAX (DMIN(X, X4) - X3, 0)*(Y4 - Y3) over (X4 - X3) + etc.

Suppose in this example that the value of the independent variable is bracketed by the second and third points in the table, i.e., X2, < X < X3; then the following evaluations would apply:

(Image Omitted)

Accordingly: Y = Y1 + (X2 - X1)*(Y2 - Y1) over (X2 - X1) + (X - X2)*(Y3 - Y2) over (X3 - X2) + (0)*(Y4 - Y3) over (X4 - X3) = Y1 + Y2 - Y1 + (X - X2)*(Y3 - Y2) over (X3 - X2) Y = Y2 + (X - X2)*(Y3 - Y2) over (X3 - X2).

This is, of course, the usual formula for interpolation between the bracketed points.

Therefore, using the minimum and maximum functions provided by FORTRAN, it is possible to define an expanded formula for linear interpolation that avoids the necessity of searching tables. As written, the function is clamped and yields the upper tabular value for Y if the independent variable exceeds the range of the table.

By slightly modifying the formula, it can be written to permit linear extrapolation beyond the ends of the table. Consider: Y = Y1 + (DMIN(X, X2) - X1)* (Y2 - Y1) over (X2 - X1) * DMAN(DMIN(X, X3)- X2,0)*(Y3 - Y2) over (X3 - X2) + DMAX(X - X3, 0)*(Y4 - Y3) over (X4 - X3) If X < X1, then: Y = Y1 + (X - X4) *(Y2 - Y1) over (X2 - X1) + 0 + 0 which corresponds to a linear extrapolation prior to the first entry in the table. If X < X4, then: Y = Y1 + (X2 - X1)*(Y2 - Y1) over (X2 - X1) + (X3 - X2)*(Y3 - Y2) over (X3 - X2)+ (X - X3)* (Y4 - Y3) over (X4 - X3) Y = Y1 + Y2 - Y1 + Y3 - Y2 + (X - X3)*(Y4 - Y3) over (X4 - X3) Y = Y3 +(X - X3) *(Y4 - Y3) over (X4 - X3) which corresponds to a linear extrapolation beyond the last entry in the table.

Thus by using only the minimum function in the first term and the maximum function in the last term, linear extrapolation beyond the ends of the table is achieved.

The terms Y2 - Y1, Y3 - Y2, over X2 - X1 X3 - X2 etc, look like first divided differences, and could be calculated just once for each ta...