Tap to Read ➤

How To Interpolate Numbers

Padmini Krishna Mar 5, 2019
Have you ever struggled to calculate the value of a parameter in one condition when you know its values at other conditions, and numerically too, the known values are quite close? Join in with ScienceStruck and learn on how to interpolate numbers and the various methods used.

Numbers, Numbers, and Numbers!

This numerical method of statistical analysis facilitates the computation of those values of a variable that lie within the range of the given discrete data set but have not been explicitly defined.
Each one of us has used some technique of interpolation at least once in our lives. Finding the average of two numbers, drawing a line joining two points on a map to figure out which places lie between the two, and so on, are nothing but examples of very real applications of interpolation techniques.
In fact, if you look around you closely, you will notice that we use interpolation to solve majority of the issues that we face daily without even realizing it.
If only basic methods of interpolation existed, this technique would never have become an indispensable part of groundbreaking fields of study like image processing, digital signal processing, the study of fluid properties, and many more. There are many methods at levels of varying complexity that can be used in interpolation.
It can, in fact, even be done across the spatial dimensions. The more complex techniques of interpolation are best left to software that are optimized for this very purpose. However, basic techniques can be implemented using simple formulas.

Illustrative Examples


This formula which is commonly used for Linear Interpolation is a simplification of Lagrange's Method of Interpolation.
Let (x, y) be the coordinates of the point P, that we wish to obtain values for with the help of interpolation. A (x1,y1) and B (x2,y2) are two given discrete data points.


Problem Statement
The saturation pressure of water for different temperatures is given in the following table.
Temp (°C) Saturation Pressure (MPa)
20 0.0023393
25 0.0031699
30 0.004247
35 0.005629
40 0.0073849
Find the saturation pressure of water at 34°C.
From this table, it is evident that at 30°C, the saturation pressure of water is 0.004247 MPa, and at 35°C, its value is 0.005629 MPa. To calculate the value at 34°C, we substitute the given values in the linear interpolation formula as:
After calculating, we obtain the value of y, which is 0.0053526.
Thus, the saturation pressure of water at 34°C is 0.0053526. The value at any other temperature that lies between the given values can also be calculated in a similar manner.
So, as you can see, the method used to linearly interpolate numbers is really just simple mathematics. In case, the relationship between the variables in question is nonlinear, then one can use Lagrange's Interpolation Formula to perform Polynomial Interpolation of the numbers.
However, using Lagrange's Interpolation for higher order polynomials does not yield a completely accurate result. Hence, a technique of interpolation called Spline Interpolation was developed. This technique assigns different polynomial equations to different segments of the graph so as to optimize the result.
A software like MATLAB is well-suited to carry out interpolation of this nature. The linear method suffices for generic numerical problems.
We hope that our endeavor to illustrate how to interpolate numbers was successful.