Transcript PPT
Central Divided Difference Major: All Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati http://numericalmethods.eng.usf.edu Numerical Methods for STEM undergraduates 7/12/2016 http://numericalmethods.eng.usf.edu 1 Definition lim f x f x x f x x 0 x . Slope at xi y f(x) xi 2 x http://numericalmethods.eng.usf.edu Central Divided Difference f x x f x x f x 2x f (x ) x x 3 x x x x f xi x f xi x f xi 2 x http://numericalmethods.eng.usf.edu Example Example: The velocity of a rocket is given by 14 10 4 t 2000 ln 9.8t ,0 t 30 4 14 10 2100 t where given in m/s and t is given in seconds. Use central difference approximation of the first derivative of t 2s. Solution: a ti νt to calculate the acceleration at t 16s. Use a step size of ti 1 ti 1 2t ti 16 4 http://numericalmethods.eng.usf.edu Example (contd.) Δt 2 t i 1 t i Δt 16 2 18 ti 1 ti t a16 16 2 14 18 14 18 14 2(2) 4 14 104 18 2000 ln 9.818 453.02m/ s 4 14 10 210018 14 104 14 2000 ln 9.814 334.24m/ s 4 14 10 210014 5 http://numericalmethods.eng.usf.edu Example (contd.) Hence a16 (18) (14) 4 The exact value of 453.02 334.24 29.695m / s 2 a16 can be calculated by differentiating 14 104 t 2000 ln 9.8t 4 14 10 2100 t as d (t ) 4040 29.4t dt 200 3t a(16) 29.674m / s 2 a(t ) 6 http://numericalmethods.eng.usf.edu Example (contd.) The absolute relative true error is t TrueValue ApproximateValue 100 TrueValue 29.674 29.695 100 29.674 0.070769% 7 http://numericalmethods.eng.usf.edu Effect Of Step Size f ( x) 9e Value of h 0.05 0.025 0.0125 0.00625 0.003125 0.001563 0.000781 0.000391 0.000195 9.77E-05 4.88E-05 8 4x f ' (0.2) Using Central Divided Difference difference method. f ' (0.2) 80.65467 80.25307 80.15286 80.12782 80.12156 80.12000 80.11960 80.11951 80.11948 80.11948 80.11947 Ea -0.4016 -0.100212 -0.025041 -0.00626 -0.001565 -0.000391 -9.78E-05 -2.45E-05 -6.11E-06 -1.53E-06 a % 0.500417 0.125026 0.031252 0.007813 0.001953 0.000488 0.000122 3.05E-05 7.63E-06 1.91E-06 Significant digits 1 2 3 3 4 5 5 6 6 7 Et t % -0.53520 -0.13360 -0.03339 -0.00835 -0.00209 -0.00052 -0.00013 -0.00003 -0.00001 0.00000 0.00000 0.668001 0.16675 0.041672 0.010417 0.002604 0.000651 0.000163 4.07E-05 1.02E-05 2.54E-06 6.36E-07 http://numericalmethods.eng.usf.edu Effect of Step Size in Central Divided Difference Method f'(0.2) 95 Initial step size=0.05 85 75 1 3 5 7 9 11 Num ber of tim es the step size is halved, n 9 http://numericalmethods.eng.usf.edu Effect of Step Size on Approximate Error Num ber of steps involved, n 0 3 5 7 9 11 E(a) 1 -1 10 Initial step size=0.05 http://numericalmethods.eng.usf.edu Effect of Step Size on Absolute Relative Approximate Error 0.6 Initial step size=0.05 0.5 |E(a)|,% 0.4 0.3 0.2 0.1 0 0 1 2 3 4 5 6 7 8 9 10 11 12 Num ber of steps involved, n 11 http://numericalmethods.eng.usf.edu Least number of significant digits correct Effect of Step Size on Least Number of Significant Digits Correct Initial step size=0.05 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 Num ber of steps involved, n 12 http://numericalmethods.eng.usf.edu Effect of Step Size on True Error Num ber of steps involved, n 0.0 -0.1 0 2 4 6 8 10 12 E(t) -0.2 -0.3 -0.4 -0.5 -0.6 13 Initial step size=0.05 http://numericalmethods.eng.usf.edu Effect of Step Size on Absolute Relative True Error 0.8 0.7 Initial step size=0.05 |Et| % 0.6 0.5 0.4 0.3 0.2 0.1 0 1 2 3 4 5 6 7 8 9 10 11 Num ber of tim es step size halved,n 14 http://numericalmethods.eng.usf.edu