0% found this document useful (0 votes)
13 views23 pages

MATH-331 Lec 4

Lecture 4 of MATH-331 covers Numerical Analysis, focusing on the calculus of finite operators and interpolation methods including Newton's and Lagrange's techniques. Students will learn about finite difference operators, their relationships, and how to apply interpolation methods for estimating unknown values from given data. The lecture includes practical problems to illustrate these concepts.

Uploaded by

hashirali2024
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)
13 views23 pages

MATH-331 Lec 4

Lecture 4 of MATH-331 covers Numerical Analysis, focusing on the calculus of finite operators and interpolation methods including Newton's and Lagrange's techniques. Students will learn about finite difference operators, their relationships, and how to apply interpolation methods for estimating unknown values from given data. The lecture includes practical problems to illustrate these concepts.

Uploaded by

hashirali2024
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/ 23

Lecture 4

MATH-331
Numerical Analysis
(3+0)

Instructor: Madiha Razzaq

Institute of Environmental Sciences and Engineering (IESE)


School of Civil and Environmental Engineering (SCEE)
National University of Sciences and Technology (NUST) Islamabad, Pakistan
Learning Outcome
At the end of this lecture students will be able to learn
- Calculus of finite operators
- Interpolation methods
• Newton forward and backward differences method
• Newton divided difference
• Lagrange interpolation

3/11/2025 MATH-331 Numerical Analysis 2


The Calculus of Finite Difference
 The calculus of finite difference deals with the change take place in the value of
function due to finite change in the independent variable

 Finite Difference Operators


- Shift Operator: 𝜀 𝑓 𝑥 = 𝑓(𝑥 + ℎ)

- Forward Difference operator = ∆ 𝑓 𝑥 = 𝑓 𝑥 + ℎ − 𝑓 𝑥

- Backward Difference operator = 𝛻 𝑓 𝑥 = 𝑓 𝑥 − 𝑓 𝑥 − ℎ

- Central Difference operator = 𝛿 𝑓 𝑥 = 𝑓 𝑥 + ℎ/2 − 𝑓 𝑥 − ℎ/2

𝑓 𝑥+ℎ/2 + 𝑓 𝑥−ℎ/2
- Average operator = 𝜇 𝑓 𝑥 =
2

3/11/2025 MATH-331 Numerical Analysis 3


Shift Operator
𝜀𝑓 𝑥 = 𝑓(𝑥 + ℎ)
 𝜀2𝑓 𝑥 = 𝜀(𝜀𝑓 𝑥 ) = 𝜀[𝑓 𝑥 + ℎ ]
 𝜀2 𝑓 𝑥 = 𝑓 𝑥 + ℎ + ℎ
 𝜀2𝑓 𝑥 = 𝑓 𝑥 + 2ℎ
 𝜀3𝑓 𝑥 = 𝑓 𝑥 + 3ℎ
 𝜀𝑛𝑓 𝑥 = 𝑓 𝑥 + 𝑛ℎ
−1
 𝜀 𝑓 𝑥 =𝑓 𝑥−ℎ
/2 1
 1
𝜀 𝑓 𝑥 =𝑓 𝑥+ ℎ
2

3/11/2025 MATH-331 Numerical Analysis 4


Forward Difference Operator (∆)
∆ 𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥)

Where h is any interval

∆2 𝑓 𝑥 = ∆(∆𝑓 𝑥 ) = ∆[𝑓 𝑥 + ℎ − 𝑓 𝑥 ]

∆2 𝑓 𝑥 = ∆𝑓 𝑥 + ℎ − ∆𝑓 𝑥

∆2 𝑓 𝑥 = [𝑓 𝑥 + ℎ + ℎ − 𝑓 𝑥 + ℎ ] − [𝑓 𝑥 + ℎ − 𝑓 𝑥 ]

∆2 𝑓 𝑥 = 𝑓 𝑥 + 2ℎ − 2𝑓 𝑥 + ℎ + 𝑓 𝑥

3/11/2025 MATH-331 Numerical Analysis 5


Backward Difference Operator (𝛻)
𝛻 𝑓(𝑥) = 𝑓(𝑥) − 𝑓(𝑥 − ℎ)

Where h is any interval

𝛻2 𝑓 𝑥 = 𝛻(𝛻𝑓 𝑥 ) = 𝛻[𝑓 𝑥 − 𝑓 𝑥 − ℎ ]

𝛻2 𝑓 𝑥 = 𝛻𝑓 𝑥 − 𝛻𝑓 𝑥 − ℎ

