SlideShare a Scribd company logo
1 of 27
Interpolation
Lagrange interpolation
Find Lagrange interpolating polynomial that fit the following
data (x0, y0), (x1, y1), (x2, y2), (x3, y3)
Example: (2, -3), (-1, 7), (4, 6), (12, -4)
Find cubic Lagrange interpolating polynomial satisfy the
above data.
Solution:
3
(x 1)(x 4)(x 12) (x 2)(x 4)(x 12)
P ( 3) (7)
(2 1)(2 4)(2 12) ( 1 2)( 1 4)( 1 12)
(x 2)(x 1)(x 12) (x 2)(x 1)(x 4)
(6) ( 4)
(4 2)(4 1)(4 12) (12 2)(12 1)(12 4)
- - - - -
- - - - -
- - - -
- - - -

  
   
 
  
 
Inverse Lagrange interpolation
This method used to obtain a root of the interpolating
polynomials; also we can obtain any x related to its given y.
Example: Find a root of the cubic Lagrange interpolating
polynomial satisfies the data (2, -3), (-1, 7), (4, 6), (12, -4).
Solution:
(y 7)(y 6)(y 4) (y 3)(y 6)(y 4)
x (2) ( 1)
(-3 7)(-3 6)(-3 4) (7 3)(7 6)(7 4)
(y 3)(y 7)(y 4) (y 3)(y 7)(y 6)
(4) (12)
(6 3)(6 7)(6 4) (-4 3)(-4 7)(-4 6)
   
  
   
     
 
     
- -
- -
At y = 0, then
(y 7)(y 6)(y 4) (y 3)(y 6)(y 4)
x (2) ( 1)
(-3 7)(-3 6)(-3 4) (7 3)(7 6)(7 4)
(y 3)(y 7)(y 4) (y 3)(y 7)(y 6)
(4) (12)
(6 3)(6 7)(6 4) (-4 3)(-4 7)(-4 6)
   
  
   
     
 
     
- -
- -
is the root
Newton interpolation
Find Newton interpolating polynomial that fit the following data
(x0, y0), (x1, y1), (x2, y2), (x3, y3)
x y  y 
 y 
 y
x0 y0
1 0
1 0
y y
A
x x



x1 y1
2 0
B A
D
x x



2 1
2 1
y y
B
x x


 3 0
E D
F
x x



x2 y2
3 1
C B
E
x x



3 2
3 2
y y
C
x x



