0% found this document useful (0 votes)
24 views

Expt 2_Interpolation_PPT

The document outlines the concept and applications of interpolation, particularly focusing on Lagrange's Interpolating Polynomial. It explains how interpolating polynomials can reconstruct functions from known data points and discusses the uniqueness of such polynomials for given data sets. Additionally, it includes examples, practice problems, and limitations of Lagrange interpolation, emphasizing its sensitivity to data and errors.

Uploaded by

reenavinu2
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)
24 views

Expt 2_Interpolation_PPT

The document outlines the concept and applications of interpolation, particularly focusing on Lagrange's Interpolating Polynomial. It explains how interpolating polynomials can reconstruct functions from known data points and discusses the uniqueness of such polynomials for given data sets. Additionally, it includes examples, practice problems, and limitations of Lagrange interpolation, emphasizing its sensitivity to data and errors.

Uploaded by

reenavinu2
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/ 21

MATHEMATICAL PHYSICS II LAB

Bachelor of Physics (Hons) II Semester


Experiment 2
Interpolation

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 1


What is Interpolation?

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 2


Uses of Interpolation
There are two main uses of interpolation or interpolating polynomials.
■ The first use is in reconstructing the function 𝑓(𝑥) when it is not given
explicitly and only the values of 𝑓(𝑥) and or its certain order
derivatives at a set of points called Nodes are known.
■ The reconstructed function can then be used to estimate the values of
𝑓 𝑥 at discrete points 𝑥! lying within the interval 𝑥" , 𝑥# . This
estimation of values of 𝑓 𝑥 is also referred to as interpolation.
■ The second use is to replace the function 𝑓(𝑥) by the interpolating
polynomial ∅(𝑥) so that many common operations such as
determination of roots, differentiation, integration etc., that are
intended for the function 𝑓(𝑥) may be performed using ∅(𝑥).
• The simplest form of an interpolant is a polynomial
• It is always possible to construct a unique polynomial of
degree n that passes through n + 1 distinct data points
Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 3
Existence of an Interpolating Polynomial
■ A polynomial ∅(𝑥) is called an interpolating polynomial if the values of ∅(𝑥) and / or its
certain order derivatives coincide with those of 𝑓(𝑥) and / or its certain order derivatives at
one or more tabular points.
■ The existence of a polynomial function ∅(𝑥) which approximates any continuous function
𝑓(𝑥) on a finite interval 𝑥! , 𝑥" is guaranteed by Weierstrass Approximation Theorem which
states:
If any function 𝒇(𝒙) is continuous in 𝒙𝒐 ≤ 𝒙 ≤ 𝒙𝒏 then given any 𝝐 > 𝟎 , there exists
polynomial ∅(𝒙) such that 𝒇 𝒙 − ∅(𝒙) < 𝝐, for all 𝒙 in 𝒙𝒐 , 𝒙𝒏 .
■ This means that it is possible to find a polynomial ∅(𝑥) whose graph remains within the
region bounded by y = 𝑓 𝑥 − 𝜖 and y = 𝑓 𝑥 + 𝜖 for all 𝑥 between 𝑥! and 𝑥" , however small
is 𝜖.
■ Uniqueness of Interpolating Polynomial ∅(𝒙) : For (n+1) data points, there is one and only
one polynomial of order n that passes through all the points. For example,
• there is only one straight line ( a linear polynomial) that passes through two points.
• there is only one parabola ( a quadratic polynomial) that connects three points.
■ Polynomial Interpolation consists of determining the unique nth order polynomial that fits the
given (n+1) data points.
■ Although there is a unique nth order polynomial that fits (n+1) data points, there are a variety
of mathematical formats in which the polynomial can be expressed.
■ We will be doing one such format, namely, the LAGRANGE Polynomials.

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 4


Weierstrass Approximation Theorem

𝑃 𝑥 ↔ ∅(𝑥) is the
Interpolating Polynomial.

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 5


Some Examples of Interpolating Polynomial

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 6


Lagrange’s Interpolation Polynomial
(equally/unequally spaced data points)

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 7


Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 8
It can also be written as:

%&" (&"
(𝑥 − 𝑥( )
𝑓 𝑥 ≈ 𝑃" 𝑥 = 9 𝑓(𝑥% ) :
(𝑥% − 𝑥( )
%&' (&'
()%

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 9


Cardinal Functions ■ If 𝑛 = 2, the interpolant is a parabola given by
𝑝, 𝑥 = 𝑦! 𝑙! 𝑥 + 𝑦+ 𝑙+ 𝑥 + 𝑦, 𝑙, (𝑥), where
■ Lagrange's Interpolating Polynomial can be written as

where the subscript 𝑛 represents the degree of the


polynomial and
■ The Cardinal Functions are polynomials of degree 𝑛
and have the property
where 𝛿*( is Kronecker delta

■ 𝑙* (𝑥) are called the Cardinal Functions.


■ If 𝑛 = 1, the interpolant is a straight line given by
𝑝+ 𝑥 = 𝑦! 𝑙! 𝑥 + 𝑦+ 𝑙+ (𝑥) with

Fig: Quadratic Cardinal Functions


Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 with 𝑥! = 0, 𝑥+ = 2, 𝑥, =103
More on Lagrange Interpolation
■ To prove that the Lagrange’s interpolating
polynomial passes through the data points, we
write

■ Error in Polynomial Interpolation can be shown


to be

where 𝜉 lies somewhere in the interval [𝑥! , 𝑥" ]


■ It is instructive to note that the farther a data Pseudo Code Implementation of
point is from 𝑥, the more it contributes to the Lagrange Interpolating Polynomial
error at 𝑥.
Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 11
Lagrange Linear Interpolation
■ To determine a polynomial of degree one, 𝑃# 𝑥 , that passes through the distinct
points (𝑥! , 𝑓(𝑥! )) & (𝑥# , 𝑓(𝑥# )) such that 𝑃# 𝑥! = 𝑓(𝑥! ) & 𝑃# 𝑥! = 𝑓(𝑥! ).
■ Lagrange’s Linear Interpolating Polynomial for a function 𝑓 𝑥 can be written as:
𝑃# 𝑥 = 𝑎# 𝑥 + 𝑎! ………….. (1)
with 𝑎! & 𝑎# as arbitrary constants to be determined using the conditions
𝑃# 𝑥! = 𝑎# 𝑥! + 𝑎! = 𝑓(𝑥$ )…………..(2)
𝑃# 𝑥# = 𝑎# 𝑥# + 𝑎! = 𝑓(𝑥# )…………….(3)
■ Eliminating 𝑎! & 𝑎# in the above equations, the required interpolating polynomial is
𝑃# 𝑥 𝑥 1 𝑃# 𝑥 𝑥 1
Given by 𝑃# (𝑥$ ) 𝑥! 1 = 𝑓(𝑥$ ) 𝑥! 1 = 0 . Solving the determinant we get,
𝑃# (𝑥# ) 𝑥# 1 𝑓(𝑥# ) 𝑥# 1
𝒙'𝒙𝟏 𝒙'𝒙𝒐
■ 𝑷𝟏 𝒙 = 𝒇 𝒙𝒐 + 𝒇 𝒙𝟏
𝒙𝒐 '𝒙𝟏 𝒙𝟏 '𝒙𝒐

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 12


Practice Problem-1

■ Determine the linear Lagrange


interpolating polynomial that passes
through the points (2, 4) and (5, 1).
■ The required Polynomial is
𝑃# 𝑥 = −x + 6

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 13


Lagrange Quadratic Interpolation
For three data points (𝑥" , 𝑓(𝑥" )), (𝑥D, 𝑓(𝑥D)) & (𝑥E, 𝑓(𝑥E)) ,
the Lagrange Interpolating Polynomial of degree two, 𝑃E 𝑥 , for the
function 𝑓(𝑥) such that,
𝑃E 𝑥" = 𝑓(𝑥" ), 𝑃E 𝑥D = 𝑓(𝑥D) & 𝑃E 𝑥E = 𝑓(𝑥E)
can be shown to be given by
𝒙G𝒙𝟏 (𝒙G𝒙𝟐 ) 𝒙G𝒙𝟎 (𝒙G𝒙𝟐 ) 𝒙G𝒙𝟎 (𝒙G𝒙𝟏 )
𝑷𝟐 𝒙 = 𝒙𝒐 G𝒙𝟏 𝒙𝒐 G𝒙𝟐
𝒇 𝒙𝒐 + 𝒙𝟏 G𝒙𝟎 𝒙𝟏 G𝒙𝟐
𝒇 𝒙𝟏 + 𝒙𝟐 G𝒙𝟎 𝒙𝟐 G𝒙𝟏
𝒇 𝒙𝟐

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 14


Visual Depiction of Rationale behind Lagrange Polynomial

■ The figure depicts a Quadratic Lagrange Interpolant


using 3 data points
■ Each of the three terms in the expression for 𝑷𝟐 𝒙
on the previous slide passes through one data point
& is zero at the other two points
■ The summation of the three terms must, therefore,
be the unique second-order polynomial 𝑷𝟐 𝒙 that
passes exactly through the three points.

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 15


Practice Problem-2

𝑃D 2 = 0.4620981
𝑃E 2 = 0.5658444

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 16


Practice Problem 3: Falling Parachutist

■ A parachutist of mass 68.1 kg jumps out of a


stationary hot air balloon. The drag
coefficient is 12.5 kg/s.
■ The velocity-time data of the falling
parachutist is given in the adjacent table.
■ Construct polynomials of orders n = 4,3,2 & 1
to estimate the velocity of the parachutist at
𝑡 = 10 s.
■ Compare & Analyze the results obtained.
Schematic Diagram
of forces acting on a
falling parachutist
𝐹- : Upward force due
to air resistance
𝐹. : Downward force
due to gravity
Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 17
Practice Problem 3: Result & Analysis
■ Lower the order, the lower the estimated
value of the velocity at 𝑡 = 10 s
■ The higher-order polynomials tend to
overshoot the trend of the given data
■ The first or second-order versions are most
appropriate for this particular trend analysis
■ It should be remembered, however, that be-
cause we are dealing with uncertain data,
regression would actually be more
appropriate
■ This example illustrates that higher-order
polynomials tend to be ill-conditioned, that
is, they tend to be highly sensitive to round-
off error. Limitation of Lagrange Interpolation:
Although the Lagrange polynomials are well-suited for
■ The same problem applies to higher-order determining intermediate values between points, they do not
polynomial regression provide a convenient polynomial of the conventional form
𝑃" (𝑥)
Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25
18
Direct Fitting of a Polynomial

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 19


Matrix Formulation
■ The Matrix Formulation of the given system of (n+1) equations can be written as
𝑦% 1 𝑥% 𝑥%' . . . . 𝑥%( 𝑎%
𝑦& 1 𝑥& 𝑥&' . . . . 𝑥&( 𝑎&
𝑦' 1 𝑥 𝑥 '
. . . . 𝑥 ( 𝑎'
: = :
' ' '
: : .. .. : :
: : : : .. .. : :
𝑦( 1 𝑥( 𝑥(' . . . . 𝑥(( 𝑎(
■ A unique solution exists if the “determinant” of the coefficients is ≠ 0.
■ The given determinant is the Vandermonde Determinant of the vector
𝑋 = 𝑥% , 𝑥& , 𝑥' , … … . . 𝑥( as
1 𝑥% 𝑥%' .. .. 𝑥%(
1 𝑥& 𝑥&' .. .. 𝑥&(
𝑉 𝑥% , 𝑥& , 𝑥' , … … . . 𝑥( = 1 𝑥' 𝑥'' .. .. 𝑥'(
: : : .. .. :
: : : .. .. :
1 𝑥( 𝑥(' .. .. 𝑥((

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 20


Drawbacks of Direct Fitting Approach

It should be noted that the foregoing approach is not the most efficient method that is
available to determine the coefficients of an interpolating polynomial because:
■ The given system of equations is usually ill-conditioned.
■ Whether they are solved with an elimination method or with a more efficient
algorithm, the resulting coefficients can be highly inaccurate, particularly for large n.
■ When used for a subsequent interpolation, they often yield erroneous results.
■ For interpolation problems, we prefer to work with Newton & Lagrange Interpolating
Polynomials.

Dr. Pragati Ashdhir , Professor, Department of Physics, Hindu College@2024-25 21

You might also like