Appendix Alemany2022
Appendix Alemany2022
The work in10 presents a derivation of the transit probability pt for walker positions on a lattice based on a constant step length
in the entire domain. Here, we consider domains where the diffusivity between compartments may differ and re-derive the
probability of transit for the domain in figure 9 considering the different step lengths.
Figure 9. A grid of walker positions x near a permeable barrier located at xb . The concentration at x p , i.e. U(x p ,t + 2δt), is
composed of the contribution of three different walker positions at time t (two time steps prior) through four different paths.
The green path reflects at the barrier with probability 1 − pt,L→R , while the orange path passes through the barrier with transit
probability pt,R→L .
Consider the probability of finding a walker at x p as the sum of probabilities of neighbouring walkers jumping to x p . Away
from interfaces, this results in
1 1
U(x p ,t + δt) = U(x p − δ x,t) + U(x p + δ x,t) . (15)
2 2
Selecting x p to be near a barrier at xb (see figure 9 for the possible paths of walkers to reach this position) results in additional
terms involving pt (both pt,L→R and pt,R→L ). The barrier location is chosen to coincide with a grid point. A walker located
here will proceed left/right according to the appropriate probability of transit. The contributions of different U(x,t) terms
to U(x p ,t + 2δt) in figure 9 (with the path colour indicated) are:
1 1 1 − pt,L→R pt,R→L
U(x p ,t + 2δt) = U(x p − 2δ xL ,t) + U(x p ,t) + U(x p ,t) + U(x p + δ xL + δ xR ,t) (16)
|4 {z } |4 {z } | 2 {z } | 2 {z }
free diffusion (red) free diffusion (blue) reflection (green) transit (orange)
One may now express x p relative to xb , e.g. the contribution of the orange path from the right side of the barrier is:
This allows us to perform a Taylor series expansion of every term around xb , taking care to expand infinitesimally to the left
and right of the barrier as appropriate.
Following that, we apply the diffusion equation (1) to remove the time derivative. The boundary condition in equation (3)
∂ 2U ∂ 2U
DR = DL (18)
∂ x2 R ∂ x2 L
allows us to express everything in terms of U|L , (∂U/∂ x)L , and (∂ 2U/∂ x2 )L as well as pt,L→R and δ xL . Since we did not
specify any constraints regarding the values of DL and DR or their relationship, pt is equivalent to pt,i→ j in equation (5) given
the diffusivities DL = Di and DR = D j .
The final expression is:
∂ 2U
r r r
DL DL DL DL ∂U DL
0 = 2pt 1 − U|L + 2 1− 1+ pt δ xL − pt + pt 1 − δ xL2 (19)
DR DR DR κ ∂x L DR ∂ x2 L
17/22
Figure 10. Interface model for a membrane on the fast side
It is important to recognise that this recovers the expression derived by Powles et al. in the case DL = DR 10 . It also suggests
that the model in equation (5) as derived in25 relies on ignoring the terms associated with U and ∂ 2U/∂ x2 . Since we cannot
make statements about the magnitude of these terms, the former omission is only valid provided pt → 0 or DL /DR → 1, while
the latter requires δ x → 0 as well. These relations are in line with observations of the model’s behaviour throughout this work.
Here, the infinite sums only converge if |(1 − Pb1 )(1 − Pd )| < 1, which is the case given that all P ≤ 1. The probabilities without
power of i − 1 can be removed from the summation and, knowing that
n
1
lim
n→∞
∑ (1 − A)i (1 − B)i = A + B − AB , (22)
i=0
18/22
To proof that both methods are equivalent we need to show that the following equality is valid
Pb1
Pb2 = (24)
Pb1 + Pd + Pb1 Pd
where a is a constant parameter as it only depends on κ and δt. The membrane probabilities from either side (Pb1 and Pb2 ) can
then be simplified to
ab
Pb1 = , (26a)
1 + ab
ac
Pb2 = . (26b)
1 + ac
1 1 b
where b and c are √ and √ respectively. The probability PD given by Equation (6) can be also rewritten as PD = .
D1 D2 c
If we consider all these simplifications, the right hand side of equation (24) is reduced to the following
Pb1 ac
= = Pb2 (27)
Pb1 + Pd + Pb1 Pd 1 + ac
validating the equality in equation (24) and showing that both methods give the same probability.
C Flux analysis
Here, we further analyse the steady-state case and offer an explanation for the differences in the reference models’ behaviour
observed in section 3.2 and elsewhere in this work. Consider the control volume around a barrier bounded by the maximum step
length δ x on either side as illustrated in figure 11. Note the difference between the running variable x (and its differential dx)
and the finite step length δ x.
The net flux J = −D∂U/∂ x can be split into its individual components, i.e. the amount of walkers/concentration crossing
from left to right or right to left, whose magnitudes are given by:
1 0 U(x)
Z
JL→R = + pt,L→R (x) dx , (28a)
δt −δ xL 2
1 δ xR U(x)
Z
JR→L = − pt,R→L (x) dx . (28b)
δt 0 2
The integral bounds on the two sides cover the farthest that a walker can be located away from the boundary on either side in
order for its step δ x to interact with the barrier. While the concentration density U(x) in general depends on position x, we
ignore this dependency here because we assume U = constant in the domain for the steady-state case. The factor 1/2 accounts
for the fact that only half the walkers are expected to step towards the barrier. The ± signs are included to designate the
directionality of the flux components J such that ∑ J = 0. For simplicity, we now omit this and use magnitudes only. We also
cancel the terms U and δt and henceforth use the probability integrals F:
Z
FA→B = pt,A→B (x) dx . (29)
The steady-state solution requires the net flux ∑ J = 0, i.e. FL→R = FR→L . If not, an imbalance in U(x) will develop. If the
diffusivities on both sides are equal (DL = DR = D), the models considered in this work reduce to pt,L→R = pt,R→L . Furthermore,
by definition δ xL = δ xR and hence ∑ J = 0. Next, we consider the different models for the non-trivial case DL 6= DR .
19/22
Figure 11. A graphical explanation of the flux analysis around two compartments (DL > DR ) separated by a permeable barrier
with asymmetric transit probabilities pt,L→R and pt,R→L . The control volume is bounded by the step lengths δ x on either side.
Walkers located inside this volume at a point with concentration/density U(x) add to the flux component J with their weighted
contribution ±U(x)pt (x), provided they step towards the barrier (accounted for by the factor 1/2).
For this model, the probabilities pt do not depend on x but only on D. As a result, we can remove pt from the integral and
simplify the result:
Z 0 p
FL→R = pt,L→R dx = pt,L→R δ xL = pt,L→R 2DL δt , (31a)
−δ xL
Z δ xR p
FR→L = pt,R→L dx = pt,R→L δ xR = pt,R→L 2DR δt . (31b)
0
To remove the awkward min-operator for pt , consider √ the two distinct cases in table 1 separately. For both combinations of
pt values it is clear that FL→R = FR→L . In fact, F = 2Dmin δt which we also observe in numerical simulations with κ = ∞.
Table 1. The two cases of DL and DR considered in equation (30) and their corresponding probabilities of transit pt and
resulting fluxes F.
D pq
t,L→R pt,R→L F
DR √
DL > DR DL 1 2DR δt
q
DL √
DL < DR 1 DR 2DL δt
20/22
C.2 Membrane model
The authors in25 introduce two probabilities of transit pt , going from L to R and from R to L:
2κsL 2κsL
pt,L→R = ≈ , (32a)
DL + 2κsL DL
2κsR 2κsR
pt,R→L = ≈ . (32b)
DR + 2κsR DR
Each pt depends on the diffusivity D of the original compartment and the distance s from the step origin to the barrier. The
latter is equal to ∓x since xb = 0, such that sL ∈ [−δ xL , 0] and sR ∈ [0, δ xR ] respectively. Note that the simplification on the
right-hand sides of equation (32) only applies if 2κs D. We will analyse both cases below.
Since FL→R and FR→L depend on DL and DR respectively, and because F cannot be reduced further, we conclude that FL→R 6=
FR→L and thus ∑ J 6= 0 as observed in section 3.
κδ xL2
Z 0
2κ 0
Z
FL→R = pt,L→R (x) dx = −x dx = = 2κδt , (35a)
−δ xL DL −δ xL DL
κδ xR2
Z δ xR
2κ δ xR
Z
FR→L = pt,R→L (x) dx = x dx = = 2κδt . (35b)
0 DR 0 DR
Hence, FL→R = FR→L = 2κδt (we confirm this in simulations with small δt) and the model will retain the steady-state solution.
Recall that the simplification above requires that 2κδ s D. This can be recast to
√ r
2κ 2Dδt 8κ 2 δt
1 = (36)
D D
and we now observe that the threshold at which a significant error in the fluxes occurs increases with κ and δt and decreases
with D. This is in line with observations in figure 5.
21/22
δt = 10 ms δt = 1 ms δt = 0.1 ms
0.04
0.03
Np = 103
0.02
0.01
0.00
0.0300
0.0275
Np = 104
0.0250
0.0225
0.0200
0.0300
0.0275
Np = 105
0.0250
0.0225
0.0200
0.0300
Hybrid model
0.0275 Reference model
Np = 106
0.0250
0.0225
0.0200
0 10 20 30 40 0 10 20 30 40 0 10 20 30 40
x(µm) x(µm) x(µm)
Figure 12. Convergence of random walk simulations of the steady-state in figure 3 using both transit models for varying
number of walkers N p and time steps δt. The total simulated time is t = 100 ms and walkers are initially seeded uniformly in
the domain (DL = 2.5 µm2 /ms, DR = 0.5 µm2 /ms, κ = 0.05 µm/ms).
D Convergence
Figure 12 shows the histograms of walker positions for both transit models considered in this work, equations (5) and (6). We
consider three time steps and increase the number of walkers until the random fluctuations are of an acceptable level (compare
section 3.2).
.
22/22