lecture 8

# lecture 8 - Fig PT6.10 Chapter 23 Numerical Differentiation...

This preview shows pages 1–14. Sign up to view the full content.

Fig PT6.10

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Chapter 23 Numerical Differentiation
Numerical Differentiation Estimate the derivatives (slope, curvature, etc.) of a function by using the function values at only a set of discrete points Ordinary differential equation (ODE) Partial differential equation (PDE) Represent the function by Taylor polynomials or Lagrange interpolation Evaluate the derivatives of the interpolation polynomial at selected nodal points

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Forward difference Backward difference Centered difference Numerical Differentiation
Forward difference x i 1 x i x i+1 x h

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Backward difference x i 1 x i x i+1 x h
Centered difference x i 1 x i x i+1 x 2h

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
First Derivatives Forward difference Backward difference Central difference ) x ( f i-2 i-1 i i+1 i+2 1 i 1 i 1 i 1 i 1 i 1 i 1 i 1 i 1 i i 1 i i 1 i i 1 i i i 1 i i 1 i i 1 i i 1 i x x y y x x ) x ( f ) x ( f ) x ( f x x y y x x ) x ( f ) x ( f ) x ( f x x y y x x ) x ( f ) x ( f ) x ( f x y
Truncation Errors Uniform grid spacing ) x ( f ! 3 h ) x ( f ! 2 h ) x ( f h ) x ( f ) h x ( f ) x ( f ) x ( f ! 3 h ) x ( f ! 2 h ) x ( f h ) x ( f ) h x ( f ) x ( f i 3 i 2 i i i 1 i i 3 i 2 i i i 1 i ) ) ( ) ( ) ( ) ( : ) ( ) ( ) ( ) ( : ) ( ) ( ) ( ) ( : 2 3 2 1 i 1 i i 2 1 i i i 1 i 1 i i O(h f 6 h h 2 x f x f x f central O(h) f 2 h h x f x f x f backward O(h) f 2 h h x f x f x f forward

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Error Propagation x x f x f x x x f x f x f x f x x ~ ) ( ) ( ) ~ ( ) ( ) ( ) ~ ( ) ( ~ Error in x leads to error in f(x)
Example: First Derivatives Use forward and backward difference approximations to estimate the first derivative of at x = 0.5 with h = 0.5 and 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 ( f 2 3 4 % . , . . . . . . ) . ( ) . ( ) . ( , . % . , . . . . . ) . ( ) ( ) . ( , . 5 26 155 1 25 0 925 0 63632813 0 5 0 75 0 5 0 f 75 0 f 5 0 f 25 0 h 9 58 45 1 5 0 925 0 2 0 5 0 1 5 0 f 1 f 5 0 f 5 0 h t t % . , . . . . . . ) . ( ) . ( ) . ( , . % . , . . . . . ) ( ) . ( ) . ( , . 7 21 714 0 25 0 10351563 1 925 0 25 0 5 0 25 0 f 5 0 f 5 0 f 25 0 h 7 39 55 0 5 0 2 1 925 0 0 5 0 0 f 5 0 f 5 0 f 5 0 h t t

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example: First Derivative Use central difference approximation to estimate the first derivative of at x = 0.5 with h = 0.5 and 0.25 (exact sol. = -0.9125) Central Difference 2 . 1 x 25 . 0 x 5 . 0 x 15 . 0 x 1 . 0 ) x ( f 2 3 4 % 4 . 2 , 934 . 0 5 . 0 10351563 . 1 63632813 . 0 25 . 0 75 . 0 ) 25 . 0 ( f ) 75 . 0 ( f ) 5 . 0 ( f , 25 . 0 h % 6 . 9 , 0 . 1 1 2 . 1 2 . 0 0 1 ) 0 ( f ) 1 ( f ) 5 . 0 ( f , 5 . 0 h t t
Second-Derivatives Taylor-series expansion Uniform grid spacing Second-order accurate O(h 2 )

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 82

lecture 8 - Fig PT6.10 Chapter 23 Numerical Differentiation...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online