Prof. Muhammad Saeed ( Interpolation and Curve Fitting )

Presentation on theme: "Prof. Muhammad Saeed ( Interpolation and Curve Fitting )"— Presentation transcript:

Prof. Muhammad Saeed ( Interpolation and Curve Fitting )

2M.Sc. Physics 1.Interpola tion a)Newton-Gregory Forward Formula Evenly Spaced Data

M.Sc. Physics3 a)Lagrange Polynomials (Cubic) Unevenly Spaced Data b)Divided Difference

M.Sc. Physics4 c)Cubic Spline For condition 1 (Natural Spline): 2(h 0 +h 1 )h1h1 0000 S1S1 f[x 1, x 2 ] - f[x 0,x 1 ] h1h1 2(h 1 +h 2 )h2h2 000 S2S2 f[x 2, x 3 ] - f[x 1,x 2 ] 0h2h2 2(h 2 +h 3 )h3h3 00 S3S3 f[x 3, x 4 ] - f[x 2,x 3 ] 00h3h3 2(h 3 +h 4 )h4h4 0 S4S4 = 6 f[x 4, x 5 ] - f[x 3,x 4 ] 000.. …. 0000 ….. 0000h n-2 2(h n-2 +h n-1 ) S n-1 f[x n-1, x n ] - f[x n-2,x n-1 ]

M.Sc. Physics5 2.Curve Fitting Least-Squares Approximations Functions to Fit 1) y = mx+c 2)Polynomial 2)y = ae bx 3)y = a log(x) + b 4) y = ax b 5) 6)y = ax 2 +bx y= a

M.Sc. Physics6 Nxx2x2 x3x3 ….xnxn a0a0 Y xx2x2 x3x3 x4x4 x n+1 a1a1 xY x2x2 x3x3 x4x4 x5x5 …..x n+2 a2a2 x2Yx2Y ……. …..… a3a3 = …. …………..… …. … …… ……..…. … xnxn x n+1 x n+2 x n+3 ….x 2n anan xnYxnY a)Polynomial Fit The Best Fit is determined by the minimum value of

M.Sc. Physics7 123456789101112131415 Weight 10.012.015.017.020.027.035.041.048.050.051.054.059.066.075.0 Height 0.750.860.951.081.121.261.351.511.551.601.631.671.711.781.85 Use W=aH b as mathematical model Problem: Weight to Height Ratio of Human Beings

M.Sc. Physics8 b)Line Regression

M.Sc. Physics9 c)Polynomial Regression m is the degree of polynomial

M.Sc. Physics10

Similar presentations