Download presentation
Presentation is loading. Please wait.
1
21 Aug 2007 KKKQ 3013 PENGIRAAN BERANGKA Week 7 – Interpolation & Curve Fitting 21 August 2007 8.00 am – 9.00 am
2
21 Aug 2007 Week 7 Page 2 Topics Introduction Newton Interpolation: Finite Divided Difference Lagrange Interpolation Spline Interpolation Polynomial Regression Multivariable Interpolation
3
21 Aug 2007 Week 7 Page 3 Tutorial Example 1 (adapted courtesy of ref. [1]) Dynamic viscosity of water (10 -3 N.s/m 2 ) is related to temperature T( o C) in the following manner: [1] Chapra, S.C & Canale, R.P, Numerical Methods for Engineers, McGraw-Hill 5th ed. (2006) a)Estimate at T = 7.5 o C using cubic spline interpolation b)Use polynomial regression to determine a best fit parabola of the above data. In addition, determine the corresponding standard deviation. Based on this parabola, what is at T = 7.5 o C ?
4
21 Aug 2007 Week 7 Page 4 Tutorial Example 1
5
21 Aug 2007 Week 7 Page 5 Tutorial Example 1
6
21 Aug 2007 Week 7 Page 6 Tutorial Example 1
7
21 Aug 2007 Week 7 Page 7 Tutorial Example 1
8
21 Aug 2007 Week 7 Page 8 Tutorial Example 1
9
21 Aug 2007 Week 7 Page 9 Tutorial Example 1
10
21 Aug 2007 Week 7 Page 10 Tutorial Example 1 (using MATLAB) >> x=[0 5 10 20 30] x = 0 5 10 20 30 >> y=[1.787 1.519 1.307 1.002 0.7975] y = 1.7870 1.5190 1.3070 1.0020 0.7975 >> a=interp1(x,y,7.5,'spline') a = 1.4069 >> p=polyfit(x,y,2) p = 0.0007 -0.0534 1.7784 >> b=polyval(p,7.5) b = 1.4172 Prediction using cubic spline interpolation Coefficient for best fit quadratic equation i.e. a 2, a 1 and a 0 in descending powers of x
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.