Вы находитесь на странице: 1из 2

Universidad de Chile The numerical simulation of complex PDE problems

Facultad de Ciencias Fı́sicas y Matemáticas P. Frey, M. De Buhan


Year 2008 MA691 & CC60X

TP Scilab N◦ 2
The finite difference method (II)

Exercice 1 : Analysis of an evolution problem


We consider the following boundary-value problem posed in the domain R∗+ × Ω, where Ω =]0, 1[ :
Given ε > 0, c ≥ 0, f (t, x) ∈ L2 (]0, T [, Ω), λ ∈ R, find u : [0, T ] × [0, 1] → R such that
  
∂u ∂ ∂u ∂u
 ∂t (t, x) − ε ∂x ∂x (t, x) + λ ∂x (t, x) + cu(t, x) = f (t, x) , x ∈ Ω, t ∈]0, T [ ,



(P) (1)

 u(t, 0) = u(t, 1) = 0 , t ∈]0, T [

u(0, x) = u0 (x) , x∈Ω

where T > 0 represents the final time. Under these assumptions, the problem (P) has a unique
weak solution.
This problem is a model of the evolution of the concentration of a chemical species transported
by a fluid of velocity λ, the function ε(t, x) indicates the intensity of the diffusive effect and the
parameter c (usually a function c(t, x)) is supposed to represent the chemical reaction undergone by
the species. The creation and the deletion of the species by an external force are taken into account
in the function f . The function u0 represents the initial state of the chemical concentration of the
species. This explains why this equation is often called an unsteady convection-diffusion-reaction.
equation.
1. A pseudo exact analytical solution.
We consider the function
u(t, x) = exp(−L(t + t0 )(x − x0 )2 ) ,
with the constants L = 1000, t0 = 0.1 and x0 = 0.5 chosen so that u(t, x) almost vanishes
on the domain boundary during the simulation T = 1. Thus, the ”exact” solution u satisfies
the homogeneous boundary conditions and can be compared with the solution obtained by
solving the boundary-value problem with u0 (x) = u(0, x).
(i) Compute the right-hand side function of the problem (P).
(ii) Write a Scilab program to compute the exact solution and the corresponding right-
hand side function. This function shall take two arguments : the time t and the space
coordinate x.
2. Finite-difference discretization of the problem (P).
For N ∈ N∗ , we pose h = 1/(N +1) and we define the space points xk = kh, k ∈ {0, . . . , N +1}
such that x0 = 0 and xN +1 = 1, and the intervals Ik =]xk , xk+1 [, k ∈ {0, . . . , N }. Similarly,
we consider M ∈ N∗ and we define the time steps tn = nδ, δ = 1/M , n = 0, . . . , M . Hence,
the aim is to compute an approximation of u(t, x) at each mesh point (tn , xk ), n = 0, . . . , M ,
k = 0, . . . , N + 1. We denote hereafter unk the approximation (determined numerically) of
u(tn , xk ).

1
(i) Using the following approximations of the space and time derivatives of u :

∂ 2u −unk+1 + 2unk − unk−1 ∂u un − unk−1


− (tn , xk ) ' , (tn , x − k) ' k+1 ,
∂x2 h2 ∂x 2h (2)
∂u un+1
k − unk
(tn , xk ) '
∂t δ
write a finite difference scheme for problem (P).
(ii) Show that this scheme is consistent with the equation of problem (P).
(iii) Under what condition is the finite difference scheme convergent ?
(iv) Show that the scheme is equivalent to
(
U n+1 = Ah U n + δF n , n = 0, . . . , M
0 (3)
Uk = u0 (xk ) , j ∈ {1, . . . , N }

where for every n ∈ {0, . . . , M }, we denote U n = (unk )1≤k≤N , F n = (fkn )1≤k≤N and Ah is a
matrix depending on the parameters ε, λ and c to be determined. Write a Scilab program
to compute the matrix Ah . Solve the problem (P) for ε = 1, λ = 1, c = 1.
(v) We want to replace the previous explicit scheme by an implicit scheme. Modify the
approximation of the time related derivative term to this end. Write a Scilab function to
solve the problem for this new scheme.
3. Numerical issues.
The discretization of problem (P) raises several numerical issues.
(i) For the explicit scheme (3), consider the parameters : ε = 0.01, λ = 1, c = 1. Plot the
solutions and plot kuh (1, ·) − u(1, ·)k0 with respect to N in log–log scale for M = 25 fixed.
(ii) Same question for ε = 0.01, λ = 0, c = 1000.

Вам также может понравиться