Home > Documents > CISE301 : Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures 37-39

# CISE301 : Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures 37-39

Date post: 16-Feb-2016
Category:
View: 85 times
Description:
CISE301 : Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures 37-39. KFUPM Read 29.1-29.2 & 30.1-30.4. L ecture 37 Partial Differential Equations. Partial Differential Equations (PDEs). What is a PDE? Examples of Important PDEs. Classification of PDEs. - PowerPoint PPT Presentation
69
CISE301_Topic9 KFUPM 1 Methods Topic 9 Partial Differential Equations (PDEs) Lectures 37-39 KFUPM Read 29.1-29.2 & 30.1-30.4
Transcript

CISE301_Topic9 KFUPM 1

CISE301: Numerical Methods

Topic 9 Partial Differential Equations

(PDEs)Lectures 37-39

KFUPM

CISE301_Topic9 KFUPM 2

Lecture 37Partial Differential

Equations Partial Differential Equations (PDEs). What is a PDE? Examples of Important PDEs. Classification of PDEs.

CISE301_Topic9 KFUPM 3

Partial Differential Equations

s)t variableindependen are and example (in thest variableindependen moreor twoinvolves PDE

),(),(

:Examples

2

2

tx

ttxu

xtxu

A partial differential equation (PDE) is an equation that involves an unknown function and its partial derivatives.

CISE301_Topic9 KFUPM 4

Notation

.derivativeorder highest theoforder PDE theofOrder

),(

),(

2

2

2

txtxuu

xtxuu

xt

xx

CISE301_Topic9 KFUPM 5

Linear PDEClassification

0322032

032

PDENonlinear of Examples0432

0)2cos(4312:PDElinear of Example

sderivative its andfunction unknown in thelinear isit iflinear is PDEA

2

ttxtxx

txtxx

ttxtxx

xtxx

xttxtxx

uuuuuuu

uuu

uuutuuuu

CISE301_Topic9 KFUPM 6

Representing the Solution of a PDE(Two Independent Variables) Three main ways to represent the solution

Different curves are used for different values of one of the independent variable

x1

t1

),( 11 txT

Three dimensional plot of the function T(x,t)

The axis represent the independent variables. The value of the function is displayed at grid points

T=3.5

T=5.2

CISE301_Topic9 KFUPM 7

Heat Equation

)sin()0,(0),1(),0(

0),(),(2

2

xxTtTtT

ttxT

xtxT

x

ice ice Temperature at different x at t=0

Temperature at different x at t=h

Temperature

Position x

Thin metal rod insulated everywhere except at the edges. At t =0 the rod is placed in ice

Different curve is used for each

value of t

CISE301_Topic9 KFUPM 8

Heat Equation

)sin()0,(0),1(),0(

0),(),(2

2

xxTtTtT

ttxT

xtxT

x

ice iceTime t

Temperature T(x,t)

Position xx1

t1

),( 11 txT

CISE301_Topic9 KFUPM 9

Linear Second Order PDEsClassification

Elliptic04

Hyperbolic04

Parabolic04

:follows as 4on based classfied is

and ,, y, x,offunction a is Dy and x of functions are C and B, A,

,0s)t variableindependen-(2 PDElinear order secondA

2

2

2

2

ACB

ACB

ACB

AC)(B

uuu

DuCuBuA

yx

yyxyxx

CISE301_Topic9 KFUPM 10

Linear Second Order PDEExamples (Classification)

HyperbolicisACBCBA

ttxu

xtxu

ParabolicisACBCBkA

ttxT

xtxTk

Equation Wave041,0,1

0),(),(Equation Wave

______________________________________EquationHeat

040,0,

0),(),(EquationHeat

2

2

2

2

2

2

2

2

CISE301_Topic9 KFUPM 11

Classification of PDEs Linear Second order PDEs are important

sets of equations that are used to model many systems in many different fields of science and engineering.

Classification is important because: Each category relates to specific engineering

problems. Different approaches are used to solve these

categories.

CISE301_Topic9 KFUPM 12

Examples of PDEs PDEs are used to model many systems in

many different fields of science and engineering.

Important Examples:

Wave Equation Heat Equation Laplace Equation Biharmonic Equation

CISE301_Topic9 KFUPM 13

Heat Equation

ttzyxu

ztzyxu

ytzyxu

xtzyxu

),,,(),,,(),,,(),,,(2

2

2

2

2

2

The function u(x,y,z,t) is used to represent the temperature at time t in a physical body at a point with coordinates (x,y,z) .

CISE301_Topic9 KFUPM 14

Simpler Heat Equation

ttxu

xtxu

),(),(2

2

u(x,t) is used to represent the temperature at time t at the point x of the thin rod.

x

CISE301_Topic9 KFUPM 15

Wave Equation

2

2

2

2

2

2

2

2 ),,,(),,,(),,,(),,,(t

tzyxuz

tzyxuy

tzyxux

tzyxu

The function u(x,y,z,t) is used to represent the displacement at time t of a particle whose position at rest is (x,y,z) .

Used to model movement of 3D elastic body.

CISE301_Topic9 KFUPM 16

Laplace Equation0),,,(),,,(),,,(

2

2

2

2

2

2

ztzyxu

ytzyxu

xtzyxu

Used to describe the steady state distribution of heat in a body.

Also used to describe the steady state distribution of electrical charge in a body.

CISE301_Topic9 KFUPM 17

Biharmonic Equation

0),,(),,(2),,(4

4

22

4

4

4

ytyxu

yxtyxu

xtyxu

Used in the study of elastic stress.

CISE301_Topic9 KFUPM 18

Boundary Conditions for PDEs To uniquely specify a solution to the PDE, a

set of boundary conditions are needed. Both regular and irregular boundaries are

possible.

)sin()0,(0),1(0),0(

0),(),(:EquationHeat 2

2

xxututu

ttxu

xtxu

region of interest

x1

t

CISE301_Topic9 KFUPM 19

The Solution Methods for PDEs Analytic solutions are possible for simple

and special (idealized) cases only.

To make use of the nature of the equations, different methods are used to solve different classes of PDEs.

The methods discussed here are based on the finite difference technique.

CISE301_Topic9 KFUPM 20

Lecture 38Parabolic Equations

Parabolic Equations Heat Conduction Equation Explicit Method Implicit Method Cranks Nicolson Method

CISE301_Topic9 KFUPM 21

Parabolic Equations

04 if parabolic is

and ,, y, x,offunction a is Dy and x of functions are C and B, A,

,0y) , x st variableindependen-(2 PDElinear order secondA

2

ACB

uuu

DuCuBuA

yx

yyxyxx

CISE301_Topic9 KFUPM 22

Parabolic Problems

solution. aspecify uniquely toneeded are conditionsBoundary *)04( problem Parabolic *

)sin()0,(0),1(),0(

0),(),(:EquationHeat

2

2

2

ACB

xxTtTtT

ttxT

xtxT

x

ice ice

CISE301_Topic9 KFUPM 23

First Order Partial Derivative Finite Difference

xTT

xT

xTT

xT

xTT

xT jijijijijiji

,1,,,1,1,1 ,

2

ForwardDifferenceMethod

Central Difference Method

Backward Difference

Method

CISE301_Topic9 KFUPM 24

Finite Difference Methods

tTT

ttxT

xTT

xtxT

tTTT

ttxu

xTTT

xtxT

xTT

xtxT

jijijiji

jijiji

jijiji

jiji

,1,,,1

21,,1,

2

2

2,1,,1

2

2

,1,1

),(,),(

:Formula DifferenceForward)(

2),(

)(2),(

2),(

: FormulasDifferenceCentral t]and x offunction is T [ formula difference finiteby sderivative theReplace

CISE301_Topic9 KFUPM 25

Finite Difference MethodsNew Notation

tTT

ttxT

xTT

xtxT

tTTT

ttxT

xTTT

xtxT

xTT

xtxT

li

li

li

li

li

li

li

li

li

li

li

li

11

2

11

2

2

211

2

2

11

),(,),(

:Formula DifferenceForward)(

2),(

)(2),(

2),(

: FormulasDifferenceCentralSuperscript for t-axis

andSubscript for x-axisTil-1=Ti,j-1=T(x,t-∆t)

CISE301_Topic9 KFUPM 26

Solution of the PDEs

points. grid at the t)T(x, of value theDetermine:meansSolution

)sin()0,(

0),1(),0(

0),(),(EquationHeat 2

2

xxT

tTtTt

txTx

txT

t

x

CISE301_Topic9 KFUPM 27

Solution of the Heat Equation

• Two solutions to the Parabolic Equation (Heat Equation) will be presented:

1. Explicit Method:

Simple, Stability Problems.

2. Crank-Nicolson Method:

Involves the solution of a Tridiagonal system of equations, Stable.

CISE301_Topic9 KFUPM 28

Explicit Method

),(),()21(),(),(

0),(),(1),(),(2),(1

),(),(),(),(2),(

0),(),(

2

2

2

2

2

thxutxuthxuktxuhkDefine

txuktxuk

thxutxuthxuh

ktxuktxu

hthxutxuthxu

ttxu

xtxu

CISE301_Topic9 KFUPM 29

Explicit MethodHow Do We Compute?

meansthxutxuthxuktxu ),(),()21(),(),(

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

u(x,t+k)

CISE301_Topic9 KFUPM 30

Explicit MethodHow Do We Compute?

meansthxutxuthxuktxu ),(),()21(),(),(

CISE301_Topic9 KFUPM 31

Explicit Method

.slowit makes This

.2

0)21( stability, guarantee To

.magnified are errors unstable beCan

),(),()21(),(),(:usingdirectly computed becan ),(

2h kor

thxutxuthxuktxuktxu

CISE301_Topic9 KFUPM 32

Crank-Nicolson Method

),(),(),(),(

2,

0),(),(1),(),(2),(1

),(),(),(),(2),(

0),(),(

2

2

2

2

2

thxutxurthxuktxus

srkhsDefine

ktxutxuk

thxutxuthxuh

kktxutxu

hthxutxuthxu

ttxu

xtxu

CISE301_Topic9 KFUPM 33

Explicit MethodHow Do We Compute?

meansthxutxurthxuktxus ),(),(),(),(

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

u(x,t - k)

CISE301_Topic9 KFUPM 34

Crank-Nicolson Method

4

3

2

1

4

3

2

1

111

111

:equations of system lTridiagona a as expressed becan ),(),(),(),(

:equation The

bbbb

uuuu

rr

rr

thxutxurthxuktxus

CISE301_Topic9 KFUPM 35

Crank-Nicolson Method

Method).Explicit the to(comparedk h,larger usecan Weerror). ofion magnificat (No stable is method The

equations.linear of system lTridiagona a solving involves method The

CISE301_Topic9 KFUPM 36

Examples

Explicit method to solve Parabolic PDEs.

Cranks-Nicholson Method.

CISE301_Topic9 KFUPM 37

Heat Equation

solution. aspecify uniquely toneeded are conditionsAuxiliary *)04( problem Parabolic *

)sin()0,(0),1(),0(

0),(),(

2

2

2

ACB

xxututu

ttxu

xtxu

x

ice ice

CISE301_Topic9 KFUPM 38

Example 1

4

]1,0[],1,0[for x)u(t, find to25.0,25.0

)sin()0,(0),1(),0(

0

:PDE theSolve

2

2

2

hk

txkhUse

xxututu

tu(x,t)

xu(x,t)

CISE301_Topic9 KFUPM 39

Example 1 (Cont.)

),(4),(7),(4),(

0),(),(4),(),(2),(16

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

0),(),(

2

2

2

thxutxuthxuktxutxuktxuthxutxuthxu

ktxuktxu

hthxutxuthxu

ttxu

xtxu

CISE301_Topic9 KFUPM 40

Example 1),(4),(7),(4),( thxutxuthxuktxu

t=0

t=0.25

t=0.5

t=0.75

t=1.0

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

CISE301_Topic9 KFUPM 41

Example 1

9497.00)4/sin(7)2/sin(4)0,0(4)0,25(.7)0,5(.4)25.0,25.0(

uuuu

t=0

t=0.25

t=0.5

t=0.75

t=1.0

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

CISE301_Topic9 KFUPM 42

Example 1

1716.0)4/sin(4)2/sin(7)4/3sin(4)0,25.0(4)0,5.0(7)0,75.0(4)25.0,5.0(

uuuu

t=0

t=0.25

t=0.5

t=0.75

t=1.0

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

CISE301_Topic9 KFUPM 43

Remarks on Example 1

0.025kLet

0.03125kselect toneeds One021 :results accurateFor

721 :becauseaccuratenot probably are results obtained The

CISE301_Topic9 KFUPM 44

Example 1),(4.0),(2.0),(4.0),( thxutxuthxuktxu

t=0

t=0.025

t=0.05

t=0.075

t=0.10

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

CISE301_Topic9 KFUPM 45

Example 1

t=0

t=0.025

t=0.05

t=0.075

t=0.10

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

0.54140)4/sin(2.)2/sin(4.0)0,0(4.0)0,25.0(2.0)0,5.0(4.0)025.0,25.0(

uuuu

CISE301_Topic9 KFUPM 46

Example 1

t=0

t=0.025

t=0.05

t=0.075

t=0.10

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

0.7657)4/sin(4.0)2/sin(2.)4/3sin(4.0)0,25.0(4.0)0,5.0(2.0)0,75.0(4.0)025.0,5.0(

uuuu

CISE301_Topic9 KFUPM 47

Example 2

]1,0[],1,0[for x)u(t, find to25.0,25.0methodNicolson -Crank using Solve

)sin()0,(0),1(),0(

0

:PDE theSolve

2

2

txkhUse

xxututu

tu(x,t)

xu(x,t)

CISE301_Topic9 KFUPM 48

Example 2Crank-Nicolson Method

),(),(25.2),(),(25.0

25.22,25.0

0),(),(4),(),(2),(16

),(),(),(),(2),(

0),(),(

2

2

2

2

thxtxuthxuktxu

srkhsDefine

ktxutxuthxutxuthxuk

ktxutxuh

thxutxuthxut

txux

txu

CISE301_Topic9 KFUPM 49

Example 2

t=0

t=0.25

t=0.5

t=0.75

t=1.0

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

2125.20)25.0sin(25.0)25.0,5.0()25.0,25.0(25.2)25.0,0()25.0,0.0(25.0

uuuuuu

u1 u2 u3

CISE301_Topic9 KFUPM 50

Example 2

t=0

t=0.25

t=0.5

t=0.75

t=1.0

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

321 25.2)5.0sin(25.0)25.0,75.0()25.0,5(.25.2)25.0,25.0()5.0,0(25.0

uuuuuuu

u1 u2 u3

CISE301_Topic9 KFUPM 51

Example 2

t=0

t=0.25

t=0.5

t=0.75

t=1.0

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

025.2)75.0sin(25.0)25.0,1()25.0,75(.25.2)25.0,5.0()0,75.0(25.0

32

uuuuuu

u1 u2 u3

CISE301_Topic9 KFUPM 52

Example 2Crank-Nicolson Method

21151.02912.0

21152.0

)75.0sin(25.0)5.0sin(25.0)25.0sin(25.0

25.21125.21

1252:system al tridiagonfollowing

theofsolution a toconverted is PDE theofsolution The

3

2

1

3

2

1

uuu

uuu.

CISE301_Topic9 KFUPM 53

Example 2Second Row

t=0

t=0.25

t=0.5

t=0.75

t=1.0

x=0.25 x=0.5x=0.0 x=0.75 x=1.0

0

0

0

0

0

0

0

0

0

0

Sin(0.25π) Sin(0. 5π) Sin(0.75π)

2125.202115.0)5.0,5.0()5.0,25.0(25.2)5.0,0()25.0,25.0(25.0

uuuuuu

0.2115 0.2991 0.2115

u1 u2 u3

CISE301_Topic9 KFUPM 54

Example 2The process is continued until the values of u(x,t) on the desired grid are computed.

CISE301_Topic9 KFUPM 55

RemarksThe Explicit Method: • One needs to select small k to ensure stability.• Computation per point is very simple but many

points are needed.

Cranks Nicolson:• Requires the solution of a Tridiagonal system.• Stable (Larger k can be used).

CISE301_Topic9 KFUPM 56

Lecture 39Elliptic

Equations Elliptic Equations Laplace Equation Solution

CISE301_Topic9 KFUPM 57

Elliptic Equations

04 if Elliptic is

and ,, y, x,offunction a is Dy and x of functions are C and B, A,

,0y) , x st variableindependen-(2 PDElinear order secondA

2

ACB

uuu

DuCuBuA

yx

yyxyxx

CISE301_Topic9 KFUPM 58

Laplace Equation Laplace equation appears in several

engineering problems such as: Studying the steady state distribution of heat in a

body. Studying the steady state distribution of electrical

charge in a body.

sink)heat (or sourceheat :y)f(x, y)(x,point at re temperatustatesteady :

),(),(),(2

2

2

2

T

yxfy

yxTx

yxT

CISE301_Topic9 KFUPM 59

Laplace Equation

EllipticACB

CBA

yxfy

yxTx

yxT

044

1,0,1

),(),(),(

2

2

2

2

2

Temperature is a function of the position (x and y)

When no heat source is available f(x,y)=0

CISE301_Topic9 KFUPM 60

Solution Technique A grid is used to divide the region of

interest. Since the PDE is satisfied at each point in

the area, it must be satisfied at each point of the grid.

A finite difference approximation is obtained at each grid point.

21,,1,

2

2

2,1,,1

2

2 2),(,2),(

yTTT

yyxT

xTTT

xyxT jijijijijiji

CISE301_Topic9 KFUPM 61

Solution Technique

0

22:by edapproximat is

0),(),(

2),(

,2),(

21,,1,

2,1,,1

2

2

2

2

21,,1,

2

2

2,1,,1

2

2

yTTT

xTTT

yyxT

xyxT

yTTT

yyxT

xTTT

xyxT

jijijijijiji

jijiji

jijiji

CISE301_Topic9 KFUPM 62

Solution Technique

04:

) (

022

,1,1,,1,1

21,,1,

2,1,,1

jijijijiji

jijijijijiji

TTTTThyxAssume

EquationDifferenceLaplaciany

TTTx

TTT

CISE301_Topic9 KFUPM 63

Solution Technique

jiT ,1jiT ,jiT ,1

1, jiT

1, jiT

04 ,1,1,,1,1 jijijijiji TTTTT

CISE301_Topic9 KFUPM 64

Example It is required to determine the steady state

temperature at all points of a heated sheet of metal. The edges of the sheet are kept at a constant temperature: 100, 50, 0, and 75 degrees.

50

0

100

75

The sheet is divided to 5X5 grids.

CISE301_Topic9 KFUPM 65

Example1004,1 T 1004,2 T 1004,3 T

503,4 T

502,4 T

501,4 T

753,0 T

752,0 T

751,0 T

00,1 T 00,2 T 00,3 T

KnownTo be determined

3,1T

2,1T

1,1T

3,2T

2,2T

1,2T

3,3T

2,3T

1,3T

CISE301_Topic9 KFUPM 66

First Equation1004,1 T 1004,2 T

753,0 T

752,0 T

KnownTo be determined

3,1T

2,1T

3,2T

2,2T

0410075

04

3,13,22,1

3,13,22,14,13,0

TTT

TTTTT

CISE301_Topic9 KFUPM 67

Another Equation1004,1 T 1004,2 T 1004,3 T

KnownTo be determined

3,1T

2,1T

3,2T

2,2T

3,3T

2,3T

04100

04

3,22,23,33,1

3,22,23,34,23,1

TTTT

TTTTT

CISE301_Topic9 KFUPM 68

Solution The Rest of the Equations

1501001755007550075

410114101

0140011004101

10141011014001

10041010141

1014

33

23

13

32

22

12

31

21

11

TTTTTTTTT

CISE301_Topic9 KFUPM 69

Convergence and Stability of the Solution Convergence

The solutions converge means that the solution obtained using the finite difference method approaches the true solution as the steps approach zero.

Stability: An algorithm is stable if the errors at each

stage of the computation are not magnified as the computation progresses.

tx and

Recommended