x3 y3
Then interpolating polynomial will be as follows:
0 0 1 0 1 2
3 0 (x x (x x )(x x ) D (x x )(x x )(x x ) F
P y + +

  - - - - - -
Example: Find interpolating polynomial that fit the following data
using Newton method
(1, 3), (3, 7), (8, 12), (10, 20)
Solution:
x y  y 
 y 
 y
1 3
7 3 2
3 1
 

3 7
1
1 2
8 1 7
  

12 7 1
8 3
 

1
(
10 1 14
[(3/7) 1/7)]
 


8 12
3
4 1
10 3 7
 

20 12 4
10 8
 

10 20
P3 = 3 + (x – 1)(2) + (x – 1)(x – 3)(-1/7) + (x – 1)(x – 3)(x – 8)(1/14)
Problems
1- (1,3) , (5,-7) , (-13,4) , (2,47) , (-6,15)
Find Lagrange & Newton interpolating polynomials that fit
the above data.
2- Find Lagrange & Newton interpolating polynomial that fit
the following data, then find P(5).
x -1 3 9 13 20
y 5 7 -15 4 9
Curve fitting
Find the first degree polynomial y = ax + b that best fit N
data points (x1, y1), (x2, y2), (x3, y3),… , (xN, yN)
Solution
Construct the following 2 equations
2
i
i i i
N N N
i =1 i =1 i =1
x y a x b x

  
+ , i i
i =1
N N
i =1
y a x bN

  +
i = 1, 2, …, N
Example: Find a straight line that best fit the data (-1, 3), (1, 7), (3, 2)
Solution: Let the straight line is y = ax + b, we have to
2
i
i i i
3 3 3
i =1 i =1 i =1
x y a x + b x

   , i i
i =1
3 3
i =1
y a x + 3b

 
i xi
2
i
x yi xi yi
1 -1 1 3 -3
2 1 1 7 7
3 3 9 2 6
Sum i
3
i=1
x
 =3 2
i
3
i=1
x
 =11 i
3
i=1
y
 = 12 i i
3
i=1
x y
 = 10
Thus 10 11a +3 b
 , 12 3a +3 b
  a = -1/4, b = 17/4
Curve fitting
Find the second degree polynomial y = ax2
+ bx + c that best fit N data
points (x1, y1), (x2, y2), (x3, y3),… , (xN, yN)
Solution
Construct the following 3 equations
2 4 3 2
i i i i i
i=1
N N N N
i=1 i=1 i=1
x y a x b x c x

   
+ + ,
3 2
i i i i i
i=1
N N N N
i=1 i=1 i=1
x y a x b x c x

   
+ + ,
2
i i i
N N N
i=1 i=1 i=1
y a x b x cN

  
+ + i = 1, 2, …, N
Example: Find a quadratic polynomial that best fit the data (-2, 2),
(-1, 1), (0, 1), (2, 2)
Solution: Let the approximated quadratic polynomial is
y = ax2
+ bx + c and we have to evaluate constants a, b and c.
We have to construct the following equations
2 4 3 2
i i i i i
i=1
4 4 4 4
i=1 i=1 i=1
x y a x + b x +c x

    ,
3 2
i i i i i
i=1
4 4 4 4
i=1 i=1 i=1
x y a x + b x +c x

    ,
2
i i i
4 4 4
i=1 i=1 i=1
y a x + b x + 4 c

  
i xi
2
i
x 3
i
x 4
i
x yi xi yi
2
i
x yi
1 -2 4 -8 16 2 -4 8
2 -1 1 -1 1 1 -1 1
3 0 0 0 0 1 0 0
4 2 4 8 16 2 4 8
Sum -1 9 -1 33 6 -1 17
Therefore 17 33a-b+9 c
 , 1 a+9 b c
   , 6 9a-b+4c

Solve the 3 equations to get a, b, c
Fitting exponential curves to data points
To find an exponential curve y = aebx
that best fit set of given N data
Points (x1, y1), (x1, y1), (x2, y2), (x3, y3),…, (xN, yN), we have first to
modify the exponential curve to first degree polynomial by taking
n to both sides such that
n y = bx + n a
We can express this equation in simplest form such that
Y = Ax+ B
Where Y = n y, A = b and B = n a
Construct the equations
2
i
i i i
N N N
i =1 i =1 i =1
x Y A x + B x

   , i i
i =1
N N
i =1
Y A x + B N

  ,
i = 1, 2, …, N
Example: Find the constants of the curve y = aebx
that best fit the
data (2, 1), (1, 3), (0, 1)
Solution: we have to get the approximated values for a and b that
best fit the above data, given N = 3, then we put the above
exponential form as a first degree polynomial so that the equation
will be Y = Ax+ B, where Y = n y, A = b and B = n a.
Construct the 2 equations
2
i
i i i
3 3 3
i =1 i =1 i =1
x Y A x + B x

   , i i
i =1
3 3
i =1
Y A x +3 B

 
According to the above three points, we can calculate i
3
i=1
x
 , 2
i
3
i=1
x
 ,
i
3
i=1
Y
 , i i
3
i=1
x Y
 using the following table
i xi yi
2
i
x Yi = n yi xi Yi
1 2 1 4 Y1= n 1= 0 0
2 1 3 1 Y2= n 3 n 3
3 0 1 0 Y3= n 1= 0 0
Sum i
3
i=1
x
 =3 2
i
3
i=1
x
 = 5 i
3
i=1
Y
 = n 3 i i
3
i=1
x Y
 = n 3
Therefore n 3 5 A + 3 B
 , n3 3 A + 3 B

Solve the 2 equations to get constants A and B,
where A = b and B = n a.
Fitting rational function to data points
To find the constants of the rational function y = 1
ax b
+
that best fit
set of given data (x1, y1), (x1, y1), (x2, y2), (x3, y3),…, (xN, yN), we
have first to modify the rational function to first degree polynomial
by putting Y = 1
y
and we can express this equation in simplest form
such that Y = ax + b.
Construct the equations
2
i
i i i
N N N
i =1 i =1 i =1
x Y A x + B x

   , i i
i =1
N N
i =1
Y A x + B N

  ,
i = 1, 2, …, N
Example: Find the constants of the rational function
y = 1
ax b
+
that best fit the data (2, 1/3), (1, 1), (0, 1/2)
Solution:
We have first to modify the rational function to first degree
polynomial by putting Y = 1
y
and we can express this
equation in simplest form such that Y = ax + b.
Construct the 2 equations
2
i
i i i
3 3 3
i =1 i =1 i =1
Y
x a x + b x

   , i i
i =1
3 3
i =1
Y a x + 3 b

 
According to the above data, i
3
i=1
x
 , 2
i
3
i=1
x
 , i
3
i=1
Y
 , i i
3
i=1
x Y
 can
be calculated as follows
i xi yi
2
i
x Yi =
i
1
y xi Yi
1 2 1/3 4 Y1=
1
1
y
= 3 6
2 1 1 1 Y2=
2
1
y
= 1 1
3 0 1/2 0 Y3=
3
1
y
=2 0
Sum i
3
i=1
x

=3
3
2
i
i=1
x
 = 5 i
3
i=1
Y
 = 6 i i
3
i=1
x Y
 = 7
Therefore 7 5 a +3 b
 , 6 3a +3 b

Solve the 2 equations to get a & b
Fitting any function (y = a x)
 + b) to data points
