1. Overview & Applications
Interpolation is the process of estimating unknown values that fall between known data points. Essential for working with tabulated engineering data from standards, handbooks, and experimental measurements.
Thermodynamic properties
Steam tables
Enthalpy, entropy, density at intermediate P/T from ASME steam tables.
Fluid properties
Viscosity, density
API gravity corrections, gas compressibility from Standing-Katz charts.
Pipe specifications
ASME B36.10M
Interpolate wall thickness, weights for intermediate nominal sizes.
Pressure ratings
ASME B16.5
Flange pressure ratings at intermediate temperatures between listed values.
Key Concepts
- Linear interpolation: Assumes straight-line relationship between two adjacent points
- Bilinear interpolation: Two-dimensional interpolation for data on rectangular grid (x, y → z)
- Inverse interpolation: Finding x given y when y is tabulated as function of x
- Extrapolation: Estimating beyond table range (risky - use with caution)
- Lagrange/Newton polynomials: Higher-order methods for improved accuracy
Why interpolation matters: Engineering tables cannot list every possible value. Interpolation allows engineers to extract intermediate values with quantifiable accuracy. Critical for thermodynamic calculations, material properties, and equipment specifications.
Interpolation vs. Curve Fitting
| Aspect |
Interpolation |
Curve Fitting |
| Data points |
Passes exactly through known points |
Approximates trend, may not pass through points |
| Use case |
Tables with accurate measurements |
Noisy experimental data |
| Methods |
Linear, cubic spline, Lagrange |
Least squares regression, polynomial fit |
| Accuracy |
Exact at table points |
Minimizes overall error |
2. Linear Interpolation
Linear interpolation assumes a straight-line relationship between two adjacent data points. Most common method for engineering tables due to simplicity and adequate accuracy for closely-spaced data.
Fundamental Equation
Linear Interpolation Formula:
Given two points: (x₁, y₁) and (x₂, y₂)
Find y at intermediate x where x₁ < x < x₂
y = y₁ + (x - x₁) × (y₂ - y₁) / (x₂ - x₁)
Or equivalently:
y = y₁ + (y₂ - y₁) × (x - x₁) / (x₂ - x₁)
Where:
x = Target independent variable
y = Interpolated dependent variable
(x₁, y₁) = Lower bound point
(x₂, y₂) = Upper bound point
Interpolation Fraction
Normalized Form:
Define interpolation fraction:
f = (x - x₁) / (x₂ - x₁)
where 0 ≤ f ≤ 1
Then:
y = y₁ + f × (y₂ - y₁)
y = (1 - f) × y₁ + f × y₂ (weighted average form)
This shows interpolation as weighted average of boundary values.
Example Calculation - Steam Table Interpolation
Find enthalpy of saturated steam at 250 psia from ASME steam tables:
Given data (from steam tables):
P = 240 psia → h_g = 1199.3 Btu/lb
P = 260 psia → h_g = 1198.4 Btu/lb
Find: h_g at P = 250 psia
Solution:
f = (250 - 240) / (260 - 240) = 10 / 20 = 0.5
h_g = 1199.3 + 0.5 × (1198.4 - 1199.3)
h_g = 1199.3 + 0.5 × (-0.9)
h_g = 1199.3 - 0.45
h_g = 1198.85 Btu/lb
Verification: Halfway between points → average of boundary values
h_avg = (1199.3 + 1198.4) / 2 = 1198.85 Btu/lb ✓
Accuracy Considerations
| Data Characteristics |
Linear Interpolation Accuracy |
Recommendation |
| Nearly linear between points |
< 0.1% error |
Linear interpolation excellent |
| Slight curvature |
0.1–1% error |
Linear acceptable for most engineering |
| Moderate curvature |
1–5% error |
Consider cubic spline or add data points |
| High curvature |
> 5% error |
Must use higher-order interpolation |
| Sparse data (>10% spacing) |
Variable, possibly large |
Verify with additional data if available |
Error Estimation
The maximum error in linear interpolation can be estimated from the second derivative:
Truncation Error:
E_max ≤ (h²/8) × max|f''(x)|
Where:
h = x₂ - x₁ (interval width)
f''(x) = second derivative of function
Interpretation:
- Error proportional to h² (square of spacing)
- Halving table spacing reduces error by factor of 4
- Functions with large curvature (high f'') have larger errors
When Linear Interpolation Fails
- Phase transitions: Abrupt property changes (e.g., latent heat at saturation) cannot be interpolated linearly
- Logarithmic relationships: Exponential data (e.g., vapor pressure vs. temperature) requires log interpolation
- Discontinuities: Step functions or data with breaks invalidate linear assumption
- Wide spacing: Tables with >20% spacing between points may have significant curvature
Best practice: Always check if interpolated value is reasonable. Compare to adjacent table values, verify units, and confirm result makes physical sense. For critical calculations, use higher-order methods or finer data tables.
3. Bilinear Interpolation
Bilinear interpolation extends linear interpolation to two dimensions, used for data tables with two independent variables (e.g., pressure and temperature). Essential for thermodynamic property tables and compressibility charts.
Bilinear Interpolation Formula
Two-Dimensional Interpolation:
Given four corner points on rectangular grid:
(x₁, y₁) → z₁₁
(x₂, y₁) → z₂₁
(x₁, y₂) → z₁₂
(x₂, y₂) → z₂₂
Find z at intermediate point (x, y)
Step 1: Interpolate in x-direction at y = y₁
z_a = z₁₁ + (x - x₁)/(x₂ - x₁) × (z₂₁ - z₁₁)
Step 2: Interpolate in x-direction at y = y₂
z_b = z₁₂ + (x - x₁)/(x₂ - x₁) × (z₂₂ - z₁₂)
Step 3: Interpolate in y-direction between z_a and z_b
z = z_a + (y - y₁)/(y₂ - y₁) × (z_b - z_a)
Compact Form
Single Equation Form:
Define normalized coordinates:
f_x = (x - x₁)/(x₂ - x₁)
f_y = (y - y₁)/(y₂ - y₁)
Then:
z = (1-f_x)(1-f_y)z₁₁ + f_x(1-f_y)z₂₁ + (1-f_x)f_y z₁₂ + f_x f_y z₂₂
This is weighted average of four corner values.
Each corner weighted by product of distances from opposite edges.
Example - Compressibility Factor from Standing-Katz Chart
Find Z-factor for natural gas at P_r = 3.5, T_r = 1.25 from Standing-Katz data:
Given corner points (P_r, T_r → Z):
(3.0, 1.2) → Z = 0.720
(4.0, 1.2) → Z = 0.650
(3.0, 1.3) → Z = 0.760
(4.0, 1.3) → Z = 0.695
Target: (P_r = 3.5, T_r = 1.25)
Step 1: Interpolate at T_r = 1.2
f_P = (3.5 - 3.0)/(4.0 - 3.0) = 0.5
Z_a = 0.720 + 0.5 × (0.650 - 0.720) = 0.720 - 0.035 = 0.685
Step 2: Interpolate at T_r = 1.3
Z_b = 0.760 + 0.5 × (0.695 - 0.760) = 0.760 - 0.0325 = 0.7275
Step 3: Interpolate in T_r direction
f_T = (1.25 - 1.2)/(1.3 - 1.2) = 0.5
Z = 0.685 + 0.5 × (0.7275 - 0.685) = 0.685 + 0.021 = 0.706
Result: Z = 0.706 at (P_r = 3.5, T_r = 1.25)
Order of Interpolation
Bilinear interpolation is commutative - interpolating first in x then y gives same result as y then x:
| Method |
Sequence |
Result |
| Method A |
Interpolate x at y₁, then x at y₂, then y |
z = 0.706 |
| Method B |
Interpolate y at x₁, then y at x₂, then x |
z = 0.706 |
| Verification |
Both methods mathematically equivalent |
Use whichever is more convenient |
Geometric Interpretation
- Rectangular grid: Four corner points form rectangle in (x, y) space
- Planar surface: Bilinear creates twisted plane (hyperbolic paraboloid) through corners
- Not true plane: Surface can be curved, not flat like true plane
- Exact at corners: Interpolated surface passes exactly through all four data points
Bilinear limitations: Assumes linear variation along each axis. For highly nonlinear functions, consider bicubic interpolation or finer grid spacing. Common in compressibility charts, steam tables, and psychrometric charts.
Extension to Three Dimensions
Trilinear interpolation extends to three independent variables (x, y, z → w):
Trilinear Interpolation:
Requires 8 corner points of a rectangular box.
Sequence:
1. Four bilinear interpolations on each face in z-direction
2. Two linear interpolations in y-direction
3. One linear interpolation in x-direction
Or use compact form:
w = Σ(i,j,k) w_ijk × (1-f_x or f_x) × (1-f_y or f_y) × (1-f_z or f_z)
where sum is over 8 corners (i,j,k = 1 or 2)
Used for 3D property tables (e.g., P, T, composition).
4. Inverse & Advanced Methods
Inverse Interpolation
Inverse interpolation finds x given y, when table lists y as function of x. Common when table is organized opposite to your needs.
Inverse Linear Interpolation:
Given: (x₁, y₁) and (x₂, y₂)
Find: x such that y has specified value
Solve for x from linear equation:
y = y₁ + (x - x₁) × (y₂ - y₁)/(x₂ - x₁)
Rearranging:
x = x₁ + (y - y₁) × (x₂ - x₁)/(y₂ - y₁)
Note: Only valid if y₁ ≠ y₂ (function must be monotonic)
Example - Finding Pressure for Target Enthalpy
Steam table lists enthalpy vs. pressure. Find pressure for h_g = 1200 Btu/lb:
Given:
P = 220 psia → h_g = 1200.2 Btu/lb
P = 240 psia → h_g = 1199.3 Btu/lb
Find: P for h_g = 1200.0 Btu/lb
Using inverse interpolation:
P = 220 + (1200.0 - 1200.2) × (240 - 220)/(1199.3 - 1200.2)
P = 220 + (-0.2) × (20)/(-0.9)
P = 220 + (-0.2) × (-22.22)
P = 220 + 4.44
P = 224.4 psia
Verification: Target h is closer to upper value (220 psia),
so result should be closer to 220 than 240 ✓
Logarithmic Interpolation
For exponentially-varying data (e.g., vapor pressure), use logarithmic interpolation:
Log-Linear Interpolation:
When y varies exponentially with x:
ln(y) = ln(y₁) + (x - x₁) × [ln(y₂) - ln(y₁)]/(x₂ - x₁)
Or:
y = y₁ × exp[(x - x₁) × ln(y₂/y₁)/(x₂ - x₁)]
Equivalent to:
y = y₁ × (y₂/y₁)^[(x-x₁)/(x₂-x₁)]
Example: Vapor pressure vs. temperature (Clausius-Clapeyron relationship)
Cubic Spline Interpolation
For smooth, high-accuracy interpolation over multiple points:
Cubic Spline:
Construct piecewise cubic polynomials between each pair of points:
S_i(x) = a_i + b_i(x - x_i) + c_i(x - x_i)² + d_i(x - x_i)³
Constraints:
1. Passes through all data points
2. First derivatives continuous at interior points
3. Second derivatives continuous at interior points
4. Boundary conditions (natural, clamped, or periodic)
Advantages:
- Smooth, continuous curvature
- No oscillations (unlike high-order polynomials)
- Excellent for closely-spaced data
Disadvantages:
- Complex to calculate (requires solving tridiagonal system)
- Overkill for simple engineering tables
Lagrange Polynomial Interpolation
Fits polynomial through n points exactly:
Lagrange Interpolation:
For n data points (x₁,y₁), (x₂,y₂), ..., (x_n,y_n):
P(x) = Σ y_i × L_i(x)
where L_i(x) = Π [(x - x_j)/(x_i - x_j)] for j ≠ i
Each L_i is basis polynomial:
- L_i(x_i) = 1
- L_i(x_j) = 0 for j ≠ i
Advantages:
- Exact fit through all points
- Simple to understand
Disadvantages:
- Oscillates wildly for n > 5 (Runge's phenomenon)
- Computationally expensive for large n
- Linear/cubic spline usually better in practice
Extrapolation - Use with Extreme Caution
Extrapolation estimates values beyond the table range:
| Method |
Risk Level |
When to Use |
| Linear extrapolation (short) |
Moderate |
<5% beyond last point, linear trend confirmed |
| Linear extrapolation (long) |
High |
Avoid - curvature likely outside range |
| Polynomial extrapolation |
Very high |
Almost never - oscillates wildly beyond data |
| Physical model |
Low (if validated) |
Use theory-based equation, not blind extrapolation |
Extrapolation warning: "Interpolation is science, extrapolation is art" - extrapolating beyond table range is inherently risky. Physical behavior may change outside measured range (phase transitions, new regimes). Always seek additional data or use theoretical models when going beyond table bounds.
Interpolation Method Selection
- Linear: Default choice for most engineering tables, adequate accuracy if data closely spaced
- Bilinear: Two independent variables (P-T tables, compressibility charts)
- Logarithmic: Exponentially varying data (vapor pressure, reaction rates)
- Cubic spline: High accuracy needed, smooth data, computer implementation available
- Lagrange: Educational purposes, rarely used in practice due to oscillations
5. Practical Applications
ASME Steam Tables (B31.1 / B31.3)
Interpolating thermodynamic properties for power and process piping:
Example: Superheated Steam Enthalpy
Find h at P = 850 psia, T = 750°F
From ASME steam tables:
At P = 800 psia:
T = 700°F → h = 1371.4 Btu/lb
T = 800°F → h = 1424.6 Btu/lb
At P = 900 psia:
T = 700°F → h = 1368.5 Btu/lb
T = 800°F → h = 1422.3 Btu/lb
Step 1: Interpolate at P = 850 psia for each T
At T = 700°F:
h = 1371.4 + 0.5 × (1368.5 - 1371.4) = 1369.95 Btu/lb
At T = 800°F:
h = 1424.6 + 0.5 × (1422.3 - 1424.6) = 1423.45 Btu/lb
Step 2: Interpolate at T = 750°F
f = (750 - 700)/(800 - 700) = 0.5
h = 1369.95 + 0.5 × (1423.45 - 1369.95) = 1396.7 Btu/lb
Result: h = 1396.7 Btu/lb at 850 psia, 750°F
Pipe Schedule Interpolation (ASME B36.10M)
Estimating wall thickness for intermediate pipe sizes:
Example: NPS 14 SCH 40 Wall Thickness
From B36.10M:
NPS 12 SCH 40 → t = 0.406 in, OD = 12.75 in
NPS 16 SCH 40 → t = 0.500 in, OD = 16.00 in
Note: Schedule number is not constant ratio across sizes
For intermediate NPS 14:
Linear interpolation in OD:
OD_14 = 14.00 in (standard)
f = (14.00 - 12.75)/(16.00 - 12.75) = 1.25/3.25 = 0.385
t_14 = 0.406 + 0.385 × (0.500 - 0.406)
t_14 = 0.406 + 0.036 = 0.442 in
Actual B36.10M value: t = 0.438 in (within 1%)
Flange Pressure Rating (ASME B16.5)
Interpolating pressure rating at intermediate temperatures:
Example: Class 300 Rating at 625°F
From B16.5 for Class 300 Carbon Steel:
T = 600°F → P = 535 psig
T = 650°F → P = 505 psig
Find rating at T = 625°F:
f = (625 - 600)/(650 - 600) = 0.5
P = 535 + 0.5 × (505 - 535) = 535 - 15 = 520 psig
Conservative approach: Use next lower rating (505 psig)
Engineering approach: 520 psig acceptable for design
Note: B16.5 ratings drop with temperature due to material strength loss.
Compressibility Factor Charts (Standing-Katz)
Already covered in bilinear example, but critical application for gas calculations:
- Reduced properties: P_r = P/P_c, T_r = T/T_c must be calculated first
- Chart reading: Standing-Katz charts typically have 0.05 intervals in P_r, 0.1 in T_r
- Accuracy: Bilinear interpolation gives ±0.5% Z-factor accuracy vs. chart reading
- Alternative: Dranchuk-Abou-Kassem correlation eliminates chart interpolation
Viscosity Correction (API/ASTM)
Temperature corrections for petroleum products:
Kinematic Viscosity vs. Temperature
Viscosity-temperature relationship is exponential:
ln(ln(ν + 0.7)) = A - B × ln(T) (ASTM D341)
For interpolation between two temperatures:
Use log-log linear interpolation
Given:
T₁ = 100°F → ν₁ = 150 cSt
T₂ = 200°F → ν₂ = 45 cSt
Find ν at T = 150°F:
Linear in log space:
ln(ν) = ln(ν₁) + [ln(T) - ln(T₁)] × [ln(ν₂) - ln(ν₁)]/[ln(T₂) - ln(T₁)]
ln(ν) = ln(150) + [ln(150) - ln(100)] × [ln(45) - ln(150)]/[ln(200) - ln(100)]
ln(ν) = 5.011 + 0.405 × (-1.204)/0.693
ln(ν) = 5.011 - 0.704 = 4.307
ν = exp(4.307) = 74.1 cSt
Common Engineering Applications
| Application |
Table Source |
Interpolation Type |
Typical Accuracy |
| Steam properties |
ASME Steam Tables |
Bilinear (P, T) |
< 0.5% |
| Gas compressibility Z |
Standing-Katz chart |
Bilinear (P_r, T_r) |
< 1% |
| Pipe wall thickness |
ASME B36.10M |
Linear (NPS) |
± 2-5% |
| Flange ratings |
ASME B16.5 |
Linear (T) |
< 1% |
| Vapor pressure |
Antoine equation data |
Logarithmic (T) |
< 2% |
| Viscosity |
ASTM D341 charts |
Log-log (T) |
< 3% |
Best Practices and Common Pitfalls
- Check bounds: Verify target value is within table range before interpolating
- Units consistency: Ensure all values use consistent units (absolute pressure/temperature)
- Monotonic data: Inverse interpolation requires y to be monotonically increasing or decreasing
- Avoid extrapolation: Seek additional data or use theoretical models outside table range
- Verify reasonableness: Interpolated value should fall between boundary values (unless intentional extrapolation)
- Consider curvature: For highly nonlinear data, use logarithmic or cubic spline methods
- Significant figures: Don't report more precision than original table data (typically 3-4 sig figs)
Engineering judgment: Interpolation is a mathematical tool, but engineering judgment is essential. Always verify interpolated results make physical sense, compare to similar conditions, and consider using conservative values for safety-critical calculations per ASME B31.8/B31.3/B31.4.
Software Implementation
Modern tools for interpolation:
- Excel: FORECAST.LINEAR, TREND functions; VBA for bilinear
- Python: scipy.interpolate (interp1d, interp2d, griddata, UnivariateSpline)
- MATLAB: interp1, interp2, interp3, griddedInterpolant
- Specialized: NIST REFPROP, Aspen HYSYS for thermodynamic properties