S.N.PATEL INSTITUTE OF TECHNOLOGY
AND RESEARCH CENTRE
Computational Method for Mechanical Engineering
Prepared by :
Padhiyar Brijesh R.
(170490728009)
Interpolation
Interpolation means to find values of
function f(x) for an x between
different x-values x0, x1…, xn at
which the values of f(x) are given.
NEWTON’S FORWARD
&
NEWTON’S BACKWARD
INTERPOLATION
NEWTON’S FORWARD INTERPOLATION
• Formula of Newton’s Forward Interpolation
𝑦 𝑛 𝑥 = 𝑦0 + 𝑝𝚫𝑦0 +
𝑝(𝑝 − 1)
𝚫2 𝑦0 +
𝑝(𝑝 − 1)(𝑝 − 2)
2! 3!
𝚫3 𝑦0 +⋯
+
𝑝(𝑝 − 1) (𝑝 − 2)…(𝑝 − 𝑛 + 1)
𝑛!
𝚫 𝑛 𝑦0
Here :- 𝑝 = 𝑥−𝑥0
ℎ
EXAMPLE
• Find The value Of 𝒕𝒂𝒏 0.12
𝑥 0.10 0.15 0.20 0.25 0.30
𝑦 = 𝑡𝑎𝑛 𝑥 0.1003 0.1511 0.2027 0.2553 0.3093
Solution
X Y Δ Δ2 Δ3 Δ4
0.10 0.1003
0.0508
0.15 0.1511 0.0008
0.0516 0.0002
0.20 0.2027 0.0010 0.0002
0.0526 0.0004
0.25 0.2553 0.0014
0.0540
0.30 0.3093
Applying Newton’s Forward Difference Interpolation Formula.
𝑦 𝑛 (x) = 𝑦0 + 𝑝𝚫𝑦0 + 𝚫2 𝑦0 +
𝑝(𝑝 − 1) 𝑝(𝑝 − 1) (𝑝 − 2)
2! 3!
𝚫3 𝑦0 +
𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3)
4!
𝚫4 𝑦0
Here 𝑦 𝑛 (x) = tan(0.12)
∴ 𝑝 = 𝑥−𝑥0
= 0.12−0.10
= 0.02
= 0.4
ℎ 0.05 0.05
∴ 𝑦 𝑛 (𝑥)= 0.1003 + 0.4( 0.0508)
(0.4−2)
+ 0.4 0.4−1
0.0008 + 0.4(0.4−1)
2 6 24
0.0002 + 0.4( 0.4−1)(0.4−2)(0.4−3)
0.0002
𝑦 𝑛 (x)= 0.1205
NEWTON’S BACKWARD INTERPOLATION
• Formula of Newton’s Backward Interpolation
𝑦 𝑛 (x) = 𝑦 𝑛 𝑝𝛁𝑦 𝑛 +
𝑝(𝑝 + 1)
2!
𝛁2 𝑦 𝑛 + ⋯+
𝑝(𝑝 − 1) … (𝑝 + 𝑛 − 1)
𝑛!
𝛁 𝑛 𝑦 𝑛
Here :- 𝑝 =
+
X - Xn
h
EXAMPLE
• Consider Following Tabular Values Determine y (300)
𝑥 50 100 150 200 250
𝑦 618 724 805 906 1032
Solution
X Y 𝛁 𝛁2 𝛁3 𝛁4
50 618
106
100 724 -25
81 45
150 805 20 -40
101 5
200 906 5
126
250 1032
Applying Newton’s Backward Difference interpolation Formula.
𝑦 𝑛 (𝑥 )= 𝑦0 + 𝑝𝛁𝑦 𝑛 +
𝑝(𝑝 − 1)
2!
𝛁2 𝑦 𝑛 +
𝑝(𝑝 − 1)(𝑝 − 2)
3!
𝛁3 𝑦 𝑛 +
𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3)
4!
𝛁4 𝑦 𝑛
Here, 𝑦 𝑛 (𝑥 ) = 𝑦 𝑛 (300)
∴ 𝑝 = 𝑥−𝑥 𝑛
= 300−250
= 1
ℎ 50
∴ 𝑦n(x) = 1032 + 126+
1(1+1)
2!
25 +
1( 1+1)(1+2)
3!
5 +
1( 1+1)(1+2)(1+3)
4!
(−40)
= 1032 + 126 + 25 + 5 −4
𝑦 𝑛(300) = 1148
NEWTON’S DIVIDED DIFFERENCE
INTERPOLATION
NEWTON’S DEVIDED
DIFFERENCE FORMULA
        0 0 0 1 0 1 0 1 2.....f x y x x x x x x x x x x x     
