Vous êtes sur la page 1sur 2

Numerical Methods for Differential Equations

and Applications
Camile Fraga Delfino Kunz
29th November 2018
The heat equation
Consider the heat flow in a bar subjected to some external source of heat. If
we suppose that the temperature distribution is constant at each cross section of
the bar, it varies only on x direction and can be modeled a one dimensional equa-
tion. Let u(x, t) denote the temperature at point x at time t, where 0 < x < 1.
The solution is governed by the heat equation:

∂u ∂2u
= κ 2 + φ(x, t)
∂t ∂x
where κ is the coefficient of heat conduction for the material and φ(x, t) is the
heat source (or sink if φ < 0). This equation is also known as diffusion equation.
On the steady-state the temperature doesn’t change on time, that is, ∂u/∂t =
0, and then the temperature is a function only of space, u = u(x), and we can
write:

u00 (x) + φ(x) = 0

If we consider Neumann boundary condition at one of the edges, let us say


u0 (0) = α, for some constant α, it means that we are imposing the flow on
x = 0 to be α. For homogeneous Neuman condition, u0 (0) = 0, means that the
bar is isolated at this edge. On the other hand, supposing Dirichlet boundary
condition on x = 1, that is, u(1) = β for some constant β, means that we are
fixing the temperature at this point.

Exercises - Matlab
a) Solve the BVP

00 x
 u (x) = e ,
 0<x<1
u0 (0) = 1

u(1) = e1

using the following Finite Difference approximation:

1
Ui−1 − 2Ui + Ui+1
u00 (xi ) ≈ , i = 1, 2, . . . , m − 1
h
where m is the number of subintervals and h = xi − xi−1 .

How to approach the Neumann boundary condition?

b) The solution for the BVP is simply u(x) = ex .


Use space discretization

h = [0.5; 0.25; 0.1; 0.05; 0.025; 0.01; 0.005]

and measure the error given by

Ei = Ui − u(xi )

for each h.
Plot h versus
 m−1
X 1/2
kEh k2 = h |Ej |2
j=1
.

References
1 Leveque, R. J. Finite Difference Methods for Ordinary and Partial Differ-
ential Equations. SIAM, 2007.

Vous aimerez peut-être aussi