TE Mechanical-Numerical Methods & Optimization - Unit 05
TE Mechanical-Numerical Methods & Optimization - Unit 05
TE Mechanical-Numerical Methods & Optimization - Unit 05
Compiled by
Dr. Shyam Arjun Sonawane
Associate Professor, Mechanical Engineering
Government College of Engineering & Research, Avasari (Kh)
What is Inverse Interpolation ?
• Given (x0,y0), (x1,y1), …… (xn,yn), find the value of ‘x’ at a value of ‘y’
that is not given.
Interpolation: Lagrange formula
• We have been finding the value of y corresponding to a certain value of
x from a given set of values of x and y by using the Lagrange formula
given by
yg=(y0)(L0) + (y1)(L1) + (y2)(L2) +…………+(Yn-1)(Ln-1)
• L0 = (xg − x1) (xg − x2)……. (xg − xn-1)/ (x0 − x1 ) (x0 − x2 ) ……. (x0 − xn-1 )
• L1 = (xg − x0) (xg − x2)……. (xg − xn-1)/ (x1 − x0 ) (x1 − x2 ) ……. (x1 − xn-1 )
• L2 = (xg − x0) (xg − x1)……. (xg − xn-1)/ (x2 − x0 ) (x2 − x1 ) ……. (x2− xn-1 )
• ……………………………………………………………………………………………….
• Ln-1 = (xg − x0) (xg − x1)……. (xg − xn-2)/ (xn-1 − x0 ) (xn-1 − x1) ……. (xn-1 − xn-2 )
Inverse Interpolation: Lagrange formula
• On the other hand, the process of estimating the value of x for a
value of y is called inverse interpolation.
xg = 1.7160 at yg = 2
Problems on Inverse Interpolation
1. The following table gives the values of x and y.
x 20 25 30 35
f(x) 0.342 0.423 0.5 0.65
Problems on Inverse Interpolation
3. The following data gives the values of y corresponding to certain
values of x. Find the value of x when y=167.59789 by applying
Lagrange’s method.
x 1 2 5 7
y 1 12 117 317
Reference Books
1. Steven C. Chapra, Raymond P. Canale, Numerical Methods for
Engineers, 4/e, Tata McGraw Hill Editions
2. Dr. B. S. Garewal, Numerical Methods in Engineering and Science,
Khanna Publishers,.
3. Steven C. Chapra, Applied Numerical Methods with MATLAB for
Engineers and Scientist, Tata Mc-Graw Hill Publishing Co-Ltd
4. Rao V. Dukkipati, Applied Numerical Methods using Matlab, New
Age International Publishers
Reference Books …Contd
5. Gerald and Wheatley, Applied Numerical Analysis, Pearson
Education Asia
6. E. Balagurusamy, Numerical Methods, Tata McGraw Hill
7. P. Thangaraj, Computer Oriented Numerical Methods, PHI
8. S. S. Sastry, Introductory Methods of Numerical Analysis, PHI.
Lagrange Method of Interpolation
Compiled by
Dr. Shyam Arjun Sonawane
Associate Professor, Mechanical Engineering
Government College of Engineering & Research, Avasari (Kh)
What is Interpolation ?
• Given (x0,y0), (x1,y1), …… (xn,yn), find the value of ‘y’ at a value of ‘x’
that is not given.
Lagrange Interpolation
Lagrangian interpolating polynomial is given by
n
f n ( x) = Li ( x) f ( xi )
i =0
where ‘ n ’ in f n (x) stands for the n th order polynomial that approximates the function y = f (x)
3
The Lagrange Polynomial: The Linear Case
The problem of determining a polynomial of degree one that passes
through the distinct points
(x0, y0) and (x1, y1)
is the same as approximating a function f for which
f (x0) = y0 and f (x1) = y1
by means of a first-degree polynomial interpolating, or agreeing
with, the values of f at the given points.
Using this polynomial for approximation within the interval given by
the endpoints is called polynomial interpolation.
The Lagrange Polynomial: The Linear Case …cont
• Define the functions L0(x) = (x − x1)/ (x0 − x1 )and L1(x) = (x − x0) /(x1 −
x0) .
• The linear Lagrange interpolating polynomial though (x0, y0) and (x1,
y1) is
Where x is the distance from the surface (mm) and V is the velocity
(mm/sec). Use Lagrange’s interpolation polynomial
Problems on Lagrange’s Interpolation
2. Using the following points, fit a polynomial using Lagrange’s
method and find the value of y at x=2.7
x 0 1 2 5
y 2 3 12 147
Problems on Lagrange’s Interpolation
4. Using Lagrange’s formula, find a unique polynomial P(x) of degree
2 or less and hence evaluate P(1.5)
x 1 3 4
y 1 27 54
Problems on Lagrange’s Interpolation
5. Using suitable interpolation formula find a polynomial which
passes the points
x 0 1 3 4
y -12 0 6 12
Problems on Lagrange’s Interpolation
6. Use Lagrange’s method to fit a polynomial to the following points
and find the value of y at x=1
x -1 0 2 3
y -8 3 1 12
Reference Books
1. Steven C. Chapra, Raymond P. Canale, Numerical Methods for
Engineers, 4/e, Tata McGraw Hill Editions
2. Dr. B. S. Garewal, Numerical Methods in Engineering and Science,
Khanna Publishers,.
3. Steven C. Chapra, Applied Numerical Methods with MATLAB for
Engineers and Scientist, Tata Mc-Graw Hill Publishing Co-Ltd
4. Rao V. Dukkipati, Applied Numerical Methods using Matlab, New
Age International Publishers
Reference Books …Contd
5. Gerald and Wheatley, Applied Numerical Analysis, Pearson
Education Asia
6. E. Balagurusamy, Numerical Methods, Tata McGraw Hill
7. P. Thangaraj, Computer Oriented Numerical Methods, PHI
8. S. S. Sastry, Introductory Methods of Numerical Analysis, PHI.
Newton’s Forward and Backward
Difference Interpolation
Compiled by
Dr. Shyam Arjun Sonawane
Associate Professor, Mechanical Engineering
Government College of Engineering & Research, Avasari (Kh)
What is Interpolation ?
• Given (x0,y0), (x1,y1), …… (xn,yn), find the value of ‘y’ at a value of ‘x’
that is not given.
Lagrange Interpolation Disadvantages
• The amount of computation required is large
• Interpolation for additional values of requires the same
amount of effort as the first value (i.e. no part of the previous
calculation can be used)
• When the number of interpolation points are changed
(increased/decreased), the results of the previous
computations can not be used
• Error estimation is difficult (at least may not be convenient)
3
Newton’s Forward Interpolation
• Use Newton Interpolation which is based on developing difference
tables for a given set of data points
• The Nth degree interpolating polynomial obtained by fitting N + 1
data points will be identical to that obtained using Lagrange
formulae!
• Newton interpolation is simply another technique for obtaining the
same interpolating polynomial as was obtained using the Lagrange
formulae
Newton’s Forward Interpolation …cont
• We assume equi-spaced points
Newton’s Forward Interpolation …cont
• Forward differences are now defined as follows:
Where u= ((xg – x0 ) / h)
h = step size
Newton’s Forward Interpolation …cont
Example: From the following table of yearly premium for policies
maturity at coming ages, estimate the premiums for policies
maturity at the age of 46 years.
Age (x) 45 50 55 60 65
Premium (y) 2.871 2.404 2.083 1.862 1.712
Newton’s Forward Interpolation …cont
Solution: (1) Calculate the value of h and u
h= x1 – x0
= 55 – 45
=5
u= ((xg – x0 ) / h)
= ((46 - 45) / 5 )
= 0.2
Newton’s Forward Interpolation …cont
(2) Prepare the Newton’s Forward difference table
x y ∆yo ∆2yo ∆3yo ∆4yo
45 2.871 -0.467 0.146 -0.046 0.017
50 2.404 -0.321 0.1 -0.029
55 2.083 -0.221 0.071
60 1.862 -0.15
65 1.712
Newton’s Forward Interpolation …cont
(3) Calculate the value of yg at xg = 46
yg = y0 + u ∆yo + ((u(u-1)) / 2 !) ∆2yo + ((u(u-1) (u-2)) / 3 !) ∆3yo +
((u(u-1) (u-2) (u-3)) / 4 !) ∆4yo
• yg = 2.7631
• At xg = 46 , yg = 2.7631 (Answer)
Problems on Newton’s Forward Interpolation
1. State the order of polynomial which might be suitable for
following function. Calculate f(3.5) using forward difference
formula
x 2 3 4 5 6 7 8 9
y 19 48 99 178 291 444 643 894
Problems on Newton’s Forward Interpolation
2. Find the value of y for x=0.5 for the following table of x, y values
using Newton’s forward difference formula
x 0 1 2 3 4
y 1 5 25 100 250
Problems on Newton’s Forward Interpolation
3. From the tabulated values of x and y given below prepare forward
difference table. Find the polynomial passing through the points and
estimate the value of y when x=1.5. Also find the slope of curve at
x=1.5
x 0 2 4 6 8
y 5 29 125 341 725
Problems on Newton’s Forward Interpolation
4. Find the polynomial passing through the following points using
Newton’s forward difference formula and hence find y and dy/dx at x
=0.5
x 0 1 2 3 4 5
y 1 1 7 25 61 12
Problems on Newton’s Forward Interpolation
5. Following is the table of square roots. Calculate the values of
square root of 151 and 155 by using Newton’s forward difference
formula
x 0 1 3 4
y -12 0 6 12
Problems on Newton’s Forward Interpolation
6. The following data are taken from the steam table. Find the
pressure at t=142⁰C using Newton’s forward difference formula
x0 y0
x1 y1
x2 y2
x3 y3
Newton’s Backward Interpolation …cont
Newton’s Backward Interpolation …cont
Example: For the following data using backward difference
polynomial interpolate at x = 0.25
0.1 1.4
---- yn - 1
Newton’s Backward Interpolation …cont
Problem on Newton’s Backward Interpolation
1. Prepare the backward difference table for the given values of x and
y
x 0 2 4 6 8 10
y 2 6 8 9 11 15
Reference Books
1. Steven C. Chapra, Raymond P. Canale, Numerical Methods for
Engineers, 4/e, Tata McGraw Hill Editions
2. Dr. B. S. Garewal, Numerical Methods in Engineering and Science,
Khanna Publishers,.
3. Steven C. Chapra, Applied Numerical Methods with MATLAB for
Engineers and Scientist, Tata Mc-Graw Hill Publishing Co-Ltd
4. Rao V. Dukkipati, Applied Numerical Methods using Matlab, New
Age International Publishers
Reference Books …Contd
5. Gerald and Wheatley, Applied Numerical Analysis, Pearson
Education Asia
6. E. Balagurusamy, Numerical Methods, Tata McGraw Hill
7. P. Thangaraj, Computer Oriented Numerical Methods, PHI
8. S. S. Sastry, Introductory Methods of Numerical Analysis, PHI.