0% found this document useful (0 votes)
54 views21 pages

Part (14) - Interpolation 2

The document describes Lagrange interpolation and Newton's divided differences interpolation. It provides examples of using both methods to find interpolating polynomials of different orders (linear, quadratic, cubic) and evaluate them. Specifically: - Lagrange interpolation constructs polynomials using Lagrange basis polynomials, while Newton's method uses divided differences to find the coefficients. - Higher order polynomials require more data points - a linear polynomial needs 2 points, quadratic needs 3, and cubic needs 4. - Examples show constructing the polynomials for different datasets and evaluating them to find function values at specific points. - The last example sets up using Newton's method to find the acceleration for a dataset at a given time using quadratic interpolation.
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)
54 views21 pages

Part (14) - Interpolation 2

The document describes Lagrange interpolation and Newton's divided differences interpolation. It provides examples of using both methods to find interpolating polynomials of different orders (linear, quadratic, cubic) and evaluate them. Specifically: - Lagrange interpolation constructs polynomials using Lagrange basis polynomials, while Newton's method uses divided differences to find the coefficients. - Higher order polynomials require more data points - a linear polynomial needs 2 points, quadratic needs 3, and cubic needs 4. - Examples show constructing the polynomials for different datasets and evaluating them to find function values at specific points. - The last example sets up using Newton's method to find the acceleration for a dataset at a given time using quadratic interpolation.
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/ 21

C) Lagrange Interpolation

The interpolating polynomial is given by:

where n in 𝑓𝑛 𝑥 stands for the 𝑛𝑡ℎ order polynomial that approximates the function
𝑦 = 𝑓 𝑥 given at n+1 data points.

And the Lagrange polynomial is :

- For a polynomial of the 𝑛𝑡ℎ order, n+1 points are required which will form n+1
Lagrange polynomials
C) Lagrange Interpolation

- Linear Lagrange Interpolation: ( 2 points are required 𝑥0 , 𝑦0 , 𝑥1 , 𝑦1 ).

This will form two Lagrange polynomials according to:

𝑥−𝑥1 𝑥−𝑥0
Which are : 𝐿0 (𝑥) = , 𝐿1 (𝑥) =
𝑥0 −𝑥1 𝑥1 −𝑥0

And the interpolating polynomial is:


𝑓1 𝑥 = 𝐿0 𝑥 𝑓 𝑥0 + 𝐿1 𝑥 𝑓(𝑥1 )
C) Lagrange Interpolation
- Quadratic Lagrange Interpolation: ( 3 points are required 𝑥0 , 𝑦0 , 𝑥1 , 𝑦1 , 𝑥2 , 𝑦2 ).

This will form three Lagrange polynomials according to:


(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
𝐿0 (𝑥) =
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )

(𝑥 − 𝑥0 )(𝑥 − 𝑥2 )
𝐿1 (𝑥) =
(𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 )

(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )
𝐿2 (𝑥) =
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )

And the interpolating polynomial is:

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


Example 5
Using the Lagrange interpolation, find the following:

1) The 1st order interpolating polynomial.


𝒙 𝒇(𝒙)
2) The value of 𝑓 −0.5 -1 3
0 -4
Example 5 - Solution 𝒙 𝒇(𝒙)
The linear interpolating polynomial is:
-1 3
0 -4
𝑓1 𝑥 = 𝐿0 𝑥 𝑓 𝑥0 + 𝐿1 𝑥 𝑓(𝑥1 )

The Lagrange polynomials are 𝐿0 𝑎𝑛𝑑 𝐿1 :

𝑥 − 𝑥1 𝑥−0
𝐿0 𝑥 = = =−𝑥
𝑥0 − 𝑥1 −1 − 0

𝑥 − 𝑥0 𝑥 − −1
𝐿1 𝑥 = = =𝑥+1
𝑥1 − 𝑥0 0 − −1

𝑓1 𝑥 = 𝐿0 𝑥 𝑓 𝑥0 + 𝐿1 𝑥 ⇒ 𝑓 𝑥1 = −𝑥 3 + (𝑥 + 1)(−4) ⇒ 𝑓1 𝑥 = −7𝑥 − 4
⇒ 𝑓1 −0.5 = −7 −0.5 − 4 = −0.5
Example 6
Using the 2nd order Lagrange interpolation, find the value of 𝑓 0.8 .

𝒙 𝒇(𝒙)
-1 3
0 -4
1 5
2 -6
3 2
Example 6 - Solution
For the 2nd order (quadratic) interpolation, choose 3 points that bracket 𝑥 = 0.8.

𝒙 𝒇(𝒙)
-1 3
0 -4
1 5
2 -6
3 2
𝒙 𝒇(𝒙)
Example 6 - Solution 0 -4
The quadratic interpolating polynomial is: 1 5
2 -6
𝑓2 𝑥 = 𝐿0 𝑥 𝑓 𝑥0 + 𝐿1 𝑥 𝑓 𝑥1 + 𝐿2 𝑥 𝑓(𝑥2 )

