NUMERICAL DIFFERENTIATION NUMERICAL DIFFERENTIATION The derivative of f

  • Slides: 33
Download presentation
NUMERICAL DIFFERENTIATION

NUMERICAL DIFFERENTIATION

NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to

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.

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

Assume that a function goes through three points: Lagrange Interpolating Polynomial

If the points are equally spaced, i. e. ,

If the points are equally spaced, i. e. ,

Three-point formula:

Three-point formula:

If the points are equally spaced with x 0 in the middle:

If the points are equally spaced with x 0 in the middle:

Another Three-point formula:

Another Three-point formula:

Alternate approach (Error estimate) Take Taylor series expansion of f(x+h) about x: . .

Alternate approach (Error estimate) Take Taylor series expansion of f(x+h) about x: . . . (1)

Forward Difference Formula

Forward Difference Formula

Three-point Formula

Three-point Formula

The Second Three-point Formula Take Taylor series expansion of f(x+h) about x: Take Taylor

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

Second Three-point Formula

Summary of Errors Forward Difference Formula Error term

Summary of Errors Forward Difference Formula Error term

Summary of Errors continued First Three-point Formula Error term

Summary of Errors continued First Three-point Formula Error term

Summary of Errors continued Second 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

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 Forward Difference formula:

Using the 1 st Three-point formula:

Using the 1 st Three-point formula:

Using the 2 nd Three-point formula: The exact value of

Using the 2 nd Three-point formula: The exact value of

Comparison of the results with h = 0. 1 The exact value of is

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.

Second-order Derivative Add these two equations.

A temperature gradient can be measured down into the soil as shown below. MEASUREMENTS

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

 • 0. 2 0. 4 0. 6 0. 8 1. 0 0. 9798652

• 0. 2 0. 4 0. 6 0. 8 1. 0 0. 9798652 0. 9177710 0. 808038 0. 6386093 0. 3843735

 • 1. 29 1. 31 1. 4 11. 5900 6 13. 7817 6

• 1. 29 1. 31 1. 4 11. 5900 6 13. 7817 6 14. 0427 6 14. 3074 1 16. 8618 7

 • 1. 00 1. 01 1. 02 1. 03 1. 04 3. 12

• 1. 00 1. 01 1. 02 1. 03 1. 04 3. 12 3. 14 3. 18 3. 24