
Fluid Mechanics: Worksheet 3
June 2019
Excercises
1. Download Explicit.m and run it! You should see a bump that diffuses following
the diffusion equation.
2. Altering the previous code, solve the following reaction-diffusion equation
∂tf=κ∆f+f(1 −f)
with the same initial conditions as before. With κ= 0.1,κ= 0.01 and κ=
0.001. What is the difference in behavior in each case?
3. Altering the code, solve the spatially inhomogeneous Lotka-Volterra model
(∂tu=κu∆u+u(1 −v)
∂tv=κv∆v−v(1 −u).
To plot both the populations of rabbits and foxes at the same time use the com-
mand:
subplot(1,2,1)
surf(X,Y,u)
subplot(1,2,2)
surf(X,Y,v)
The initial conditions and parameters should be the following
•Both uand vhave the initial conditions as in the first excercise. Diffusivity
coefficients κu=κv= 0.001.
•With
u(x, y) = n1/2if (x−1/4)2+ (y−1/4)2<1/16
v(x, y) = n1/2if (x−3/4)2+ (y−3/4)2<1/16
Diffusivity coefficients κu=κv= 0.001.
•Same initial conditions as the previous exercise. κu= 0.01 κv= 0.001
•Play around with parameters and initial conditions.
1