0% found this document useful (0 votes)
4 views27 pages

3 Interpolating Lagrange +divided Difference

This lecture on Numerical Analysis covers Lagrange Interpolation and Interpolation Using Divided Differences. Lagrange Interpolation is a method for constructing a polynomial that passes through a given set of data points, while the Divided Differences method offers a more convenient approach for numerical work. Examples are provided to illustrate the application of both interpolation techniques.
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)
4 views27 pages

3 Interpolating Lagrange +divided Difference

This lecture on Numerical Analysis covers Lagrange Interpolation and Interpolation Using Divided Differences. Lagrange Interpolation is a method for constructing a polynomial that passes through a given set of data points, while the Divided Differences method offers a more convenient approach for numerical work. Examples are provided to illustrate the application of both interpolation techniques.
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/ 27

October 6 University

Faculty of Engineering

Numerical Analysis
Lecture 4

By : Mahmoud Salim
PhD in Telecommunication Engineering

m.salim.eng@o6u.edu.eg 1
Table of Content – Lecture 4

1 Lagrange Interpolation

2 Interpolation Using Divided Differences


Lagrange Interpolation m.salim.eng@o6u.edu.eg 3

Lagrange Interpolation
• Interpolation is the process of deriving a
simple function from a set of discrete
data points so that the function passes
through all the given data points (i.e.
reproduces the data points exactly) and
can be used to estimate data points in
between the given ones.

4
m.salim.eng@o6u.edu.eg

Lagrange Interpolation

• Assume that we have this set of n+1 points:


x0 x1 ……….. xn
y0 y1 ……….. yn

• We are looking forward to constructing a polynomial ����(��)

that is exact to f(x) at (��+1) points inside (��,��). That is:

����(��) = ��0(��) �� (��0) + ��1(��) �� (��1) + ⋯ +


����(��) �� (����)

5
m.salim.eng@o6u.edu.eg

Lagrange Interpolation
���� �� =�� − ���� �� − ����
… (�� − ����) ���� −
���� ���� − ���� …
(���� − ����)

�� − ��
���� �� = �� �� − ���� … (�� − ����)
���� − ���� ���� −
..
���� … (���� − ����) .
���� �� =�� − ���� �� − ���� …
(�� − ����−��) ���� −
���� ���� − ���� … (����
− ����−��)
6
m.salim.eng@o6u.edu.eg

Lagrange Interpolation
• Then we construct ����(x) as:
• Hence , the linear interpolant is:

where ����=f (����)

7
m.salim.eng@o6u.edu.eg

Lagrange Interpolation
+

+
8
m.salim.eng@o6u.edu.eg

Lagrange Interpolation
• Example: Given a set of three data points:
xi 0 2 4
Yi = fi 1 5 17

• Determine the Lagrange interpolation polynomial of degree 2 which passes


through these points.

• First we compute ��0,��1,��2:


• ���� =(��−����)(��−����)
(��−��) (��−��)
(����−����)(����−����)=
−��(��−��)
(��−��)
(��−��)(��−��) (��−��)(��−��)=
��
• ���� =(��−����)(��−����)
(��−��)
(����−����)(����−����)=

• ���� =(��−����)(��−����)
(��−��)(��−��)
(����−����)(����−����)=
��(��−��)
(��−��)(��−��) =
��

9
m.salim.eng@o6u.edu.eg

Lagrange Interpolation
xi 0 2 4
Yi = fi 1 5 17

• The Lagrange interpolation polynomial is:

L2 (x) = ��2(��) = f0 * ��0(��) + f1 *


��1(��) + f2 * ��2(��) =1 * ��0(��) + 5 *
��1(��) + 17 * ��2 (��)
2
=1+x .

10
m.salim.eng@o6u.edu.eg
Interpolation Using Divided Differences

m.salim.eng@o6u.edu.eg 11

Interpolation Using Divided Differences


• The Lagrange formula for interpolation is not
particularly convenient for numerical work.
• Interpolation Using Divided Differences is much more
easier to handle.

����(��) =�� [��0] + (��−��0) �� [��0,��1] +


(��−��0) (��−��1) �� [��0,��1,��2] +⋯+
(��−��0) (��−��1)
…(��−����−1)��[��0,��1,…,����].

12
m.salim.eng@o6u.edu.eg

Interpolation Using Divided Differences


