Académique Documents
Professionnel Documents
Culture Documents
Scientic Computing I
Module 6: The 1D Heat Equation Michael Bader
Lehrstuhl Informatik V
Tt = T we examine the 1D case, and set = 1 to get: ut = uxx for x (0, 1), t > 0
using the following initial and boundary conditions: u(x, 0) = f(x), x (0, 1) t>0
Separation of Variables
insert u(x, t) = X(x) T(t) into PDE: 2 (X(x) T(t)) = (X(x) T(t)) t x2 or X(x) Tt (t) = T(t) Xxx (x) divide by X(x)T(t), and get: Tt (t) Xxx (x) = T(t) X(x) true for all x and all t, only if: Tt (t) Xxx (x) = = T(t) X(x)
Fouriers Method
the functions uk (x, t) := Tk (t)Xk (x) = e(k) t sin(kx), solve the 1D heat equation PDE for the initial and boundary conditions: uk (0, t) = uk (1, t) = 0, t>0 x (0, 1).
2
k = 1, 2, . . . ,
uk (x, 0) = sin(kx),
ck sin(kx).
2
=e
(k)2 t
cke(k) t sin(kx),
Find coefcients ck such that the initial condition f(x) can be represented as f(x) =
k=1
2
ck sin(kx).
(k)2 t
u(xj , tm )
sin(kx)
3 4
converges to a well-dened function u Verify that u solves the differential equation ut = uxx Verify that u satises the boundary conditions u(0, t) = u(1, t) = 0 Verify that u satises the initial condition u(x, 0) = f(x)
vj
(m)
vj1 2vj
(m)
(m)
+ vj+1
(m)
h2
(3)
for j = 1, . . . , n 1, and m 0.
An Explicit Scheme
add initial and boundary conditions:
(m) v0 (0) vj (m) vn
= 0, for
for all
= f(xj ),
j = 1, . . . , n 1.
for all time steps (m), (0) starting with the initial conditions vj = f(xj ).
stability condition of the step size! (similar to ODE) examine conservation of energy
E (t) =
0
2 u (x, t) dx = t
1
1 0
= 2
0
uk (x, 0) = f(x),
= 2 u2 (x, t) dx
0
E(t) :=
0
Therefore: E(t) E(0) (energy never increases) compare to initial condition u(x, 0) = f(x):
1 0
u2 (x, t) dx
1 0
f 2 (x) dx
Corrollaries
assume: both u1 (x, t) and u2 (x, t) are solutions for initial conditions f1 (x) and f2 (x) let w(x, t) := u1 (x, t) u2 (x, t), then wt (x, t) = (u1 )t (x, t) (u2 )t (x, t) = (u1 )xx (x, t) (u2 )xx (x, t) = wxx (x, t) w(0, t) = w(1, t) = 0 w(x, 0) = u1 (x, 0) u2 (x, 0) = f1 (x) f2 (x) therefore, w(x, t) is a solution of the heat equation for initial condition fw (x) = f1 (x) f2 (x)
Corrollary 1 Uniqueness
if f1 = f2 , then fw (x) = 0 energy is decreasing:
1 0 1 0 1 0
(u1 u2 )2 (x, t) dx =
therefore:
1 0
w2 (x, t) dx 0
w=0
u1 = u2 .
Corrollary 2 Stability
now: f2 = f1 + ( small), then
1 0 1 0 1
w2 (x, t) dx =
vj
(m) 2
therefore:
if is small, the difference between u1 and u2 also has got to be small, i.e. small perturbations in the initial conditions lead to small perturbations in the solution.
vj
(m+1) 2
vj
(m) 2
(m)
0,
or
(m+1)
(m)
vj
(m)
vj1
(m+1)
2vj
(m+1)
+ vj+1
(m+1)
h2
is only correct, if 1 h2 2 or h2 . 2
= vn
(m)
= 0,
for all
m 0,
otherwise: increasing energy (physically incorrect), leads to large oscillations in the solution
initial conditions: vj
(0)
= f(xj ),
for
j = 1, . . . , n 1.
+ (1 + 2r)vj
(m+1)
rvj+1
(m+1)
= vj
v(m) = Mm v(0)
vj
(m) 2
= h vj
(m) T (m) vj .
MT M I v(m)
v(m)
v(m)
T
v(m)
= h v(m)