[Switch] Numerical Analysis - The Lagrange interpolation polynomial interpolation

I. Introduction

  Consider a practical example, when we press the button sine calculator, what happens? We all know that there is a calculator can handle the addition and multiplication of hardware, but it is how to calculate the sine of a number of it? Polynomial interpolation can solve this problem. We will revisit this issue in the future. Currently, we first learn what is and how interpolation interpolation.

Second, what is interpolated

  As shown below, we assume that a set of data points collected (x, y) (x, y) (x, y), such as (0,1), (2,2), (3,4) (0, 1), (2,2), (3,4) (0, 1), (2, 2), (3, 4). There is a parabola through the three points, we put the parabolic called after the three point quadratic interpolation polynomial .

This leads to the definition of the mathematical interpolation, as follows:

DEFINITIONS interpolation]   If P (xi) = yi (1⩽i⩽n ) P (xi) = yi (1⩽i⩽n) P (x_i) = y_i (1 \ leqslant i \ leqslant n), then the function y = P (x) y = P (x) interpolating the data points

(x1,y1),⋅⋅⋅,(xn,yn)(x_1, y_1), \cdot \cdot \cdot , (x_n, y_n)

 Simply put, that is, if a function by a set of data points, then call this function interpolating this set of data points.

Two, Lagrange interpolation

2.1 discussion

  Now that we know what is interpolation , please consider a question, if I only know that a set of n data points (x1, y1), ⋅⋅⋅, (xn, yn) (x_1, y_1), \ cdot \ cdot \ cdot, (x_n, y_n), we would like to request a polynomial interpolation can set all the data points. And the degree of the polynomial is d = n-1d = n - 1 times, how to do?

  Lagrange interpolation formula gives the answer for this problem. For example, assuming that a point (x1, y1), (x2, y2), (x3, y3) (x_1, y_1), (x_2, y_2), (x_3, y_3), then the secondary interpolation polynomial is interpolated by the Lagrange polynomial is given as follows:

P2(x)=y1(x−x2)(x−x3)(x1−x2)(x1−x3)+y2(x−x1)(x−x3)(x2−x1)(x2−x3)+y3(x−x1)(x−x2)(x3−x1)(x3−x2)P_2(x) = y_1 \frac{(x - x_2)(x - x_3)}{(x_1 - x_2)(x_1 - x_3)} + y_2 \frac{(x - x_1)(x - x_3)}{(x_2 - x_1)(x_2 - x_3)} + y_3 \frac{(x - x_1)(x - x_2)}{(x_3 - x_1)(x_3 - x_2)}

   So one might ask, such a polynomial must be correct, the answer is: yes . We can verify:

1. When x time = x1x = x1, P2 (x1) = y1P_2 (x1) = y1;

2. When x = x2x = x2, P2 (x2) = y2P_2 (x2) = y2;

3. When x time = x3x = x3, P2 (x3) = y3P_2 (x3) = y3;

   We only consider these three points, because we only have three points, on three points, the polynomial interpolation are successful, and therefore, this polynomial must be correct. (Note that this polynomial on variable xx is 2 times)

2.2 mathematical definition

Generally, it is assumed nn given points (x1, y1), ⋅⋅⋅, (xn, yn) (x_1, y_1), \ cdot \ cdot \ cdot, (x_n, y_n), then for n between 1 and each of definable kk

Lk(x)=(x−x1)⋅⋅⋅(x−xk−1)(x−xk+1)⋅⋅(x−xn)(xk−x1)⋅⋅⋅(xk−xk−1)(xk−xk+1)⋅⋅(xk−xn)L_k(x) = \frac{(x - x_1) \cdot \cdot \cdot (x - x_{k -1})(x - x_{k + 1}) \cdot \cdot (x - x_n)}{(x_k - x_1) \cdot \cdot \cdot (x_k - x_{k -1})(x_k - x_{k + 1}) \cdot \cdot (x_k - x_n)}

 An interesting property LkL_k are:

1. Lk (x k) = 1L_k (x_k) = 1