Example :
Find the polynomial of the lowest possible degree which assumes the values 3, 12,
15,-21 when x has the values 3, 2, 1,-1, respectively. Hence find f(0).
Solution
X Y Δ Δ2 Δ3
-1 -21
18
1 15 -7
-3 1
2 12 -3
-9
3 3
Using Newton’s divided difference formula, we get
f(x)=−21+(x − (−1)) * 18 +(x +1) (x − 1) * (−7) + (x + 1) (x − 1) (x − 2) * 1
= −21 + 18 (x + 1) + (x2 −1) (−7) + (x3 - 2x2 – x +2)
f(x) =x3 - 9x2 + 17x + 6
Hence f(0) = 6.
LANGRANGE’S INTERPOLATION
1 2
0
0 1 0 2 0
0 2
1
1 0 1 2 1
0 1
2
2 0 2 1 2
( )( )........( )
( )
( )( )........( )
( )( )........( )
( )( )........( )
( )( )........( )
+ .....
( )( )........( )
n
n
n
n
n
n
x x x x x x
F x y
x x x x x x
x x x x x x
y
x x x x x x
x x x x x x
y
x x x x x x
  

  
  

  
  
  
...
EXAMPLE
• Compute f(0.3) for the data
𝑥 0 1 3 4 7
f 1 3 49 129 813
1 2
0
0 1 0 2 0
0 2
1
1 0 1 2 1
0 1
2
2 0 2 1 2
( )( )........( )
( )
( )( )........( )
( )( )........( )
( )( )........( )
( )( )........( )
+ .....
( )( )........( )
n
n
n
n
n
n
x x x x x x
F x y
x x x x x x
x x x x x x
y
x x x x x x
x x x x x x
y
x x x x x x
  

  
  

  
  
  
...
(0.3−1)(0.3−3)(0.3−4)(0.3−7) (0.3−0)(0.3−3)(0.3−4)(0.3−7) (0.3−0)(0.3−1)(0.3−4)(0.3−7)
(0.3−0)(0.3−1)(0.3−3)(0.3−7) (0.3−0)(0.3−1)(0.3−3)(0.3−4)
(−1)(−3)(−4)(−7) (1)(-2)(−3)(−6) (3)(2)(−1)(−4)
(4)(3)(1)(−3) (4)(3)(6)(7)
*1+= *49+*3+
*813*129+
= 1.831
Thank you…

