



































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




































































Insulated Boundaries
© 2012 by Douglas Wilhelm Harder. Some rights reserved.
Outline
This topic discusses numerical approximations to
solutions to the heat-conduction/diffusion equation:
conduction/diffusion equation
Review
In Laboratory 1, you solved a boundary-value problem:
d
u
k − 1
k
−
u
k + 1
= g(x
k
),
there are three unknowns:
u
k – 1
u
k
u
k + 1
of n – 2 linear equations which must be
solved
and u
Review
In Laboratory 2, we used an explicit method:
are known, we need only evaluate this
for u
through u
, 1 , 1, , 1,
2
2
i k i k i k i k i k
t
u u u u u
h
x
The Crank-Nicolson Method
What happens if we focus on the point (x
, t
)?
,
2
,
u u
u x t
t h
u u u
u x t
x h
These focus on (x
, t
)
The Crank-Nicolson Method
This gives us the finite-difference equation
The linear equation now has:
One known u
, u
, u
, 1 , 1, 1 , 1 1, 1
2
2
i k i k i k i k i k
t
u u u u u
h
The Crank-Nicolson Method
Given two equations, we can add them:
2
2
i k i k i k i k i k
i k i k i k i k i k
t
u u u u u
h
t
u u u u u
h
2 2 2
2
i k i k i k i k i k
i k i k i k
t
u u u u u
h
t
u u u
h
2
The Crank-Nicolson Method
As we did in Laboratory 1, we could then write n
equations
2 1 2 2
k k k k k k k
ru r u ru u r u u u
2, 1 3, 1 4, 1 3, 2, 3, 4,
2 1 2 2
k k k k k k k
ru r u ru u r u u u
2 1 2 2
k k k k k k k
ru r u ru u r u u u
2, 1 1, 1 , 1 1, 2, 1, ,
2 1 2 2
x x x x x x x
n k n k n k n k n k n k n k
ru r u ru u r u u u
2 1 2 2
x x x x x x x
n k n k n k n k n k n k n k
ru r u ru u r u u u
..
.
.
n
x
Unknowns Knowns
The Crank-Nicolson Method
That is: u
= a
(t
)
u
= b
(t
)
2 1 2 2
k k k k k k k
ru r u ru u r u u u
2, 1 3, 1 4, 1 3, 2, 3, 4,
2 1 2 2
k k k k k k k
ru r u ru u r u u u
2 1 2 2
k k k k k k k
ru r u ru u r u u u
2, 1 1, 1 , 1 1, 2, 1, ,
2 1 2 2
x x x x x x x
n k n k n k n k n k n k n k
ru r u ru u r u u u
2 1 2 2
x x x x x x x
n k n k n k n k n k n k n k
ru r u ru u r u u u
..
.
.
Unknowns Knowns
Bring them to the right-hand side....
The Crank-Nicolson Method
We now have n
2, 1 3, 1 2, 1, 2, 3, bndry 1
2 1 2 2
k k k k k k k
r u ru u r u u u ra t
2, 1 1, 1 1, 2, 1, , bndry 1
2 1 2 2
x x x x x x
n k n k n k n k n k n k k
ru r u u r u u u rb t
2, 1 3, 1 4, 1 3, 2, 3, 4,
2 1 2 2
k k k k k k k
ru r u ru u r u u u
2 1 2 2
k k k k k k k
ru r u ru u r u u u
2 1 2 2
x x x x x x x
n k n k n k n k n k n k n k
ru r u ru u r u u u
..
.
.
Unknowns Knowns
The Crank-Nicolson Method
Note the structure of b :
2, 1, 2, 3, bndry 1
1, 2, 1, , bndry 1
2 2
2 2
2 2
2 2
2 2
x x x x
x x x x
k k k k
k k k k
k k k k
n k n k n k n k
n k n k n k n k
u r u u u ra t
u r u u u
u r u u u
u r u u u
u r u u u rb t
bndry 1
bndry 1 1, 2, 1, ,
2 2 2 2 2 2
x x x x
x x x x
k k k k
k
k k k k
k k k k
n k n k n k n k
k n k n k n k n k
u u u u
ra t
u u u u
u u u u
r
u u u u
rb t u u u u
diff
Approximating the Solution
Thus, given the initial state at time t
, we create a system
of equations with k = 1 to solve for u
through u