𝛻2 𝑓 𝑥 = [𝑓 𝑥 − 𝑓 𝑥 − ℎ ] − [𝑓 𝑥 − ℎ − 𝑓 𝑥 − ℎ − ℎ ]

𝛻2 𝑓 𝑥 = 𝑓 𝑥 − 2𝑓 𝑥 − ℎ + 𝑓 𝑥 − 2ℎ

3/11/2025 MATH-331 Numerical Analysis 6


Relationships b/w Operators
1. 𝜀 = 1 + ∆
2. ∇ = 1 − 𝜀 -1

3. 𝜀∇ = ∇𝜀 =∆
4. ∆ − ∇ = ∆∇
5. 1 + ∆ (1 − ∇) = 1
6. 𝜀 = ehD

3/11/2025 MATH-331 Numerical Analysis 7


Problems
∆2 𝜀 ∗ e x
Show that ex = ex 2 x , the interval of being h
𝜀 ∆e

Solve ∆𝐶𝑜𝑡 2𝑥, the interval of being 1

3/11/2025 MATH-331 Numerical Analysis 8


Interpolation
 Interpolation: The technique or method of estimating unknown values from given
set of observations

 Interpolation with Unevenly Spaced Points


- Lagrange Interpolation

- Newton’s Divided Difference Interpolation

 Interpolation with Evenly Spaced Points


- Newton’s Forward Difference Interpolation

- Newton’s Backward Difference Interpolation

3/11/2025 MATH-331 Numerical Analysis 9


Newton Forward Difference Method

a=

𝑢 𝑢 𝑢 𝑢 𝑢
𝑓 𝑥 = f(a) + 1!∆f(a)+ 2! (u-1)∆2f(a)+ 3! (u-1) (u- 2) ∆3f(a)+ 4! (u- 1) (u- 2) (u -3) ∆4f(a)+ ...+ 𝑛! (u-1) (u- 2) …(u-(n-1))∆nf(a)

3/11/2025 MATH-331 Numerical Analysis 10


Newton Backward Difference Method

a=

𝑢 𝑢 𝑢 𝑢 𝑢
𝑓 𝑥 = f(a) + 1! 𝛻f(a)+ 2! (u+1) 𝛻 2f(a)+ 3! (u+1)(u+2) 𝛻 3f(a)+ 4! (u+1)(u+2)(u+3)𝛻 4f(a)+ ..+ 𝑛! (u+1) (u+2) ..(u+(n-1)) 𝛻nf(a)

3/11/2025 MATH-331 Numerical Analysis 11


Problem 1
Form a difference table and interpolate the value of f(x) when x=4, given.

x 3 5 7 9 x =4
a= 3
f(x) 180 150 120 90 h= 2
a+hu = 4
u= 0.5
x f(x) ∆ f(x) ∆2 f(x) ∆3 f(x)
3 180 Solution
-30 f(4) = 165
5 150 0
-30 0
7 120 0
-30
9 90
𝑢 𝑢 𝑢
𝑓 𝑥 = f(a) + 1!∆f(a)+ 2! (u-1)∆2f(a)+ 3! (u-1) (u- 2) ∆3f(a)

3/11/2025 MATH-331 Numerical Analysis 12


Problem 2
Estimate population in 1895 and 1925 from following statistics.

Year 1891 1901 1911 1921 1931 x =1895


Forward Interpolation Method

a= 1891
Population 46 66 81 93 101 h= 10
a+hu = 1895
x f(x) ∆ f(x) ∆2 f(x) ∆3 f(x) ∆4 f(x) u= 0.4
1891 46
20 Solution
1901 66 -5 f(1895) = 54.85
15 2
1911 81 -3 -3
12 -1
1921 93 -4
8
1931 101
𝑢 𝑢 𝑢 𝑢
𝑓 𝑥 = f(a) + 1!∆f(a)+ 2! (u-1)∆2f(a)+ 3! (u-1) (u- 2) ∆3f(a)+ 4! (u- 1) (u- 2) (u -3) ∆4f(a)
3/11/2025 MATH-331 Numerical Analysis 13
Problem 2
Estimate population in 1895 and 1925 from following statistics.

Year 1891 1901 1911 1921 1931 x =1925


a= 1931
Backward Interpolation Method

