Professional Documents
Culture Documents
Class 6th Dec
Class 6th Dec
and Applications
Camile Fraga Delfino Kunz
6th December 2018
∂b ∂2b
= D 2 + rb (1)
∂t ∂x
where:
• b(x, t): population density at location x and time t;
• D: diffusion coefficient of microorganisms;
• r: growth rate (if positive) or death rate (if negative).
1
Exercise
Consider the problem:
∂2b
∂b
= D 2 , x ∈ (0, L)
∂t ∂x
b(0, t) = α , b(L, t) = β , t ∈ (0, T ]
(
1 , x = L/2
b(x, 0) =
0, otherwise
a) Find a numerical approximation for the problem with Forward Euler for
the time integration and Finite Differences for the space. Remember that the
Forward Euler is a conditionally stable method and for the diffusion equation
Dk 1
the stability condition is 2 ≤ . Test your program for the following set of
h 2
parameters:
i) D=0.2; L=10; T=1; m=51; N=400;
ii) D=2; L=10; T=1; m=51; N=100.
b) Now implement a Backward Method for the time integration and test
your program with the same parameters as a).
References
1. Edelstein-Keshet, L. Mathematical models in biology. SIAM, 2005.
2. Leveque, R. J. Finite difference methods for ordinary and partial differen-
tial equations. SIAM, 2007.