[go: up one dir, main page]

0% found this document useful (0 votes)
42 views13 pages

Lagrange Interpolation

The document discusses curve fitting using Lagrange interpolation polynomials. It explains that Lagrange interpolation finds a unique polynomial of order n that passes through n+1 data points without calculating divided differences. The document provides examples of linear, quadratic, and cubic Lagrange interpolation polynomials. It also works through an example of fitting a 3rd order Lagrange polynomial to a set of 4 data points.

Uploaded by

Benj Mendoza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views13 pages

Lagrange Interpolation

The document discusses curve fitting using Lagrange interpolation polynomials. It explains that Lagrange interpolation finds a unique polynomial of order n that passes through n+1 data points without calculating divided differences. The document provides examples of linear, quadratic, and cubic Lagrange interpolation polynomials. It also works through an example of fitting a 3rd order Lagrange polynomial to a set of 4 data points.

Uploaded by

Benj Mendoza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

30 Mar 2020

Numerical
Methods
Module 3 part 3
By Carlos Hortinela IV

1
30 Mar 2020

Curve Fitting

Interpolation
Interpolation is the most common method to estimate
intermediate values between precise data point. The
common method used for this purpose is polynomial
interpolation. Recall the formula for the nth order
polynomial is
f n ( x)  a0  a1 x  a 2 x 2  a3 x 3  ...  a n x n
For n + 1 data points, there is only one polynomial of
order n that passes through all the points. Polynomial
interpolation consists of determining the unique nth-
order polynomial that fits n + 1 data points.

2
30 Mar 2020

Curve Fitting

Although there is one nth order polynomial that fits n + 1


data points, there is a variety of mathematical formats in
which this polynomial can be expressed.

3
30 Mar 2020

Curve Fitting

Lagrange Interpolating Polynomials


The Lagrange interpolating polynomial is simply a
reformation of the Newton’s polynomial that avoids
the computation of divided differences. It can be
represented concisely as
n
f n ( x)   Li ( x) f ( xi )
i 0

n x  xj
Li( x)  
j  0; j  i xi  x j

4
30 Mar 2020

Curve Fitting

Linear (1st order) fit using Lagrange interpolation

5
30 Mar 2020

Curve Fitting

Linear (1st order) fit using Lagrange interpolation

6
30 Mar 2020

Curve Fitting

Linear (1st order) fit using Lagrange interpolation

7
30 Mar 2020

Curve Fitting

The summation of all the products designated by the


Lagrange terms creates a unique nth order polynomial
that passes exactly through all n + 1 data points.

First order interpolation (Linear)


( x  x1 ) ( x  x0 )
f 1 ( x)  f ( x0 )  f ( x1 )
( x0  x1 ) ( x1  x0 )

8
30 Mar 2020

Curve Fitting

Quadratic (2nd order) fit using Lagrange interpolation

9
30 Mar 2020

Curve Fitting

Second order interpolation (quadratic or parabolic)


( x  x1 )( x  x2 ) ( x  x0 )( x  x2 )
f 2 ( x)  f ( x0 )  f ( x1 )
( x0  x1 )( x0  x2 ) ( x1  x0 )( x1  x2 )
( x  x0 )( x  x1 )
 f ( x2 )
( x2  x0 )( x2  x1 )
Third order interpolation (cubic )
( x  x1 )( x  x2 )( x  x3 ) ( x  x0 )( x  x2 )( x  x3 )
f 3 ( x)  f ( x0 )  f ( x1 )
( x0  x1 )( x0  x2 )( x0  x3 ) ( x1  x0 )( x1  x2 )( x1  x3 )
( x  x0 )( x  x1 )( x  x3 ) ( x  x0 )( x  x1 )( x  x2 )
 f ( x2 )  f ( x3 )
( x2  x0 )( x2  x1 )( x2  x3 ) ( x3  x0 )( x3  x1 )( x3  x2 )

10
30 Mar 2020

Curve Fitting

Example: Fit the following data using Lagrange


Interpolating Polynomial.
x 1 4 -3 3
f(x) -4 59 -32 22

Label the following data points,


x0 = 1, f(x0) = -4; x1 = 4, f(x1) = 59; x2 = -3, f(x2) = -32; x3 = 3,
f(x3) = 22;

11
30 Mar 2020

Curve Fitting

Third order Lagrange polynomial function,


𝑓3 𝑥 = 𝐿0(𝑥 𝑓(𝑥0 + 𝐿1(𝑥 𝑓(𝑥1 + 𝐿2(𝑥 𝑓(𝑥2 + 𝐿3(𝑥 𝑓(𝑥3

( x  x1 )( x  x2 )( x  x3 ) ( x  x0 )( x  x2 )( x  x3 )
f 3 ( x)  f ( x0 )  f ( x1 )
( x0  x1 )( x0  x2 )( x0  x3 ) ( x1  x0 )( x1  x2 )( x1  x3 )
( x  x0 )( x  x1 )( x  x3 ) ( x  x0 )( x  x1 )( x  x2 )
 f ( x2 )  f ( x3 )
( x2  x0 )( x2  x1 )( x2  x3 ) ( x3  x0 )( x3  x1 )( x3  x2 )

Substituting the given values then,


𝑥−4 𝑥+3 𝑥−3 𝑥−1 𝑥+3 𝑥−3
𝑓3 𝑥 = (−4 + (59 +
1−4 1+3 1−3 4−1 4+3 4−3
𝑥−1 𝑥−4 𝑥−3 𝑥−1 𝑥−4 𝑥+3
(−32 + (22)
−3−1 −3−4 −3−3 3−1 3−4 3+3

12
30 Mar 2020

Curve Fitting

Evaluating each Lagrange term then,


1 3
𝐿0(𝑥 𝑓(𝑥0 = − 𝑥 − 4𝑥 2 − 9𝑥 + 36
6
59 3
𝐿1(𝑥 𝑓(𝑥1 = 𝑥 − 𝑥 2 − 9𝑥 + 9
21
4 3
𝐿2(𝑥 𝑓(𝑥2 = 𝑥 − 8𝑥 2 − 19𝑥 − 12
21
−11 3
𝐿3(𝑥 𝑓(𝑥3 = 𝑥 − 2𝑥 2 − 11𝑥 + 12
6
𝑓3 𝑥 = 𝑥 3 − 5
x 1 4 -3 3
f(x) -4 59 -32 22

13

You might also like