0% found this document useful (0 votes)
27 views35 pages

Interpolation

The document provides an overview of interpolation techniques, including linear interpolation and Newton's interpolation methods, with practical examples and formulas. It explains how to estimate unknown values within a range of known data points and discusses the difference between interpolation and extrapolation. Several mathematical problems are presented to illustrate the application of these concepts in real-world scenarios.
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)
27 views35 pages

Interpolation

The document provides an overview of interpolation techniques, including linear interpolation and Newton's interpolation methods, with practical examples and formulas. It explains how to estimate unknown values within a range of known data points and discusses the difference between interpolation and extrapolation. Several mathematical problems are presented to illustrate the application of these concepts in real-world scenarios.
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/ 35

Interpolation

Instructor - Sadia Tasnim


Lecturer
Presidency University
Dhaka, Bangladesh
Interpolation
Interpolation is used in → Estimating unknown values within the
range of a set of known data points.
Real world examples:
• Estimating temperature at a time between two recorded values.
• Rescaling images in computer graphics.
Time(in min) Temp.(℃)
0 24.1
5 24.6
10 25.8
15 27.5
20 29
• Interpolation: Estimating values within the data range. Limited to
existing data.
• Extrapolation: Estimating values beyond the data range. Used for
predictions outside the known data.
Linear Interpolation
• Formula:
𝑦2 − 𝑦1
𝑦 = 𝑦1 + 𝑥 − 𝑥1 ×
𝑥2 − 𝑥1
• x is the point to interpolate in between the coordinates (𝑥1 , 𝑦1 )
and (𝑥2 , 𝑦2 ).
• y is the interpolated value.
Math 1
Q: Find the value of y if x = 7 using linear interpolation and some set
of values are given as (3, 4), (6, 8)?
Sol:
Let, 𝑥1 = 3, 𝑦1 = 4, 𝑥2 = 6, 𝑦2 = 8 & 𝑥 = 7
We know,
𝑦2 − 𝑦1
𝑦 = 𝑦1 + 𝑥 − 𝑥1 ×
𝑥2 − 𝑥1
8−4
or, 𝑦 = 4 + 7 − 3 ×
6−3
28
or, y= = 9.33
3
∴ 𝑇ℎ𝑒 𝑖𝑛𝑡𝑒𝑟𝑝𝑜𝑙𝑎𝑡𝑒𝑑 𝑣𝑎𝑙𝑢𝑒 𝑎𝑡 𝑥 = 7 𝑖𝑠 𝑦 = 9.33
Math 2
Q: Calculate the estimated height of the boy in the fourth position.
Position (x) 1 2 3 5
Height in ft. 3 4.5 5 6
(y)

Sol:Let, 𝑥1 = 3, 𝑦1 = 5, 𝑥2 = 5, 𝑦2 = 6 & 𝑥 = 4
We know,
𝑦2 − 𝑦1
𝑦 = 𝑦1 + 𝑥 − 𝑥1 ×
𝑥2 − 𝑥1
6−5
or, 𝑦 = 5 + 4 − 3 ×
5−3
or, y = 5.5
∴ 𝑇ℎ𝑒 ℎ𝑒𝑖𝑔ℎ𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑏𝑜𝑦 𝑖𝑛 𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛 4 𝑖𝑠 5.5 𝑓𝑡.
Math 3
Q: Calculate the temperature at time 1 minute and 5 minute
through linear interpolation from the given chart.
Time ( min) 0 2 3 4 6 7
Temperature(℃) 24.1 24.9 25.7 26.3 28 28.6

Sol: To find the temperature at time 1 min:


Let, 𝑥1 = 0, 𝑦1 = 24.1, 𝑥2 = 2, 𝑦2 = 24.9 & 𝑥 = 1
We know,
𝑦2 − 𝑦1
𝑦 = 𝑦1 + 𝑥 − 𝑥1 ×
𝑥2 − 𝑥1
24.9−24.1
or, 𝑦 = 24.1 + 1 − 0 ×
2−0
or, y = 24.5
Sol: To find the temperature at time 5 min:
Let, 𝑥1 = 4, 𝑦1 = 26.3, 𝑥2 = 6, 𝑦2 = 28 & 𝑥 = 5
We know,
𝑦2 − 𝑦1
𝑦 = 𝑦1 + 𝑥 − 𝑥1 ×
𝑥2 − 𝑥1
28−26.3
or, 𝑦 = 26.3 + 5 − 4 ×
6−4
or, y = 27.15

∴ 𝑇ℎ𝑒 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 𝑎𝑡 𝑡𝑖𝑚𝑒 1 𝑚𝑖𝑛𝑢𝑡𝑒 𝑖𝑠 24.5℃ &


𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 𝑎𝑡 𝑡𝑖𝑚𝑒 5 𝑚𝑖𝑛𝑢𝑡𝑒 𝑖𝑠 27.15℃.
Newton’s Interpolation
1. Newton’s Forward Interpolation
2. Newton’s Backward Interpolation

• These two methods are used in case of equal interval sets of data.
• Newton’s Forward Interpolation is used in the beginning of data
table.
• Newton’s Backward Interpolation is used at the tail of data table.
Newton’s Forward Interpolation
• Let x0, x1, x2,x3,……..,xn-1,xn be a set of equidistant values of variable x.

• x1-x0= x2-x1= x3-x2 =……..= xn-xn-1= h


𝑥−𝑥0
• Let, 𝑢 =

• Newton’s forward Interpolation formula is:


𝑢 𝑢(𝑢−1) 2 𝑢(𝑢−1)(𝑢−2) 3 𝑢(𝑢−1)(𝑢−2)⋯(𝑢−𝑛+1) 𝑛
y= 𝑦0 + Δ𝑦0 + Δ 𝑦0 + Δ 𝑦0 + ⋯+ Δ 𝑦0
1! 2! 3! 𝑛!
Math 1
From the table interpolate the value of f(x) when x=4, given
X 3 5 7 9
F(x) = y 180 150 120 90

Here, x1-x0= x2-x1= x3-x2 = h = 2

𝑥 − 𝑥0 4 − 3
∴𝑢= = = 0.5
ℎ 2
Newton’s forward Interpolation formula is:
𝑢 𝑢(𝑢−1) 2 𝑢(𝑢−1)(𝑢−2) 3 𝑢(𝑢−1)(𝑢−2)⋯(𝑢−𝑛+1) 𝑛
y = 𝑦0 + Δ𝑦0 + Δ 𝑦0 + Δ 𝑦0 + ⋯+ Δ 𝑦0
1! 2! 3! 𝑛!
Difference Table:
x y=f(x) ∆y ∆𝟐 y ∆𝟑 y

3 180

150-180
= -30
5 150
-30-(-30)
=0
0-0
120-150
=0
7 120 = -30
-30-(-30)
=0
90-120
=-30
9 90
Difference Table:
x y=f(x) ∆y ∆𝟐 y ∆𝟑 y
𝑦0 = 180
3 180 Δ𝑦0 = -30

150-180 Δ2 𝑦0 = 0
= -30
5 150 Δ3 𝑦0 = 0
-30-(-30)
=0
0-0
120-150
=0
7 120 = -30
-30-(-30)
=0
90-120
=-30
9 90
𝑢 𝑢(𝑢−1) 2 𝑢(𝑢−1)(𝑢−2) 3 𝑢(𝑢−1)(𝑢−2)⋯(𝑢−𝑛+1) 𝑛
y = 𝑦0 + Δ𝑦0 + Δ 𝑦0 + Δ 𝑦0 + ⋯ + Δ 𝑦0
1! 2! 3! 𝑛!
0.5 0.5×(0.5−1) 0.5× 0.5−1 × 0.5−2
y= 180 + × −30 + × 0 + × 0
1! 2! 3!
y = 180 – 15 = 165
Problem 2
From the table interpolate the value of f(x) when x=2.5, given
x 2 3 4 5 6

y=f(x) 14.5 16.3 17.5 18 19

Ans :
Problem 3
• Estimate the population in 1893 from the following data:
Year 1891 1901 1911 1921
Population 46 66 81 93

Here, x1-x0= x2-x1= x3-x2 = h = 10

𝑥 − 𝑥0 1893 − 1891
∴𝑢= = = 0.2
ℎ 10
Difference Table:
x y=f(x) ∆y ∆𝟐 y ∆𝟑 y Newton’s forward Interpolation formula is:
𝑢 𝑢(𝑢−1) 2 𝑢(𝑢−1)(𝑢−2) 3
y = 𝑦0 + Δ𝑦0 + Δ 𝑦0 + Δ 𝑦0 + ⋯+
1! 2! 3!
1891 46
𝑢(𝑢−1)(𝑢−2)⋯(𝑢−𝑛+1) 𝑛
Δ 𝑦0
𝑛!
20
Or,
1901 66 -5
0.2 0.2×(0.2−1)
15 2 y = 46 + × 20 + × −5
1! 2!

1911 81 -3 0.2× 0.2−1 × 0.2−2


+ ×2
3!
12
Or, y=50.496 = 51 (approx.)
1921 93