To find y = a x)
 + b that best fit set of given data (xi, yi),
i = 1, 2, 3,…, N, where x)
 is any given continuous function.
Construct the 2 equations i
i i i
N N N
i =1 i =1 i =1
2
) ) )
x y a x ] + b x
   
   ,
i i
i =1
N N
i =1
)
y a x + b N
 
  , i = 1, 2, 3,…, N
i
N
i=1
x )

 , i
N
i=1
y
 , 2
i
N
i=1
x )]

 , i i
N
i=1
x ) y

 evaluated as follows
i xi i
x )
 yi i
2
x )]
 i
x )
 yi
1 x1 1
x )
 y1 1
2
x )]
 1
x )
 y1
2 x2 2
x )
 y2 2
2
x )]
 2
x )
 y2
3 x3 3
x )
 y3 3
2
x )]
 3
x )
 y3
N xN N
x )
 yN
2
N
x )]
 N
x )
 ym
Sum i
N
i=1
x )

 i
N
i=1
y
 2
i
N
i=1
x )]

 i i
N
i=1
x ) y


Example: Find a & b of the curve y = a sin(x) + b that best fit
the data (1, 0), (2, 3), (5, 1)
Solution: We have to construct the 2 equations
i i i i
3 3 3
i =1 i =1 i =1
2
)] ) )
[sin(x y a sin(x ] + b sin(x
 
   ,
i i
i =1
3 3
i =1
)
y a sin(x + 3 b

 
xi i
sin x )
 yi i
2
[sin x )]
 [ i
sin x )
 ] yi
1 sin 1)
 = 0.841 0 0.7073 0
2 sin 2)
 = 0.91 3 0.8281 2.73
5 sin 5)
 = -0.959 1 0.9197 -0.959
3
i=1
i
sin x )

 = 0.792 i
3
i=1
y
 = 4
3
i=1
2
i
[sin x )]


= 2.4551
3
i=1
i i
[sin x )] y


= 1.771
i
i =1
3
)
sin(x
 , i
3
i =1
2
)
sin(x ]

 , i i
3
i =1
)]
[sin(x y
 , i
3
i =1
y
 are evaluated as
follows
Therefore 1.771 2.4551a +0.792 b
 , 4 0.792 a +3b
 , solve to
get a and b
Problems
1- Find the linear equation that best fit the following data
a) (1, -1), (4, 11), (-1, -9) and (-2, -13)
b) (-3, 70), (1, 21), (-7, 110) and (5, -35)
2- Find the parabolic equation that best fit the following data
a) (-1, 10), (0, 9), (1, 7), (2, 5), (3, 4),(4, 3),(5, 0), (6, -1)
b) (-4.5, 0.7), (-3.2, 2.3), (-1.4, 3.8), (0.8, 5.0),(2.5, 5.5), (4.1, 5.6)
3- Find the exponential curve y = aebx
that best fit the following
data
a) (11, 7), (23, 13), (32, 25)
b) (21, 17), (41, 3), (68, 5), (93, 15)
4- Find the curve y = a cos(x) + bx that best fit the following data
a) (31, 17), (23, 13), (12, 15)
b) (21, 19), (35, 23), (68, 5), (93, 15)
5- Find the constants of the curve y = a sinx + b ln x + c ex
that
best fit the data points (11, 7), (23, 13), (50, 27)

