# diffusion equation plot (matlab or maple)

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.

-
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: youtube.com/watch?v=Zdxzxcibk90 :) – tentaclenorm May 1 '12 at 16:27

Diffuse := (t, x) -> 1/(2sqrt(Pi t))exp(-(x-v t)^2/4 t);