The Lagrange polynomials are 𝐿0 , 𝐿1 𝑎𝑛𝑑 𝐿2 :

𝑥 − 𝑥1 𝑥 − 𝑥2 0.8 − 1 0.8 − 2
𝐿0 𝑥 = ⇒ 𝐿0 0.8 = = 0.12
𝑥0 − 𝑥1 𝑥0 − 𝑥2 0−1 0−2

𝑥 − 𝑥0 𝑥 − 𝑥2 0.8 − 0 0.8 − 2
𝐿1 𝑥 = ⇒ 𝐿1 0.8 = = 0.96
𝑥1 − 𝑥0 𝑥1 − 𝑥2 1−0 1−2

𝑥 − 𝑥0 𝑥 − 𝑥1 0.8 − 0 0.8 − 1
𝐿2 𝑥 = ⇒ 𝐿2 0.8 = = −0.08
𝑥2 − 𝑥0 𝑥2 − 𝑥1 2−0 2−1
𝒙 𝒇(𝒙)
Example 6 - Solution 0 -4
1 5
2 -6

Now, the Lagrange polynomials are 𝐿0 = 0.12 , 𝐿1 = 0.96 𝑎𝑛𝑑 𝐿2 = −0.08

Hence, he quadratic interpolating polynomial is:

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

𝑓2 0.8 = 𝐿0 0.8 𝑓 0 + 𝐿1 0.8 𝑓 1 + 𝐿2 0.8 𝑓(2)

𝑓2 0.8 = (0.12) (−4) + (0.96) (5) + (−0.08) (−6)

𝑓2 0.8 = 4.8
Example 7
The following table represents the time – velocity characteristics of a rocket.

- Determine the velocity at t = 16 s, using:


𝒕𝒊𝒎𝒆 (𝒔) 𝒗𝒆𝒍𝒐𝒄𝒊𝒕𝒚 (𝒎/𝒔)
a) Linear (1st order) Lagrange interpolation. 0 0
b) Quadratic (2nd order) Lagrange interpolation. 10 230
15 360
c) Using the quadratic (2nd order) Lagrange
20 520
interpolation, find: 25 600
30 900
1- The acceleration at t = 16 s.

2- The distance that the rocket had travelled from t= 0 s to t= 30 s


Example 8
Using the 3nd order (cubic) Lagrange interpolation, find the value of 𝑓 3 .
𝒙 𝒇(𝒙)
3.2 22
Solution
2.7 17.8
1.0 14.2
4.8 38.3
D) Newton’s Divided Differences Interpolating Polynomials
This method interpolates the data to a polynomial of the following form:
𝒇𝒏 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎 + 𝒃𝟐 𝒙 − 𝒙𝟎 𝒙 − 𝒙𝟏 + ⋯ + 𝒃𝒏 𝒙 − 𝒙𝟎 𝒙 − 𝒙𝟏 … (𝒙 − 𝒙𝒏−𝟏 )

Where 𝑏0 , 𝑏1 , … . 𝑏𝑛 are the first, second,… 𝑛𝑡ℎ finite divided differences,

For 𝑛𝑡ℎ order polynomial, n+1 divided differences are required, as well as n+1 data points.
𝑏0 = 𝑓 𝑥0

𝑓 𝑥1 − 𝑓(𝑥0 )
𝑏1 =
𝑥1 − 𝑥0

𝑓 𝑥2 − 𝑓(𝑥1 ) 𝑓 𝑥1 − 𝑓(𝑥0 )

𝑥2 − 𝑥1 𝑥1 − 𝑥0
𝑏2 =
𝑥2 − 𝑥0
D) Newton’s Divided Differences Interpolating Polynomials

- Linear Newton’s divided difference interpolation:


𝒇𝟏 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎

𝒙 𝒇(𝒙) Second Divided


Difference
𝒃𝟎 𝒇 𝒙𝟏 − 𝒇(𝒙𝟎 ) 𝒃𝟏
𝑥0 𝑓(𝑥0 )
𝒙𝟏 − 𝒙𝟎

𝑥1 𝑓(𝑥1 )
Example 9

Using Newton’s divided differences for linear interpolation, find f(6)

𝒙 𝒇(𝒙)
2 6

10 12
Example 9 - Solution
- Linear Newton’s divided difference interpolation:
𝒇𝟏 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎

𝒙 𝒇(𝒙) Second Divided


Difference
𝒃𝟎 𝟏𝟐 − 𝟔 𝟑 𝟏 𝒃
2 6 = = 𝟎. 𝟕𝟓
𝟏𝟎 − 𝟐 𝟒

10 12

𝒇𝟏 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎 𝒇𝟏 𝒙 = 𝟔 + 𝟎. 𝟕𝟓 𝒙 − 𝟐 𝒇𝟏 𝒙 = 𝟎. 𝟕𝟓𝒙 + 𝟒. 𝟓
Example 9 - Solution
- Linear Newton’s divided difference interpolation:
𝒇𝟏 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎

𝒙 𝒇(𝒙) Second Divided


