Formula for interpolation. Interpolation formula between two values. Complicated types of interpolation

23.11.2021

Interpolation is a method of finding intermediate variables of a function from several already known values. For the first time, the wording "interpolation" was introduced by John Vallis in the scientific essay "The Arithmetic of the Infinite".

Linear interpolation

The simplest case of interpolation is "linear", that is, finding a value from two given points. This calculation process can be viewed as a linear function, thereby making the calculation more visual. Applying a function to a coordinate system is called an approximation. To do this, it is necessary to draw a straight line on the coordinate axis through known points. It is logical that the desired value, located between the first two points, can be found graphically, knowing the abscissa X. If the X coordinate of the desired value lies outside the known values ​​\u200b\u200b(X 1, X 2), then the calculation process is called extrapolation.

The calculator allows you to determine the value of the Y ordinate of the desired value, knowing the X and Y coordinates of the other two functions, as well as its abscissa. To calculate, you must enter the values ​​of the given two points X 1 , Y 1 and X 2 , Y 2 , as well as specify the X coordinate of the desired point, and the service will automatically determine the calculation method and perform it.

Linear interpolation formula

The following formula is used to calculate:

Calculation example

Given: coordinates of two points A(3;1.5) and B(6;5).
Find: ordinate of point C with abscissa 4.5.

After that, we substitute the values ​​\u200b\u200bin the specified formula:

Y = 5 + (1.5 - 5) / (3 - 6) (4.5 - 6) = 5 + (-3.5) / (-3) (-1.5) = 3.25.


(0,1) (2,5) (4,17)
Find equation

Tool to find the equation of a function. Lagrange Interpolating Polynomial is a method for finding the equation corresponding to a curve having some dots coordinates of it.

Answers to Questions

dCode allow to use the Lagrangian method for interpolating a Polynomial and finds back the original using known points (x,y) values.

Example: By the knowledgeof the points \((x,y) \) : \((0,0),(2,4),(4,16) \) the Polynomial Lagrangian Interpolation method allow to find back \(y = x^2 \). Once deducted, the interpolating function \(f(x) = x^2 \) allow to estimate the value for \(x = 3 \), here \(f(x) = 9 \).

The Lagrange interpolation method allows a good approximation of polynomial functions.

There are others interpolation formulas (rather than Lagrange/Rechner) such as Neville interpolation also available online on dCode.

You can edit this Q&A (add new info, improve translation, etc.) " itemscope="" itemtype="http://schema.org/Question">

What are the limits for Interpolating with Lagrange?

Since the complexity of the calculations increases with the number of points, the program is limited to 25 coordinates (with distinct x-values ​​in the Q).

Ask a new question

source code

