nm08s3part5(iii)

18
P ART V NUMERICAL DIFFERENTIATION & INTEGRATION 1

Upload: aus-alister

Post on 22-Jul-2015

36 views

Category:

Documents


0 download

TRANSCRIPT

PART V NUMERICAL DIFFERENTIATION & INTEGRATION 1 Q23.8 pg 644 Estimate first derivative of(a) y=x3 + 4x 15 ; at x = 0, h = 0.25 (b) y = ex + x; at x = 2, h = 0.2 By using (i) forward, backward, centered difference approximation (ii) Richardson extrapolation Q23.9 pg 644 The following data was collected for the distance traveled versus time for a rocket: Use numerical differentiation to estimate the rockets velocity and acceleration at each time. 2 T,s0255075100125 Y,km032587892100 NUMERICAL DIFFERENTATION Introduction and Background High Accuracy Differentiation Formulas Richardson Extrapolation 3 Introduction Estimate the derivatives (slope, curvature, etc.) of a function by using the function values at only a set of discrete points Represent the function by Taylor polynomials or Lagrange interpolation Evaluate the derivatives of the interpolation polynomial at selected nodal points ONE-D CONSTITUTIVE LAWS IN ENGINEERING LawEquationPhysical AreaGradientFluxProportionality Fourier Law Heat Conduction TemperatureHeat Flux Thermal conductivity Ficks LawMass DiffusionConcentrationMass Flux Diffusivity DArcys Law Flow Through Porous Medium HeatFlow Flux Hydraulic Conductivity Ohms LawCurrent FlowVoltageCurrent Flux Electrical Conductivity Newtons Viscous Law FluidsVelocityShear Stress Dynamic Viscosity Hooks Law ElasticityDeformationStressYoungs modulus dTq kdx= dcJ Ddx= dhq kdx= dVJdxo = dudxt =LELAo =4 FIRST DERIVATIVES 5 ) x ( f'i-2i-1 ii+1i+2 x Forward difference Backward difference Central difference Actuali ii ii ii ix xy yx xx f x fx f=~'++++1111) ( ) () (1111) ( ) () (=~'i ii ii ii ix xy yx xx f x fx f1 11 11 11 1) ( ) () ( + + + +=~'i ii ii ii ix xy yx xx f x fx fDIFFERENTIATION BASED ONTAYLOR SERIES ( ) ( ) ( )( ).........! 2' ''21+ + + =+hx fh x f x f x fii i iFORWARD FINITE DIFFERENCE ( ) () ()().........! 2' ''21+ + + =+hx fh x f x f x fii i i()( ) ()( ) h Ohx f x fx fi ii+=+1'The error is O(h) 6 FORWARD DIVIDED DIFFERENCE ( )( ) ( )( ) ( ) h Ohfx x Ox xx f x fx fii ii ii ii+A= +=+++111'f(x) x (xi, yi) What is derivative at this point? f(x) x (xi, yi) (x i+1,y i+1) Determine a second point base on Dx (h) f(x) x (xi, yi) (x i+1,y i+1) How does this compare to the actual first derivative at xi? f(x) x (xi, yi) (x i+1,y i+1) 7 ( ) ( ) ( )( )( ) ( ) ( )( ).....! 2' ''......! 2' ''2121+ + =+ + + =+hx fh x f x f x fhx fh x f x f x fii i iii i iExpand the Taylor series backwards The error is still O(h) BACKWARD FINITE DIFFERENCE f(x) x (xi,yi) (xi-1,yi-1) ( )( ) ( )hfhx f x fx fii iiV==1'8 Subtractbackward difference approximation from forward Taylor series expansion ( ) ( ) ()() + + = +31 1! 3' ' '2 ' 2 hx fh x f x f x fii i iCENTERED FINITE DIFFERENCE f(x) x (xi,yi) (xi-1,yi-1) (xi+1,yi+1)()( ) ( )( )21 12' h Ohx f x fx fi ii= +( ) ( ) ( )( ) ( )( ) ( ) ( )( ) ( )...! 3' ' '! 2' ''...! 3' ' '! 2' ''3 213 21hx fhx fh x f x f x fhx fhx fh x f x f x fi ii i ii ii i i + =+ + + =+The error is O(h2) 9 f(x) x f(x) x f(x) x f(x) x true derivative backward finite divided difference approx. centered finite divided difference approx. forward finite divided difference approx. SUMMARY 10 3 -point Forward difference 3 -point Backward difference ) x ( f'i-2i-1ii+1i+2 2 i i2 i 1 i ii 2 ii 1 i 2 ix xx f 3 x f 4 x f 3x fx xx f 3 x f 4 x fx f ++ ++ ~ ' + ~ ') ( ) ( ) () () ( ) ( ) () (Parabolic curve GENERAL 3 POINTS FIRST DERIVATIVE 11 Use forward and backward difference approximations of O(h2) to estimate the first derivative of at x = 0.5 with h = 0.25(exact sol. = -0.9125) Forward Difference Backward Difference 2 . 1 x 25 . 0 x 5 . 0 x 15 . 0 x 1 . 0 ) x ( f2 3 4+ =% 82 . 5 , 859375 . 05 . 0) 925 . 0 ( 3 ) 6363281 . 0 ( 4 2 . 0) 25 . 0 ( 2) 5 . 0 ( f 3 ) 75 . 0 ( f 4 ) 1 ( f) 5 . 0 ( f= = + = + = 't c% 77 . 3 , 878125 . 05 . 02 . 1 ) 035156 . 1 ( 4 ) 925 . 0 ( 3) 25 . 0 ( 2) 0 ( f ) 25 . 0 ( f 4 ) 5 . 0 ( f 3) 5 . 0 ( f= =+ =+ = 'tcFIRST DERIVATIVE 17 FORWARD FINITE-DIVIDED DIFFERENCES 19 BACKWARD FINITE-DIVIDED DIFFERENCES 20 CENTERED FINITE-DIVIDED DIFFERENCES 21 RICHARDSON EXTRAPOLATION Two ways to improve derivative estimates decrease step size use a higher order formula that employs more points More accurate approximation It is used to generate high-accuracy results while using low-order formulas. 22 RICHARDSON EXTRAPOLATION Integrals (second-order) In similar fashion, Derivatives(second-order, h2=h1/2) 23 | | ( ) ( ) ( )( / )/ ( ) ( )2 2 121 22 1 2 11I I h I h I hh h 14 1h h 2 I I h I h3 3= + = = ( ) ( )2 14 1D D h D h3 3= For a centered difference approximation with O(h2) the application of this formula will yield a new derivative estimate of O(h4). Special case h2 = h1/2 EXAMPLE Given the following function, use Richardsons extrapolation to determine the derivative at 0.5. f(x) = -0.1x4- 0.15x3 - 0.5x2 - 0.25x +1.2 f'(0.5)=? By using centered difference to calculate f'(0.5) with h= 0.5 and h=0.25. H= 0.5h=0.25 f'(0.5) = (0.2-1.2)/2*0.5f'(0.5) = (0.636-1.1035)/2*0.25 f(0) = 1.2 f(0.25) =1.1035 f(0.5) = 0.925 f(0.75) = 0.636 f(1) = 0.2 24