Scientific Computing
Partial Differential EquationsIntroduction and
Finite Difference Formulas
Partial Differential Equations
• A partial differential equation (PDE) is an equation involving partial derivatives of an unknown function of two or more independent variables
• The following are examples. Note: u may depend on spatial variables and possibly a time variable.
Partial Differential Equations
yuy
ux
yx
u
t
u
yx
u
x
u
uy
uxy
x
u
58
6
12
22
22
2
33
2
2
2
2
2
2
Partial Differential Equations
• Because of their widespread application in engineering, our study of PDE will focus on linear, second-order equations
• The following general form will be evaluated for B2 - 4AC (Variables – x and y/t)
Au
xB
u
x yC
u
yD
2
2
2 2
2 0
Partial Differential Equations
B2-4AC Category Example
< 0 Elliptic Laplace equation (steady state with 2 spatial dimensions)
= 0 Parabolic Heat conduction equation (time variablewith one spatial dimension)
>0 Hyperbolic Wave equation (time-variable with onespatial dimension)
2
2
22
2 1
t
y
cx
y
2
2
2
20
T
x
T
y
t
T
x
T
2
2
Heat Equation
• One of the classical partial differential equation of mathematical physics is the equation describing the conduction of heat in a solid body (Originated in the 18th century).
• Consider a straight bar with uniform cross-section and homogeneous material. We wish to develop a model for heat flow through the bar.
Heat Equation
• Let u(x,t) be the temperature on a cross section located at x and at time t. We shall follow some basic principles:– A. Fourier’s Law: The amount of heat energy per
unit time flowing through a unit of cross-sectional area is proportional to with constant of proportionality k(x) called the thermal conductivity of the material.
xu /
Heat Equation
– B. Heat flow is always from points of higher temperature to points of lower temperature.
– C. The amount of heat energy necessary to raise the temperature of an object of mass “m” by an amount u is a “c(x) m(x) u”, where c(x) is the specific heat capacity of the material.
Heat Equation
• By Fourier’s Law the amount of heat H(x) flowing from left to right through the surface A of a cross section at x during the time interval t can be approximated by:
),()()( txx
utxkxH
A
x
Heat Equation
• Likewise, the amount of heat H(x+ x) flowing from left to right through a cross section at (x + x) during the time interval t is about:
B
x + x
).,(u
t)()( txxx
xxkxxH
Heat Equation
• Then, on the interval [x, x+x], during time t , the total change in heat is approximately:
B
x + x
A
x
t),(u
)(
-t),(u
)()()(
txx
xk
txxx
xxkxHxxH
Heat Equation
• Dividing by t x we get:
• From Item C above for a change in x ofx :H = c.m.u=c(x) .((x)x).u
where (x) is the linear mass density function.
),(u
)(
-),(u
)(1)()(
txx
xk
txxx
xxkxxt
xHxxH
Heat Equation
• Thus:
• Substituting this into the formula from the previous slide gives:
xt
uxxxc
xt
xHxxH
)()()()(
),(u
)(
-),(u
)(1)()(
txx
xk
txxx
xxkxxt
uxxxc
Heat Equation
• Canceling x on the left we get:
• If we take the limits as t, x 0, we get:
),(u
)(
-),(u
)(1)()(
txx
xk
txxx
xxkxt
uxxc
),()(),()()( txx
uxk
xtx
t
uxxc
Heat Equation
• If we assume k, c, are constants, then the eq. becomes:
( ) where • This is the Heat Equation in one (space)
dimension.
2
22
x
u
t
u
c
k
2
Boundary and Initial conditions
• We need to designate what the initial temperature distribution is in the rod: u(x,0)
• We also need to designate what the temperature function is at the ends of the rod: u(0,t) and u(L,t) where L = length of rod.
• For example, if the ends of the rod are kept at constant temps T1 and T2 ,then
u(0,t) = T1 and u(L,t) = T2
.0 , )()0,(
, 0 , (t)),(
, 0 ),(),0(
, 0 ,0 , ),(),(
1
0
2
22
Lxxfxu
tgtLu
ttgtu
tLxtxx
utx
t
u
One Dimensional Heat Equation
Multi-dimensional space
• Now consider an object in which the temperature is a function of more than just the x-direction. Then the heat conduction equation can then be written:– 2-D:
– 3-D:
tyyxx uuu )(2
tzzyyxx uuuu )(2
Solving the Heat Equation
• A solution u(x,t) for the heat equation is a function that satisfies the PDE and all initial conditions.
• Solution methods:
– Method of Finite Differences (MFD)
– Method of Finite Elements (MFE)
Finite Differences
• The method of finite differences approximates the value of the derivatives of u(x,t) at a point (x0,t0) in its domain, say
by using a combination of function values at
nearby points. Method is due to Newton.• Start with simpler case of f(x)
),(),( 002
2
00 txx
uortx
t
u
Differentiation
• The mathematical definition of a derivative begins with a difference approximation:
and as x is allowed to approach zero, the difference becomes a derivative:
yx
f xi x f xi
x
dy
dxlim
x 0
f xi x f xi x
Differentiation Formulas
• Taylor series expansion can be used to generate high-accuracy formulas for derivatives by using the expansion around several points around a given point xi.
• Three categories for the formula include – forward finite-difference– backward finite-difference– centered finite-difference
Differentiation Formulas
• Forward difference
• Backward difference
• Centered difference
Forward Difference
xi1 xi xi+1
xh
ApproximationTrue
derivative
Backward Difference
xi1 xi xi+1
xh
True
derivative
Approxi
mat
ion
Centered Difference
xi1 xi xi+1
x2h
True
derivative
Approximatio
n
First Derivatives)x(f
i-2 i-1 i i+1 i+2x
• Forward difference
• Backward difference
• Central difference1i1i
1i1i
1i1i
1i1i
1ii
1ii
1ii
1ii
i1i
i1i
i1i
i1i
xx
yy
xx
)x(f)x(f)x(f
xx
yy
xx
)x(f)x(f)x(f
xx
yy
xx
)x(f)x(f)x(f
Second Derivatives
• Using the Taylor series expansion about xi we get:
where Thus,
And,
)(!4
)(!3
)(!2
)()()(
)(!4
)(!3
)(!2
)()()(
2
432
1
1
432
1
fh
xfh
xfh
xfhxfxf
fh
xfh
xfh
xfhxfxf
iiiii
iiiii
)]()([
!4)(
!2)(2)()( 21
42
11 ffh
xfh
xfxfxf iiii
iiii xhxandhxx 21
)(!4
)()(2)()(
2
211 f
h
h
xfxfxfxf iiii
Centered Finite-Difference
Forward Finite-Difference
Backward Finite-Difference
Top Related