pdes & parabolic problems jacob y. kazakia © 20031 partial differential equations linear in two...

16
PDEs & Parabolic p roblems Jacob Y. Kazakia © 2003 1 Partial Differential Equations near in two variables: 0 ...... ) , ( ) , ( ) , ( 2 2 2 2 2 y u y x C y x u y x B x u y x A classification at a given point (x,y): equation Wave 0 4 equatio conduction Heat 0 4 equation s Laplace' 0 4 2 2 2 hyperbolic AC B parabolic AC B elliptic AC B l point of view Initial Value Problem ( time evolution) Hyperboli Boundary Value Problem ( static solution) Elliptic cern: Initial Value Problem : Stability Boundary Value Problem: Efficiency

Upload: melvin-sherman

Post on 21-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 1

Partial Differential Equations

Linear in two variables:

0......),(),(),(2

22

2

2

y

uyxC

yx

uyxB

x

uyxA

Usual classification at a given point (x,y):

equation Wave04

equation conductionHeat 04

equation sLaplace'04

2

2

2

hyperbolicACB

parabolicACB

ellipticACB

From the numerical point of view Initial Value Problem ( time evolution) Hyperbolic or Parabolic Boundary Value Problem ( static solution) Elliptic

Computational Concern: Initial Value Problem : Stability Boundary Value Problem: Efficiency

Page 2: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 2

Parabolic PDEsinsulated rod

time line

x = 0 x = L x axis

T = 0o

at all times

T = 0o

at all times

T = T0 f ( x )at time = 0

What is the temperaturelater ?

T(x,t) T(x+x,t)

x

area A

heat flux in heat flux out

heat flux in =txx

TAk

,

heat flux out =txxx

TAk

,

Balance equation:

2

2limit in the

,

,,

t

T

t

T:as written becan which ,

x

T

c

k

x

xT

xT

c

k

x

TAk

x

TAk

t

TxAc

v

tx

vtxxtxv

txx

Page 3: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 3

nondimensionalization

2

22

scale

2

2

20

scale

0

0scale

2

2

:obtain we tchoosing

T

t

T

:becomesequation theand

T

TT ,

t

tt ,

L

x x

using T ,t ,x variablesonalnondimensiselect t

T

x

T

t

T

k

Lc

x

T

Lc

k

t

T

x

T

c

k

v

v

v

Page 4: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 4

Numerical Solution

x = 0 u = f(x) x = L

u = g1(t) u = g2(t)u t = u xx

consider a grid:

hx

kt

k

txuktxutxu

h

thxutxuthxutxu

t

xx

,,,

,,2,,

2

thxutxuthxuktxuor

thxutxuthxuh

ktxuktxu

,,21,,

,,2,,,2

this results in an explicit method:

where2h

k

Page 5: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 5

Stencil for explicit solution

2

0 13hh

k2h

k

3012 )21( uuuu

Page 6: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 6

Example - Instability

3012 )21( uuuu

xu

521

3

3/1

2

h

k

kh

then using

we obtain the following results

rational arithmetic rounded to one decimal

u1=3*0 - 5(1/3) + 3*(2/3) = 1/3u2=3*(1/3) - 5(2/3) + 3*1 = 2/3u3=3*0 - 5(1/3) + 3*(2/3) = 1/3u4=2/3........Solution : u = x ( satisfies all conditions)

u1=3*0 - 5(.3) + 3*(.7) = .6u2=3*(.3) - 5(.7) + 3*1 = .4u3=3*0 - 5(.6) + 3*(.4) = -1.8u4=+2.8u5= 17.4u6= -16.4u7= -136.2u8= +137.2 Unstable results

u = 0

u = 1/3

u = 2/3

u = 1x = 1

u=0 u=1

t

x

1 2

3 4

5 6

7 8

Page 7: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 7

Instability - reasons/conditions

x = au =

u=0 u=0

ktaxh

k ,22

t

1

2

3

4

x

u1= (1 - 2) u2= (1 - 2)2 u3= (1 - 2)3 ......un= (1 - 2)n

for physically sensible results we must have (1 - 2) positive and less than one

210

1210

lyequivalentor

000,20.00005

1 rows of#or

0.00005 k havemust we

0.01 h and 1for t22

1

:havemust we

methodexplicit stable afor

2

2

h

korh

k

Page 8: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 8

Stable solution- the Implicit method

(x , t)

4

0 13 hh

k

(x+h , t)(x-h , t)

(x , t - k)

210340

210340

2

2

toes translatequation aldifferenti The

hkwhereuuuuu

orh

uuu

k

uu

uu xxt

4103 21

:points of roweach at system ltridiagona

dominant diagonally theproduces this

uuuλuλ

Page 9: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 9

Example on Implicit method

u =.3 u =.7

u=0 u=1

t

x

1 2

3 4

5 6

7 8

k = h = 1 / 3 , = 3 , 1 + 2 = 7

for the points 1 and 2 at the first level up we obtain

3 * 0 - 7 u1 + 3 u2 = - 0.33 u1 - 7 u2 + 3 * 1 = - 0.7

using one decimal digit arithmetic the solution of this system is:

u2 = .7 and u1 = .3

Stable and consistent method.

Page 10: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 10

Crank - Nicholson Method

A

0 13

7 4 8h

k

2847

4

2

2

2103

0

2

2

40

2

2

h

uuu

x

u

h

uuu

x

u

differencecentralk

uu

t

u

A

8474103

2847103240

2847103

4

2

2

0

2

2

2

2

22)1(2

using222

2

22

2

1

uuuuuuu

h

kuuuuuu

h

kuu

h

uuuuuu

x

u

x

u

x

u

A

This is more accurate without increasing the work considerably.Same form LHS of the equation

Page 11: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 11

A Boundary Value Technique 1

utxFuu txx ,,

tgu 1 tgu 2

)(xfu 0x ax

t

x

utxFuu txx ,,

tgu 1 tgu 2

)(xfu 0x ax

t

x

Tt )(xUu

here U(x) is the solution of the problem for t largesummarized on the right

)(lim)(

)(lim)0(

),,(lim

2

1

tgaU

tgU

UtxFU

t

t

txx

solve the problem and get U(x)

Page 12: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 12

A Boundary Value Technique 2

we can then write the finite difference analog of the equationusing the stencil

0 u(x,t) 1 u(x+h,t) u(x-h,t) 3

2 u(x,t+k)

4 u(x,t-k)

see example next slide

Page 13: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 13

B V T Example 1

10)0,(

0),1(

00),0(

10

xxxu

tetu

ttu

xuxuu

t

xtxx

the exact solution of this problem is:

textxu ),(

( differentiate and substitute to prove that this is indeed the case)

As time tends to large values the problem simplifies to: Uxx = x Ux with U(0) = 0 and U(1) = 0

which has the trivial solution U = 0 everywhere

We choose T = 2 ( this is our approximation to large time)and we use k = h = 1/3

Page 14: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 14

B V T Example 2

(0,2)

(0,5/3)

(0,4/3)

(0,1)

(0,2/3)

(0,1/3)

(0,0)(1/3,0) (2/3,0) (1,0)

(1,1/3)

(1,2/3)

(1,1)

(1,4/3)

(1,5/3)

(1,2)(1/3,2) (2/3,2)

u=0 u=0

u=0

u=0

u=0

t

x

u=0

u=0

u=0

u=0

u=1/3 u=2/3

u=1

u=e -1/3

u=e -2/3

u=e -1

u=e -4/3

u=e -5/3

u=e -2 =0.14

1 2

3 4

5 6

7 8

9 10

we now write the finite difference equations for each of the 10 points and we obtain 10 equations to be solved simultaneously. This produces a solution which agrees with the exact one in two decimal places

The first two equations ( points 1 and 2 ) are:

verify this

31

81102

318

2

1

2

3

2

1718

142

321

euuu

uuu

Page 15: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 15

Two Dimensional Diffusion Equation

1n+1

2n+1 5n+1

0n+1

6n+1

3n+1

7n+1 4n+1 8n+1

A

1n

2n 5n

0n

6n

3n

7n 4n 8n

2

2

2

2

y

u

x

u

t

u

Try to implement Crank- Nicholson Scheme on this problem

kt

hyx

nnnn

nn

nnn

n

nnn

n

uuuuhk

uuh

uuuu

hh

uuuu

h

yyxx

yx

0

2

0

2

0

2

0

22

00

2402

0

222

3010

22

11

1

111

1

111

1

2

1

21,

21

We must write one such equation per each interior point and then solve the system at each time step.

Page 16: PDEs & Parabolic problems Jacob Y. Kazakia © 20031 Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):

PDEs & Parabolic problems

Jacob Y. Kazakia © 2003 16

Two Dimensional Diff. Eqn Cont.

2

2

2

2

y

u

x

u

t

u

nnnn

nn

uuuuhk

uuyyxx 0

2

0

2

0

2

0

22

0011

1

2

1

We must write one such equation per each interior point and then solve the system at each time step.

finite difference equivalent

Difficulty: Large system of equations which is sparse but not tridiagonal or even banded

Remedy: ADI method ( Alternating Direction Implicit solution) a) write the above equation in the form:

nljy

nljy

nljx

nljx

nlj

nlj uuuu

h

kuu ,

21,

2,

21,

22,

1, 2

b) divide each time step into two steps of size t/2. In each sub step, treat a different dimension implicitly i.e.

1,

2,

22,

1,,

2,

22,,

21

21

21

21

22 nljy

nljx

nlj

nlj

nljy

nljx

nlj

nlj uu

h

kuuanduu

h

kuu

Advantage: at each sub step only a tridiagonal system is solved