Population 46 66 81 93 101 h= 10
a+hu = 1925
x f(x) ∆ f(x) ∆2 f(x) ∆3 f(x) ∆4 f(x) u= -0.6
1891 46
20 Solution
1901 66 -5 f(1925) = 96.84
15 2
1911 81 -3 -3
12 -1
1921 93 -4
8
1931 101
𝑢 𝑢 𝑢 𝑢
𝑓 𝑥 = f(a) + 1! 𝛻f(a)+ 2! (u+1) 𝛻 2f(a)+ 3! (u+1)(u+2) 𝛻 3f(a)+ 4!
(u+1)(u+2)(u+3)𝛻 4f(a)
3/11/2025 MATH-331 Numerical Analysis 14
Lagrange Interpolation
Lagrange interpolation method is used to find value of y from unevenly spaced data.
n x y= f(x)
𝑥−𝑥2 𝑥−𝑥3 𝑥−𝑥4 ∗𝑦1
1 x1 y1 𝑓 𝑥 = + x is the value at
(𝑥1 −𝑥2 )(𝑥1 −𝑥3 )(𝑥1 −𝑥4 ) which y value need
2 x2 y2 𝑥−𝑥1 𝑥−𝑥3 𝑥−𝑥4 ∗𝑦2 to be interpolated
+
(𝑥2 −𝑥1 )(𝑥2 −𝑥3 )(𝑥2 −𝑥4 )
3 x3 y3
𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥4 ∗𝑦3
4 x4 y4 +
(𝑥3 −𝑥1 )(𝑥3 −𝑥2 )(𝑥3 −𝑥4 )
. . . 𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥3 ∗𝑦4
. . . (𝑥4 −𝑥1 )(𝑥4 −𝑥2 )(𝑥4 −𝑥3 )
n xn yn

3/11/2025 MATH-331 Numerical Analysis 15


Problem 1
Find the value of y at x = 0 given some set of values (-2, 5), (1, 7), (3, 11), (7, 34).

x -2 1 3 7

y 5 7 11 34

𝑥−𝑥2 𝑥−𝑥3 𝑥−𝑥4 ∗𝑦1 𝑥−𝑥1 𝑥−𝑥3 𝑥−𝑥4 ∗𝑦2 𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥4 ∗𝑦3 𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥3 ∗𝑦4
𝑓 𝑥 = + + +
(𝑥1 −𝑥2 )(𝑥1 −𝑥3 )(𝑥1 −𝑥4 ) (𝑥2 −𝑥1 )(𝑥2 −𝑥3 )(𝑥2 −𝑥4 ) (𝑥3 −𝑥1 )(𝑥3 −𝑥2 )(𝑥3 −𝑥4 ) (𝑥4 −𝑥1 )(𝑥4 −𝑥2 )(𝑥4 −𝑥3 )

0−1 0−3 0−7 ∗5 0+2 0−3 0−7 ∗7 0+2 0−1 0−7 ∗11 0+2 0−1 0−3 ∗34
𝑓 0 = + + + = 6.039
(−2−1)(−2−3)(−2−7) (1+2)(1−3)(1−7) (3+2)(3−1)(3−7) (7+2)(7−1)(7−3)

3/11/2025 MATH-331 Numerical Analysis 16


Problem 2
Find the value of y at x = 10 at given set of values

x 5 6 9 11

y 12 13 14 16

𝑥−𝑥2 𝑥−𝑥3 𝑥−𝑥4 ∗𝑦1 𝑥−𝑥1 𝑥−𝑥3 𝑥−𝑥4 ∗𝑦2 𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥4 ∗𝑦3 𝑥−𝑥1 𝑥−𝑥2 𝑥−𝑥3 ∗𝑦4
𝑓 𝑥 = + + +
(𝑥1 −𝑥2 )(𝑥1 −𝑥3 )(𝑥1 −𝑥4 ) (𝑥2 −𝑥1 )(𝑥2 −𝑥3 )(𝑥2 −𝑥4 ) (𝑥3 −𝑥1 )(𝑥3 −𝑥2 )(𝑥3 −𝑥4 ) (𝑥4 −𝑥1 )(𝑥4 −𝑥2 )(𝑥4 −𝑥3 )

10−6 10−9 10−11 ∗12 10−5 10−9 10−11 ∗13 10−5 10−6 10−11 ∗14 10−5 10−6 10−9 ∗16
𝑓 10 = + + + = 14.67
(5−6)(5−9)(5−11) (6−5)(6−9)(6−11) (9−5)(9−6)(9−11) (11−5)(11−6)(11−9)

3/11/2025 MATH-331 Numerical Analysis 17


