Академический Документы
Профессиональный Документы
Культура Документы
(4)
1
Lagrange Interpolation
x0 … x, f(x0) … y
(x − x )
n
i ( x) = (x − x )
j =0, j i
j
i j
2
Examples:
x0 = 1, x2 = 4, n = 3 find x1 ?
𝑥2 − 𝑥0
ℎ= , 𝑥1 = 𝑥2 − ℎ
𝑛
4 − 1
ℎ= = 1 , 𝑥1 = 4 − 1 = 3
3
x0 = 0, x1 = 3, n = 3 find x2 ?
𝑥1 − 𝑥0
ℎ= , 𝑥2 = 𝑥1 − ℎ
𝑛
3 − 2 1 1 8
ℎ= = , 𝑥2 = 3 − =
3 3 3 3
x1 = 2, x3 = 4, n = 2 find x2 ?
𝑥3 − 𝑥1
ℎ= , 𝑥2 = 𝑥3 − ℎ
𝑛
4 − 2
ℎ= = 1 , 𝑥2 = 4 − 1 = 3
2
Example:
x
With n = 2, f(x) = 2 , in the interval [0, 2] find f(x) using Lagrange
interpolation and find the value of x = √2
3
Solution
x0 = 0, x2 = 2, n = 2 then get x1
𝑥2 − 𝑥0
ℎ= , 𝑥1 = 𝑥2 − ℎ
𝑛
2 − 0
ℎ= = 1 , 𝑥1 = 2 − 1 = 3
2
(√2 − 1)(√2 − 2)
ℓ2,0 (√2) = = −0.12132
2
√2 (√2 − 2)
ℓ2,1 (√2) = = 0.82842
−1
(√2 − 1)(√2 − 2)
ℓ2,2 (√2) = = 0.29289
2
4
Example:
Find f(4.5) with Lagrange interpolation when n=2 and
f(3)= -2, f(9) = 3, f(4) = 5
----------------
Example:
To find how much heat is required to bring a kettle of water to its
boiling point, you are asked to calculate the specific heat of water at
61C. The specific heat of water is given as a function of time in
Table
5
Taylor's Series
Given data is f(X), X0
ℎ ′ ℎ2 ′′
𝑓 (𝑥 ) = 𝑓 (𝑥0 ) + 𝑓 (𝑥0 ) + 𝑓 (𝑥0 )
1! 2!
ℎ3 ′′′ ℎ𝑛 ′𝑛
+ 𝑓 (𝑥0 ) + ⋯ + 𝑓 (𝑥0 )
3! 𝑛!
h = X – X0
𝑓′(𝑥0 ) = (𝑒𝑥 )′ = 𝑒0 = 1
h = x – x0 = x – 0 = x
6
Notes on derivative:
7
Lagrange Example