NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula
Find an approximate value for 0. 1 0. 5877867 0. 6418539 0. 5406720 0. 01 0. 5877867 0. 5933268 0. 5540100 0. 001 0. 5877867 0. 5883421 0. 5554000 The exact value of
Assume that a function goes through three points: Lagrange Interpolating Polynomial
If the points are equally spaced, i. e. ,
Three-point formula:
If the points are equally spaced with x 0 in the middle:
Another Three-point formula:
Alternate approach (Error estimate) Take Taylor series expansion of f(x+h) about x: . . . (1)
Forward Difference Formula
Three-point Formula
The Second Three-point Formula Take Taylor series expansion of f(x+h) about x: Take Taylor series expansion of f(x-h) about x: Subtract one expression from another
Second Three-point Formula
Summary of Errors Forward Difference Formula Error term
Summary of Errors continued First Three-point Formula Error term
Summary of Errors continued Second Three-point Formula Error term
Example: Find the approximate value of 1. 9 12. 703199 2. 0 14. 778112 2. 1 2. 2 17. 148957 19. 855030 with
Using the Forward Difference formula:
Using the 1 st Three-point formula:
Using the 2 nd Three-point formula: The exact value of
Comparison of the results with h = 0. 1 The exact value of is 22. 167168 Formula Error Forward Difference 23. 708450 1. 541282 1 st Three-point 22. 032310 0. 134858 2 nd Three-point 22. 228790 0. 061622
Second-order Derivative Add these two equations.
A temperature gradient can be measured down into the soil as shown below. MEASUREMENTS 0 1. 25 3. 75 13. 5 12 10 which can be used to compute the heat flux at z=0: q(z=0) = -3. 5 x 10 -7(1800)(840)(-133. 3 0 C/m)=70. 56 W/m 2