dCode retains ownership of the source code of the script Lagrange Interpolating Polynomial online. Except explicit open source license (indicated Creative Commons / free), any algorithm, applet, snippet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt , encrypt, decipher, cipher, decode, code, translate) written in any informatic langauge (PHP, Java, C#, Python, Javascript, Matlab, etc.) which dCode owns rights will not be released for free. To download the online Lagrange Interpolating Polynomial script for offline use on PC, iPhone or Android, ask for price quote on

Interpolation. Introduction. General statement of the problem

When solving various practical problems, the results of research are drawn up in the form of tables showing the dependence of one or more measured quantities on one defining parameter (argument). Such tables are usually presented in the form of two or more rows (columns) and are used to form mathematical models.

Functions given in tables in mathematical models are usually written in tables of the form:

Y1(X)

Y(X0)

Y(X1)

Y(Xn)

Ym(X)

Y(X0)

Y(X1)

Y(Xn)

The limited information provided by such tables, in some cases, requires obtaining the values ​​of the functions Y j (X) (j=1,2,…,m) at points X that do not coincide with the nodal points of the table X i (i=0,1,2 ,…,n). In such cases, it is necessary to determine some analytical expression φ j (X) to calculate the approximate values ​​of the investigated function Y j (X) at arbitrarily given points X . The function φ j (X) used to determine the approximate values ​​of the function Y j (X) is called the approximating function (from the Latin approximo - approach). The proximity of the approximating function φ j (X) to the approximated function Y j (X) is ensured by choosing the appropriate approximation algorithm.

We will do all further considerations and conclusions for tables containing the initial data of one investigated function (ie, for tables with m=1 ).

1. Methods of interpolation

1.1 Statement of the interpolation problem

Most often, to determine the function φ(X), a statement is used, called the statement of the interpolation problem.

In this classical statement of the interpolation problem, it is required to determine the approximate analytical function φ(X) , whose values ​​at the nodal points X i match the values Y(X i ) of the original table, i.e. conditions

ϕ (X i ) = Y i (i = 0,1,2,..., n )

The approximating function φ(X) constructed in this way makes it possible to obtain a fairly close approximation to the interpolated function Y(X) within the range of values ​​of the argument [X 0 ; X n ], defined by the table. When setting the values ​​of the X argument, not owned this interval, the interpolation problem is converted into an extrapolation problem. In these cases, the accuracy

values ​​obtained when calculating the values ​​of the function φ(X) depends on the distance of the value of the argument X from X 0 if X< Х 0 , или от Х n , если Х >Xn.

In mathematical modeling, the interpolating function can be used to calculate the approximate values ​​of the function under study at intermediate points of the subintervals [Х i ; Xi+1]. Such a procedure is called table seal.

The interpolation algorithm is determined by the method of calculating the values ​​of the function φ(X). The simplest and most obvious implementation of the interpolating function is to replace the investigated function Y(X) on the interval [X i ; Х i+1 ] by a line segment connecting the points Y i , Y i+1 . This method is called the linear interpolation method.

1.2 Linear interpolation

With linear interpolation, the value of the function at the point X, located between the nodes X i and X i+1, is determined by the formula of a straight line connecting two adjacent points of the table

Y(X) = Y(Xi )+

Y(Xi + 1 ) − Y(Xi )

(X − Xi ) (i = 0,1,2, ...,n),

X i+ 1 − X i

On fig. 1 shows an example of a table obtained as a result of measurements of a certain value Y(X) . Rows of the source table are highlighted. To the right of the table there is a scatter plot corresponding to this table. The compaction of the table is made due to the calculation by the formula

(3) values ​​of the function being approximated at points Х corresponding to the midpoints of subintervals (i=0, 1, 2, … , n ).

Fig.1. Compacted table of the function Y(X) and its corresponding diagram

When considering the graph in Fig. 1 it can be seen that the points obtained as a result of the compaction of the table using the linear interpolation method lie on the segments of the straight lines connecting the points of the original table. Linear accuracy

interpolation, essentially depends on the nature of the interpolated function and on the distance between the nodes of the table X i, , X i+1 .

It is obvious that if the function is smooth, then, even with a relatively large distance between the nodes, the graph constructed by connecting the points with straight line segments makes it possible to accurately estimate the nature of the function Y(X). If the function changes quickly enough, and the distances between the nodes are large, then the linear interpolating function does not allow obtaining a sufficiently accurate approximation to the real function.

The linear interpolating function can be used for a general preliminary analysis and evaluation of the correctness of the interpolation results, which are then obtained by other more accurate methods. Such an assessment becomes especially relevant in cases where calculations are performed manually.

1.3 Interpolation by canonical polynomial

The method of interpolating a function by a canonical polynomial is based on constructing an interpolating function as a polynomial in the form [ 1 ]

ϕ (x) = Pn (x) = c0 + c1 x + c2 x 2 + ... + cn x n

The coefficients with i of the polynomial (4) are free interpolation parameters, which are determined from the Lagrange conditions:

Pn (xi ) = Yi , (i = 0 , 1 , ... , n)

Using (4) and (5), we write the system of equations

C x + c x 2

C x n = Y

C x + c x 2

C x n

C x 2

C x n = Y

The solution vector with i (i = 0, 1, 2, …, n ) of the system of linear algebraic equations (6) exists and can be found if there are no matching nodes x i . The determinant of system (6) is called the Vandermonde determinant1 and has an analytical expression [2].

1 Vandermonde's determinant called the determinant

It is equal to zero if and only if xi = xj for some . (Material from Wikipedia - the free encyclopedia)

To determine the values ​​of coefficients with i (i = 0, 1, 2, … , n)

equations (5) can be written in the vector-matrix form

A* C = Y ,

where A is the matrix of coefficients determined by the table of powers of the argument vector X= (x i 0 , x i , x i 2 , … , x i n ) T (i = 0, 1, 2, … , n)

x0 2

x0 n

xn 2

xn n

С is a column vector of coefficients with i (i = 0, 1, 2, …, n), and Y is a column vector of values ​​Y i (i = 0, 1, 2, …, n) of the interpolated function at the interpolation nodes.

The solution to this system of linear algebraic equations can be obtained by one of the methods described in [3]. For example, according to the formula

С = A− 1 Y ,

where A -1 is the matrix inverse of matrix A. To obtain the inverse matrix A -1, you can use the MIN() function, which is included in the set of standard functions of the Microsoft Excel program.

After the values ​​of the coefficients with i are determined, using the function (4), the values ​​of the interpolated function for any value of the argument x can be calculated.

Let's write the matrix A for the table shown in Fig. 1, without taking into account the rows that condense the table.

Fig.2 Matrix of the system of equations for calculating the coefficients of the canonical polynomial

Using the MOBR() function, we obtain the matrix A -1 inverse to matrix A (Fig. 3). Then, according to formula (9), we obtain the vector of coefficients С=(c 0 , c 1 , c 2 , …, c n ) T shown in fig. 4.

To calculate the values ​​of the canonical polynomial in the cell of the column Y canonical , corresponding to the value x 0 , we introduce the formula converted to the following form, corresponding to the zero row of the system (6)

=((((c 5

* x 0 + c 4 )* x 0 + c 3 )* x 0 + c 2 )* x 0 + c 1 )* x 0 + c 0

C0 +x *(c1 + x *(c2 + x*(c3 + x*(c4 + x* c5 ))))

Instead of writing " c i " in the formula entered into the cell of the Excel table, there should be an absolute reference to the corresponding cell containing this coefficient (see Fig. 4). Instead of "x 0" - a relative reference to the cell of column X (see Fig. 5).

Y canonical (0) of the value that matches the value in cell Y lin (0) . When dragging a formula written in a cell Y canonical (0), the values ​​of Y canonical (i) must also match, corresponding to the node points of the original

tables (see Fig. 5).

Rice. 5. Diagrams built according to the tables of linear and canonical interpolation

Comparison of graphs of functions built according to tables calculated using the formulas of linear and canonical interpolation, we see in a number of intermediate nodes a significant deviation of the values ​​obtained by the formulas of linear and canonical interpolation. It is more reasonable to judge the accuracy of interpolation based on obtaining additional information about the nature of the process being modeled.

- — [Ya.N. Luginsky, M.S. Fezi Zhilinskaya, Yu.S. Kabirov. English Russian Dictionary of Electrical Engineering and Power Industry, Moscow, 1999] Electrical engineering topics, basic concepts EN linear interpolation ...

linear interpolation- tiesinė interpoliacija statusas T sritis fizika atitikmenys: angl. linear interpolation vok. linear interpolation, f rus. linear interpolation, fpranc. interpolation lineaire, f … Fizikos terminų žodynas

LINEAR INTERPOLATION- a method for approximately calculating the value of the function f (x), based on replacing the function f (x). With a linear function, the parameters a and b are chosen in such a way that the values ​​L (x) coincide with the values ​​f (x) at given points x 1 and x 2: These conditions… … Mathematical Encyclopedia

interpolation- Calculation of intermediate values ​​between two known points. For example: linear linear interpolation exponential exponential interpolation The process of outputting a color image when the pixels belonging to the area between two color ... ... Technical Translator's Handbook

interpolation- and, well. interpolation f. lat. interpolatio change; alteration, distortion. 1. An insert of later origin in which l. text that does not belong to the original. ALS 1. There are many interpolations made by scribes in ancient manuscripts. Ush. 1934. 2 ... Historical Dictionary of Gallicisms of the Russian Language

Interpolation- About the function, see: Interpolant. Interpolation, interpolation in computational mathematics is a way of finding intermediate values ​​of a quantity from an existing discrete set of known values. Many of those who are faced with scientific and ... ... Wikipedia

Interpolation (Math.)

Bilinear Interpolation- Bilinear interpolation in computational mathematics is an extension of linear interpolation for functions of two variables. The key idea is to carry out the usual linear interpolation first in one direction, then in the other ... Wikipedia

Interpolation- About the function, see: Interpolant. Interpolation in computational mathematics is a way of finding intermediate values ​​of a quantity from an existing discrete set of known values. Many of those who are faced with scientific and engineering calculations often ... Wikipedia

Lookup table- (English lookup table) is a data structure, usually an array or an associative array, used to replace calculations with a simple search operation. The increase in speed can be significant, since getting data from memory ... ... Wikipedia

Many of us have come across incomprehensible terms in different sciences. But there are very few people who are not afraid of incomprehensible words, but on the contrary, they cheer up and force them to go deeper into the subject being studied. Today we will talk about such a thing as interpolation. This is a method of plotting graphs from known points, which allows predicting its behavior on specific sections of the curve with a minimum amount of information about the function.

Before moving on to the essence of the definition itself and tell about it in more detail, let's delve a little into the history.

Story

Interpolation has been known since ancient times. However, this phenomenon owes its development to several of the most prominent mathematicians of the past: Newton, Leibniz and Gregory. It was they who developed this concept using the more advanced mathematical methods available at the time. Before that, interpolation, of course, was used and used in calculations, but they did it in completely inaccurate ways, requiring a large amount of data to build a model that is more or less close to reality.

Today, we can even choose which of the interpolation methods is more suitable. Everything is translated into a computer language that can predict with great accuracy the behavior of a function in a certain area, limited by known points.

Interpolation is a rather narrow concept, so its history is not so rich in facts. In the next section, we will understand what interpolation actually is and how it differs from its opposite - extrapolation.

What is interpolation?

As we have already said, this is the general name for methods that allow you to plot a graph by points. At school, this is mainly done by compiling a table, identifying points on a graph and roughly constructing lines connecting them. The last action is done based on considerations of the similarity of the function under study to others, the type of graphs of which we know.

However, there are other, more complex and precise ways to accomplish the task of plotting a point-by-point plot. So, interpolation is actually a "prediction" of the behavior of a function in a specific area, limited by known points.

There is a similar concept associated with the same area - extrapolation. It is also a prediction of the graph of a function, but beyond the known points of the graph. With this method, a prediction is made based on the behavior of a function over a known interval, and then this function is applied to an unknown interval as well. This method is very convenient for practical application and is actively used, for example, in the economy to predict ups and downs in the market and to predict the demographic situation in the country.

But we have deviated from the main topic. In the next section, we will understand what interpolation is and what formulas can be used to perform this operation.

Types of interpolation

The simplest type is nearest neighbor interpolation. With this method, we get a very approximate plot consisting of rectangles. If you have seen at least once an explanation of the geometric meaning of the integral on a graph, then you will understand what kind of graphical form we are talking about.

In addition, there are other methods of interpolation. The most famous and popular are associated with polynomials. They are more accurate and allow predicting the behavior of a function with a rather meager set of values. The first interpolation method we will look at is linear polynomial interpolation. This is the easiest method from this category, and for sure each of you used it at school. Its essence lies in the construction of straight lines between known points. As you know, a single straight line passes through two points of the plane, the equation of which can be found based on the coordinates of these points. Having built these straight lines, we get a broken graph, which, at the very least, but reflects the approximate values ​​of the functions and in general terms coincides with reality. This is how linear interpolation works.

Complicated types of interpolation

There is a more interesting, but at the same time more complex way of interpolation. It was invented by the French mathematician Joseph Louis Lagrange. That is why the calculation of interpolation by this method is named after him: interpolation by the Lagrange method. The trick here is this: if the method described in the previous paragraph uses only a linear function for calculation, then the Lagrange expansion also involves the use of polynomials of higher degrees. But it is not so easy to find the interpolation formulas themselves for different functions. And the more points are known, the more accurate the interpolation formula is. But there are many other methods as well.

There is also a more perfect and closer to reality method of calculation. The interpolation formula used in it is a collection of polynomials, the application of each of which depends on the section of the function. This method is called a spline function. In addition, there are also ways to do such a thing as interpolation of functions of two variables. There are only two methods here. Among them are bilinear or double interpolation. This method allows you to easily build a graph by points in three-dimensional space. Other methods will not be affected. In general, interpolation is a universal name for all these methods of plotting graphs, but the variety of ways in which this action can be performed forces us to divide them into groups depending on the type of function that is subject to this action. That is, interpolation, an example of which we considered above, refers to direct methods. There is also inverse interpolation, which differs in that it allows you to calculate not a direct, but an inverse function (that is, x from y). We will not consider the latter options, since it is quite difficult and requires a good mathematical knowledge base.

Let's move on to perhaps one of the most important sections. From it we learn how and where the set of methods we are discussing is applied in life.

Application

Mathematics, as you know, is the queen of sciences. Therefore, even if at first you do not see the point in certain operations, this does not mean that they are useless. For example, it seems that interpolation is a useless thing, with the help of which only graphs can be built, which few people need now. However, in any calculations in engineering, physics and many other sciences (for example, biology), it is extremely important to present a fairly complete picture of the phenomenon, while having a certain set of values. The values ​​themselves, scattered over the graph, do not always give a clear idea of ​​the behavior of the function in a particular area, the values ​​of its derivatives and the points of intersection with the axes. And this is very important for many areas of our lives.

And how will it be useful in life?

It can be very difficult to answer such a question. But the answer is simple: no way. This knowledge is of no use to you. But if you understand this material and the methods by which these actions are carried out, you will train your logic, which will be very useful in life. The main thing is not the knowledge itself, but the skills that a person acquires in the process of studying. After all, it is not for nothing that there is a saying: "Live for a century - learn for a century."

Related concepts

You can understand for yourself how important this area of ​​mathematics was (and still is) by looking at the variety of other concepts associated with this. We have already talked about extrapolation, but there is also an approximation. Maybe you've heard this word before. In any case, we also analyzed what it means in this article. Approximation, like interpolation, are concepts related to plotting function graphs. But the difference between the first and the second is that it is an approximate construction of a graph based on similar known graphs. These two concepts are very similar to each other, and the more interesting it is to study each of them.

Conclusion

Mathematics is not as difficult a science as it seems at first glance. She's rather interesting. And in this article we tried to prove it to you. We looked at the concepts associated with plotting graphs, learned what double interpolation is, and analyzed with examples where it is used.