# Why is the answer to this diffusion example unintuitive?

Imagine a linear decrease in concentration from left to right. Using Fick's first law,

$J = -D \frac{d \psi}{d x}$

for all x, from left to right, we have the same flux amount because the decrease is linear.

So $J(x) = m$

According to Fick's second law,

$\frac{d \psi}{d t} = -D \frac{d^2 \psi}{d x^2} = \frac{d J}{d x}$

So $\frac{d J(x)}{d x} = 0$

so dJ/dx is just 0 since the 2nd derivative of a line is 0. Yet this seems unintuitive. I would expect as long as there is a concentration gradient, there should be a change in concentration at each point until the concentration is completely uniform. There must be an error in my math or reasoning, where is it?

EDIT:

To clarify the boundary conditions, imagine a closed box with no out flow or in flow at the edges.

-

1
If there is a concentration gradient, the concentration will change - but only later. At the very same time, there's just nonzero "acceleration", and it takes nonzero time for it to acquire a velocity. Your complaint is completely analogous to the complaint that $d^2 h/dt^2 = -g$ for the height of an apple is wrong because the apple should always fall down, even if it has a zero velocity. Well, velocity is independent of the acceleration. It's only the acceleration that is equal to $-g$, and the initial velocity may be 0 or anything. The same with velocity of the concentration. – Luboš Motl Feb 12 '11 at 7:14

## 2 Answers

As Ted Bunn said, the linear concentration profile is only a steady state if there is a steady inflow at one end and a steady outflow at the other. This net flow is what preserves the concentration gradient.

With the "closed box" boundary condition instead, there is indeed an error in your reasoning because the linear profile is no longer a steady state. So, to make things explicit, you should have instead:

$$\left.J(x)\right|_{t=0} = m$$ $$\left.\frac{\partial\psi}{\partial t}\right|_{t=0} = 0$$ for all x in the interior of the box.

However, these results do not imply that $\psi(x)$ is always constant. At time $t=0$, there is a constant flow from left to right, but because the box is closed this means that the concentration at the left edge of the box is decreasing and the concentration at the right edge is increasing (even though it hasn't yet begun to change anywhere in the interior - If you want, you can say that $\partial\psi/\partial t(t=0)$ has the form of two Dirac delta functions).

The only way I know to get the full solution is expanding in a Fourier series. For concreteness, say the box extends from $x=-1/2$ to $x=1/2$. The correct basis of eigenfunctions to use for this boundary condition contains functions whose derivative is zero at the edges of the box, namely $\sin(n \pi x)$ for odd n and $\cos(n \pi x)$ for even n. Since the initial condition is an odd function, the cosines don't appear. Also, for convenience, set the initial slope equal to $\pi^2/4$.

$$\psi(x,t=0) = \frac{\pi^2}{8} - \frac{\pi^2}{4} x = \frac{\pi^2}{8} - \sum_{n\text{ odd}} \frac{\sin(n\pi x)}{n^2}$$ (where the last equality is from the well-known Fourier series of a triangle wave) $$\psi(x,t) = \frac{\pi^2}{8} - \sum_{n\text{ odd}} \frac{\sin(n\pi x)}{n^2} e^{-nt/\tau}$$

where $\tau$ is a time scale that depends on the diffusion constant and dimensions (if you want, I can work out what it actually is, but it's irrelevant for the discussion).

If you plot this function at different $t$ values increasing from zero, you can clearly see that the concentration is becoming smoothed out and tending toward a uniform concentration of the average value, $\pi^2/8$.

Thus, even though at $t = 0$ it seems like the concentration isn't changing anywhere ($\partial\psi/\partial t$ = 0), it immediately begins changing, and diffusion does eventually lead to a uniform concentration.

Here are some plots I made, using terms through $n=15$:

-

1
+1 excellent answer! – David Zaslavsky♦ Feb 12 '11 at 6:44
Thanks for the great answer. I have to remember to keep in mind the interesting stuff tends to happen at the boundary conditions so I always need to consider them for these types of physics problems. – bmillare Feb 12 '11 at 16:09

One thing that might help your intuition is to think about what happens at the edges of the region under consideration. There must be a steady inflow from one end and a steady outflow from the other end. Fluid is continually flowing "downhill" (from high concentration to low), but the source at the "top" constantly replenishes things, so the concentration gradient remains.

I don't know if that helps, but it's the best I can do.

-

1
Perhaps it's tidier to focus explicitly on the edges, and rephrase the problem/solution as a boundary value problem? – genneth Feb 12 '11 at 1:31

2
I thought (although I guess it isn't explicitly stated) that the question was considering diffusion in a closed box with no inflow or outflow through the edges. – David Zaslavsky♦ Feb 12 '11 at 2:34

1
@David, thats a good point, I didn't state the boundary conditions, but what I had in mind is what you said, a closed box with no inflow or outflow through the edges. I'll update the question. – bmillare Feb 12 '11 at 5:28
I see. I was thinking that the $d\psi/dx$ retained its constant value even at the edges, which implies the inflow / outflow. Now that I understand the intended situation correctly, I agree with Keenan Pepper's excellent answer. – Ted Bunn Feb 12 '11 at 14:36
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 21, "mathjax_display_tex": 4, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9580690264701843, "perplexity_flag": "head"}