Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The advection diffusion equation is the partial differential equation $$\frac{\partial C}{\partial t} = D\frac{\partial^2 C}{\partial x^2} - v \frac{\partial C}{\partial x}$$ with the boundary conditions $$\lim_{x \to \pm \infty} C(x,t)=0$$ and initial condition $$C(x,0)=f(x).$$

C(x,t)=Q/(2*square-root(D*pi*t))*exp((-(x-v*t)^2)/4*D*t), Q is the mass.

Here D is the diffusivity and v is the advection velocity. How can plot with Matlab or Maple for Q = 1 and D = 1, C(x, t) at t = 1 for v = 0, v = 0.1 and v = 1.0. Superimpose the three curves on the one axis.

Thanks for any help.

share|cite|improve this question
I don't see a Q anywhere in the previous equations, so is "Q=1" a typo? Also, do you know the solution to this PDE? – tentaclenorm May 1 '12 at 14:49
C(x,t)=Q/(2*square-root(Dpit))*exp((-(x-vt)^2)/4*Dt), Q is the mass. I appreciate your help. – user1332075 May 1 '12 at 15:15
This wasn't created by me, but I thought you might enjoy trying to reproduce it in matlab: :) – tentaclenorm May 1 '12 at 16:27
up vote 2 down vote accepted

This seems to do the trick in maple...

Diffuse := (t, x) -> 1/(2sqrt(Pi t))exp(-(x-v t)^2/4 t);
plot([subs(v = 0, Diffuse(1, x)), subs(v = .1, Diffuse(1, x)), subs(v = 1, Diffuse(1, x))], x = -2 .. 2, colour = [red, blue, green])

enter image description here

share|cite|improve this answer
thank you a lot – user1332075 May 1 '12 at 18:31
@user1332075 you are very welcome! Good luck with your heat equation. – tentaclenorm May 1 '12 at 18:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.