Numerical Differentiation

85 downloads 259 Views 134KB Size Report
11/14/2007 http://numericalmethods.eng.usf.edu. 1. Numerical Differentiation h xf hxf xf h. )(. ) ( lim. )(. 0. −. +. = ′. →. Recall the definition of first derivative.
11/14/2007

Numerical Differentiation Recall the definition of first derivative f ′( xi ) ≅

f ( xi + h) − f ( xi ) f ( xi +1 ) − f ( xi ) = h xi +1 − xi

f ′( xi ) =

f ′( x) = lim h →0

f ( x + h) − f ( x ) h

forward difference

f ( xi ) − f ( xi −1 ) xi − xi −1

backward difference

averaging f ′( xi ) =

f ( xi +1 ) − f ( xi −1 ) xi +1 − xi −1

central difference

Truncation Error (formula order) using Taylor series (Theorem 1.16) f ( x ) = f ( x0 ) + f ′( x0 )( x − x0 ) + f ′′( x0 )

( x − x0 ) 2 ( x − x0 ) n + ... + f n ( x0 ) + f n! 2!

n +1

(c )

( x − x0 ) n +1 ( n + 1)!

x0 < c < x

Let

x = x0 + h, n = 1

f ( x0 + h) = f ( x0 ) + f ′( x0 )h + f ′′(c1 )

h2 f ( x0 + h) − f ( x0 ) h ⇒ f ′( x0 ) = − f ′′(c1 ) h 2! 2

Forward difference with 0 (h) Let

x = x0 − h, n = 1

f ( x0 − h) = f ( x0 ) + f ′( x0 )(−h) + f ′′(c2 )

h2 f ( x0 ) − f ( x0 − h) h ⇒ f ′( x0 ) = + f ′′(c2 ) h 2! 2

Backward difference with 0 (h)

http://numericalmethods.eng.usf.edu

1

11/14/2007

Centered Formula of Order O (h 2)

http://numericalmethods.eng.usf.edu

2

11/14/2007

Higher order derivatives

http://numericalmethods.eng.usf.edu

3

11/14/2007

http://numericalmethods.eng.usf.edu

4

11/14/2007

Write (3) for step sizes h and 2h

http://numericalmethods.eng.usf.edu

5

11/14/2007

http://numericalmethods.eng.usf.edu

6

Suggest Documents