����(��) =�� [��0] + (��−��0) �� [��0,��1] +
(��−��0) (��−��1) �� [��0,��1,��2] +⋯+ (��−��0)
(��−��1) …(��−����−1)��[��0,��1,…,����].
• Divided differences are obtained by constructing a divided
table. For example (n=4)
f [x0, x1 ] f [x1, x2 ] f x2, x3 ] f [x2, x3, x4 ]
f [x1, x2 , x3, x4 ]f
x0f0=f [x0] x1f1=f [x2, x3 ] f [x3, x4 ]
[x0, x1, x2 , x3, x4 ]
[x1] x2f2=f [x2]
x3f3=f [x3] x4f4=f f [x0, x1, x2 , x3 ]
f [x0, x1, x2 ] f [x1,
[x4]

13
m.salim.eng@o6u.edu.eg
Interpolation Using Divided Differences

f [xi ,xi+1 ]=�� ����+�� − �� (����)


����+�� − ����

f [x0 ,x1]=�� ���� − �� (����)


���� − ����

f [x2 ,x3, x4]=f [x3 ,x4] − f [x2 ,x3]


���� − ����
f [x
f [x1 ,x2 ,x3, x4]= 2 ,x3, x4] − f [x1 ,x2,x3]
���� − ����
14
m.salim.eng@o6u.edu.eg

Interpolation Using Divided Differences


��4(��) =�� [��0] + (��−��0) �� [��0,��1] + (��−��0)
(��−��1) �� [��0,��1,��2] + (��−��0) (��−��1) (��−��2) ��
[��0,��1,��2, x3]+(��−��0) (��−��1) (��−��2) (��−��3) ��
[��0,��1,��2, x3, x4].

• Example: Given A divided difference table for function values


{�� (−1) =1,�� (0) =1,�� (3) =181,�� (−2) =−39,�� (4) =801}
xi -1 0 3 -2 4
fi 1 1 181 -39 801

15
m.salim.eng@o6u.edu.eg

Interpolation Using Divided Differences


��−��
����−����=

x0=-1 f0=1 x1=0 f1=1 x2=3 ��−(−��)= ��


�� ��
f [x1, x2 ] = �� −��
f2=181 x3=-2 f3=-39 x4=4
(����)
f4=801

f [x0, x1 ]= �� ���� −�� ������−��


����−����=
(����)
��−��= ����
f [x2, x3 ] = �� ���� −�� (����)

(����)

−����−�����
����−����= ������−(−���
����−����=

�)

−��−��= ����
��−(−��)= ������
�� ��
f [x3, x4 ] = �� −��
16
m.salim.eng@o6u.edu.eg

Interpolation Using Divided Differences

f [x0, x1 ]= �� ���� −�� (����)


��−��
����−����=

��−��= �� f [x2, x3 ] = �� ���� −�� (����)


f [x1, x2 ] = �� ���� −�� (����) ����−����=
−����−������

������−��
����−����= −��−��= ����

��−��= ���� f [x3, x4 ] = �� ���� −�� (����)


������−(−����) ����−����
����−����= ����−����=

��−(−��)= ������ −��−��= ��


f [x2, x3, x4 ] =f [x3 ,x4]−f [x2 ,x3]
f [x0, x1, x2 ] =f [x1 ,x2]−f [x0 ,x1] ������−����
����−�� ����−����=
����−����=
��−��= ����
��−(−��)= ����

f [x1, x2, x3 ] =f [x2 ,x3]−f [x1 ,x2]

17
m.salim.eng@o6u.edu.eg
Interpolation Using Divided Differences

f [x
f [x0, x1, x2 ] = 1 ,x2]−f [x0 ,x1]
����−��
����−����=
������−����
��−(−��)= ���� ����−����=

f [x1, x2, x3 ] =f [x2 ,x3]−f [x1 ,x2]


����−����
����−����=

��−��= ����
−��−��= �� f [x0, x1, x2 , x3 ]= ��−���� −��−(−��)=
f [x2, x3, x4 ] =f [x3 ,x4]−f [x2 ,x3] ��
f [x1, x2 , x3, x4 ]=����−�� ��−��= ����

18
m.salim.eng@o6u.edu.eg

Interpolation Using Divided


Differences f [x , x , x , x ]= ��−����
0 1 2 3

−��−(−��)= �� ��−(−��)

f [x1, x2 , x3, x4 ]=����−�� = ��


��−��= ����

f [x0, x1, x2 , x3, x4 ]= ����−��


19
m.salim.eng@o6u.edu.eg

Interpolation Using Divided Differences


[��0,��1,��2,x3]
• ��4(��) =�� [��0] + (��−��0) (��−��1) (��−��2)
+ (��−��0) �� [��0,��1] (��−��3) �� [��0,��1,��2, x3, x4] •
+ (��−��0) (��−��1) �� ��4(��) =1
[��0,��1,��2] + (�� − (-1)) * 0
+ (��−��0) (��−��1) (��−��2) �� + (�� − (-1)) * (x- 0)*15
+ (�� − (-1)) * (x - 0) * (x - 3) *7 f [x2 , x3 ] = ����
f [x3, x4 ] = ������
+((��−(-1)) * (x-0)* (x-3) * (x-(-2)) *3
f [x0 , x1 , x2 ] =����
=?????
f [x1 , x2 , x3 ] =��
xi -1 0 3 -2 4 f [x2 , x3 , x4 ] =����
f(xi ) 1 1 181 39 801 f [x , x , x , x ]=��
0 1 2 3
f [x1 , x2 , x3, x4 ]=����
f [x0 , x1 ]= ��
f [x0 , x1, x2 , x3, x4 ]= ��
f [x1 , x2 ] = ����
20
m.salim.eng@o6u.edu.eg
Any Questions? m.salim.eng@o6u.edu.eg 21

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