Docsity

Central Divided Difference Method, Lecture notes of Engineering Mathematics

Partial preview of the text

Download Central Divided Difference Method and more Lecture notes Engineering Mathematics in PDF only on Docsity!

Module 2

Lesson 6

Numerical Differentiation

Central Divided Difference

Edgar M. Adina

Instructor

CE 50 P- 2

Numerical Solutions to Engineering Problems

Introduction

➢ Calculus is the mathematics of change. Because engineers must

continuously deal with systems and processes that change, calculus is

an essential tool of engineering.

➢ Standing in the heart of calculus are the mathematical concepts of

differentiation and integration :

Δ𝑦

Δ𝑥

=

𝑓(𝑥𝑖 + Δ𝑥) − 𝑓(𝑥𝑖)

Δ𝑥 𝑑𝑦

𝑑𝑥

=Δ𝑥 lim 0

𝑓(𝑥𝑖 + Δ𝑥) − 𝑓(𝑥𝑖)

Δ𝑥

𝐼 = න

𝑎

𝑏

𝑓(𝑥)𝑑𝑥

Applications

➢ Differentiation has so many engineering applications

(heat transfer, fluid dynamics, chemical reaction kinetics,

etc…)

➢ Integration is equally used in engineering (compute work

in ME, nonuniform force in SE, cross-sectional area of a

river, etc…)

Differentiation

The finite difference becomes a derivative as Δx approaches zero.

𝜟𝒚

𝜟𝒙

=

𝒇(𝒙𝒊 + 𝜟𝒙) − 𝒇(𝒙𝒊)

𝜟𝒙 x

f x x f x

dx

dy (^) i i

x (^) 

( ) ( ) lim 0

  • − = →

Numerical Application of Taylor Series

If f (x) and its first n+ 1 derivatives are continuous on an

interval containing x

i+ 1

and x

i

, then:

Where the remainder R

n

is defined as:

𝑓 𝑥𝑖+ 1 ≅ 𝑓 𝑥𝑖 + 𝑓

′ 𝑥𝑖 𝑥𝑖+ 1 − 𝑥𝑖 +

𝑓

′′ 𝑥𝑖

2!

𝑥𝑖+ 1 − 𝑥𝑖

2

𝑓

3 𝑥𝑖

3!

𝑥𝑖+ 1 − 𝑥𝑖

3 +... +

𝑓

𝑛 𝑥𝑖

𝑛!

𝑥𝑖+ 1 − 𝑥𝑖

𝑛

  • 𝑅𝑛

𝑅𝑛 =

𝑓

𝑛+ 1 𝜉

𝑛 + 1!

𝑥𝑖+ 1 − 𝑥𝑖

𝑛+ 1

Numerical Application of Taylor Series

➢ The series is built term by term

➢ Continuing the addition of more terms to get better

approximation we have:

𝑓 𝑥𝑖+ 1 ≅ 𝑓 𝑥𝑖

𝑓 𝑥𝑖+ 1 ≅ 𝑓 𝑥𝑖 + 𝑓

′ 𝑥𝑖 𝑥𝑖+ 1 − 𝑥𝑖

𝑓 𝑥𝑖+ 1 ≅ 𝑓 𝑥𝑖 + 𝑓

′ 𝑥𝑖 𝑥𝑖+ 1 − 𝑥𝑖 +

𝑓

′′ 𝑥𝑖

2!

𝑥𝑖+ 1 − 𝑥𝑖

2

zero order approximation

st

order approximation

nd

order approximation

Taylor Series: ξ in the Remainder Term

❑ Limitations

➢ ξ is not exactly known but lies somewhere between xi and xi+ 1

➢ To evaluate R

n

, the (n+ 1 ) derivative of f (x) has to be determined.

To do this f (x) must be known

➔ if f (x) was known there would be no need to perform the Taylor series

expansion!!!

❑ Modification

R

n

= O(h

n+ 1

) the truncation error is of the order of h

n+ 1.

(h = x

i+ 1

  • x i

➢ If the error is O(h), halving the step size will halve the error.

➢ If the error is O(h

2

), halving the step size will quarter the error.

➢ In general, the truncation error is decreased by addition of more terms in the

Taylor series.

Centered Difference Formulas- 1

st derivative

Start with the 2

nd degree Taylor expansions about x for f (x+h) and f (x-h):

Subtract ( 5 ) from ( 4 )

Hence

𝑓(𝑥𝑖+ 1 ) = 𝑓(𝑥𝑖) + 𝑓′(𝑥𝑖)ℎ +

𝑓′′(𝑥𝑖)

2

ℎ

2

  • 𝑂(ℎ

3 )

2

3

( 4 )

( 5 )

𝑓(𝑥𝑖+ 1 ) − 𝑓(𝑥𝑖− 1 ) = 2 𝑓′(𝑥𝑖)ℎ + 𝑂(ℎ

3 )

2

Centered Difference Formulas- 2

nd derivative

Start with the 3

rd degree Taylor expansions about x for f (x+h) and f (x-h):

Add equations ( 8 ) and ( 9 ), and solve for f ’’(x)

2

3

  • 𝑂(ℎ

4 ) ( 8 )

2 −

3

  • 𝑂(ℎ

4 ) (^9 )

Centered Difference Formulas- 2

nd derivative

Start with the addition between the 5

th degree Taylor expansions about x for f (x+h)

and f (x-h):

Use the step size 2 h, instead of h, in ( 10 )

Multiply equation ( 10 ) by 16 , subtract ( 11 ) from it, and solve for f ’’(x)

2

( 4 )

4

6 ) (^10 )

( 11 )

2

4

2

( 4 )

4

6

Example 1

Solution

( )

( ) ( )

t
t t
a t

i i i

  • −

 1  1 ti = 16

1

t i + = ti + t

14

16 2

1

=

= −

t (^) i − = ti − t

( )

( ) ( )

2 ( ) 2

18 14 16

a

( ) ( )

t = 2

( ) ( )

  1. 8 ( 18 ) 14 10 210018

18 2000 ln 4

4

−  

 = = 453. 02 m/s
14 2000 ln

4

4

 = = 334. 24 m/s

( )

( ) ( )

a

2  29. 694 m/s

Example 1

The absolute relative true error is

t =

= 0. 069157 %

The exact value of the acceleration at is

( )

2 a 16 = 29. 674 m/s

t = 16 s

Example 2

The velocity of a rocket is given by

( ) 9. 8 , 0 30 14 10 2100

2000 ln 4

4

−    

= t t t

 t

Use central difference approximation of second derivative of to

calculate the jerk at. Use a step size of.

ν ( ) t

t = 16 s Δ t^^ =^2 s

Example 2

Solution ( )

( )

2

(^1 )

t

t t t a t

i i i i

  • −

ti

1

t i + = ti + t

1

t i − = ti − t

( )

( ) ( ) ( )

( )

2

j 

t = 2

( ) ( )

  1. 8 ( 18 ) 14 10 210018

18 2000 ln 4

4

−  

 = = 453. 02 m/s

( ) ( )

  1. 8 ( 16 ) 14 10 210016

16 2000 ln 4

4

−  

 = =^392.^07 m/s

( ) ( )

  1. 8 ( 14 ) 14 10 210014

14 10 14 2000 ln 4

4

−  

  

 −

  = =^334.^24 m/s

( )

( ) ( ) ( )

( )

2 2

j

( )

3  0. 77969 m/s