This preview shows pages 1–3. Sign up to view the full content.
17.1
NucE 309, Fall 2011,
Lectures 17 and 18
21.4
Numerical Methods for Solving Elliptic Differential Equations (was 19.4)
NOTE:
If an analytical solution can be found, these numerical methods would not be used.
These numerical
methods are only used for complex equations, boundary conditions, or geometries.
We are using simple equations
and boundary conditions as an example.
A.
OneDimensional Conduction Equation with no Heat Generation
We will look at several conduction equations as examples.
The first equation is the onedimensional conduction
equation with no heat generation.
2
2
0
T
x
with boundary conditions:
(0)
5,
( )
10
TT
L
The domain from
0to
x
xL
will be discretized into N grid cells.
x
x
=
0
x
=
L
If the grid points are evenly spaced,
/
x LN
.
At each grid point, we will write the finite difference equations:
2
11
22
2
0
ii
i
i
T
T
xx
This central difference formula for the second derivative is second order accurate.
This gives us a set of linear equations.
Since all terms are divided by
2
x
, we can multiply by
2
x
to simplify
each equation.
01
2
12
3
23
4
34
5
32
1
21
20
NN
N
N
T
T
T
T
T
T
X
X
X
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document17.2
This gives us
N
1 linear equations to solve for
N
1 unknowns.
Since
T
0
and
T
N
are boundary conditions, we can
substitute the value of these variables and write them on the righthandside of the equation.
12
0
3
23
4
34
5
32
1
21
2
20
2
NN
N
NNN
TT T
TT
T
T
T
T
TTT
This set of equations can be written in matrix form,
.
Tr
A
(I'm using r as the righthandside vector since we
will use b for a different vector later.)
10
2
3
2
1
2
100000
0
1
0
0
0
0
0
01
2
1000
0
00
0
000
0
0
00001
2
1
000001
2
N
T
T
T
Notice that the matrix has nonzero elements on only three diagonals, the main diagonal and the two next to it.
This
is called a tridiagonal matrix.
It is very easy (efficient) to solve this set of equations since the matrix A has many
zeroes.
The solution method is called the Thomas Algorithm.
Let's compare the FORTRAN program for Gauss
elimination and Thomas Algorithm.
(The pivoting step is not shown below.)
Gauss Elimination
Thomas Algorithm
c
Forward Elimination
c
Forward Elimination
do 5 k=1,n1
do 5 k=1,n1
!pivot row
do 5 i=k+1,n
i=k+1
! i=row to be
This is the end of the preview. Sign up
to
access the rest of the document.
 Fall '08
 PAULEY,LAURA

Click to edit the document details