𝑦0 = 46
Δ𝑦0 = 20
Δ2 𝑦0 = -5
Δ3 𝑦0 = 2
Problem 4
𝑥 − 𝑥0 0.25 − 0.0
ℎ = 0.1 & 𝑢 = = = 2.5
ℎ 0.1
𝒙 𝒚 ∆𝒚 ∆𝟐 𝒚 ∆𝟑 𝒚 ∆𝟒 𝒚
0.0 0.0000
0.0998
-0.0009 𝑦0 = 0
0.1 0.0998 -0.0012 Δ𝑦0 = 0.0998
0.0989 Δ2 𝑦0 = -0.0009
0.2 0.1987 -0.0021 0.0004 Δ3 𝑦0 = -0.0012
-0.0008 Δ4 𝑦0 = 0.0004
0.0968
0.3 0.2955 -0.0029

0.0939
0.4 0.3894
Some problems
1. Estimate 𝑓 2.5 for given data point:
x 1 2 3 4 5
f(x) 3 15 49 111 217

2. Estimate 𝑓(0.5) using Newton’s Forward Interpolation for


𝑓 𝑥 = 𝑒 𝑥 from the given data point and compare with original
value of 𝑒 0.5 :
x 0 0.2 0.4 0.6 0.8
f(x) 1.0000 1.2214 1.4918 1.8221 2.2255
Newton’s Backward Interpolation
Suppose we want to find the annual premium at the age of 33 from the following data,

Age 24 28 32 36 40

Annual 28.06 30.19 32.73 34.94 40


Premium

Backward of the Table


𝑥−𝑥𝑛
𝑢= ; where ℎ = 𝑥𝑛 − 𝑥𝑛−1

Newton’s backward interpolation formula:

𝑢 𝑢×(𝑢+1) 𝑢×(𝑢+1)×(𝑢+2)
𝑦= 𝑦𝑛 + × ∇𝑦𝑛−1 + × ∇2 𝑦𝑛−2 + × ∇3 𝑦𝑛−3 + ⋯
1! 2! 3!
Example
Q: Find the value of 𝑓(1.35) using Newton’s backward interpolation
from the following data points:
𝑥 1 1.1 1.2 1.3 1.4
𝑓(𝑥) 2.7183 3.0042 3.3201 3.6693 4.0552

Soln:

𝑥−𝑥𝑛 1.35−1.4
𝑢= = = −0.5 ; where ℎ = 𝑥𝑛 − 𝑥𝑛−1 = 1.4 − 1.3 = 0.1
ℎ 0.1

Newton’s backward interpolation formula:


𝑢 𝑢×(𝑢+1) 𝑢×(𝑢+1)×(𝑢+2)
𝑦= 𝑦𝑛 + × ∇𝑦𝑛−1 + × ∇2 𝑦𝑛−2 + × ∇3 𝑦𝑛−3 + ⋯
1! 2! 3!
Difference table:
𝑥 𝑓 𝑥 =𝑦 ∇𝑦 ∇2 𝑦 ∇3 𝑦 ∇4 𝑦

1 2.7183
0.2859
0.03
1.1 3.0042 0.0033
0.3159 0.0001
1.2 3.3201 0.0333
0.0034
0.3492
1.3 3.6693 0.0367

0.3859
1.4 4.0552
Newton’s backward interpolation formula:
𝑢 𝑢×(𝑢+1) 𝑢×(𝑢+1)×(𝑢+2)
𝑦 = 𝑦𝑛 + × ∇ 𝑦𝑛−1 + × ∇2 𝑦𝑛−2 + × ∇3 𝑦𝑛−3 +⋯
1! 2! 3!
𝑢 𝑢×(𝑢+1) 𝑢×(𝑢+1)×(𝑢+2)
𝑦= 𝑦4 + × ∇𝑦3 + × ∇2 𝑦2 + × ∇3 𝑦1
1! 2! 3!

𝑢 × (𝑢 + 1) × (𝑢 + 2) × (𝑢 + 3)
+ × ∇4 𝑦0
4!

−0.5 −0.5×(−0.5+1) −0.5×(−0.5+1)×(−0.5+2)


𝑦 = 4.0552 + × 0.3859 + × 0.0367 + ×
1! 2! 3!
−0.5×(−0.5+1)×(−0.5+2)×(−0.5+3)
0.0034 + × 0.0001
4!

𝑦 = 3.857446094
1) Estimate f(1.25) using Newton's Backward Interpolation from
data points:
x 1.0 1.1 1.2 1.3
f(x) 2.7183 3.0042 3.3201 3.6693

2) Values of x ( in degrees) and sin x are given in the following table:


x° 15 20 25 30 35 40
f(x) 0.259 0.342 0.423 0.5 0.574 0.643

Find the value of sin (38̊ ) using newton’s backward difference


formula.
Lagrange’s Interpolation
• When the given values are at unequal interval, we will use
Lagrange’s Interpolation.
Definition
Math 1
Math 2
Math 3
Math 4

You might also like