3. Numerical Methods I

Interpolation

Interpolation in Engineering Computation

students, imagine you have temperature readings at $8$ AM, $10$ AM, and noon, but you need a value at $9$ AM to plan a process or predict performance 🌡️. In engineering, this kind of “fill in the missing value” task happens all the time. Interpolation is the mathematical way to estimate a value between known data points.

What Interpolation Means

Interpolation is a numerical method used to estimate a value of a function at a point inside the range of known data. If you know values of a function at certain inputs, interpolation helps you approximate the value at an input between them.

For example, suppose a sensor measures displacement at $x=1$ and $x=3$, and you want the value at $x=2$. Interpolation gives a method to estimate that value from the available data. This is different from guessing randomly because it uses a mathematical rule based on the data.

The main idea is simple: if a curve passes through known points, then the curve can be used to estimate missing values. In engineering computation, this is useful for tables, experimental data, graphs, calibration curves, and computer-based modeling.

Some important terms are:

  • Data points: known values such as $\left(x_0,y_0\right)$, $\left(x_1,y_1\right)$, and so on.
  • Interpolating function: the curve or formula built from the data.
  • Independent variable: the input, often written as $x$.
  • Dependent variable: the output, often written as $y$.

A basic goal of interpolation is to build a function $P\left(x\right)$ such that it matches the known data values exactly, meaning $P\left(x_i\right)=y_i$ for the given points.

Why Engineers Use Interpolation

Interpolation is everywhere in engineering because real systems often produce data only at limited points. Machines may be tested at selected speeds, materials may be measured at certain temperatures, and weather stations may only report at fixed times. But engineers often need values in between those points.

Here are common examples:

  • A civil engineer may need soil strength at a moisture level that was not directly tested.
  • A mechanical engineer may estimate stress values between points in an experimental table.
  • An electrical engineer may use calibration data to convert sensor voltage into physical units.
  • A computer engineer may use lookup tables in software to speed up calculations.

Interpolation is especially useful when the formula behind the data is unknown or too complicated. Instead of deriving a full theoretical model, engineers can use the measured data to estimate missing values accurately enough for practical work.

This topic belongs to Numerical Methods I because it uses numerical approximations rather than exact symbolic formulas. It is related to root-finding and curve fitting, but it has a different purpose. Root-finding looks for where a function equals zero, while interpolation builds a function that matches known points. Curve fitting usually allows some error, while interpolation usually passes exactly through the data points.

Linear Interpolation: The Simplest Method

The simplest interpolation method is linear interpolation. It assumes the data between two points changes in a straight line. This is often a good first estimate when the interval is small.

If you know two points $\left(x_0,y_0\right)$ and $\left(x_1,y_1\right)$, then the linear interpolation formula for a value at $x$ is

$$

$P\left(x\right)=y_0+\frac{\left(x-x_0\right)\left(y_1-y_0\right)}{x_1-x_0}$

$$

This formula says: start at $y_0$ and move proportionally toward $y_1$.

Example

Suppose a battery’s voltage is $12.0$ V at $x=0$ hours and $11.4$ V at $x=2$ hours. Estimate the voltage at $x=1$ hour.

Using linear interpolation,

$$

$P\left(1\right)=12.0+\frac{\left(1-0\right)\left(11.4-12.0\right)}{2-0}$

$$

$$

$P\left(1\right)=12.0+\frac{-0.6}{2}=11.7$

$$

So the estimated voltage at $1$ hour is $11.7$ V.

Linear interpolation is easy and fast, but it may not be accurate if the true relationship curves strongly. In that case, higher-order methods may work better.

Polynomial Interpolation: Matching More Points

When more accuracy is needed, engineers often use polynomial interpolation. A polynomial can pass through several data points exactly. If there are $n+1$ data points, there is a unique polynomial of degree at most $n$ that fits them, provided the $x$-values are distinct.

A polynomial interpolant might look like

$$

$P\left(x\right)=a_0+a_1x+a_2x^2+\cdots+a_nx^n$

$$

The coefficients $a_0,a_1,\dots,a_n$ are chosen so that the polynomial matches the data.

Why not always use a very high degree polynomial?

Although higher-degree polynomials can fit more points, they can also behave badly between points or near the ends of the interval. This is a known issue in numerical methods. A polynomial that matches the data exactly may still wiggle too much and give poor estimates. Because of this, engineers often use the lowest degree that gives acceptable accuracy.

Lagrange Interpolation

One important polynomial method is Lagrange interpolation. It builds the interpolating polynomial as a sum of special basis polynomials.

For data points $\left(x_0,y_0\right),\left(x_1,y_1\right),\dots,\left(x_n,y_n\right)$, the interpolating polynomial is

$$

$P\left(x\right)=\sum_{i=0}^{n} y_iL_i\left(x\right)$

$$

where

$$

