[go: up one dir, main page]

0% found this document useful (0 votes)
150 views21 pages

Finite Difference Method For PDEs

The document summarizes the finite difference method for solving partial differential equations (PDEs). It provides an example of using the method to solve the 2D Laplace equation modeling heat distribution on a plate with given boundary conditions. The method involves approximating derivatives using Taylor series expansions, resulting in finite difference equations at grid points. The example equations for the heated plate are written and can be solved numerically using the Gauss-Seidel method to obtain temperature values at each point.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views21 pages

Finite Difference Method For PDEs

The document summarizes the finite difference method for solving partial differential equations (PDEs). It provides an example of using the method to solve the 2D Laplace equation modeling heat distribution on a plate with given boundary conditions. The method involves approximating derivatives using Taylor series expansions, resulting in finite difference equations at grid points. The example equations for the heated plate are written and can be solved numerically using the Gauss-Seidel method to obtain temperature values at each point.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

A Lecture on

The Finite Difference Method for PDE’s


…in GEM601: Numerical Methods for Graduate Students

Dr. Ian Dominic F. Tabañag


Instructor
The Finite Difference Method
…for solving elliptic PDE’s (an example)…

Steady state distribution systems characterized by elliptic PDEs: Temperature distributions on a heated plate (a),
seepage of water under a dam (b), and the electric field near the point of a conductor (c).
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
Finite Difference Approximations
…based from the Taylor Series…

Taylor series expansion centered at a


2 3 𝑛
𝑥 − 𝑎 𝑥 − 𝑎 𝑥 − 𝑎 𝑥−𝑎
𝑦 𝑥 = 𝑦 𝑎 + 𝑦′ 𝑎 ⋅ + 𝑦 ′′ 𝑎 ⋅ + 𝑦 ′′′ 𝑎 ⋅ + ⋯ + 𝑦 (𝑛) 𝑎 ⋅
1! 2! 3! 𝑛!
Setting ℎ = 𝑥 − 𝑎, then

ℎ ′′
ℎ 2 ′′′
ℎ 3 (𝑛)
ℎ 𝑛
𝑦 𝑥 =𝑦 𝑎 +𝑦 𝑎 ⋅ +𝑦 𝑎 ⋅ +𝑦 𝑎 ⋅ + ⋯+ 𝑦 𝑎 ⋅
1! 2! 3! 𝑛!

Re-writing into alternative forms:


ℎ2 ℎ3 ℎ𝑛
𝑦 𝑥+ℎ =𝑦 𝑥 + 𝑥 ⋅ℎ+ 𝑦′ ′′′
𝑥 ⋅ + 𝑦 𝑥 ⋅ + ⋯+ 𝑦 𝑛 𝑦 ′′
𝑥 ⋅ [1]
2 6 𝑛!
ℎ 2 ℎ 3 ℎ 𝑛
𝑦 𝑥 − ℎ = 𝑦 𝑥 − 𝑦 ′ 𝑥 ⋅ ℎ + 𝑦 ′′ 𝑥 ⋅ − 𝑦 ′′′ 𝑥 ⋅ + ⋯ + −1 𝑛 ⋅ 𝑦 𝑛 𝑥 ⋅ [2]
2 6 𝑛!

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
Finite Difference Approximations
…based from the Taylor Series…

If h is small then higher ordered terms of h can be ignored. Then neglecting terms involving ℎ2
and higher and solving [1] and [2]

Approximations for the first derivative:


1
y′ x ≈ 𝑦 𝑥 + ℎ − 𝑦 𝑥 [3]

1
𝑦 ′ x ≈ [𝑦 𝑥 − 𝑦 𝑥 − ℎ ] [4]

Furthermore, subtracting [1] and [2] also yields
1
𝑦′ 𝑥 ≈ 𝑦 𝑥+ℎ −𝑦 𝑥−ℎ [5]
2ℎ

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
Finite Difference Approximations
…based from the Taylor Series…

When neglecting terms involving ℎ3 and higher and solving [1] and [2]

Approximations for the second derivative:


1
𝑦 ′′ 𝑥 ≈ 2 [𝑦 𝑥 + ℎ − 2𝑦 𝑥 + 𝑦 𝑥 − ℎ ] [6]

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
FDM for an Elliptic PDE
…an example of a heated plate system…

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
FDM for an Elliptic PDE
…an example of a heated plate system…

 2T  2T
+ 2 =0
x 2
y Laplace Equation
 2T Ti +1, j − 2Ti , j + Ti −1, j O[D(x)2]
= With Boundary Conditions:
x 2 x 2 𝑇 0, 𝑦 = 75°𝐶 ; 𝑇 𝐿, 𝑦 = 50°𝐶
 2T Ti , j +1 − 2Ti , j + Ti , j −1 𝑇 𝑥, 0 = 0°𝐶 ; 𝑇 𝑥, 𝐿 = 100°𝐶
= O[D(y)2]
y 2
y 2

Ti +1, j − 2Ti , j + Ti −1, j Ti , j +1 − 2Ti , j + Ti , j −1


+ =0
x 2
y 2

