mathematics//differential equations//PDE//diffusion equation

The diffusion equation is the partial differential equation that describes how a quantity (a concentration, a temperature) spreads in space: its time rate at a point is proportional to the **curvature** of its profile there.


The diffusion equation is the partial differential equation that describes how a quantity (a concentration, a temperature) spreads in space: its time rate at a point is proportional to the curvature of its profile there.

∂c∂t=D ∂2c∂x2in one dimension,∂c∂t=D ∇2cin three.\frac{\partial c}{\partial t}=D\,\frac{\partial^2 c}{\partial x^2}\qquad\text{in one dimension,}\qquad \frac{\partial c}{\partial t}=D\,\nabla^2 c\qquad\text{in three.}∂t∂c​=D∂x2∂2c​in one dimension,∂t∂c​=D∇2cin three.

Diffusion flattens the profile, the sharp bump first: the same profile at five times, the earliest at the top.

Press Play and watch the arrows: they point up where the profile bends upward and down where it bends downward, so the sharp bump melts first while the area under the curve stays the same; tap the profile to add a bump of your own.

The second derivative says whether the profile bends upward or downward. Where it bends upward the point sits below the average of its neighbors, and the concentration rises; where it bends downward the point is above its neighbors and it falls. The relation between ccc and cxxc_{xx}cxx​ is like the one between a velocity vector and its acceleration: the second derivative is how the change of the slope changes at that point.

In three dimensions a point has neighbors in every direction, and the sum of the three second derivatives is the Laplacian, ∇2c=∇⋅∇c\nabla^2 c=\nabla\cdot\nabla c∇2c=∇⋅∇c: the divergence of the gradient. ∇\nabla∇, the del operator, is the vector of partial derivatives; applied once it gives the gradient, the direction of fastest increase; the divergence of that gradient measures how much the field at a point differs from its surroundings (gradient, divergence and curl). DDD is the diffusivity, the constant that turns curvature into a rate.

Diffusion smooths: bumps decay, and the sharper the bump the faster it decays. Written on a grid or a network, the same equation becomes c˙=−Lc\dot c=-Lcc˙=−Lc with the graph Laplacian (the second derivative becomes the weighted difference to the neighbors, the profile a vector, so diffusion on a network is literally this equation), whose positive convention L=D−WL=D-WL=D−W carries the opposite sign of ∇2\nabla^2∇2; the decay rates of the spatial patterns are its eigenvalues (spectral gap).

Agreement among agents is the same equation. In a consensus protocol each drone moves its value toward its neighbours', x˙=−Lx\dot x=-Lxx˙=−Lx on the communication graph, so disagreement diffuses away like heat in a bar, and the slowest pattern, set by the second eigenvalue λ2\lambda_2λ2​ of the Laplacian, decides how long agreement takes: reducing the disagreement a thousandfold takes ln⁡1000/λ2\ln1000/\lambda_2ln1000/λ2​, about 70 s for ten drones in a chain and under a second when all ten hear each other.

It is the spatial term of the gains-minus-losses recipe: add D∇2cD\nabla^2 cD∇2c to an ODE for ccc and the model gains space; add a reaction such as an interaction term and it becomes a reaction-diffusion system.