The interpolator function code outputs a value determined by a two dimensional linear interpolation of the two inputs. The coordinates of the values within a defined fivebyfive table are the basis of the interpolation. If either input is outside the table, the first output becomes the largest possible number. The second output is a boolean value that indicates if the input points are in the fivebyfive table range. If either input is outside the table, the second output becomes a one.

Outputs:

Specifications:
Spec 
Tune 
Default 
Type 
Range 
Description 
S1 
N 
6 
I 
Note 1 
Block address of X value 
S2 
N 
6 
I 
Note 1 
Block address of Y value 
S3 
N 
0.000 
R 
Full 
Minimum value of X (X coordinate of Z11) 
S4 
N 
100.000 
R 
Full 
Maximum value of Y (Y coordinate of Z11) 
S5 
N 
0.000 
R 
Full 
Maximum value of X (X coordinate of Z55) 
S6 
N 
0.000 
R 
Full 
Minimum value of Y (Y coordinate of Z55) 
S7 
Y 
0.000 
R 
Full 
Z11 table entry 
S8 
Y 
0.000 
R 
Full 
Z12 table entry 
S9 
Y 
0.000 
R 
Full 
Z13 table entry 
S10 
Y 
0.000 
R 
Full 
Z14 table entry 
S11 
Y 
0.000 
R 
Full 
Z15 table entry 
S12 
Y 
0.000 
R 
Full 
Z21 table entry 
S13 
Y 
0.000 
R 
Full 
Z22 table entry 
S14 
Y 
0.000 
R 
Full 
Z23 table entry 
S15 
Y 
0.000 
R 
Full 
Z24 table entry 
S16 
Y 
0.000 
R 
Full 
Z25 table entry 
S17 
Y 
0.000 
R 
Full 
Z31 table entry 
S18 
Y 
0.000 
R 
Full 
Z32 table entry 
S19 
Y 
0.000 
R 
Full 
Z33 table entry 
S20 
Y 
0.000 
R 
Full 
Z34 table entry 
S21 
Y 
0.000 
R 
Full 
Z35 table entry 
S22 
Y 
0.000 
R 
Full 
Z41 table entry 
S23 
Y 
0.000 
R 
Full 
Z42 table entry 
S24 
Y 
0.000 
R 
Full 
Z43 table entry 
S25 
Y 
0.000 
R 
Full 
Z44 table entry 
S26 
Y 
0.000 
R 
Full 
Z45 table entry 
S27 
Y 
0.000 
R 
Full 
Z51 table entry 
S28 
Y 
0.000 
R 
Full 
Z52 table entry 
S29 
Y 
0.000 
R 
Full 
Z53 table entry 
S30 
Y 
0.000 
R 
Full 
Z54 table entry 
S31 
Y 
0.000 
R 
Full 
Z55 table entry 
168.1 Explanation
Interpolation determines the value of the dependent variable Z based on the values of the two independent variables X,Y.
Specifications S3 through S6 specify the high and low limits for the independent variables. The fivebyfive table shown in Figure 1684 is for the interpolation. Input Z11 is the value of the dependent variable Y that corresponds to the maximum value of the Y variable and the minimum value of the X variable. Likewise, input Z55 is the value of the dependent variable that corresponds to the minimum value of the Y variable and the maximum value of the X variable. If either of the dependent variable values go outside the maximum value in the table, the output becomes the largest possible number (Z11 and Z55). The increments of X must be equal and the increments of Y must be equal. X and Y need not be equal to each other.
This block can easily handle any situation requiring a two dimensional linear interpolation, for example, steam tables. Using temperature and pressure as the X and Y variables, and enthalpy as the Z variable, the user could find the enthalpy associated with any temperature pressure combination that is within the confines of the table.
Implementing this block requires the creation of a lookup table and entering it into the block via S7 through S31. For example, if using this block for enthalpy values, go to the steam tables, and transfer the information needed into the block via the specifications. The values in the table are predefined values of the dependent variable that correspond to the designated values of the independent variables.
The block calculates the interpolated output value with the equations:
where:
ZY1 
= 

ZY2 
= 

Xact 
= 
Actual value of X.

Xmin 
= 
Value of X for column before Xact.

Xmax 
= 
Value of X for column after Xact.

Xspan 
= 
Range of X values between columns. The range between columns is automatically defined when selecting the minimum and maximum values for X. Since the data table is divided into five columns,

Yact

= 
Actual value of Y. 
Ymin

= 
Value of Y for row after Yact.

Ymax 
= 

Yspan 
= 
Range of Y values between rows. The range between rows is automatically defined when selecting the minimum and maximum values for Y. Since the data table is divided into five rows,

Z(Xnnn,Ymmm) 
= 
The Z value in the array corresponding to the X and Y values defined by nnn and mmm.

168.2 Applications
Use this block in any situation requiring the linear interpolation of one variable from the values of two others. External logic is easily implemented to form a large lookup table from multiple interpolator blocks. The following examples illustrate use of the interpolator block for both two dimensional and single dimensional interpolation.
The interpolator block can be used to determine steam properties as mentioned earlier. First, select the range of X and Y, in this case, pressure (P) and temperature (T). Since steam table data is in absolute pressure, Table 1683 uses pounds per square inch absolute, and the range of pressure is altered for input to the interpolator block.
The abrupt changes in the original s and h values show that the values are on both sides of the saturation line. Verify this by looking at the saturation temperature (Tsat). In order to have valid data down to the saturation line (only in the superheated region), extrapolate valid superheated data down to the next lower temperature. At 15 pounds per square inch absolute, the superheated region permits temperatures down to 213 degrees Fahrenheit. When using the 200 degrees Fahrenheit value of h (168.09) for extrapolation, the interpolator block calculates h at 275 degrees Fahrenheit as 692.1. The correct value is 1180.7.
Obviously, there is a need to determine a new value of the minimum allowable temperature for superheated steam (from steam tables: T = 220, h = 1154.2). By using these two points (1216.2 and 1154.2), extrapolate linearly to get h = 1144.7 at T = 200.
Similar calculations are made for the remaining pressures. The below saturation line value remaining (200 degrees Fahrenheit for P 165 psia) can be made equal to the 350 degrees Fahrenheit value or remain as they are (current calculations never permit their use). Additional function blocks may be added to monitor below superheated values. The second output of the interpolator block (status) determines if the pressure is less than 15 pounds per square inch absolute. Low pressures cause fixed values of h and s to be output from the block.
Use the interpolator block for single dimensional interpolation by setting the range of y equals zero to ten, and fixing the y input (S2) at 0.0. Then only one row (y = 0.0) needs filled in. This function block will linearly interpolate between two values in its table. For curve segments that do not have inflection points (second derivative crossing through zero), the resulting error always has the same sign as shown in Figure 1681. For applications requiring greater accuracy, use a function generator block. When linearizing the curve with a function generator block, the straight lines are selected such that errors are equal on both sides of the curve as shown in Figure 1682. If a segment requires greater accuracy (such as around an operating point), the function generator breakpoints can be spaced closer together.