2. Lk(xj)=0(j≠k)L_k(x_j) = 0 \qquad (j \neq k)

  Thus, the definition of n-1n - 1 times Lagrange Polynomial

Pn−1(x)=y1L1(x)+⋅⋅⋅+ynLn(x)P_{n - 1}(x) = y_1 L_1(x) + \cdot \cdot \cdot + y_n L_n(x)

2.3 and the existence and uniqueness

Some people may ask, for a given n data points, which is the only polynomial interpolation do? That can only be made to a polynomial interpolation of these n points do? The answer is: not .

  We think we know nn coordinate points for two-dimensional plane, we certainly can draw an infinite line to pass through these points, each line corresponds to that of a polynomial. So what is the problem lie?

  Polynomial is infinite, however, data points for interpolation polynomial nn, which is less than the maximum number of times equal to n-1n -, such a polynomial, can only be only one. Use mathematics to describe this problem as follows:

【theorem】

  Set (x1, y1), ⋅⋅⋅, (xn, yn) (x_1, y_1), \ cdot \ cdot \ cdot, (x_n, y_n) nn is xix_i mutually different points in the plane, and then there is a there is only one number is less than n-1n - 1 times polynomial satisfies

P(xi)=yi,i=1,⋅⋅⋅,nP(x_i) = y_i,  \qquad i = 1,  \cdot \cdot \cdot, n

【prove】

(1) Existence of: Existence of explicit formula derived by the Lagrange interpolation.

  (2) Uniqueness: assume there exist two such formulas, for example, P (x) P (x) and Q (x) Q (x), which is at most n-1n - 1 times, and are all interpolation points nn , that is:

P(x1)=Q(x1)=y1,P(x2)=Q(x2)=y2,⋅⋅⋅,P(xn)=Q(xn)=ynP(x_1) = Q(x_1) = y_1, P(x_2) = Q(x_2) = y_2, \cdot \cdot \cdot, P(x_n) = Q(x_n) = y_n。

  There H (x) = P (x) -Q (x) H (x) = P (x) - Q (x), obviously, is the number most HH n-1n - 1, and the notes

H(x1)=H(x2)=⋅⋅⋅=H(xn)H(x_1) = H(x_2) = \cdot \cdot \cdot = H(x_n)

  I.e., there are HH nn different zero. According to fundamental theorem of algebra, a polynomial of degree dd, except that it is identically zero polynomial, there may be up dd zeros. So there

H≡0H \equiv 0

  then,

P(x)≡Q(x)P(x) \equiv Q(x)

Thus, only the presence of the number less than or equal n-1n - the polynomial P 1 (x) P (x) and nn interpolation points (xi, yi) (x_i, y_i).

2.4 Examples

[Title] required interpolation point at (0,2), (1,1), (2,0), (3, -1), (0, 2), (1, 1), (2, 0), ( the number 3, -1) is less than or equal to 3 polynomials.

[Solution] Lagrange form as follows:

P(x)=2(x−1)(x−2)(x−3)(0−1)(0−2)(0−3)+1(x−0)(x−2)(x−3)(1−0)(1−2)(1−3)+0(x−0)(x−1)(x−3)(2−0)(2−1)(2−3)+(−1)(x−0)(x−1)(x−2)(3−0)(3−1)(3−2)=−x+2P(x) = 2 \frac{(x - 1)(x - 2)(x - 3)}{(0 - 1)(0 - 2)(0 - 3)} + 1 \frac{(x - 0)(x - 2)(x - 3)}{(1 - 0)(1 - 2)(1 - 3)} + 0 \frac{(x - 0)(x - 1)(x - 3)}{(2 - 0)(2 - 1)(2 - 3)} + (-1) \frac{(x - 0)(x - 1)(x - 2)}{(3 - 0)(3 - 1)(3 - 2)} = -x + 2

---------------------
Author: Essays Qling of
origin: CNBLOGS
Original: https://www.cnblogs.com/Qling/p/9764941.html
copyright notice : In this paper the author original article, reproduced, please attach Bowen link!

Guess you like

Origin www.cnblogs.com/shawnchou/p/11498988.html