Lagrange Interpolating Polynomials - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Lagrange Interpolating Polynomials

Description:

... order Lagrange Polynomials (Note that the Lagrange polynomials ... Function produces the kth Lagrange polynomial % for a set of n 1 pts. Note: k ranges from 1 ... – PowerPoint PPT presentation

Number of Views:1770
Avg rating:3.0/5.0
Slides: 11
Provided by: alfe
Category:

less

Transcript and Presenter's Notes

Title: Lagrange Interpolating Polynomials


1
Lagrange Interpolating Polynomials
1st-order Lagrange Polynomials
n1
L1(x1)1, L1(x0)0
L0(x0)1, L0(x1)0
2
f(x)
f(x1)
f(x0)
x0
x1
3
f(x)
f(x1)
f(x0)
1
L0
L1
x0
x1
4
f(x)
f(x1)
f(x0)
L0(x)f(x0)
L1
x0
x1
5
f(x)
f(x1)
f(x0)
L1(x)f(x1)
L0(x)f(x0)
x0
x1
6
f(x)
f(x1)
f(x0)
f1(x) L0(x)f(x0) L1(x)f(x1)
1
L0
L1
x0
x1
7
2nd-order Lagrange Polynomials
L0(x0)1, L0(x1)L0(x2)0
n2
L1(x1)1, L1(x0)L1(x2)0
L2(x2)1, L2(x0)L2(x1)0
(Note that the Lagrange polynomials depend on
x-values only, not y-values!!)
8
2nd-order example
Data points (1,2), (2,3), (3,2.5)
x0
x1
x2
9
4th-order example
Data points (1,2), (2,3), (3,1), (4,-1),
(5,2)
x0
x1
x2
x3
x4
10
Matlab Code
Function produces the kth Lagrange polynomial
for a set of n1 pts. Note k ranges from 1 to
n1 rather than 0 to n because vector indices
must be positive in Matlab function
Llagrange(x,Xpts,k) L 1 for
j1length(Xpts) if jk L
L.(x-Xpts(j))/(Xpts(k)-Xpts(j))
end end LL() make L a column vector
Write a Comment
User Comments (0)
About PowerShow.com