Diffusion Equation and Diffusion Constant via Brownian Motion

We piece together Fick's law and the diffusion equation step by step — from number density gradients to flux — and nail down what the diffusion constant D actually means.

I’ll pick right up from the previous post, so it’d be great if you read the two together.

Here’s what this is all about. Okay, okay, okay, okay:

“When particles are bunched together, they’ll flow from where the number density is high to where it’s low.” Can we imagine it this way??? This isn’t fiction, right???

In equation form, ’toward where the number density is high’ is The gradient ∇n, which points toward higher number density, so ’toward where it’s low’ we can write as Minus the gradient, −∇n. And ’the flow of particles’, The particle flux j, will be proportional to that. That is, let’s write down The flux is proportional to minus the gradient: j ∝ −∇n.

For simple diffusion with no drift or particle sources, take a uniform constant $D$ and write it out as an equation:

Fick’s law with the diffusion constant: j = −D∇n

Okay, let me make just one more equation. I’ll write down how the number density changes with ’time’, so we’re tying it to time $t$.

The rate of change of the total count in some region of space (a negative change)

The total count ∫n dV under a blue bracket and its rate of change −d/dt under a red one, labelled in pen

A region of space drawn as a circle

will be related to the flux passing through this place. Let me express the amount that has passed through this space as flux.

The same circle with red arrows of particles leaving through its boundary

The equation that represents this picture can be written like this:

The flux out through the closed surface, ∮ j·da

So we can write it like this:

Particle conservation: −d/dt ∫n dV = ∮ j·da, and the divergence theorem turns the right side into ∫ ∇·j dV

The continuity equation ∂n/∂t = −∇·j

Now let’s take the expression for $\vec{j}$ we put together above, Fick's law again, j = −D∇n, and substitute it in here.

Substituting Fick’s law: ∂n/∂t = −∇·(−D∇n)

The diffusion equation ∂n/∂t = D∇²n

Kyaaa~! This relation is actually called the diffusion equation.

It’s the equation Fourier came up with when he was establishing ‘heat diffusion’, and the Fourier series is what he devised to solve it properly.

So now we’re going to solve that equation. But let’s not go hunting for the 3D solution, let’s just find the 1D one hehehe

The equation reduced to 1D is

The diffusion equation in one dimension: ∂n/∂t = D ∂²n/∂x²

this one :)

Then let’s solve that differential equation. I can’t say for sure, but $n$ will be a function of $x$ and $t$, and solving the differential equation means finding the $n(x,t)$ that satisfies the equation above!@

First, look for one separable mode of $n(x,t)$!!! We’ll build the full solution by adding modes; the full Gaussian is not a single product X(x)Y(t).

Separation of variables: n(x,t) = X(x)Y(t)

Let’s say it becomes like this. If we plug this assumption into the equation,

Plugging it in: ∂/∂t X(x)Y(t) = D ∂²/∂x² X(x)Y(t)

and now I’ll shut up and just push the equations through.

Dividing by X(x)Y(t), each side must equal the same constant: (1/Y) ∂Y/∂t = −Dk² and (1/X) ∂²X/∂x² = −k²

Let’s set them equal like this! hehehe Then $Y(t)$ is~~~~

Solving for Y: ∂Y/∂t = −Dk² Y(t), so Y(t) = e^(−Dk²t)

Ta-daaa~~~

Now, the remaining $X(x)$ we’ll find a different way.

First, let’s write

One mode with wavenumber k: n(x,t) = n(x,0) e^(−Dk²t)

like this!!!! And we’re going to use the Fourier transform. First let me bring in some equations:

The Fourier transform pair: f(x) = ∫ g(α) e^(iαx) dα and g(α) = (1/2π) ∫ f(x) e^(−iαx) dx

As for how this comes out, you can look it up in the earlier Fourier post.

Let’s just change the names: alpha to $k$, and $f$ to $n$.

Renamed: n(x) = ∫ g(k) e^(ikx) dk and g(k) = (1/2π) ∫ n(x) e^(−ikx) dx

Ah but, ours has $t$ hanging on it too… T_T sob sob. Take a spatial Fourier transform at each time t. Each k-mode evolves with its own factor exp(−Dk²t).

With time: n(x,t) = ∫ g(k,t) e^(ikx) dk and g(k,t) = (1/2π) ∫ n(x,t) e^(−ikx) dx

Okay then, I’ll add one more assumption: let’s say that at the initial condition $t=0$, all $n_0$ particles were gathered at $x=0$.

Initial condition: n(x,0) = n₀δ(x)

Where are we going to apply this?

The same pair at t = 0, with n(x,0) in red

Applying it to the red one,

Plugging in the delta function: g(k,0) = (1/2π) ∫ n₀δ(x) e^(−ikx) dx = n₀/2π

it becomes like this, and we can compute $n(x,0)$. But now we carry it all the way to the separated function in $t$ and write it like this~~~!!!! Therefore $n(x,t)$ is

Each mode decays on its own: n(x,t) = ∫ g(k,t) e^(ikx) dk = ∫ g(k,0) e^(−Dk²t) e^(ikx) dk = ∫ (n₀/2π) e^(−Dk²t) e^(ikx) dk

So how do we do this integral~~~~?!?!

Let me just slap down one integration formula.

Integral formula: ∫ e^(−Aq² + Bq) dq = √(π/A) e^(B²/4A), over the whole real line

For us $A = Dt$ and $B = ix$, so the result of the integral above

The result: n(x,t) = (n₀/2π) √(π/Dt) e^(−x²/4Dt) = n₀/√(4πDt) e^(−x²/4Dt)

comes out like this.

Haven’t we seen this somewhere before??!?!

Where, you ask?

The Gaussian distribution f(x) = 1/(σ√(2π)) e^(−(x−m)²/2σ²)

Right here. Matching the normalized density n(x,t)/n₀ with the Gaussian distribution, for D > 0 and t > 0,

Matching the two: σ² = 2Dt, that is, ⟨x²⟩ = 2Dt

that’s what we’ve figured out.

Alright, anyway, so what we actually found out back in the Brownian motion post was….. hehehe

In the long-time diffusion limit of that Langevin model (t ≫ m/α), the diffusion constant $D$ is

The diffusion constant D = k_BT over the damping constant

and the point, they say, is that we’ve unmasked the true identity of the diffusion constant!!!

Heh heh heh, this is fun~ No but, what’s even funnier: with absolutely~~~ nothing, just the feeling that ‘it simply spreads out’, we’ve solved the diffusion equation like this, and it matches the diffusion constant of ‘Brownian motion’, which also simply spreads out with absolutely~~~ nothing.

$\text{variance} = 2Dt$: this relation is exactly the same lol

And going one step further, we’ve cracked the structure of that diffusion constant open one more layer… heh hehe

Wow lol, really amazing lol. Seriously, the world of mathematical physics, seriously lol. It makes me want to set something on fire lol


Heads-up. The figures here are the original notes, slips and all. A few things to watch for:

  • The diffusion equation is $\frac{\partial n}{\partial t} = D\nabla^2 n$: the line that writes $\frac{dn}{dt} = \nabla^2 n$ drops the $D$ (it is back in the next line), and since $n(\vec{r}, t)$ changes at a fixed point, the time derivatives in these first lines are partial ones.
  • The diffusion constant is $D = \frac{k_BT}{\alpha}$ (the Einstein relation: the previous post’s $\langle x^2\rangle \simeq \frac{2k_BT}{\alpha}t$ equals $2Dt$), not $\frac{2k_BT}{\alpha}$.

Comments

Discussion happens via GitHub Discussions. You'll need a GitHub account to comment.