More Related Content

Similar to Interpolation.pptx

Straight-Line-Graphs-Final -2.pptx
Straight-Line-Graphs-Final -2.pptxStraight-Line-Graphs-Final -2.pptx
Straight-Line-Graphs-Final -2.pptxKviskvis
 
Linear Regression - Least Square.pptx
Linear Regression - Least Square.pptxLinear Regression - Least Square.pptx
Linear Regression - Least Square.pptxAyushSingh254558
 
ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)CrackDSE
 
Rbsc class-9-maths-chapter-4
Rbsc class-9-maths-chapter-4 Rbsc class-9-maths-chapter-4
Rbsc class-9-maths-chapter-4 Arvind Saini
 
17 integrals of rational functions x
17 integrals of rational functions x17 integrals of rational functions x
17 integrals of rational functions xmath266
 
Maths Project Quadratic Equations
Maths Project Quadratic EquationsMaths Project Quadratic Equations
Maths Project Quadratic EquationsRishabh Dhakarwal
 
Maths important questions for 2018
Maths important questions for 2018Maths important questions for 2018
Maths important questions for 2018KarunaGupta1982
 
Maths imp questions for 2018
Maths imp questions for 2018Maths imp questions for 2018
Maths imp questions for 2018KarunaGupta1982
 
3.3 the fundamental theorem of algebra t
3.3 the fundamental theorem of algebra t3.3 the fundamental theorem of algebra t
3.3 the fundamental theorem of algebra tmath260
 
Basic concepts of curve fittings
Basic concepts of curve fittingsBasic concepts of curve fittings
Basic concepts of curve fittingsTarun Gehlot
 
2.0 rectangular coordinate system t
2.0 rectangular coordinate system t2.0 rectangular coordinate system t
2.0 rectangular coordinate system tmath260
 

Similar to Interpolation.pptx (20)

Straight-Line-Graphs-Final -2.pptx
Straight-Line-Graphs-Final -2.pptxStraight-Line-Graphs-Final -2.pptx
Straight-Line-Graphs-Final -2.pptx
 
Appendex
AppendexAppendex
Appendex
 
Algebra
AlgebraAlgebra
Algebra
 
Linear Regression - Least Square.pptx
Linear Regression - Least Square.pptxLinear Regression - Least Square.pptx
Linear Regression - Least Square.pptx
 
ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)
 
05_AJMS_332_21.pdf
05_AJMS_332_21.pdf05_AJMS_332_21.pdf
05_AJMS_332_21.pdf
 
Grph quad fncts
Grph quad fnctsGrph quad fncts
Grph quad fncts
 
Rbsc class-9-maths-chapter-4
Rbsc class-9-maths-chapter-4 Rbsc class-9-maths-chapter-4
Rbsc class-9-maths-chapter-4
 
Algebra
AlgebraAlgebra
Algebra
 
17 integrals of rational functions x
17 integrals of rational functions x17 integrals of rational functions x
17 integrals of rational functions x
 
Maths Project Quadratic Equations
Maths Project Quadratic EquationsMaths Project Quadratic Equations
Maths Project Quadratic Equations
 
Maths important questions for 2018
Maths important questions for 2018Maths important questions for 2018
Maths important questions for 2018
 
Maths imp questions for 2018
Maths imp questions for 2018Maths imp questions for 2018
Maths imp questions for 2018
 
3.3 the fundamental theorem of algebra t
3.3 the fundamental theorem of algebra t3.3 the fundamental theorem of algebra t
3.3 the fundamental theorem of algebra t
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Basic concepts of curve fittings
Basic concepts of curve fittingsBasic concepts of curve fittings
Basic concepts of curve fittings
 
2.0 rectangular coordinate system t
2.0 rectangular coordinate system t2.0 rectangular coordinate system t
2.0 rectangular coordinate system t
 
Factor theorem
Factor theoremFactor theorem
Factor theorem
 