Problem 3
Given the following data, find the linear interpolating function f(x)

x 2 5

y 1.5 4

𝑥−𝑥2 ∗𝑦1 𝑥−𝑥1 ∗𝑦2


𝑓 𝑥 = +
(𝑥1 −𝑥2 ) (𝑥2 −𝑥1 )

𝑥−5 ∗1.5 𝑥−2 ∗4 5−𝑥 𝑥−2 ∗4 5𝑥−1


𝑓 𝑥 = + = + =
(2−5) (5−2) 2 3 6

3/11/2025 MATH-331 Numerical Analysis 18


Newton Divided Difference
x f(x) ∆f(x) ∆2f(x) ∆3f(x) ∆4f(x)
x0 f(x0)
f(x1) − f(x0)
x1 − x0
∆f(x1) − ∆f(x0)
x1 f(x1) x2 − x0
f(x2) − f(x1) ∆2f(x1) − ∆2f(x0)
x2 − x1 x3 − x0
∆f(x2) − ∆f(x1) ∆3f(x1) − ∆3f(x0)
x2 f(x2) x3 − x1 x4 − x0
f(x3) − f(x2) ∆2f(x2) − ∆2f(x1)
x3 − x2 x4 − x1
∆f(x3) − ∆f(x2)
x3 f(x3) x4 − x2
f(x4) − f(x3)
x4 − x3
x4 f(x4)

𝑓 𝑥 = f(x0) + (x- x0) ∆f(x0)+ (x- x0) (x- x1) ∆2f(x0)+ (x- x0) (x- x1) (x- x2) ∆3f(x0)+ (x- x0) (x- x1) (x- x2) (x- x3) ∆4f(x0)+ ....
3/11/2025 MATH-331 Numerical Analysis 19
Problem 1
Find the value of y at x = 0, given some set of values (-2, 5), (1, 7), (3, 11), (7, 34).

x -2 1 3 7 Solution: f(0) = 6.039


y 5 7 11 34

x f(x) ∆f(x) ∆2f(x) ∆3f(x)


x0 -2 5
0.666667
x1 1 7 0.266667
2 0.039815
x2 3 11 0.625
5.75
x3 7 34

𝑓 𝑥 = f(x0) + (x- x0) ∆f(x0)+ (x- x0) (x- x1) ∆2f(x0)+ (x- x0) (x- x1) (x- x2) ∆3f(x0)

3/11/2025 MATH-331 Numerical Analysis 20


Problem 2
Find the value of y at x = 10 at given set of values
Solution: f(0) = 14.667
x 5 6 9 11

y 12 13 14 16

x f(x) ∆f(x) ∆2f(x) ∆3f(x)


x0 5 12
1
x1 6 13 -0.16667
0.333333 0.05
x2 9 14 0.133333
1
x3 11 16
𝑓 𝑥 = f(x0) + (x- x0) ∆f(x0)+ (x- x0) (x- x1) ∆2f(x0)+ (x- x0) (x- x1) (x- x2) ∆3f(x0)

3/11/2025 MATH-331 Numerical Analysis 21


Problem 3
Compute f(0.3) for the data given in the table below.
Solution: f(0.3) = 1.831
x 0 1 3 4 7

y 1 3 49 129 813

x f(x) ∆f(x) ∆2f(x) ∆3f(x) ∆4f(x)


x0 0 1
2
x1 1 3 7
23 3
x2 3 49 19 0
80 3
x3 4 129 37
228
x4 7 813

𝑓 𝑥 = f(x0) + (x- x0) ∆f(x0)+ (x- x0) (x- x1) ∆2f(x0)+ (x- x0) (x- x1) (x- x2) ∆3f(x0)+ (x- x0) (x- x1) (x- x2) (x- x3) ∆4f(x0
3/11/2025 MATH-331 Numerical Analysis 22
Problem 4
Compute f(1.5) from the data points.

x 0 0.5 1 2 Solution: f(1.5) = 6.776

y 1 1.8987 3.7183 11.3891

x f(x) ∆f(x) ∆2f(x) ∆3f(x)


x0 0 1.000
1.797
x1 0.5 1.899 1.842
3.639 0.423
x2 1 3.718 2.688
7.671
x3 2 11.389
𝑓 𝑥 = f(x0) + (x- x0) ∆f(x0)+ (x- x0) (x- x1) ∆2f(x0)+ (x- x0) (x- x1) (x- x2) ∆3f(x0)

3/11/2025 MATH-331 Numerical Analysis 23

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