Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Finite Difference Approximations-Numerical Methods in Engineering-Lecture 14 Slides-Civil Engineering and Geological Sciences, Slides of Numerical Methods in Engineering

Practical issues in applying finite difference approximations. Finite Difference Approximations, Variable Coefficients, Two Dimensional, Finite Difference, Spatial Index, Examples

Typology: Slides

2011/2012

Uploaded on 02/20/2012

damyen
damyen 🇺🇸

4.4

(27)

274 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CE 341/441 - Lecture 14 - Fall 2004
p. 14.1
LECTURE 14
PRACTICAL ISSUES IN APPLYING FINITE DIFFERENCE APPROXIMATIONS
Derivatives of Variable Coefficients
Consider the term
where is a coefficient which is a function of
Proceed in steps. First let:
Now evaluate:
d
dx
------gx()
df x()
dx
-------------


g
x
ugx()
df
dx
------
du
dx
------ui1()
=
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Finite Difference Approximations-Numerical Methods in Engineering-Lecture 14 Slides-Civil Engineering and Geological Sciences and more Slides Numerical Methods in Engineering in PDF only on Docsity!

CE 341/441 - Lecture 14 - Fall 2004

p. 14.

LECTURE 14PRACTICAL ISSUES IN APPLYING FINITE DIFFERENCE APPROXIMATIONSDerivatives of Variable Coefficients • Consider the term

where

is a coefficient which is a function of

• Proceed in steps. First let:• Now evaluate:

d ------^ dx

