Anda di halaman 1dari 7

EM 602: NUMERICAL ANALYSIS

WEDNESDAY 14/05/2014
Lectures L28, L29, L!0
Prof. Ralph W.P. Masenge
4 NUMERICAL S"LU#I"N "$ %AR#IAL
DI$$EREN#IAL E&UA#I"NS
4'5#(e )e*t E+u*t,-.
The heat conduction equation in one dimension is a typical example of a
parabolic partial differential equation. The equation for conduction of
heat in one dimension for a homogeneous body (rod) has the form
2
2
2
x
u
c
t
u

here
) ! ( t x u
denotes temperature of the body at point
x
after time
t

and
2
c is a positi"e constant that describes the rate of diffusion. # unique
solution for this problem is guaranteed by gi"ing an ,.,t,*/ c-.0,t,-.
) ( ) $ ! ( x f x u =
!
L x < < $
hich gi"es the temperature
u
at each point
x
at the beginning of the
obser"ations (time
$ = t
)! and 1-u.0*r2 c-.0,t,-.s
) ( ) ! ( ) ( ) ! $ ( t h t L u and t g t u = =
hich specify the temperature at the endpoints of the body (rod) at any
time
t
.
%ne ay of sol"ing numerically this initial and boundary "alue problem
is to approximate all the deri"ati"es by finite difference expressions.
We partition or subdi"ide the domain in space using a mesh
& ! ! ! $
& $
= =
n
x x x
and in time using a mesh
! ! $
& $
t t =
. We assume a
&
uniform partition both in space and in time! so the difference beteen to
consecuti"e space points ill be
h
and beteen to consecuti"e time
points ill be
k
.
We let
n
j
u
denote the numerical approximation of the solution
) ! ( t x u

at the nodal point
). ! (
n j
t x P
4'5'1 E34/,c,t 5et(-0
The most common explicit method for the heat conduction equation has
the folloing c-54ut*t,-.*/ 5-/ecu/e
hich at
) ! (
n j
t x P
approximates the first order term
t
u

by the first
order 6-r7*r0 0,66ere.ce formula
k
u u
n
j
n
j

+&

and the second order term
2
2
x
u

by the second'order ce.tr*/


0,66ere.ce formula
2
& &
2
h
u u u
n
j
n
j
n
j +
+

This so called Forward Time, Centered Space method or FTCS
leads to the recurrence equation(
2
The truncation errors in the finite difference scheme are proportional to
the time step and the square of the space step(
) ( ) (
2
h O k O E
T
+ =
This is an e34/,c,t 5et(-0 for sol"ing the one'dimensional heat
equation.
We can calculate
& + n
j
u
from the other "alues this ay(
2 & &
&
) 2 & (
h
k
r where ru u r ru u
n
j
n
j
n
j
n
j
= + + =
+
+
)o! ith this recurrence relation and! *noing the "alues of
u
at time
le"el n! one can calculate the corresponding "alues at time le"el n+&.
n
u
$
and
n
N
u
are calculated from the gi"en boundary conditions! in this
example they are both $.
This explicit method is *non to be numerically stable if
2
&
r
.
4'5'2 I54/,c,t 5et(-0
This is the computational molecule for the implicit method.
,f e use the 1*c87*r0 0,66ere.ce at time & + n
t
and a second'order
central difference for the space deri"ati"e at position j
x
(Backward
k
u u
n
j
n
j

+&
-
2
& &
2
h
u u u
n
j
n
j
n
j +
+
.
Time, Centered Space Method "BTCS") e get the recurrence
equation(
2
&
&
& &
&
&
2
h
U U U
k
U U
n
j
n
j
n
j
n
j
n
j
+

+ +
+
+
+
=

This is an implicit method for sol"ing the one'dimensional heat


equation. #pproximate "alues of the solution
) ! ( t x u
at node points along
the time le"el
k n t t
n
) & (
$ &
+ + =
+ are related to those along the pre"ious time
le"el
nk t t
n
+ =
$ through the equation
( )
n
j
n
j
n
j
n
j
U rU U r rU = + +
+
+
+ +

&
&
& &
&
2 &
This ill result in a system of simultaneous linear equations in the
un*non approximate "alues.
The scheme is unconditionally stable and con"ergent but usually more
numerically intensi"e than the explicit method as it requires sol"ing a
system of linear equations at each time step. The errors are linear
) (k O

o"er the time step! and quadratic
( )
2
h O
o"er the space step.
4'5'! Cr*.89N,c-/s-. 5et(-0
/inally if e use the forard difference at time n
t
and the a"erage of
second'order central differences for the space deri"ati"e at position j
x

but ta*en at the to time le"els n
t
and & + n
t
(01T1)0) e obtain the
recurrence equation(
This method is *non as the Cr*.89N,c-/s-. 5et(-0 and has the
computational molecule
2
1ran*'3icolson4s method is an implicit method. Three un*non "alues
of the solution along the time le"el & + n
t
are related to three *non "alues
along the preceding time le"el n
t
by the folloing equation.
The scheme is unconditionally numerically stable and con"ergent but
usually numerically more in"ol"ed as it requires sol"ing a system of
linear equations at each time step. The truncation errors are quadratic
o"er both the time step and the space step(
( ) ( )
2
h O k O E
T
+ = .
5sually the 1ran*63icolson scheme is the most accurate scheme for
small time steps. The explicit scheme is the least accurate and can be
unstable! but is also the easiest to implement and the least numerically
intensi"e. The implicit scheme or*s the best for large time steps.
4'5'4 Nu5er,c*/ E3*54/e
7i"en the parabolic partial differential equation
$ ! & $
2
2
> < <

t x for
x
U
t
U
)ub8ect to the ,.,t,*/ condition
& $ ) sin( ) $ ! ( < < = x for x x U

and the 1-u.0*r2 conditions
$ $ ) ! & ( ) ! $ ( > = = t for t U t U
9
(a) :erify that the function
) sin( ) exp( ) ! (
2
x t t x U =
satisfies the
equation and all the prescribed initial and boundary conditions.
(b) Ta*ing step lengths
$& . $ ! 2 . $ = = k h
approximate the
solution at all node points lying on the first and second time le"el
points using
(i) The deri"ed explicit scheme
(ii) The deri"ed implicit scheme! and
(iii) The 1ran*'3icolson scheme.
(c) ,n each case comment on the results in relation to stability and
accuracy of the method.
S-/ut,-.
5sing each scheme e ish to calculate "alues of the solution along the
first time le"el
$& . $ = t
. )ince
$& . $ = k
and
2 . $ = h
! the "alue of the
parameter
2
h
k
r =
is
2
&
.
With
2 . $ = h
! e get 2 interior nodes along the
x
axis! namely
& ; . $ < . $ 2 . $ 2 . $ $
9 2 . 2 & $
= < = < = < = < = < = x x x x x x
#t these points! the gi"en initial condition
( ) ( ) x x u sin $ ! =
has the
"alues
( ) $ $ ! $
$
$
= =u U
( ) 9;==;9 . $ $ ! 2 . $
$
2
= =u U
( ) >9&$9= . $ $ ! 2 . $
$
2
= =u U
( ) >9&$9= . $ $ ! < . $
$
.
= =u U
( ) 9;==;9 . $ $ ! ; . $
$
2
= = u U
( ) $ $ ! &
$
9
= =u U
.
:1; E34/,c,t Sc(e5e
( )
n
j
n
j
n
j
n
j
rU U r rU U
& &
&
2 &
+
+
+ + =
With
2
&
= r
! the scheme becomes
( )
n
j
n
j
n
j
n
j
U U U U
& &
&
2
2
&
+
+
+ + =
.
The "alues to be calculated along the first time le"el
$& . $ = t
are then
<

2;$;;; . $
2
&
= U
?xact 2;22>9 . $

==;$>2 . $
2
2
= U
?xact =;$<>. . $

==;$>2 . $
2
.
= U
?xact =;$<>. . $

2;$;;; . $
2
2
= U
?xact
2;22>9 . $

9.&<9= . $
&
&
= U
?xact 9.2922 . $

;<$2.> . $
&
2
= U
?xact ;<&<=2 . $

;<$2.> . $
&
.
= U
?xact ;<&<=2 . $

9.&<9= . $
&
2
= U
?xact
9.2922 . $

9;==;9 . $
$
&
= U

>9&$9= . $
$
2
= U

>9&$9= . $
$
.
= U
9;==;9 . $
$
2
= U
The abo"e "alues are obtained from the folloing calculations(
/or
$& . $ = k
( ) ( ) 9.&<9= . $ >9&$9= . $ &=99=$ . & $$$$$$ . $
2
&
2
2
&
$
2
$
&
$
$
&
&
= + + = + + = U U U U
( ) ( ) ;<$2.> . $ >9&$9= . $ >$2&&2 . & 9;==;9 . $
2
&
2
2
&
$
.
$
2
$
&
&
2
= + + = + + = U U U U
( ) ( ) ;<$2.> . $ 9;==;9 . $ >$2&&2 . & >9&$9= . $
2
&
2
2
&
$
2
$
.
$
2
&
.
= + + = + + = U U U U
( ) ( ) 9.&<9= . $ $$$$$$ . $ &=99=$ . & >9&$9= . $
2
&
2
2
&
$
9
$
2
$
.
&
2
= + + = + + = U U U U
/or
$2 . $ = k
( ) ( ) 2;$;;; . $ ;<$2.> . $ $<..&2 . & $$$$$$ . $
2
&
2
2
&
&
2
&
&
&
$
2
&
= + + = + + = U U U U
( ) ( ) ==;$>2 . $ ;<$2.> . $ =2$2=; . & 9.&<9= . $
2
&
2
2
&
&
.
&
2
&
&
2
2
= + + = + + = U U U U
( ) ( ) ==;$>2 . $ 9.&<9= . $ =2$2=; . & ;<$2.> . $
2
&
2
2
&
&
2
&
.
&
2
2
.
= + + = + + = U U U U
( ) ( ) 2;$;;; . $ $$$$$$ . $ $<..&2 . & ;<$2.> . $
2
&
2
2
&
&
9
&
2
&
.
2
2
= + + = + + = U U U U
=

Anda mungkin juga menyukai