SlideShare a Scribd company logo
1 of 24
Chapter 3. Interpolation and
Extrapolation
Hui Pan, Yunfei Duan
possible problem in physical
measurement
Sometimes know the value of a function
f(x) at a set of points, but we don’t have an
analytic expression for f(x) that lets us
calculate its value at an arbitrary point.
Interpolation and Extrapolation
Estimate f(x) for arbitrary x by, in some
sense, drawing a smooth curve through
the xi. If the desired x is in between the
largest and smallest of the xi’s the problem
is called interpolation. Otherwise it is
called extrapolation.
For example, suppose we have a table like this, which gives
some values of an unknown function f. Interpolation
provides a means of estimating the function at intermediate
points, such as x = 2.5.1
1: from wiki: http://en.wikipedia.org/wiki/Interpolation
x F(x)
0 0
1 0.8415
2 0.9093
3 0.1411
4 -0.7568
5 -0.9589
6 -0.2794
Linear interpolation
Since 2.5 is midway
between 2 and 3, it is
reasonable to take
f(2.5) midway between
f(2) = 0.9093 and f(3) =
0.1411, which yields
0.5252.
Polynomial interpolation
f(x) = -0.001521x6 – 0.003130x5 + 0.07321x4 –
0.3577x3 + 0.2255x2 + 0.9038x
Substituting x = 2.5, we find that
f(2.5) = 0.5965.
Spline interpolation
In this case we get f(2.5) = 0.5972.
Spline interpolation uses low-degree polynomials in each of the intervals, and
chooses the polynomial pieces such that they fit smoothly together. The resulting
function is called a spline.
The natural cubic spline interpolating the points in the
table above is given:
Different between interpolation
and function approximation
Interpolation: Given the function f at points
not of your own choosing.
Function approximation: Allowed to compute
the function f at any desired points for the
purpose of developing your approximation.
Two steps for the conceptually interpolation
process:
1. Fit an interpolation function to the data points
provided.
2. Evaluate that interpolating function at a target
point x.
Disadvantages for the above two-stage method:
1. Less efficient.
2. More susceptible to round-off error.
Many practical schemes start at a nearby point f(xi),
and then add a sequence of (hopefully) decreasing
corrections, as information from other nearby f(xi)’s
is incorporated.
The order of the interpolation:
The number of points – 1 used in an interpolation
scheme.
Increasing the order does not necessarily increase
the accuracy, especially in polynomial interpolation.
adding points close to the desired point usually does
help, but a finer mesh implies a larger table of
values, which is not always available.
Searching an Ordered Table:
• Given an array xj , j = 0, …, N – 1, with the
monotonically increasing or monotonically
decreasing , and given an integer M <= N, and a
number , find an interger j10such that x is among
the xj10, …, xj10+M-1. x should lies between xm and
xm+1, where
𝑀 = 𝑗10 +
𝑀 −2
2
• Bisection is the best way to solve the problem.
Search with Correlated Values:
Not good to do a full bisection when interpolation
routines are called multiply times.
Hunt method starts with a random position in the
table. It first “hunts,” either up or down, in
increments of 1, then 2, then 4, etc., until the
desired value is bracketed. It then bisects in the
bracketed interval.
hunt algorithm
Function hunt( double x)
{
//check xx[] is monotonic increasing or decreasing
//define jl as start point, ju as end point, inc as increment value
//move to right side if true.
if(x >= xx[jl])
{
for(;;) {
//update ju equal to jl plus increment value
//if ju >= n-1 or x < xx[ju], break;
//else update jl equal to ju, and increment * 2
}
} else {
for(;;) {
//update jl equal to jl minus increment value
//if jl <= 0 or x >= xx[jl], break;
//else update ju equal to jl, and increment * 2
}
}
bisection algorithm;
}
Cubic Spline Interpolation
We start from a set of points [xi , yi] for i = 0, 1, …, n for the
function y = f(x). The cubic spine interpolation is a
piecewise continuous curve, passing through each of the
values in the table.
• Spline of degree k = 3
• The domain of s is an interval [a, b]
• S, S’, S’’ are all continuous functions on [a, b]
S0(x) , x ∈[x0, x1]
S(x) = S1(x) , x ∈[x1, x2]
…
Sn-1(x) , x ∈[xn-1, xn]
Si(x) is a cubic polynomial that will be used on the
subinterval [xi, xi+1].
There is a separate cubic polynomial for each interval [xj-1,
xj], each with its own coefficients:
S(x) = sj(x) = ajx3 + bjx2 + cjx + dj x ∈ (xj—1, xj), j = 1,2,…n
• 4 coefficients with n subintervals = 4n equations
• There are 4n-2 conditions
• Interpolation conditions
• Continuity conditions
1. Set one or both of y0’’ and yN-1’’ equal to 0. S’’(x0) = 0,
S’’(xn) = 0.
2. Set either of y0’’ andyN-1’’ to values calculate from first
derivative function so as to make the first derivative of
the interpolating function have a specified value on
either or both boundaries.
The gold of cubic spline interpolation:
1. Smooth in the first derivative
2. Continuous in the second derivative.
Thus means :
s(xj – 0) = s(xj + 0)
s’(xj – 0) = s’(xj + 0) j = 1,2, …, n - 1
s’’(xj – 0) = s(xj + 0)
Assuming s’’(xi) = Mi (i = 0, 1, 2, …, n). Because s(x) is third
degree polynomial between xi and xi+1, so s’’(x)is first
degree polynomial in [xi , xi+1], which is:
𝑠′′′ 𝑥 =
𝑀𝑖+1 − 𝑀𝑖
𝑥𝑖+1 − 𝑥𝑖
∀𝑥 ∈ [𝑥𝑖, 𝑥𝑖+1]
Taylor series:
)
1
(
)
)(
6
2
6
1
(
)
(
)
(
!
3
)
(
!
2
)
)(
(
)
(
)
(
!
3
)
(
!
2
)
)(
(
)
(
!
3
)
(
)
(
!
2
)
(
)
)(
(
)
(
)
(
1
1
1
1
2
1
1
2
1
1
1
3
1
1
2
3
2
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
j
i
i
i
i
i
i
i
i
i
x
x
M
M
x
x
y
y
x
s
x
x
M
M
x
x
M
x
x
x
s
y
y
x
x
x
x
M
M
x
x
M
x
x
x
s
y
x
x
x
s
x
x
x
s
x
x
x
s
x
s
x
s


















































Let x = xi + 1
So, we can get :
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
i
h
h
h
h
h
h
x
x
h
x
x
M
M
x
x
y
y
x
x
M
M
x
x
y
y
x
x
M
M
x
x
y
y
x
s











































1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Let
)
)(
6
1
6
2
(
)
)(
6
2
6
1
(
(2)
(1)
,
continuous
is
(x)
s’
Because
)
2
(
)
)(
6
1
6
2
(
)
(



We can get the same result between [xi – 1, xi ]

More Related Content

Similar to polynomial interpolation

Numarical values
Numarical valuesNumarical values
Numarical valuesAmanSaeed11
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlightedAmanSaeed11
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output PrimitivesPrathimaBaliga
 
Introduction to Functions
Introduction to FunctionsIntroduction to Functions
Introduction to FunctionsMelanie Loslo
 
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdfa) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdfpetercoiffeur18
 
Intro. to computational Physics ch2.pdf
Intro. to computational Physics ch2.pdfIntro. to computational Physics ch2.pdf
Intro. to computational Physics ch2.pdfJifarRaya
 
Fortran chapter 2.pdf
Fortran chapter 2.pdfFortran chapter 2.pdf
Fortran chapter 2.pdfJifarRaya
 
Mit18 330 s12_chapter4
Mit18 330 s12_chapter4Mit18 330 s12_chapter4
Mit18 330 s12_chapter4CAALAAA
 
Probability distribution
Probability distributionProbability distribution
Probability distributionManoj Bhambu
 
Continuity and differentiability
Continuity and differentiability Continuity and differentiability
Continuity and differentiability Seyid Kadher
 
WEEK-4-Piecewise-Function-and-Rational-Function.pptx
WEEK-4-Piecewise-Function-and-Rational-Function.pptxWEEK-4-Piecewise-Function-and-Rational-Function.pptx
WEEK-4-Piecewise-Function-and-Rational-Function.pptxExtremelyDarkness2
 
2nd-year-Math-full-Book-PB.pdf
2nd-year-Math-full-Book-PB.pdf2nd-year-Math-full-Book-PB.pdf
2nd-year-Math-full-Book-PB.pdfproacademyhub
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlabsheetslibrary
 
Solution of non-linear equations
Solution of non-linear equationsSolution of non-linear equations
Solution of non-linear equationsZunAib Ali
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlabZunAib Ali
 
Roots of equations
Roots of equationsRoots of equations
Roots of equationsMileacre
 
Equations root
Equations rootEquations root
Equations rootMileacre
 

Similar to polynomial interpolation (20)

Numarical values
Numarical valuesNumarical values
Numarical values
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlighted
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Introduction to Functions
Introduction to FunctionsIntroduction to Functions
Introduction to Functions
 
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdfa) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
 
Intro. to computational Physics ch2.pdf
Intro. to computational Physics ch2.pdfIntro. to computational Physics ch2.pdf
Intro. to computational Physics ch2.pdf
 
Fortran chapter 2.pdf
Fortran chapter 2.pdfFortran chapter 2.pdf
Fortran chapter 2.pdf
 
Mit18 330 s12_chapter4
Mit18 330 s12_chapter4Mit18 330 s12_chapter4
Mit18 330 s12_chapter4
 
Daa chapter7
Daa chapter7Daa chapter7
Daa chapter7
 
Probability distribution
Probability distributionProbability distribution
Probability distribution
 
Continuity and differentiability
Continuity and differentiability Continuity and differentiability
Continuity and differentiability
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
WEEK-4-Piecewise-Function-and-Rational-Function.pptx
WEEK-4-Piecewise-Function-and-Rational-Function.pptxWEEK-4-Piecewise-Function-and-Rational-Function.pptx
WEEK-4-Piecewise-Function-and-Rational-Function.pptx
 
2nd-year-Math-full-Book-PB.pdf
2nd-year-Math-full-Book-PB.pdf2nd-year-Math-full-Book-PB.pdf
2nd-year-Math-full-Book-PB.pdf
 
2018-G12-Math-E.pdf
2018-G12-Math-E.pdf2018-G12-Math-E.pdf
2018-G12-Math-E.pdf
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlab
 
Solution of non-linear equations
Solution of non-linear equationsSolution of non-linear equations
Solution of non-linear equations
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlab
 
Roots of equations
Roots of equationsRoots of equations
Roots of equations
 
Equations root
Equations rootEquations root
Equations root
 

Recently uploaded

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 

Recently uploaded (20)

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 

polynomial interpolation