mat 4725 numerical analysis section 3.1 interpolation and the lagrange polynomial
TRANSCRIPT
![Page 1: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/1.jpg)
MAT 4725Numerical Analysis
Section 3.1
Interpolation and the Lagrange Polynomial
http://myhome.spu.edu/lauw
![Page 2: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/2.jpg)
MCM Monday
Non-class members are invited Please share! Office names and $100
![Page 3: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/3.jpg)
HW 7b (d)
![Page 4: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/4.jpg)
HW 7b (e)
![Page 5: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/5.jpg)
Material Temperature.Temp
x
![Page 6: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/6.jpg)
Material Temperature.Temp
x5
?
Interpolation
![Page 7: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/7.jpg)
3.1 Goal
Find a polynomial P(x) that passes through all the data points (xi,yi), i=0,1,2,…,n
Use P(x) to estimate the function values
![Page 8: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/8.jpg)
A Simple Situation
Suppose there are only 2 data points:
(x0,f(x0)), (x1,f(x1))
Let us find a degree one poly. P(x) that passes through them.
![Page 9: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/9.jpg)
A Simple Situation
Suppose there are only 2 data points:
(x0,f(x0)), (x1,f(x1))
Let us find a degree one poly. P(x) that passes through them
Q: Why degree one?
![Page 10: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/10.jpg)
A Simple Situation
Suppose there are only 2 data points:
(x0,f(x0)), (x1,f(x1))
Let us find a degree one poly. P(x) that passes through them
Q: We know easier way to find a straight line through two points. Why the trouble?
![Page 11: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/11.jpg)
In General…
Suppose there are (n+1) data points:
(xi,f(xi)) i=0,1,2,…,n
Let us find a degree n poly. P(x) that passes through them
![Page 12: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/12.jpg)
n-th Lagrange Interpolating Poly.
0
0 0 1 1
( ) ( ) ( )
( ) ( ) ( ) ( ) ( ) ( )
n
k kk
n n
P x f x L x
f x L x f x L x f x L x
![Page 13: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/13.jpg)
Example 1
Find the 2nd Lagrange Polynomial P(x)
0 1 2
1( ) ; 2, 2.5, 4f x x x x
x
![Page 14: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/14.jpg)
Example 1 0 1 2
1( ) ; 2, 2.5, 4f x x x x
x
20
21
22
2
( ) 6.5 10
4( ) 6 8
31
( ) 4.5 53
( ) 0.05 0.425 1.15
L x x x
L x x x
L x x x
P x x x
![Page 15: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/15.jpg)
Example 1 0 1 2
1( ) ; 2, 2.5, 4f x x x x
x
1y
x
20.05 0.425 1.15y x x
![Page 16: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/16.jpg)
Example 1 0 1 2
1( ) ; 2, 2.5, 4f x x x x
x
1y
x
20.05 0.425 1.15y x x
Q: For what range will P(x) give good estimations?
![Page 17: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/17.jpg)
Error Formula
We will skip the error analysis (similar to Taylor poly.)
We will see this again in section 4.1
( 1)
0 1
( ( ))( ) ( ) ( )( ) ( )
( 1)!
where [a,b], ( ) ( , )
n
n
i
f xf x P x x x x x x x
n
x x a b
![Page 18: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/18.jpg)
Classwork 1, 2
Write a program to compute the 2nd Lagrange Polynomial
INPUT: (xi,f(xi)) i=0,1,2 OUTPUT: P(x)
![Page 19: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/19.jpg)
Remark #1
(xi,f(xi)) are passed into the program as two arrays:xx=[x0,x1,x2], yy=[y0,y1,y2]
>xx:=array(0..2,[2, 2.5, 4]);
yy:=array(0..2,[0.5, 0.4, 0.25]);
![Page 20: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/20.jpg)
Hints
Hints are provided in the handout.
![Page 21: MAT 4725 Numerical Analysis Section 3.1 Interpolation and the Lagrange Polynomial](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649eb75503460f94bc09c1/html5/thumbnails/21.jpg)
Homework
Download Homework from the web. Read the first 4 pages of 3.5 for
Wednesday