$L_i\left(x\right)=\prod_{j=0,\,j\neq i}^{n}\frac{x-x_j}{x_i-x_j}$

$$

Each basis polynomial $L_i\left(x\right)$ is designed so that $L_i\left(x_i\right)=1$ and $L_i\left(x_j\right)=0$ for $j\neq i$.

This means the polynomial passes through every data point exactly. While the formula may look long, its logic is clean: each data point contributes only to its own location and not to the others.

Newton’s Divided Difference Method

Another important approach is Newton interpolation using divided differences. This method is often preferred in computation because it is efficient when new data points are added.

The Newton form is

$$

P$\left($x$\right)$=a_0+a_$1\left($x-x_$0\right)$+a_$2\left($x-x_$0\right)$$\left($x-x_$1\right)$+$\cdots$

$$

The coefficients $a_0,a_1,a_2,\dots$ come from divided differences based on the data. The advantage is that if a new point is added, the polynomial can often be updated more easily than rebuilding everything from scratch.

This is useful in engineering software where data may arrive step by step from experiments or sensors.

Interpolation Tables and Practical Data Use

Interpolation is not only about formulas. It is also about using tables and graphs wisely 📊. Engineers often work with tabulated values such as steam tables, material property tables, or trigonometric tables.

Suppose a table gives the density of a fluid at certain temperatures, and you need a value between them. If the temperatures are close together, linear interpolation may be enough. If the property changes more quickly, polynomial interpolation may be needed.

A practical rule is to check whether the data changes smoothly. If the change is nearly straight, linear interpolation is usually fine. If the shape bends, a higher-order method may capture the pattern better.

Good interpolation also depends on data quality. If the measured values contain noise, an exact interpolating polynomial may fit the noise too, which can be misleading. In such cases, engineers may prefer curve fitting instead, where the model approximates the data rather than passing through every point.

Interpolation and Error Awareness

No numerical method is complete without thinking about error. Interpolation error is the difference between the true value and the estimated value. If the real function is $f\left(x\right)$ and the interpolated estimate is $P\left(x\right)$, then the error is

$$

$E\left(x\right)=f\left(x\right)-P\left(x\right)$

$$

The error is usually smaller when the interpolation point is near the known data and when the function is smooth.

Several factors affect accuracy:

  • The spacing of the data points.
  • The degree of the polynomial.
  • The smoothness of the actual function.
  • The presence of measurement noise.

Interpolation works best when values are estimated inside the data range. Estimating outside the range is called extrapolation, and it is riskier because the behavior outside the known data may differ greatly. Engineers should be careful not to confuse interpolation with extrapolation.

How Interpolation Fits in Numerical Methods I

Interpolation fits neatly into the larger study of Numerical Methods I. Root-finding helps solve equations like $f\left(x\right)=0$. Interpolation helps reconstruct a function from known values. Curve fitting helps create a model that approximately matches data. Together, these methods let engineers work with incomplete or imperfect information.

In a workflow, interpolation often appears in the middle of a larger analysis. For example:

  1. Collect measurements from an experiment.
  2. Use interpolation to estimate missing values.
  3. Use the estimated values in a formula or simulation.
  4. Compare results with theory or design requirements.

This makes interpolation a bridge between raw data and usable engineering decisions. It is especially important when software or calculators need fast approximate values from sparse data.

Conclusion

Interpolation is a core numerical method for estimating values between known data points. It is widely used in engineering because real-world data are often incomplete, measured at fixed intervals, or stored in tables. Linear interpolation gives a quick estimate, while polynomial methods such as Lagrange and Newton interpolation can produce more exact fits through multiple points. students, understanding interpolation helps you move from data to decisions, which is a major goal of Engineering Computation 🛠️. It also prepares you for later topics in numerical methods, especially curve fitting, error analysis, and computational modeling.

Study Notes

  • Interpolation estimates values inside the range of known data.
  • The goal is to build an interpolating function $P\left(x\right)$ such that $P\left(x_i\right)=y_i$.
  • Linear interpolation uses two points and assumes a straight-line change.
  • The linear interpolation formula is $P\left(x\right)=y_0+\frac{\left(x-x_0\right)\left(y_1-y_0\right)}{x_1-x_0}$.
  • Polynomial interpolation can pass through several data points exactly.
  • Lagrange interpolation uses basis polynomials $L_i\left(x\right)$.
  • Newton interpolation uses divided differences and is convenient when adding new points.
  • Interpolation is different from curve fitting because interpolation usually matches the data exactly.
  • Interpolation is different from extrapolation because extrapolation estimates values outside the data range.
  • Error depends on data spacing, smoothness, polynomial degree, and measurement noise.
  • Interpolation is an important part of Numerical Methods I because it connects data, models, and engineering decisions.

Practice Quiz

5 questions to test your understanding

Interpolation — Engineering Computation | A-Warded