g x (^

df ) x (^

-------------^ dx ^

^

g^

x

u^

g x (^

df ) ----- dx

du ------^ dx

u^ i

(^1) ( )

CE 341/441 - Lecture 14 - Fall 2004

p. 14.

• Now evaluate

and

hi i-

i

i-1/

i+1/

i+ hi+

x^

x

(^1) ( (^) u i )

u^ i^

1 ---+ 2

u^ i^

1 ---– 2

  • 1 ---^2 h^ i^

h^ i^

(^1) +

(^

u^ i^

1 ---+ 2

u^ i^

1 ---– (^2) u i^

1 ---+ 2

g^ i^

f^ 1 ---+ 2 i^ 1 1 ---+^2 (^ )^

g^ i^

1 ---+ 2

f^ i^

(^1) +

f^ – i h^ i^

(^1) + ---------------------- 

^

^

=^

u^ i^

1 ---– 2

g^ i^

f^ 1 ---– 2 i^ 1 1 ---–^2 (^ )

g^ i^

1 ---– 2

f^ i^

f^ i^

(^1) –

-^ h^ i ---------------------

^

^

^

=^

CE 341/441 - Lecture 14 - Fall 2004

p. 14.

Two Dimensional Finite Difference Approximations • Define nodes in a two-dimensional plane with

•^

= spatial index in the

-direction

•^

= spatial index in the

-direction

i^

x

j^

y

fi^ , j+2i, j+

i+2, j+

f i, j+1 i, j-1 i, j-

fi^ +2, j

y^

x

i-2, j

i-1, j

i, j i+1, j

i+2, j

x

fi^ , j

fi+

2 , j+

y

CE 341/441 - Lecture 14 - Fall 2004

p. 14.

• When taking partial derivatives w.r.t.

, we hold

constant

and

• Similarly

x^

y

f ------ ∂ x

i^ j ,

f^ i^

1 j ,+

f^ i^

1 j ,–

  • 2 ∆ x

fx

2

-^ i^

j ,

f^ i^

1 j ,+

2 f^

i^ j ,^

f^ i^

1 j ,–

  • x

2

fy

2

-^ i^

j ,

f^ i^

j^

(^1) + ,^

2 f^

i^ j ,^

f^ i^

j^^1 – ,

  • y

2

CE 341/441 - Lecture 14 - Fall 2004

p. 14.

Example 2 • Let’s consider: • Draw a molecule diagram for the 2nd order central difference formulation.• Obtain

by finding

⇒ ⇒

f^

2 f (^

)^

fx

4

-^

fx

(^2) y

-^

fy

4

+^

=^

fx

4

-^

(^2) ∂--------^2 ∂ x

2 f ---------^2 ∂ x ^

^

^

fx

4

-^

(^2) ∂--------^2 ∂ x

2 f ---------^2 ∂ x ^

^

^

fx

4

-^

(^2) ∂--------^2 ∂ x

(^1) ---------^2 ∆ x f^

i^ 1 j ,+

2 f i^ j ,^

f^ i^

(^1) – j ,

(^

^

^

CE 341/441 - Lecture 14 - Fall 2004

⇒ ⇒ p. 14.

fx

4

-^

(^1) ---------^2 ∆ x

(^2) --------^2 ∂ x

f^ i^

1 j ,+ (^

)^

(^2) --------^2 ∂ x

f^ i^

j , (^

)^

(^2) ∂--------^2 ∂ x f^

i^^1 –^

j , (^

^

^

^

fx

4

-^

(^1) ---------^2 ∆ x

(^1) ---------^2 ∆ x f^

i^ 2 j ,+

2 f i^

(^1) + j ,^

f^ i^

j ,

(^

–^

(^2) ---------^2 ∆ x f^

i^ 1 j ,+

2 f^

i^ j ,^

f^ i^

(^1) – j ,

(^

(^1) ---------^2 ∆ x

f^

i^ j ,^

2 f i^

(^1) – j ,^

f^ i^

(^2) – j ,

(^

+^

fx

4

-^

(^1) ---------^4 ∆ x

f^

i^ 2 j ,–

4 f i^

1 j ,–

6 f i^ j ,^

4 f i^

1 j ,+

f^ i^

2 j ,+

(^

1

-^

6

1

-

(^14) ∆ x^

CE 341/441 - Lecture 14 - Fall 2004

p. 14.

• Evaluation of the mixed derivative:

⇒ ⇒ (^4) ∂ fx

(^2) y

-^

(^2) ∂--------^2 ∂ y

2 f ---------^2 ∂ x ^

^

^

fx

(^2) y

-^

(^2) ∂--------^2 ∂ y

(^1) ---------^2 ∆ x f^

i^^1

j ,–

2 f^

i^ j ,^

f^ i^

1 j ,+

(^

^

^

fx

(^2) y

-^

(^1) ---------^2 ∆ x

(^1) ---------^2 ∆ y f^

i^ 1 j

^1 – ,

-^

2 f^

i^ 1 j ,–

f^ i^

1 j

^1 +,

(^

–^

(^2) ---------^2 ∆ y f^

i^ j^

(^1) – ,^

2 f^

i^ j ,^

f^ i^

j^ (^1) + ,

(^

(^1) ---------^2 ∆ y f^

i^ 1 j

^1 – , +^

2 f^

i^ 1 j ,+

f^ i^

1 j

^1 +,

(^

CE 341/441 - Lecture 14 - Fall 2004

⇒ p. 14.

• This then produces the following module

fx

(^2) y

-^

x

(^2) y

-^ f

i^

1 j

^1 – ,

-^

2 f^

i^ 1 j ,–

f^ i^

1 j ^1 +,

[

2 f i^ j

^1 – ,

-^

4 f i^ j ,^

2 f i^ j

^1 +,

f^ i^

1 j

^1 – , +^

2 f^

i^ 1 j ,+

f^ i^

1 j ,+

]

1^ ∆ y

2

1

-^

1

-^

4

-

1

-^

1

(^2) ∆ x

CE 341/441 - Lecture 14 - Fall 2004

p. 14.

• To obtain

, we must add up modules:

• If

then:

f

f^

fx

4

-^

fx

(^2) y

-^

fy

4

+^

x

y

h

=^

-8 20 -8^1

2

2

-^ -

1

1

1

2

2

(^14) h