Time invariance of diffusion

79 Views Asked by At

Let us assume that we have a diffusion problem in 1D that can be modelled with Brownian Motion. The diffusion is coefficient $D$, and the particle is starting at $x=0$.

Then, the probability that we find the particle at $x=x_1$ at time $t$ is

$$ f{(x_1, t)}=\frac{1}{(4\pi Dt)^{1/2}}\exp\left(-\frac{x_1^2}{4Dt}\right). $$

If the particle is at $x_1$ at $t_1$, the probability that it will be at $x_2>x_1$ at $t$ becomes

$$ f{(x_2-x_1, t)}=\frac{1}{(4\pi D(t-t_1))^{1/2}}\exp\left(-\frac{(x_2-x_1)^2}{4D(t-t_1)}\right). $$

So, I assume that $f(x_1,t)\ast f(x_2-x_1,t)=f(x_2,t)$, because

  • It can't reach $x_2$ before it reaches $x_1$
  • The time it takes for the particle to reach $x_2$ from $x_1$ is only dependent of $x_2-x_1$, not individual $x_1$ and $x_2$.
  • Probability that it reaches $x_2$ at time $t$ if it is at $x_1$ at $t_1$ is independent of $t_1$ and only dependent of $t-t_1$.

Thus, it carries all of the hallmarks of a time invariant system. It would also be linear if we initially have $N$ particles and look for concentration rather than probability.

But in a simulation environment, I cannot verify $f(x_1,t)\ast f(x_2-x_1,t)=f(x_2,t)$.

My approach is to find a time discretised $f_{\Delta{t}}=f(i\Delta{t})\Delta{t}$ and then convolve the appropriate $f_{\Delta{t}}$s. Either I make a horrendous mistake during discretisation or I am miserably wrong about the possible LTI properties of diffusion.

So, which one is it? Can I assume diffusion to be a linear time invariant system and use convolution? Or do I not approach it correctly?

The python code I use is attached.

import numpy as np

def diffusion_function_1D(D,t,x):
    return (4*np.pi*D*t)**(-.5)*np.exp(-x**2/(4*D*t))

def linear_dif_con(t,x1,x2,D,length):
    res=t/length
    t_array=np.linspace(res/2,t-res/2,length) #choosing sample points at the midpoints of bins
    dt=t_array[1]-t_array[0]
    c1_array=np.asarray(list(map(lambda t1: diffusion_function_1D(D,t1,x1)*dt,t_array))) #from 0 to x_1
    c2_array=np.asarray(list(map(lambda t1: diffusion_function_1D(D,t1,x2-x1)*dt,t_array))) #from x_1 to x_2
    c3_array=np.asarray(list(map(lambda t1: diffusion_function_1D(D,t1,x2)*dt,t_array))) #directly from 0 to x_2
    cf=diffusion_function_1D(D,t,x2)*dt
    cn=np.convolve(c1_array,c2_array)[:length]
    #Taking convolution by hand, in case np.convolve acts weird
    tot=0
    for i in range(len(c1_array)):
        tot+=c1_array[i]*c2_array[len(c1_array)-i-1]
    print(tot,c3_array[-1], cn[-1]) #correct convolution, different value

t=3
x1=1
x2=3
D=1
linear_dif_con(t,x1,x2,D,10000)
1

There are 1 best solutions below

1
On BEST ANSWER

The equation you're thinking of is called the Chapman-Kolmogorov equation for a Markov process, but I think it is slightly different from what you said (although your notation is slightly ambiguous really).

The equation (not in full generality) says

$$f_{X_t \mid X_0}(x_2 \mid 0)=\int f_{X_t \mid X_s}(x_2 \mid x_1) f_{X_s \mid X_0}(x_1 \mid 0) dx_1.$$

In the case of a time and space homogeneous process like Brownian motion, you can replace $X_t \mid X_s$ by $X_{t-s} \mid X_0$ and $x \mid y$ by $x-y \mid 0$, which gives

$$f_{X_t \mid X_0}(x_2 \mid 0)=\int f_{X_{t-s} \mid X_0}(x_2-x_1 \mid 0) f_{X_s \mid X_0}(x_1 \mid 0) dx_1.$$

This gives the convolution structure that you seem to have expected, as this can be rewritten as $\left ( f_{X_s \mid X_0}(\cdot \mid 0) * f_{X_{t-s} \mid X_0}(\cdot \mid 0 \right )(x_2)$.