by dr. samah mohamed mabrouk 1

12
Finite Deference Method by Dr. Samah Mohamed Mabrouk 1 www.smmabrouk.faculty.zu.edu.eg

Upload: wesley-scott

Post on 04-Jan-2016

229 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: By Dr. Samah Mohamed Mabrouk 1

Finite Deference Method

byDr. Samah Mohamed Mabrouk

1

www.smmabrouk.faculty.zu.edu.eg

Page 2: By Dr. Samah Mohamed Mabrouk 1

SE301_Topic 6 Al-Amer2005 2

Difference equations for the Laplace and Poisson equations

Laplace’s equation

Poisson’s equation ),(2 yxfu

02

2

2

2

y

u

x

u

02 u

Where is the Laplacian operator

),(2

2

2

2

yxfy

u

x

u

Page 3: By Dr. Samah Mohamed Mabrouk 1

3

Central difference approximation for Second derivative

211

2

2

)(

2

x

uuu

dx

ud iii

i

2

11

2

2

)(

2

y

uuu

dy

ud jjj

j

i+1x

y

i

x

i+1i-1 i

i-1

j+1

j

j-12

1,,1,

2

,1,,1

,

2

2

2

2

)(

2

)(

2

y

uuu

x

uuu

y

u

x

u

jijijijijiji

ji

j+1

j

y

j-1

Page 4: By Dr. Samah Mohamed Mabrouk 1

SE301_Topic 6 Al-Amer2005 4

For x =y = h

),(

042

1,1,,1,,1

,

2

2

2

2

ji

jijijijiji

jiyxfh

uuuuu

y

u

x

u

),(

04 2

jiSNWEij yxfhuuuuu

East

West

North

South

Page 5: By Dr. Samah Mohamed Mabrouk 1

Example 1Solve the Laplace equation on a square plate of side 12 cm, using a grid of mesh 4cm and a Dirchlet B.C. as u(x,0)=u(0,y)=u(12,y)=100 and u(x,12)=0

02

2

2

2

y

u

x

u

solution

x = 0 4 8 12 0

4

8

12

u4u3

u2u1

u=100

u=100 u=100

u=0L = 12 cm , h= 4 cmN= 12/4 = 3

-4uij+ uE+uW+uN+uS = 0

(1) -4u1+u2+100+100+u3 = 0

(2) -4u2+u1+100+100+u4 = 0

(3) -4u3+100+u4+u1+0 = 0

(4) -4u4+100+u3+u2+0 = 0

Page 6: By Dr. Samah Mohamed Mabrouk 1

SE301_Topic 6 Al-Amer2005 6

In matrix form Au=b

100

100

200

200

4110

1401

1041

0114

4

3

2

1

u

u

u

u

But the problem is symmetry, u1 =u2 and u3 =u4

So we can solve only for u1 and u3

(1) -4u1+u2+100+100+u3 = 0 (3) -4u3+100+u4+u1+0 = 0

Then replace for u1 =u2 and u3 =u4, the system of equations is reduced to

-3u1 +u3 = -200

u1-3u3 = -100

Which has a solution u1 =u2 =87.5 and u3 =u4 =62.5

Page 7: By Dr. Samah Mohamed Mabrouk 1

Example 2Solve the mixed BVP for the poisson equation (uxx + uyy =12xy) on a rectangle plate as shown in the fig. (take x =y =0.5)

x = 0 0.5 1 1.5

0

0

.5

1

u4u3

u2u1

u=0

u=0 u=3y3

xdy

du6

u=0.375

u=3

Page 8: By Dr. Samah Mohamed Mabrouk 1

xyy

u

x

u12

2

2

2

2

solution

x = 0 0.5 1 1.5 0

0.5

1

u4u3

u2u1

u=0

u=0u=3y3

-4uij+ uE+uW+uN+uS = 12h2xy=3xy

(1) -4u1+u2+u3 =3(0.5)(0.5)

(2) -4u2+0.375+u1+u4 = 3(1)(0.5)

(3) -4u3+u4+u1+u5 = 3(0.5)(1)

(4) -4u4+3+u3+u2+u6 = 3(1)(1)

xdy

du6

u6u5

u=0.375

u=3

Page 9: By Dr. Samah Mohamed Mabrouk 1

x = 0 0.5 1 1.5 0

0.5

1

u4u3

u2u1

u=0

u=0u=3y3

xdy

du6

u6u5

u=0.375

u=3

xdy

du6

3)5.0(6)5.0(2 1515

uu

uu

6)1(6)5.0(2 2626

uu

uu

Then replace for u5 and u6

And put the system in the matrix form

Page 10: By Dr. Samah Mohamed Mabrouk 1

SE301_Topic 6 Al-Amer2005 10

6

5.1

125.1

75.0

4120

1402

1041

0114

4

3

2

1

u

u

u

u

Tu 191.0077.0812.1866.0

Which has a solution

Page 11: By Dr. Samah Mohamed Mabrouk 1

EXERCISE

For a rectangle thin plate of dimension 4*3 units, u(x,0)=u(x,3)=10x, u(0,y)=0 and u(4,y)= 40 +10y(y-3). Solve the Poisson’s equation 2u = 5x , take x = y = 1

Page 12: By Dr. Samah Mohamed Mabrouk 1

EXERCISES