MATHS PRESENTATION OF CH 4.pptx
MATHS PRESENTATION OF CH 4.pptxMATHS PRESENTATION OF CH 4.pptx
MATHS PRESENTATION OF CH 4.pptx
 
Quadratic equations
Quadratic equationsQuadratic equations
Quadratic equations
 

Recently uploaded

chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Interpolation.pptx

  • 2. Lagrange interpolation Find Lagrange interpolating polynomial that fit the following data (x0, y0), (x1, y1), (x2, y2), (x3, y3)
  • 3. Example: (2, -3), (-1, 7), (4, 6), (12, -4) Find cubic Lagrange interpolating polynomial satisfy the above data. Solution: 3 (x 1)(x 4)(x 12) (x 2)(x 4)(x 12) P ( 3) (7) (2 1)(2 4)(2 12) ( 1 2)( 1 4)( 1 12) (x 2)(x 1)(x 12) (x 2)(x 1)(x 4) (6) ( 4) (4 2)(4 1)(4 12) (12 2)(12 1)(12 4) - - - - - - - - - - - - - - - - - -               
  • 4. Inverse Lagrange interpolation This method used to obtain a root of the interpolating polynomials; also we can obtain any x related to its given y. Example: Find a root of the cubic Lagrange interpolating polynomial satisfies the data (2, -3), (-1, 7), (4, 6), (12, -4). Solution: (y 7)(y 6)(y 4) (y 3)(y 6)(y 4) x (2) ( 1) (-3 7)(-3 6)(-3 4) (7 3)(7 6)(7 4) (y 3)(y 7)(y 4) (y 3)(y 7)(y 6) (4) (12) (6 3)(6 7)(6 4) (-4 3)(-4 7)(-4 6)                          - - - -
  • 5. At y = 0, then (y 7)(y 6)(y 4) (y 3)(y 6)(y 4) x (2) ( 1) (-3 7)(-3 6)(-3 4) (7 3)(7 6)(7 4) (y 3)(y 7)(y 4) (y 3)(y 7)(y 6) (4) (12) (6 3)(6 7)(6 4) (-4 3)(-4 7)(-4 6)                          - - - - is the root
  • 6. Newton interpolation Find Newton interpolating polynomial that fit the following data (x0, y0), (x1, y1), (x2, y2), (x3, y3) x y  y   y   y x0 y0 1 0 1 0 y y A x x    x1 y1 2 0 B A D x x    2 1 2 1 y y B x x    3 0 E D F x x    x2 y2 3 1 C B E x x    3 2 3 2 y y C x x    x3 y3
  • 7. Then interpolating polynomial will be as follows: 0 0 1 0 1 2 3 0 (x x (x x )(x x ) D (x x )(x x )(x x ) F P y + +    - - - - - - Example: Find interpolating polynomial that fit the following data using Newton method (1, 3), (3, 7), (8, 12), (10, 20)
  • 8. Solution: x y  y   y   y 1 3 7 3 2 3 1    3 7 1 1 2 8 1 7     12 7 1 8 3    1 ( 10 1 14 [(3/7) 1/7)]     8 12 3 4 1 10 3 7    20 12 4 10 8    10 20 P3 = 3 + (x – 1)(2) + (x – 1)(x – 3)(-1/7) + (x – 1)(x – 3)(x – 8)(1/14)
  • 9. Problems 1- (1,3) , (5,-7) , (-13,4) , (2,47) , (-6,15) Find Lagrange & Newton interpolating polynomials that fit the above data. 2- Find Lagrange & Newton interpolating polynomial that fit the following data, then find P(5). x -1 3 9 13 20 y 5 7 -15 4 9
  • 10. Curve fitting Find the first degree polynomial y = ax + b that best fit N data points (x1, y1), (x2, y2), (x3, y3),… , (xN, yN) Solution Construct the following 2 equations 2 i i i i N N N i =1 i =1 i =1 x y a x b x     + , i i i =1 N N i =1 y a x bN    + i = 1, 2, …, N
  • 11. Example: Find a straight line that best fit the data (-1, 3), (1, 7), (3, 2) Solution: Let the straight line is y = ax + b, we have to 2 i i i i 3 3 3 i =1 i =1 i =1 x y a x + b x     , i i i =1 3 3 i =1 y a x + 3b    i xi 2 i x yi xi yi 1 -1 1 3 -3 2 1 1 7 7 3 3 9 2 6 Sum i 3 i=1 x  =3 2 i 3 i=1 x  =11 i 3 i=1 y  = 12 i i 3 i=1 x y  = 10 Thus 10 11a +3 b  , 12 3a +3 b   a = -1/4, b = 17/4
  • 12. Curve fitting Find the second degree polynomial y = ax2 + bx + c that best fit N data points (x1, y1), (x2, y2), (x3, y3),… , (xN, yN) Solution Construct the following 3 equations 2 4 3 2 i i i i i i=1 N N N N i=1 i=1 i=1 x y a x b x c x      + + , 3 2 i i i i i i=1 N N N N i=1 i=1 i=1 x y a x b x c x      + + , 2 i i i N N N i=1 i=1 i=1 y a x b x cN     + + i = 1, 2, …, N
  • 13. Example: Find a quadratic polynomial that best fit the data (-2, 2), (-1, 1), (0, 1), (2, 2) Solution: Let the approximated quadratic polynomial is y = ax2 + bx + c and we have to evaluate constants a, b and c. We have to construct the following equations 2 4 3 2 i i i i i i=1 4 4 4 4 i=1 i=1 i=1 x y a x + b x +c x      , 3 2 i i i i i i=1 4 4 4 4 i=1 i=1 i=1 x y a x + b x +c x      , 2 i i i 4 4 4 i=1 i=1 i=1 y a x + b x + 4 c    
  • 14. i xi 2 i x 3 i x 4 i x yi xi yi 2 i x yi 1 -2 4 -8 16 2 -4 8 2 -1 1 -1 1 1 -1 1 3 0 0 0 0 1 0 0 4 2 4 8 16 2 4 8 Sum -1 9 -1 33 6 -1 17 Therefore 17 33a-b+9 c  , 1 a+9 b c    , 6 9a-b+4c  Solve the 3 equations to get a, b, c
  • 15. Fitting exponential curves to data points To find an exponential curve y = aebx that best fit set of given N data Points (x1, y1), (x1, y1), (x2, y2), (x3, y3),…, (xN, yN), we have first to modify the exponential curve to first degree polynomial by taking n to both sides such that n y = bx + n a We can express this equation in simplest form such that Y = Ax+ B Where Y = n y, A = b and B = n a
  • 16. Construct the equations 2 i i i i N N N i =1 i =1 i =1 x Y A x + B x     , i i i =1 N N i =1 Y A x + B N    , i = 1, 2, …, N Example: Find the constants of the curve y = aebx that best fit the data (2, 1), (1, 3), (0, 1)
  • 17. Solution: we have to get the approximated values for a and b that best fit the above data, given N = 3, then we put the above exponential form as a first degree polynomial so that the equation will be Y = Ax+ B, where Y = n y, A = b and B = n a. Construct the 2 equations 2 i i i i 3 3 3 i =1 i =1 i =1 x Y A x + B x     , i i i =1 3 3 i =1 Y A x +3 B   
  • 18. According to the above three points, we can calculate i 3 i=1 x  , 2 i 3 i=1 x  , i 3 i=1 Y  , i i 3 i=1 x Y  using the following table i xi yi 2 i x Yi = n yi xi Yi 1 2 1 4 Y1= n 1= 0 0 2 1 3 1 Y2= n 3 n 3 3 0 1 0 Y3= n 1= 0 0 Sum i 3 i=1 x  =3 2 i 3 i=1 x  = 5 i 3 i=1 Y  = n 3 i i 3 i=1 x Y  = n 3 Therefore n 3 5 A + 3 B  , n3 3 A + 3 B  Solve the 2 equations to get constants A and B, where A = b and B = n a.
  • 19. Fitting rational function to data points To find the constants of the rational function y = 1 ax b + that best fit set of given data (x1, y1), (x1, y1), (x2, y2), (x3, y3),…, (xN, yN), we have first to modify the rational function to first degree polynomial by putting Y = 1 y and we can express this equation in simplest form such that Y = ax + b. Construct the equations 2 i i i i N N N i =1 i =1 i =1 x Y A x + B x     , i i i =1 N N i =1 Y A x + B N    , i = 1, 2, …, N
  • 20. Example: Find the constants of the rational function y = 1 ax b + that best fit the data (2, 1/3), (1, 1), (0, 1/2) Solution: We have first to modify the rational function to first degree polynomial by putting Y = 1 y and we can express this equation in simplest form such that Y = ax + b. Construct the 2 equations 2 i i i i 3 3 3 i =1 i =1 i =1 Y x a x + b x     , i i i =1 3 3 i =1 Y a x + 3 b   
  • 21. According to the above data, i 3 i=1 x  , 2 i 3 i=1 x  , i 3 i=1 Y  , i i 3 i=1 x Y  can be calculated as follows i xi yi 2 i x Yi = i 1 y xi Yi 1 2 1/3 4 Y1= 1 1 y = 3 6 2 1 1 1 Y2= 2 1 y = 1 1 3 0 1/2 0 Y3= 3 1 y =2 0 Sum i 3 i=1 x  =3 3 2 i i=1 x  = 5 i 3 i=1 Y  = 6 i i 3 i=1 x Y  = 7 Therefore 7 5 a +3 b  , 6 3a +3 b  Solve the 2 equations to get a & b
  • 22. Fitting any function (y = a x)  + b) to data points To find y = a x)  + b that best fit set of given data (xi, yi), i = 1, 2, 3,…, N, where x)  is any given continuous function. Construct the 2 equations i i i i N N N i =1 i =1 i =1 2 ) ) ) x y a x ] + b x        , i i i =1 N N i =1 ) y a x + b N     , i = 1, 2, 3,…, N
  • 23. i N i=1 x )   , i N i=1 y  , 2 i N i=1 x )]   , i i N i=1 x ) y   evaluated as follows i xi i x )  yi i 2 x )]  i x )  yi 1 x1 1 x )  y1 1 2 x )]  1 x )  y1 2 x2 2 x )  y2 2 2 x )]  2 x )  y2 3 x3 3 x )  y3 3 2 x )]  3 x )  y3 N xN N x )  yN 2 N x )]  N x )  ym Sum i N i=1 x )   i N i=1 y  2 i N i=1 x )]   i i N i=1 x ) y  
  • 24. Example: Find a & b of the curve y = a sin(x) + b that best fit the data (1, 0), (2, 3), (5, 1) Solution: We have to construct the 2 equations i i i i 3 3 3 i =1 i =1 i =1 2 )] ) ) [sin(x y a sin(x ] + b sin(x      , i i i =1 3 3 i =1 ) y a sin(x + 3 b   
  • 25. xi i sin x )  yi i 2 [sin x )]  [ i sin x )  ] yi 1 sin 1)  = 0.841 0 0.7073 0 2 sin 2)  = 0.91 3 0.8281 2.73 5 sin 5)  = -0.959 1 0.9197 -0.959 3 i=1 i sin x )   = 0.792 i 3 i=1 y  = 4 3 i=1 2 i [sin x )]   = 2.4551 3 i=1 i i [sin x )] y   = 1.771 i i =1 3 ) sin(x  , i 3 i =1 2 ) sin(x ]   , i i 3 i =1 )] [sin(x y  , i 3 i =1 y  are evaluated as follows Therefore 1.771 2.4551a +0.792 b  , 4 0.792 a +3b  , solve to get a and b
  • 26. Problems 1- Find the linear equation that best fit the following data a) (1, -1), (4, 11), (-1, -9) and (-2, -13) b) (-3, 70), (1, 21), (-7, 110) and (5, -35) 2- Find the parabolic equation that best fit the following data a) (-1, 10), (0, 9), (1, 7), (2, 5), (3, 4),(4, 3),(5, 0), (6, -1) b) (-4.5, 0.7), (-3.2, 2.3), (-1.4, 3.8), (0.8, 5.0),(2.5, 5.5), (4.1, 5.6)
  • 27. 3- Find the exponential curve y = aebx that best fit the following data a) (11, 7), (23, 13), (32, 25) b) (21, 17), (41, 3), (68, 5), (93, 15) 4- Find the curve y = a cos(x) + bx that best fit the following data a) (31, 17), (23, 13), (12, 15) b) (21, 19), (35, 23), (68, 5), (93, 15) 5- Find the constants of the curve y = a sinx + b ln x + c ex that best fit the data points (11, 7), (23, 13), (50, 27)