x = y
Ti +1, j + Ti −1, j + Ti , j +1 + Ti , j −1 − 4Ti , j = 0 Laplacian difference equation.
Holds for all interior points

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
FDM for an Elliptic PDE
…an example of a heated plate system…

Performing the balances around node (1,1):

T21 + T01 + T12 + T10 − 4T11 = 0


T01 = 75
T10 = 0
− 4T11 + T12 + T21 = 0

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
FDM for an Elliptic PDE
…an example of a heated plate system…

4T11 − T21 − T12 = 75


− T11 + 4T21 − T13 − T22 =0
− T21 + 4T31 − T32 = 50
− T11 + 4T12 − T22 − T13 = 75
− T21 − T12 + 4T22 − T32 − T23 =0
− T31 − T22 + 4T32 − T33 = 50
− T12 + 4T13 − T23 = 175
− T22 − T13 + 4T23 − T33 = 100
− T32 − T23 + 4T33 = 150

Can be solved numerically via the Gauss-Seidel Method!


Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
FDM for an Elliptic PDE 𝜕2𝑇
𝑞𝑥 = −𝑘 ⋅ 2 ≈ −𝑘 ⋅
𝜕𝑥
𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗
2Δ𝑥
…an example of a heated plate system… 𝜕2𝑇 𝑇𝑖,𝑗+1 − 𝑇𝑖,𝑗−1
𝑞𝑦 = −𝑘 ⋅ 2 ≈ −𝑘 ⋅
𝜕𝑦 2Δ𝑦
𝑞𝑛 = 𝑞𝑥2 + 𝑞𝑦2
𝑞𝑦
𝜃= tan−1
𝑞𝑥

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
-Any Questions???-
Please feel free to ask…….

Up next: FDM for parabolic PDE’s


The Finite Difference Method
…for solving parabolic PDE’s…

• Parabolic equations are employed to characterize time-


variable (unsteady-state) problems.
• Conservation of energy can be used to develop an
unsteady-state energy balance for the differential element in
a long, thin insulated rod.

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Finite Difference Method
…for solving parabolic PDE’s (an example of heat conduction)…

B.C. 1 B.C. 2

PDE

I.C.

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Finite Difference Method
…for solving parabolic PDE’s (an example of heat conduction)…
• Energy balance together with Fourier’s law of heat conduction
yields heat-conduction equation:

 2T T
k 2 =
x t
• Just as elliptic PDEs, parabolic equations can be solved by
substituting finite divided differences for the partial derivatives.
• In contrast to elliptic PDEs, we must now consider changes in
time as well as in space.
• Parabolic PDEs are temporally open-ended and involve new
issues such as stability.
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Finite Difference Method
…for solving parabolic PDE’s (an example of heat conduction)…

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Finite Difference Method
…explicit method for solving parabolic PDEs…

• The heat conduction equation requires


approximations for the second derivative in
space and the first derivative in time:
 2T Ti +l 1 − 2Ti l + Ti −l 1
=
x 2
x 2
T Ti l +1 − Ti l
=
t t This equation can be written for all
Ti +l 1 − 2Ti l + Ti −l 1 Ti l +1 − Ti l interior nodes on the rod.
k = It provides an explicit means to
(x ) 2
t
compute values at each node for a
kt future time based on the present
(
Ti l +1 = Ti l +  Ti +l 1 − 2Ti l + Ti −l 1 ) = values at the node and its
(x )2 neighbors.

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Finite Difference Method
…explicit method for solving parabolic PDEs…

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Finite Difference Method
…a simple implicit method for solving parabolic PDEs…

• Implicit methods overcome difficulties associated with


explicit methods at the expense of somewhat more
complicated algorithms.
• In implicit methods, the spatial derivative is approximated at
an advanced time interval l+1:

 2T Ti +l +11 − 2Ti l +1 + Ti −l +11



x 2
(x )2
which is second-order accurate.

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Finite Difference Method
…a simple implicit method for solving parabolic PDEs…
l +1 l +1 l +1 l +1
T − 2Ti + T Ti − Ti l
k i +1 i −1
=
(x )2 t
− Ti −l +11 + (1 + 2 )Ti l +1 − Ti +l +11 = Ti l
This eqn. applies to all but the first and the
last interior nodes, which must be modified
to reflect the boundary conditions:

T0l +1 = f 0 t l +1 ( )
(1 + 2 )T1l +1 − T2l +1 = T1l + f 0 (t l +1 )
Resulting m
i=m unknowns and m

(1 + 2 )Tml +1 − Tml +−11 = Tml + f m+1 (t l +1 ) linear algebraic


equations
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Finite Difference Method
…difference between explicit and implicit methods…

Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
Finite Difference Method for
PDE’s
Numerical Methods for Graduate Students

Any Questions?
Comments? -End of Presentation-
Thank you for your attention!
IMAGE ATTRIBUTION:
1. Title Slide – [Order and Degree of the Differential Equaiton], Arundhati De, available online at:
https://www.pngitem.com/download/ihmixxx_order-and-degree-of-differential-equation-ordinary-differential/

You might also like