Difference
𝒃𝟎 𝟏𝟐 − 𝟔 𝟑 𝟏 𝒃
2 6 = = 𝟎. 𝟕𝟓
𝟏𝟎 − 𝟐 𝟒

10 12

𝒇𝟏 𝒙 = 𝟎. 𝟕𝟓𝒙 + 𝟒. 𝟓 𝒇𝟏 𝟔 = 𝟎. 𝟕𝟓 ∗ (𝟔) + 𝟒. 𝟓 𝒇𝟏 𝟔 = 𝟗
D) Newton’s Divided Differences Interpolating Polynomials

- Quadratic Newton’s divided difference interpolation:


𝒇𝟐 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎 + 𝒃𝟐 𝒙 − 𝒙𝟎 (𝒙 − 𝒙𝟏 )

𝒙 𝒇(𝒙) Second Divided Third Divided Difference


Difference
𝒃𝟎 𝒃𝟏 𝒇 𝒙𝟐 − 𝒇(𝒙𝟏 ) 𝒇 𝒙𝟏 − 𝒇(𝒙𝟎 ) 𝒃𝟐
𝒇 𝒙𝟏 −𝒇(𝒙𝟎 ) −
𝑥0 𝑓(𝑥0 ) 𝒙𝟐 − 𝒙𝟏 𝒙𝟏 − 𝒙𝟎
𝒙𝟏 −𝒙𝟎
𝒙𝟐 − 𝒙𝟏
𝒇 𝒙𝟐 −𝒇(𝒙𝟏 )
𝑥1 𝑓(𝑥1 ) 𝒙𝟐 −𝒙𝟏

𝑥2 𝑓(𝑥2 )
Example 10

Using Newton’s divided differences for quadratic interpolation, the acceleration


when t= 80 seconds
𝒕𝒊𝒎𝒆 (s) 𝒂𝒄𝒄𝒆𝒍𝒆𝒓𝒂𝒕𝒊𝒐𝒏 (𝒎/𝒔𝟐 )
30 15

50 25

90 65
Example 10 - Solution

- Quadratic Newton’s divided difference interpolation:


𝒇𝟐 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎 + 𝒃𝟐 𝒙 − 𝒙𝟎 (𝒙 − 𝒙𝟏 )

𝒙 𝒇(𝒙) Second Divided Third Divided Difference


Difference
𝒃𝟎 𝒃𝟏
𝟐𝟓−𝟏𝟓 𝟎. 𝟓 − 𝟏 −𝟎. 𝟓 −𝟏 𝒃𝟐
30 15 = 𝟎. 𝟓 = =
𝟓𝟎−𝟑𝟎 𝟗𝟎 − 𝟑𝟎 𝟔𝟎 𝟏𝟐𝟎
𝟔𝟓−𝟐𝟓
50 25 =𝟏
𝟗𝟎−𝟓𝟎

90 65
Example 10 - Solution

- Quadratic Newton’s divided difference interpolation:


𝒇𝟐 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎 + 𝒃𝟐 𝒙 − 𝒙𝟎 (𝒙 − 𝒙𝟏 )

−𝟏
𝒇𝟐 𝒙 = 𝟏𝟓 + 𝟎. 𝟓 𝒙 − 𝟑𝟎 + 𝒙 − 𝟑𝟎 𝒙 − 𝟓𝟎
𝟏𝟐𝟎

The acceleration at t = 80 s :

−𝟏
𝒇𝟐 𝟖𝟎 = 𝟏𝟓 + 𝟎. 𝟓 𝟖𝟎 − 𝟑𝟎 + 𝟖𝟎 − 𝟑𝟎 𝟖𝟎 − 𝟓𝟎
𝟏𝟐𝟎
𝒇𝟐 𝟖𝟎 = 𝟐𝟕. 𝟓 𝒎/𝒔𝟐
Example 11
𝒙 𝒇(𝒙) 2nd Divided Diff 3rd Divided Diff 4th Divided Diff
4−3 3−1 1−1
0 3 𝒃𝟎 = 1 𝒃𝟏 = 1 𝒃𝟐 = 0 𝒃𝟑
1−0 2−0 4−0
7−4 6−3
1 4 =3 =1
2−1 4−1
19 − 7
2 7 =6
4−2
4 19

𝒇𝟑 𝒙 = 𝒃𝟎 + 𝒃𝟏 𝒙 − 𝒙𝟎 + 𝒃𝟐 𝒙 − 𝒙𝟎 𝒙 − 𝒙𝟏 + 𝒃𝟑 𝒙 − 𝒙𝟎 𝒙 − 𝒙𝟏 𝒙 − 𝒙𝟐
𝒇𝟑 𝒙 = 𝟑 + 𝟏 𝒙 − 𝟎 + 𝟏 𝒙 − 𝟎 𝒙 − 𝟏 + 𝟎 𝒙 − 𝟎 𝒙 − 𝟏 𝒙 − 𝟐
𝒇𝟑 𝒙 = 𝒙𝟐 + 𝟑

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy