SlideShare a Scribd company logo
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Interpolation/Curve Fitting
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Objectives
• Understanding the difference between
regression and interpolation
• Knowing how to “best fit” a polynomial into
a set of data
• Knowing how to use a polynomial to
interpolate data
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Measured Data
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Polynomial Fit!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Line Fit!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Which is better?
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Curve Fitting
• If the data measured is of high accuracy
and it is required to estimate the values of
the function between the given points,
then, polynomial interpolation is the
best choice.
• If the measurements are expected to be of
low accuracy, or the number of
measured points is too large, regression
would be the best choice.
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Interpolation
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Why Interpolation?
• When the accuracy of your measurements
are ensured
• When you have discrete values for a
function (numerical solutions, digital
systems, etc …)
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Acquired Data
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
But, how to get the equation of a
function that passes by all the
data you have!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Equation of a Line: Revision
xaay 21 +=
If you have two points
1211 xaay +=
2212 xaay += 





=












2
1
2
1
2
1
1
1
y
y
a
a
x
x
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Solving for the constants!
12
12
2
12
2112
1 &
xx
yy
a
xx
yxyx
a
−
−
=
−
−
=
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
What if I have more than two
points?
• We may fit a
polynomial of order
one less that the
number of points we
have. i.e. four points
give third order
polynomial.
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Third-Order Polynomial
3
4
2
321 xaxaxaay +++=
For the four points
3
14
2
131211 xaxaxaay +++=
3
24
2
232212 xaxaxaay +++=
3
34
2
333213 xaxaxaay +++=
3
44
2
434214 xaxaxaay +++=
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
In Matrix Form














=




























4
3
2
1
4
3
2
1
3
4
2
24
3
3
2
23
3
2
2
22
3
1
2
11
1
1
1
1
y
y
y
y
a
a
a
a
xxx
xxx
xxx
xxx
Solve the above equation for the constants of the polynomial.
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton's Interpolation
Polynomial
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton’s Method
• In the previous procedure, we needed to solve a
system of linear equations for the unknown
constants.
• This method suggests that we may just proceed
with the values of x & y we have to get the
constants without setting a set of equations
• The method is similar to Taylor’s expansion
without differentiation!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Equation of a Line: Revision
xaay 21 +=
If you have two points
1211 xaay +=
2212 xaay += 





=












2
1
2
1
2
1
1
1
y
y
a
a
x
x
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
For the two points
12
12
1
1
xx
yy
xx
yy
−
−
=
−
−
( )
12
12
1
1
xx
yy
xx
yxf
−
−
=
−
−
( ) ( )1
12
12
1 xx
xx
yy
yxf −





−
−
+=
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
For the three points
( ) ( )
( )( )213
121
xxxxa
xxaaxf
−−+
−+=
11 ya =
12
12
2
xx
yy
a
−
−
=
13
12
12
23
23
3
xx
xx
yy
xx
yy
a
−
−
−
−
−
−
=
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Using a table
xi yi
x1 y1
x2 y2
x3 y3
13
12
12
23
23
xx
xx
yy
xx
yy
−
−
−
−
−
−
12
12
xx
yy
−
−
23
23
xx
yy
−
−
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
In General
• Newton’s Interpolation is performed for an
nth
order polynomial as follows
( ) ( ) ( )( )
( ) ( )nn xxxxa
xxxxaxxaaxf
−−++
−−+−+=
+ ...... 11
213121
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Example
• Find a 3rd
order
polynomial to
interpolate the
function described by
the given points
x Y
-1 1
0 2
1 5
2 16
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Solution: System of equations
• A third order polynomial is given by:
( ) 3
4
2
321 xaxaxaaxf +++=
( ) 11 4321 =−+−=− aaaaf
( ) 20 1 == af
( ) 51 4321 =+++= aaaaf
( ) 168422 4321 =+++= aaaaf
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
In matrix form














=

























 −−
16
5
2
1
8421
1111
0001
1111
4
3
2
1
a
a
a
a














=














1
1
1
2
4
3
2
1
a
a
a
a
( ) 32
2 xxxxf +++=
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton’s Method
• Newton’s methods defines the polynomial in the
form:
( ) ( ) ( )( )
( )( )( )3214
213121
xxxxxxa
xxxxaxxaaxf
−−−+
−−+−+=
( ) ( ) ( )( )
( )( )( )11
11
4
321
−++
++++=
xxxa
xxaxaaxf
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton’s Method
x Y
-1 1 1 1 1
0 2 3 4
1 5 11
2 16
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Newton’s Method
• Finally:
( ) ( ) ( )( )
( )( )( )11
111
−++
++++=
xxx
xxxxf
( ) ( ) ( ) ( )xxxxxxf −+++++= 32
11
( ) 32
2 xxxxf +++=
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Advantage of Newton’s Method
• The main advantage of Newton’s method
is that you do not need to invert a matrix!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Homework #6
• Chapter 18, pp. 505-506, numbers:
18.1, 18.2, 18.3, 18.5.

More Related Content

PDF
07 interpolationnewton
PDF
04 gaussmethods
PDF
06 regression
PPT
07 interpolation
DOCX
MCA_UNIT-1_Computer Oriented Numerical Statistical Methods
PDF
A Generalized Sampling Theorem Over Galois Field Domains for Experimental Des...
DOCX
MCA_UNIT-2_Computer Oriented Numerical Statistical Methods
ODP
Math powerpoint miss_j[1]
07 interpolationnewton
04 gaussmethods
06 regression
07 interpolation
MCA_UNIT-1_Computer Oriented Numerical Statistical Methods
A Generalized Sampling Theorem Over Galois Field Domains for Experimental Des...
MCA_UNIT-2_Computer Oriented Numerical Statistical Methods
Math powerpoint miss_j[1]

What's hot (13)

PPTX
Curve fitting
DOCX
Course pack unit 5
PDF
Q0749397
PPT
Hprec2 1
PDF
Comparative analysis of x^3+y^3=z^3 and x^2+y^2=z^2 in the Interconnected Sets
PDF
A NEW STUDY TO FIND OUT THE BEST COMPUTATIONAL METHOD FOR SOLVING THE NONLINE...
PDF
Ijetcas14 608
DOCX
Statistics assignment
DOCX
BSC_COMPUTER _SCIENCE_UNIT-3_DISCRETE MATHEMATICS
PDF
Ap4103260265
PDF
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-III
PPTX
Triangularization method
Curve fitting
Course pack unit 5
Q0749397
Hprec2 1
Comparative analysis of x^3+y^3=z^3 and x^2+y^2=z^2 in the Interconnected Sets
A NEW STUDY TO FIND OUT THE BEST COMPUTATIONAL METHOD FOR SOLVING THE NONLINE...
Ijetcas14 608
Statistics assignment
BSC_COMPUTER _SCIENCE_UNIT-3_DISCRETE MATHEMATICS
Ap4103260265
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-III
Triangularization method
Ad

Viewers also liked (15)

PDF
Applied numerical methods lec11
PPT
03 open methods
PDF
SJUT/Mat210/Regression/Intro 2013-14S2
PPT
1519 differentiation-integration-02
PPT
8.7 numerical integration
PDF
Applied numerical methods lec8
PPTX
Numerical method (curve fitting)
PPT
Numerical differentiation integration
PPTX
PDF
numerical differentiation&integration
PPTX
Curve fitting
PPTX
Applied Numerical Methods Curve Fitting: Least Squares Regression, Interpolation
PPTX
Engineering Numerical Analysis Lecture-1
PDF
Interpolation Methods
PDF
Introduction to Numerical Analysis
Applied numerical methods lec11
03 open methods
SJUT/Mat210/Regression/Intro 2013-14S2
1519 differentiation-integration-02
8.7 numerical integration
Applied numerical methods lec8
Numerical method (curve fitting)
Numerical differentiation integration
numerical differentiation&integration
Curve fitting
Applied Numerical Methods Curve Fitting: Least Squares Regression, Interpolation
Engineering Numerical Analysis Lecture-1
Interpolation Methods
Introduction to Numerical Analysis
Ad

Similar to 09 numerical differentiation (20)

PPT
08 interpolation lagrange
PDF
me310_6_interpolation.pdf for numerical method
PDF
Applied numerical methods lec9
PDF
Computational methods for engineering...
PPTX
interpolation-190605141327 (1).pptx
PPTX
interpolation-190605141327 (1).pptx
PPT
Top School in india
PPTX
18 Interpolation using numerical methods
PDF
2. polynomial interpolation
PPTX
Interpolation.pptx
PDF
Lecture about interpolation
PDF
Fortran chapter 2.pdf
PDF
Intro. to computational Physics ch2.pdf
PDF
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
PPT
08 numerical integration
PPTX
numericai matmatic matlab uygulamalar ali abdullah
PDF
Interpolation
PDF
Interpolation wikipedia
PDF
$$$ Cheap breville bta630 xl
08 interpolation lagrange
me310_6_interpolation.pdf for numerical method
Applied numerical methods lec9
Computational methods for engineering...
interpolation-190605141327 (1).pptx
interpolation-190605141327 (1).pptx
Top School in india
18 Interpolation using numerical methods
2. polynomial interpolation
Interpolation.pptx
Lecture about interpolation
Fortran chapter 2.pdf
Intro. to computational Physics ch2.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
08 numerical integration
numericai matmatic matlab uygulamalar ali abdullah
Interpolation
Interpolation wikipedia
$$$ Cheap breville bta630 xl

More from Mohammad Tawfik (20)

PDF
Supply Chain Management for Engineers - INDE073
PDF
Supply Chain Management 01 - Introduction
PDF
Supply Chain Management 02 - Logistics
PDF
Supply Chain Management 03 - Inventory Management
PDF
Creative problem solving and decision making
PDF
Digital content for teaching introduction
PDF
Crisis Management Basics
PDF
DISC Personality Model
PDF
Training of Trainers
PDF
Effective Delegation Skills
PDF
Train The Trainer
PDF
Business Management - Marketing
PDF
Stress Management
PDF
Project Management (CAPM) - Integration
PDF
Project Management (CAPM) - The Framework
PDF
Project Management (CAPM) - Introduction
PDF
The Creative Individual
PDF
Introduction to Wind Energy
PDF
Finite Element for Trusses in 2-D
PDF
Future of Drones ITW'16
Supply Chain Management for Engineers - INDE073
Supply Chain Management 01 - Introduction
Supply Chain Management 02 - Logistics
Supply Chain Management 03 - Inventory Management
Creative problem solving and decision making
Digital content for teaching introduction
Crisis Management Basics
DISC Personality Model
Training of Trainers
Effective Delegation Skills
Train The Trainer
Business Management - Marketing
Stress Management
Project Management (CAPM) - Integration
Project Management (CAPM) - The Framework
Project Management (CAPM) - Introduction
The Creative Individual
Introduction to Wind Energy
Finite Element for Trusses in 2-D
Future of Drones ITW'16

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology
20250228 LYD VKU AI Blended-Learning.pptx
Unlocking AI with Model Context Protocol (MCP)
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The AUB Centre for AI in Media Proposal.docx
Diabetes mellitus diagnosis method based random forest with bat algorithm
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf

09 numerical differentiation

  • 1. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Interpolation/Curve Fitting
  • 2. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Objectives • Understanding the difference between regression and interpolation • Knowing how to “best fit” a polynomial into a set of data • Knowing how to use a polynomial to interpolate data
  • 3. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Measured Data
  • 4. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Polynomial Fit!
  • 5. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Line Fit!
  • 6. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Which is better?
  • 7. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Curve Fitting • If the data measured is of high accuracy and it is required to estimate the values of the function between the given points, then, polynomial interpolation is the best choice. • If the measurements are expected to be of low accuracy, or the number of measured points is too large, regression would be the best choice.
  • 8. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Interpolation
  • 9. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Why Interpolation? • When the accuracy of your measurements are ensured • When you have discrete values for a function (numerical solutions, digital systems, etc …)
  • 10. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Acquired Data
  • 11. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik But, how to get the equation of a function that passes by all the data you have!
  • 12. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Equation of a Line: Revision xaay 21 += If you have two points 1211 xaay += 2212 xaay +=       =             2 1 2 1 2 1 1 1 y y a a x x
  • 13. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Solving for the constants! 12 12 2 12 2112 1 & xx yy a xx yxyx a − − = − − =
  • 14. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik What if I have more than two points? • We may fit a polynomial of order one less that the number of points we have. i.e. four points give third order polynomial.
  • 15. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Third-Order Polynomial 3 4 2 321 xaxaxaay +++= For the four points 3 14 2 131211 xaxaxaay +++= 3 24 2 232212 xaxaxaay +++= 3 34 2 333213 xaxaxaay +++= 3 44 2 434214 xaxaxaay +++=
  • 16. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik In Matrix Form               =                             4 3 2 1 4 3 2 1 3 4 2 24 3 3 2 23 3 2 2 22 3 1 2 11 1 1 1 1 y y y y a a a a xxx xxx xxx xxx Solve the above equation for the constants of the polynomial.
  • 17. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Newton's Interpolation Polynomial
  • 18. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Newton’s Method • In the previous procedure, we needed to solve a system of linear equations for the unknown constants. • This method suggests that we may just proceed with the values of x & y we have to get the constants without setting a set of equations • The method is similar to Taylor’s expansion without differentiation!
  • 19. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Equation of a Line: Revision xaay 21 += If you have two points 1211 xaay += 2212 xaay +=       =             2 1 2 1 2 1 1 1 y y a a x x
  • 20. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik For the two points 12 12 1 1 xx yy xx yy − − = − − ( ) 12 12 1 1 xx yy xx yxf − − = − − ( ) ( )1 12 12 1 xx xx yy yxf −      − − +=
  • 21. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik For the three points ( ) ( ) ( )( )213 121 xxxxa xxaaxf −−+ −+= 11 ya = 12 12 2 xx yy a − − = 13 12 12 23 23 3 xx xx yy xx yy a − − − − − − =
  • 22. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Using a table xi yi x1 y1 x2 y2 x3 y3 13 12 12 23 23 xx xx yy xx yy − − − − − − 12 12 xx yy − − 23 23 xx yy − −
  • 23. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik In General • Newton’s Interpolation is performed for an nth order polynomial as follows ( ) ( ) ( )( ) ( ) ( )nn xxxxa xxxxaxxaaxf −−++ −−+−+= + ...... 11 213121
  • 24. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Example • Find a 3rd order polynomial to interpolate the function described by the given points x Y -1 1 0 2 1 5 2 16
  • 25. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Solution: System of equations • A third order polynomial is given by: ( ) 3 4 2 321 xaxaxaaxf +++= ( ) 11 4321 =−+−=− aaaaf ( ) 20 1 == af ( ) 51 4321 =+++= aaaaf ( ) 168422 4321 =+++= aaaaf
  • 26. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik In matrix form               =                           −− 16 5 2 1 8421 1111 0001 1111 4 3 2 1 a a a a               =               1 1 1 2 4 3 2 1 a a a a ( ) 32 2 xxxxf +++=
  • 27. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Newton’s Method • Newton’s methods defines the polynomial in the form: ( ) ( ) ( )( ) ( )( )( )3214 213121 xxxxxxa xxxxaxxaaxf −−−+ −−+−+= ( ) ( ) ( )( ) ( )( )( )11 11 4 321 −++ ++++= xxxa xxaxaaxf
  • 28. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Newton’s Method x Y -1 1 1 1 1 0 2 3 4 1 5 11 2 16
  • 29. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Newton’s Method • Finally: ( ) ( ) ( )( ) ( )( )( )11 111 −++ ++++= xxx xxxxf ( ) ( ) ( ) ( )xxxxxxf −+++++= 32 11 ( ) 32 2 xxxxf +++=
  • 30. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Advantage of Newton’s Method • The main advantage of Newton’s method is that you do not need to invert a matrix!
  • 31. ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Homework #6 • Chapter 18, pp. 505-506, numbers: 18.1, 18.2, 18.3, 18.5.