Interpolation

  • 1.
    S.N.PATEL INSTITUTE OFTECHNOLOGY AND RESEARCH CENTRE Computational Method for Mechanical Engineering Prepared by : Padhiyar Brijesh R. (170490728009)
  • 2.
    Interpolation Interpolation means tofind values of function f(x) for an x between different x-values x0, x1…, xn at which the values of f(x) are given.
  • 3.
  • 4.
    NEWTON’S FORWARD INTERPOLATION •Formula of Newton’s Forward Interpolation 𝑦 𝑛 𝑥 = 𝑦0 + 𝑝𝚫𝑦0 + 𝑝(𝑝 − 1) 𝚫2 𝑦0 + 𝑝(𝑝 − 1)(𝑝 − 2) 2! 3! 𝚫3 𝑦0 +⋯ + 𝑝(𝑝 − 1) (𝑝 − 2)…(𝑝 − 𝑛 + 1) 𝑛! 𝚫 𝑛 𝑦0 Here :- 𝑝 = 𝑥−𝑥0 ℎ
  • 5.
    EXAMPLE • Find Thevalue Of 𝒕𝒂𝒏 0.12 𝑥 0.10 0.15 0.20 0.25 0.30 𝑦 = 𝑡𝑎𝑛 𝑥 0.1003 0.1511 0.2027 0.2553 0.3093
  • 6.
    Solution X Y ΔΔ2 Δ3 Δ4 0.10 0.1003 0.0508 0.15 0.1511 0.0008 0.0516 0.0002 0.20 0.2027 0.0010 0.0002 0.0526 0.0004 0.25 0.2553 0.0014 0.0540 0.30 0.3093
  • 7.
    Applying Newton’s ForwardDifference Interpolation Formula. 𝑦 𝑛 (x) = 𝑦0 + 𝑝𝚫𝑦0 + 𝚫2 𝑦0 + 𝑝(𝑝 − 1) 𝑝(𝑝 − 1) (𝑝 − 2) 2! 3! 𝚫3 𝑦0 + 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4! 𝚫4 𝑦0 Here 𝑦 𝑛 (x) = tan(0.12) ∴ 𝑝 = 𝑥−𝑥0 = 0.12−0.10 = 0.02 = 0.4 ℎ 0.05 0.05 ∴ 𝑦 𝑛 (𝑥)= 0.1003 + 0.4( 0.0508) (0.4−2) + 0.4 0.4−1 0.0008 + 0.4(0.4−1) 2 6 24 0.0002 + 0.4( 0.4−1)(0.4−2)(0.4−3) 0.0002 𝑦 𝑛 (x)= 0.1205
  • 8.
    NEWTON’S BACKWARD INTERPOLATION •Formula of Newton’s Backward Interpolation 𝑦 𝑛 (x) = 𝑦 𝑛 𝑝𝛁𝑦 𝑛 + 𝑝(𝑝 + 1) 2! 𝛁2 𝑦 𝑛 + ⋯+ 𝑝(𝑝 − 1) … (𝑝 + 𝑛 − 1) 𝑛! 𝛁 𝑛 𝑦 𝑛 Here :- 𝑝 = + X - Xn h
  • 9.
    EXAMPLE • Consider FollowingTabular Values Determine y (300) 𝑥 50 100 150 200 250 𝑦 618 724 805 906 1032
  • 10.
    Solution X Y 𝛁𝛁2 𝛁3 𝛁4 50 618 106 100 724 -25 81 45 150 805 20 -40 101 5 200 906 5 126 250 1032
  • 11.
    Applying Newton’s BackwardDifference interpolation Formula. 𝑦 𝑛 (𝑥 )= 𝑦0 + 𝑝𝛁𝑦 𝑛 + 𝑝(𝑝 − 1) 2! 𝛁2 𝑦 𝑛 + 𝑝(𝑝 − 1)(𝑝 − 2) 3! 𝛁3 𝑦 𝑛 + 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4! 𝛁4 𝑦 𝑛 Here, 𝑦 𝑛 (𝑥 ) = 𝑦 𝑛 (300) ∴ 𝑝 = 𝑥−𝑥 𝑛 = 300−250 = 1 ℎ 50 ∴ 𝑦n(x) = 1032 + 126+ 1(1+1) 2! 25 + 1( 1+1)(1+2) 3! 5 + 1( 1+1)(1+2)(1+3) 4! (−40) = 1032 + 126 + 25 + 5 −4 𝑦 𝑛(300) = 1148
  • 12.
  • 13.
    NEWTON’S DEVIDED DIFFERENCE FORMULA        0 0 0 1 0 1 0 1 2.....f x y x x x x x x x x x x x     
  • 14.
    Example : Find thepolynomial of the lowest possible degree which assumes the values 3, 12, 15,-21 when x has the values 3, 2, 1,-1, respectively. Hence find f(0).
  • 15.
    Solution X Y ΔΔ2 Δ3 -1 -21 18 1 15 -7 -3 1 2 12 -3 -9 3 3
  • 16.
    Using Newton’s divideddifference formula, we get f(x)=−21+(x − (−1)) * 18 +(x +1) (x − 1) * (−7) + (x + 1) (x − 1) (x − 2) * 1 = −21 + 18 (x + 1) + (x2 −1) (−7) + (x3 - 2x2 – x +2) f(x) =x3 - 9x2 + 17x + 6 Hence f(0) = 6.
  • 17.
    LANGRANGE’S INTERPOLATION 1 2 0 01 0 2 0 0 2 1 1 0 1 2 1 0 1 2 2 0 2 1 2 ( )( )........( ) ( ) ( )( )........( ) ( )( )........( ) ( )( )........( ) ( )( )........( ) + ..... ( )( )........( ) n n n n n n x x x x x x F x y x x x x x x x x x x x x y x x x x x x x x x x x x y x x x x x x                     ...
  • 18.
    EXAMPLE • Compute f(0.3)for the data 𝑥 0 1 3 4 7 f 1 3 49 129 813
  • 19.
    1 2 0 0 10 2 0 0 2 1 1 0 1 2 1 0 1 2 2 0 2 1 2 ( )( )........( ) ( ) ( )( )........( ) ( )( )........( ) ( )( )........( ) ( )( )........( ) + ..... ( )( )........( ) n n n n n n x x x x x x F x y x x x x x x x x x x x x y x x x x x x x x x x x x y x x x x x x                     ... (0.3−1)(0.3−3)(0.3−4)(0.3−7) (0.3−0)(0.3−3)(0.3−4)(0.3−7) (0.3−0)(0.3−1)(0.3−4)(0.3−7) (0.3−0)(0.3−1)(0.3−3)(0.3−7) (0.3−0)(0.3−1)(0.3−3)(0.3−4) (−1)(−3)(−4)(−7) (1)(-2)(−3)(−6) (3)(2)(−1)(−4) (4)(3)(1)(−3) (4)(3)(6)(7) *1+= *49+*3+ *813*129+ = 1.831
  • 20.