1 Introduction

Brownian motion is the random movement of a microparticle due to thermal agitation. This name was given in reference to Robert Brown, a botanist, who observed in 1828 for the first time the erratic trajectories of pollen grains, using a microscope [1]. He concluded that this motion was not from a living source since he observed the same phenomenon with grains of inorganic matter, like minute fragments of window glass or mineral substances. In 1905, Albert Einstein [2], William Sutherland [3] and Marian Von Smoluchowski [4], physically modelled Brownian motion, and independently calculated the diffusion coefficient of a single particle, assuming that matter is discontinuous. In 1909, Jean Perrin [5] validated Einstein’s theory by studying both the distribution and the agitation of microparticles in suspension. Moreover, doing so, he experimentally measured the Avogadro number, proving the atomic nature of matter, and was thus awarded the Nobel Prize in 1926. Besides, from this work, it then became clear that Brownian motion can be a probe of conservative forces. In 1908, Paul Langevin [6] developed the equation that governs Brownian trajectories using the fundamental principle of dynamics, and taking into account both the viscous Stokes force and a new stochastic force representing the effect of momentum transfer from collisions with solvent molecules. It is worth stressing that many variations and applications around Brownian motion in the bulk are continuously explored nowadays, and some of the key underlying hypotheses and concepts remain at the heart of epistemological discussions [7, 8].

In the second half of the 20th century, the rise of miniaturization triggered the need for a further understanding of interfacial and confinement effects on colloidal mobility [9,10,11]. Almost ninety years after the Einstein-Sutherland-Smoluchowski theory, a seminal study of Brownian motion near rigid walls was performed [12]. In the latter, the space-dependent wall-friction-induced reduction in the average planar diffusion coefficient of confined colloids was revealed. This result triggered a novel research activity on Brownian motion in confinement [13,14,15,16,17,18,19,20], with implications in single-molecule force spectroscopy [21, 22], and surface-force measurements [23, 24]. Random and active motion of microalgae near boundaries may also be impacted by the existence of an altered mobility in confinement [25]. A key feature of confined Brownian motion is the emergence of multiplicative noises due to the space-dependent diffusion constants near walls. A direct implication of such noises is the non-Gaussianity of the particle’s displacement distributions [26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45], despite the mean-square displacements (MSDs) remain linear in time (as expected for a classical Brownian process). Moving beyond rigid confinement at equilibrium, the influence of fluctuating interfaces on Brownian point-like tracers was investigated theoretically [46], and experimentally [47], as well as the effects of wall adhesion [48,49,50]. Besides, fluid and soft boundaries were considered [51,52,53,54], and Taylor dispersion in confinement was investigated [55,56,57].

While simple Brownian motion has been numerically modelled in the bulk (see Ref. [58] for a tutorial), as well as in more complicated cases involving confinement and interactions [59,60,61,62,63], an efficient and quantitative numerical approach allowing for a broadrange characterization of non-Gaussianities, is lacking to date. In this article, we aim at filling this gap. We describe how one can model the thermal dynamics of a negatively-buoyant spherical colloidal particle between two rigid walls, including surface charges. After recalling the overdamped Langevin equation including spurious forces, we solve it using an optimized numerical scheme, and investigate the full displacement statistics. As a central outcome of our work, we show in particular that special care needs to be taken in order to avoid convergence issues when computing high-order cumulants from Brownian realizations.

2 Model

2.1 Bulk Langevin equation

We consider a colloidal particle of radius a, immersed in a fluid of dynamic shear viscosity \(\eta _0\). In the bulk, the particle motion is described by the Langevin equation [6]:

$$\begin{aligned} m \ddot{\vec {{r}}}(t) = - \gamma \dot{\vec {{r}}}(t) + \vec {{\mathcal {F}}}(\vec {r}(t)) + \sqrt{2 k_\textrm{B}T \gamma } ~\vec {w}(t) ~, \end{aligned}$$
(1)

where \(\vec {r}(t) = [r_x(t), r_y(t), r_z(t)]\) is the particle center of mass position at time t, \(m = \frac{4}{3} \pi a^3\rho \) is the particle mass, \(\rho \) is the particle density, \(\gamma = 6 \pi \eta _0 a\) is the bulk Stokes drag coefficient, \(k_\textrm{B}\) is the Boltzmann constant, T is the temperature, \(\vec {{\mathcal {F}}}=-{\vec {\nabla }} V\) is the total conservative force deriving from the potential \(V[\vec {r}(t)]\), and \(\sqrt{2 k_\textrm{B}T \gamma } ~\vec {w}(t)\) is the stochastic Langevin force accounting for the random impacts of surrounding fluid molecules. In the following, the projected equations along x and y being independent and similar, we only consider the x axis. The two relevant spatial directions are thus indexed by \(i = x, z\), corresponding to the coordinates \(r_x(t) = x_t\) and \(r_z(t) = z_t\). We model \(\vec {w}(t) = [w_x(t), w_y(t), w_z(t)]\) as a Gaussian white noise of zero mean \(\langle w_i(t) \rangle = 0\), and delta-correlated variance \(\langle w_i(t) w_j(t') \rangle = \delta _{ij} \delta (t-t')\), where \(\langle \cdot \rangle \) indicates the ensemble average, \(\delta _{ij} \) the Kronecker symbol and \( \delta \) the Dirac distribution.

Fig. 1
figure 1

Schematic of the system in the (xy) plane. A particle of radius a diffuses in three dimensions in a fluid of viscosity \(\eta _0\), between two rigid and flat walls separated by a distance \(2H_\textrm{p}=2H+2a\). Besides, and in addition to gravity, we consider specific repulsive screened electrostatic potentials induced by surface charges on the particle and the walls, which are common in experiments [24] but do not affect the generality of the numerical approach developed here

The inertial term \(m \ddot{\vec {r}}\) can be further neglected in the overdamped regime, which is reached when considering times greater than the inertial time scale \(m/\gamma \approx 50~\textrm{ns}\), for \(a= 1.5~\upmu \textrm{m}\), \(\rho = 1050~\textrm{kg m}^{-3}\) and \(\eta _0 = 1~\textrm{mPa s}\). We note that, for a colloidal particle in a solvent, the underdamped Langevin equation is anyway not necessarily appropriate since there is no clear separation of time scales between hydrodynamic back flow and momentum relaxation [64].

2.2 Overdamped Langevin equation in confinement

We now consider that the particle is confined between two rigid and flat walls separated by a distance \(2 H_\textrm{p}\), as shown in Fig. 1. The gravitational acceleration \(\vec {g}\) is oriented along \(- z\). We further suppose that the particle and walls are negatively charged in water, inducing electrostatic interactions. Due to the presence of a surface-charged particle between two surface-charged planes in a dielectric medium, field reflections on the walls are expected [65]. These reflections can be seen as electric fields created by the image charges of the particle on the top and bottom walls. Here, we simplify the problem by considering a large-enough gap, so that we can ignore the contribution of such reflections. In addition, the Coulombian electrostatic interactions are screened by the ions present in water. Taking into account gravity and assuming a linear superposition of the Debye-Hückel screened electrostatic interactions from each wall, the total potential energy V(z) reads:

$$\begin{aligned} \frac{V(z)}{k_\textrm{B}T}= \displaystyle B \left[ \,\text {e}^{-(H+z)/l_\textrm{D}} + \,\text {e}^{-(H-z)/l_\textrm{D}} \right] + \frac{H+z}{l_\textrm{B}}\ , \end{aligned}$$
(2)

where B is a dimensionless electrostatic magnitude related to the particle and wall surface-charge densities [66], \(l_\textrm{D}\) is the Debye length, \(l_\textrm{B}=k_\textrm{B}T / (g\Delta m)\) is the Boltzmann length, and \(\Delta m = m-\frac{4}{3}\pi a^3 \rho _\textrm{f} \) is the particle buoyant mass with \(\rho _\textrm{f}\) the fluid density.

Moreover, the presence of the walls modifies the particle mobilities in both the x and z directions, in an anisotropic fashion. Therefore, the Stokes drag coefficients now become space and direction dependent, and we note them \(\gamma _{i}(z)=6\pi a\eta _i(z)\), with \(\eta _i(z)\) the local effective viscosities. Assuming a linear superposition of the contributions of each wall, one has [12, 67]:

$$\begin{aligned} \eta _i(z)\simeq \eta ^{(1)}_i(H+z)+\eta ^{(1)}_i(H-z) - \eta _0~, \end{aligned}$$
(3)

where we invoked the single-wall expressions \(\eta ^{(1)}_i\). When neglecting slippage at the wall [68], the latter are given by the functional forms [9]:

$$\begin{aligned} \eta ^{(1)}_x(u)= \eta _0\, \frac{1}{1 - \frac{9}{16}\xi + \frac{1}{8}\xi ^3 - \frac{45}{256}\xi ^4 - \frac{1}{16}\xi ^5}~, \end{aligned}$$
(4)

with \(\xi = a/(u+a)\), and:

$$\begin{aligned} \eta ^{(1)}_z(u)= \eta _0 \,\frac{6u^2 + 9au + 2a^2}{6u^2 + 2au} ~, \end{aligned}$$
(5)

where the last expression is a Padé approximation [69] of the complete formula [9, 70], valid with less than 1% error. We note that, in the horizontal direction x, we have omitted the supplementary logarithmic correction for the mobility in the very near vicinity of the wall [71], as this region is typically not accessed in practice due to the electrostatic repulsion between the particle and the walls [24].

Invoking the Stokes-Einstein relation, we then construct the local diffusion coefficients, as:

$$\begin{aligned} D_i(z) = \frac{ k_\textrm{B}T }{ \gamma _{i}(z) }~. \end{aligned}$$
(6)

For illustration, typical diffusion-coefficient profiles are show in Fig. 2a near the bottom rigid wall, and in Fig. 2b for two rigid walls.

Fig. 2
figure 2

Diffusion coefficients \(D_i\) along x (blue) and z (green), normalized by the bulk value \(D_0 = k_\textrm{B}T / (6 \pi a \eta _0 )\) [2], as functions of the rescaled discrete vertical coordinate \(z_n/a\), as obtained from Eqs. (3), (4), (5), (6), with \(z_n=z_t\) for \(t=n\delta t\). Two typical situations are considered: a near the bottom rigid wall, with the particle-wall contact point shifted here to correspond to \(z_{n}=0\); b between two rigid walls

We can then rewrite Eq. (1) in the overdamped regime for a particle between two rigid walls, as:

$$\begin{aligned} \left\{ \begin{aligned} \frac{\textrm{d} x_t}{\textrm{d} t}&= \sqrt{2 D_{x}(z_t)}\, w_x(t) ~, \\ \frac{\textrm{d} z_t}{\textrm{d} t}&= \sqrt{2 D_{z}(z_t)}\, w_z(t) + \frac{\mathcal {F}_z(z_t)}{\gamma _z(z_t)} ~, \end{aligned}\right. \end{aligned}$$
(7)

with \( {\mathcal {F}}_z(z_t)=- V'(z_t)\), where the prime indicates one derivative with respect to the argument. We stress that, since we consider the overdamped regime, we need to specify further the interpretation of the noise. We adopt the Îto convention, and there is thus an additional spurious drift to consider, as explained in details in Sect. 2.3. Eventually, at long time scales, the system must reach equilibrium, and one should recover the canonical Gibbs-Boltzmann distribution in position:

$$\begin{aligned} P_\textrm{eq}(z) = \frac{\text {e}^{- \beta V(z)}}{ \int _{-H}^{+H} \textrm{d}z'\, \text {e}^{- \beta V(z')} }~, \end{aligned}$$
(8)

with \(\beta = 1 /(k_\textrm{B}T)\), and using V(z) from Eq. (2).

2.3 Spurious drift

One can observe that the noise magnitude \(\sqrt{2 D_{i}(z_t)}\) in Eq. (7) depends on the random variable \(z_t\) itself – a feature which is thus usually referred to as “multiplicative noise”. It requires a specific treatment in stochastic calculus, the basics of which being recalled hereafter. Let us rewrite the vertical projection of Eq. (7) in a differential form, as:

$$\begin{aligned} \textrm{d}z_t = [U(z_t) + A(z_t) w_z(t)] \textrm{d}t\ , \end{aligned}$$
(9)

with \(A(z_t) = \sqrt{2 D_{z}(z_t)}\), and where \(U(z_t)\) is an unknown drift velocity at this stage. For integration, we consider a small time interval between t and \(t+\tau \). Since there is an intrinsic ambiguity in the evaluation of A on this interval, we introduce a parameter \(\alpha \in [0,1] \) that characterizes the chosen evaluation instant \(t + \alpha \tau \). Note that there are two common conventions: i) \(\alpha = 0\), i.e. the Îto convention; and ii) \(\alpha = 1 /2 \), i.e. the Stratonovich convention. Imposing the steady state of the associated Fokker-Planck equation to be given by the Gibbs-Boltzmann distribution (see Eq. (8) for the marginal in position), one eventually gets for all conventions [72, 73]:

$$\begin{aligned} z_{t+\tau } = z_t +\left[ \frac{{\mathcal {F}}_z(z_t)}{\gamma _z(z_t)}+(1-\alpha ) A(z_t) A'(z_t)+A(z_t) w_z(t)\right] \tau ~, \end{aligned}$$
(10)

where we have identified \(U(z_t)={\mathcal {F}}_z(z_t)/\gamma _z(z_t)+(1-\alpha ) A(z_t) A'(z_t)\). By comparison with Eq. 7, we see the appearance of a convention-dependent spurious drift velocity \((1-\alpha ) A(z_t) A'(z_t) = (1-\alpha ) D_z'(z_t)\). Without this correction brought to the discretized overdamped Langevin equation, the simulated \(z_t\) realizations would not satisfy the Gibbs-Boltzmann distribution at long times, which is a necessary condition. In the following, we choose the Îto convention (\(\alpha =0\)) for the practical numerical integration.

2.4 Numerical simulations

We discretize the problem through an Euler scheme, by considering a discrete time \(t = n \delta t\), with n a positive integer and \(\delta t\) the numerical time step. We write \(r_i(t)\) as \(r_{i, n}\), \((x_t, z_t)\) as \((x_n, z_n)\), and \(w_i(t)\) as \(w_{i, n}\). The discrete noises \(w_{i, n}\) are chosen as independent Gaussian noises, each with zero mean and \(1/\delta t\) variance. Specifically, to generate \(w_{i, n}\), we first generate a pair of uniformly-distributed random numbers using the Mersenne-Twister generator [74]. Then, we transform the latter pair into a Gaussian-distributed random variable using the Box-Muller algorithm [75, 76]. From the discretization of the horizontal projection of Eq. (7), and from Eq. (10) for the vertical projection, we get the discrete overdamped Langevin equation in the Îto convention:

$$\begin{aligned} \left\{ \begin{aligned} x_{n+1}&= x_n + \sqrt{2 D_x(z_n)} w_{x, n} \delta t \\ z_{n+1}&= z_n + [ D'_z(z_n) - \beta D_z(z_n) V'(z_n) \\&~~~~~~~~~~~~+ \sqrt{2 D_z(z_n)} w_{z, n} ] \delta t ~. \end{aligned} \right. \end{aligned}$$
(11)

To ensure thermalization in the vertical direction, and avoid unnecessary equilibration delays, we enforce the initial conditions \((x_0, z_0) = (0, z_0)\), with \(z_0\) randomly sampled from the Gibbs-Boltzmann distribution of Eq. (8), using an inverse transformation sampling [77]. In the following, each particle trajectory is simulated with \(\delta t = 0.01~\textrm{s}\), \(a=1.5~\mu \textrm{m}\), \(\eta _0=1~\mathrm {mPa.s}\), \(B=5.0\), \(l_\textrm{B}=526~\textrm{nm}\), and \(l_\textrm{D}=88~\textrm{nm}\), in order to reproduce a realistic experimental situation [24]. A typical trajectory is shown in Fig. 3a, for the 1000 first seconds. To make sure that the equilibrium along the vertical direction is reached, we verify that the Gibbs-Boltzmann distribution of Eq. (8) is reached, without any free parameter, as shown in Fig. 3b. This distribution, together with Eq. (2), provides a direct feeling of the electrostatic depletion near the bottom wall. Without such an electrostatic contribution, the probability of presence would just be a single exponential function, that would be maximal at the wall, as in the historical Perrin’s experiments [5].

Fig. 3
figure 3

a Typical numerically-simulated trajectory of a Brownian particle confined by two rigid walls, in presence of gravity and surface charges. The blue and green lines respectively represent \(x_n\) and \(z_n + H\), for the first \(10^4\) points over a total of \(N_\textrm{t}=10 ^6\) points, using a time step \(\delta t = 0.01~\textrm{s}\). b Long-term distribution of the wall-particle distance \(z_n+H\). The solid line corresponds to Eqs. (2) and (8), with \(a=1.5~\mu \textrm{m}\), \(B=5.0\), \(l_\textrm{B}=526~\textrm{nm}\), \(l_\textrm{D}=88~\textrm{nm}\), and \(H_{\text {p}} = 40 ~\mathrm {\mu m}\)

We run \(N_\textrm{s}\) simulations. Each simulation produces a trajectory of \(N_\textrm{t}\) points in time. The simulations are performed using Python [78], and each of these can take several seconds of real computation time for \(N_\textrm{t}=10 ^6\), as shown in Fig. 4. For \(N_\textrm{s}=2 \cdot 10^6\) trajectories with \(N_\textrm{t}=10 ^6\), we would need several months of real computation time. To reduce the computational time, we use Cython [79], which allows to keep the flexibility and ease of use of Python. As shown in Fig. 4, for \(N_\textrm{t} > 10 ^4\), simulations using Cython are a hundred times faster than the ones using Python.

3 Results

3.1 Mean square displacements

After having verified above that the simulated system reaches equilibrium properly, one can now turn to the investigation of the dynamical properties of interest. Let us start with the canonical and well-documented quantities, i.e. the Mean Squared Displacements (MSDs), which are defined as [80]:

$$\begin{aligned} \langle \Delta r_i^2 \rangle (\tau ) = \langle [r_i(t+\tau ) - r_i(t)]^2 \rangle \ , \end{aligned}$$
(12)

where the ensemble average \( \langle \cdot \rangle \) is computed in practice from an average \( \langle \cdot \rangle _t\) over time t. At all time lags \(\tau \) for the horizontal direction, and at small time lags for the vertical one, the MSDs are linear in \(\tau \), as shown in Fig. 5. Indeed, the absence of a preliminary ballistic regime is expected for the governing overdamped Langevin equation (see Eq. (11)). In the bulk, one would have \(\langle \Delta r_i^2 \rangle (\tau ) = 2D_0\tau \). However, in the confinement situation at stake here, the prefactor is modified. One may expect instead:

$$\begin{aligned} \langle \Delta r_i^2 \rangle (\tau ) = 2 \langle D_i \rangle _0 \tau ~, \end{aligned}$$
(13)

where \(\langle \cdot \rangle _0 = \int _{-H}^{+H} \textrm{d}z\, (\cdot ) P_\textrm{eq}(z)\) is the spatial average over the Gibbs-Boltzmann distribution (see Eq. 8).

Fig. 4
figure 4

Real computational times \(t_\textrm{c}\) as functions of the total number \(N_\textrm{t}\) of points in a given simulated trajectory, using both Python and Cython, as indicated. The solid lines correspond to the best linear regressions, from which we find \(t_\textrm{c}(\text {s}) = 6 \cdot 10^{-4} N_\textrm{t}\) for Python, and \(t_\textrm{c}(\text {s}) = 4 \cdot 10^{-7} N_\textrm{t}\) for Cython

Moreover, in Fig. 5b, one observes that the vertical MSD eventually reaches a plateau at large time lags with a value close to \( l_\textrm{B}^2\). This saturation corresponds to the fact that the vertical range is limited by gravity, which effectively traps the particle near the bottom wall. The plateau value can be computed from:

$$\begin{aligned} \lim _{\tau \rightarrow +\infty }\langle \Delta z_t^2 \rangle = \int _{-2 H}^{2 H} \textrm{d}(\Delta z_t)~\Delta z_t^2 P(\Delta z_t,\tau _{\infty })~ , \end{aligned}$$
(14)

where \(P(\Delta z_t, \tau )\) is the Probability Density Function (PDF) of the vertical displacement \(\Delta z_t\) at time lag \(\tau \), that tends to \(P(\Delta z_t, \tau _{\infty })\) when \(\tau \rightarrow +\infty \) (see Eq. 20) as discussed in the corresponding section. As shown in Fig. 5, Eqs. (13) and (14) capture well the numerical data, with no free parameter.

3.2 Fourth-order cumulants in displacements

Beyond the MSDs studied in the previous section, i.e. the second-order cumulants of the displacements, one can study higher-order cumulants. Such higher-order cumulants – and especially the horizontal one – are particularly interesting in order to characterize the inherent non-Gaussianity of the confined Brownian process. The third cumulants \(\langle \Delta r_i^3 \rangle _{\text {c}}\) are zero, since there is no external drift and \(\langle \Delta r_i \rangle = 0\). Therefore, we focus on the fourth cumulants of the displacements:

$$\begin{aligned} \begin{aligned} \langle \Delta r_i^4 \rangle _{\text {c}}&= \langle \Delta r_i^4 \rangle - 3 \langle \Delta r_i^2 \rangle ^2\ . \end{aligned} \end{aligned}$$
(15)

For our class of confined systems (see Fig. 1), in addition to a formal general expression valid at all time lags in the horizontal direction [45], one can derive the short-term and long-term asymptotic behaviors of Eq. (15). At small time lags, one has [45]:

$$\begin{aligned} \langle \Delta r_i^4 \rangle _\textrm{c} \mathrel {\mathop {\simeq }\limits _{ \tau \rightarrow 0}} 12 \left[ \langle D_i^2 \rangle _0 - \langle D_i \rangle _0^2 \right] \tau ^2\ , \end{aligned}$$
(16)

where the demonstration for the vertical direction is equivalent to the one for the horizontal direction. We however stress that the non-Gaussianity in the vertical direction is a direct result of vertical confinement, and, as such, is not as profound and interesting as its horizontal counterpart for which the motion is unbounded. At large time lags, in the horizontal direction, one has [45]:

$$\begin{aligned} \langle \Delta x_t^4 \rangle _\textrm{c} \mathrel {\mathop {\simeq }\limits _{ \tau \rightarrow +\infty }} 24\left( {\mathcal {D}}_4 \tau - {\mathcal {C}}_4\right) , \end{aligned}$$
(17)

where \({\mathcal {D}}_4\) and \({\mathcal {C}}_4\) are two known constants depending on V and \(\{D_i\}\). At large time lags, in the vertical direction, one expects a plateau given by:

$$\begin{aligned} \begin{aligned} \lim _{\tau \rightarrow +\infty }\langle \Delta z_t^4 \rangle&= \int _{-2H}^{+2H}\textrm{d}(\Delta z_t)\, \Delta z_t^4 P(\Delta z_t, \tau _\infty ) \\&~~~ - 3 \left[ \int _{-2H}^{+2H}\textrm{d}(\Delta z_t)\, \Delta z_t^2 P(\Delta z_t, \tau _\infty ) \right] ^2 , \end{aligned} \end{aligned}$$
(18)

where \(P(\Delta z_t, \tau _\infty )\) is defined in Eq. (20), as discussed in the next section.

Fig. 5
figure 5

Mean square horizontal (a) and vertical (b) displacements \(\langle \Delta r_{i,n}^2 \rangle \) (see Eq. (12)) as functions of time lag \(\tau \), for one simulated trajectory of \(N_\textrm{t}=10 ^6\) points, with a numerical time step \(\delta t=0.01~\textrm{s}\). The physical parameters are \(a=1.5~\mu \textrm{m}\), \(B=5.0\), \(l_\textrm{B}=526~\textrm{nm}\), \(l_\textrm{D}=88~\textrm{nm}\) and \(H_{\text {p}} = 40 ~\upmu \textrm{m}\). The solid lines correspond to Eq. (13), and the dashed line to Eq. (14)

As shown in Fig. 6, the fourth cumulants in displacements obtained from the numerical simulations are in agreement with the asymptotic expressions of Eqs. (16) and (18), with no adjustable parameter. Moreover, we stress that the fourth cumulant in horizontal displacement depends on both \(D_x(z)\) and \(D_z(z)\) at long times [45]. As such, there is a subtle information coupling between the vertical and horizontal motions, in spite of the fact that the respective noises are not correlated. This is a potentially relevant feature towards the practical extraction of vertical quantities from simple horizontal statistics in actual experimental systems. Note that this idea was already exploited for the second cumulant in a different class of confined systems [21].

Fig. 6
figure 6

Fourth cumulants \(\langle \Delta r_{i,n}^4 \rangle _\textrm{c}\) (see Eq. (15)) in horizontal a and vertical b displacements as functions of time lag \(\tau \), for \(N_\textrm{s}=2 \cdot 10^6\) simulated trajectory of \(N_\textrm{t}=10 ^6\) points, with a numerical time step \(\delta t=0.01~\textrm{s}\). The physical parameters are \(a=1.5~\mu \textrm{m}\), \(B=5.0\), \(l_\textrm{B}=526~\textrm{nm}\), \(l_\textrm{D}=88~\textrm{nm}\) and \(H_{\text {p}} = 40 ~\upmu \textrm{m}\). The solid lines correspond to Eq. (16), the dashed line to Eq. (17), and the dash-dotted line to Eq. (18)

3.3 Displacement distributions

Having discussed the second and fourth cumulants of displacements in the two previous sections, we now turn to the full PDFs \(P(\Delta r_i, \tau )\) of displacements \(\Delta r_i = r_i(t+\tau ) - r_i(t)\), at time lag \(\tau \). Note that, in the discretized version for numerical simulations, we denote these quantities \(P(\Delta r_{i, n},\tau )\), \(\Delta r_{i,n}\), and \(\tau =n\delta t\), respectively, with n a positive integer. In the bulk, such PDFs obey the diffusion equation and are classically given by Gaussian distributions, each of zero mean and \(2 D_0 \tau \) variance.

In our confined case, the presence of the walls modifies the Brownian motion to a so-called Brownian-yet-non-Gaussian motion [26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]. We still have a Wiener process, because only the amplitude of the noise is modified by the presence of the walls, but not the Gaussian white noise \(w_{i}\)(t) itself. The MSDs are linear in time like for the bulk case (see Eq. (13)). However, the PDFs of displacements are not Gaussian (i.e. with zero mean and \(2 \langle D_i(z) \rangle _0\) variance) anymore, in sharp contrast to the bulk case. They depart from Gaussian distributions for large displacements, in particular. At all time lags \(\tau \) for the horizontal direction, and at small time lags for the vertical one, the PDFs of displacements can be obtained from spatial averages \(\langle \cdot \rangle _0\) of the local diffusion Green’s functions over the Gibbs-Boltzmann distribution [19, 24]:

$$\begin{aligned} P(\Delta r_i, \tau ) = \int _{-2H}^{+2H} \textrm{d}z~ \frac{P_\textrm{eq}(z)}{\sqrt{4 \pi D_i(z) \tau }} \textrm{e}^{ - \frac{\Delta r_i^2 }{4 D_i(z) \tau }} ~. \end{aligned}$$
(19)

As shown in Fig. 7a–c, the PDFs in displacements obtained from the numerical simulations are in agreement with Eq. (19) with no adjustable parameter, at all time lags for the horizontal direction, and at small time lags for the vertical one. Moreover, we observe a departure from the classical bulk Gaussian distributions, that is more pronounced in the vertical direction. Interestingly, even though these three displacement distributions are non-Gaussian, the corresponding MSDs are still linear in time lag (see Fig. 5), as expected for a Brownian-yet-non-Gaussian process.

Fig. 7
figure 7

a, c Probability density functions \(P(\Delta x_n, \tau )\) in horizontal displacement \(\Delta x_n\), obtained from numerical simulations (blue dots), at small time lag \(\tau _0 = 0.01~\textrm{s}\) and large time time lag \(\tau _\infty = 95.4~\textrm{s}\), respectively. The solid black lines correspond to Eq. (19), and the dashed blue lines correspond to Gaussian distributions of zero means and \(2 \langle D_x \rangle \tau \) variances. (b,d) Probability density functions \(P(\Delta z_n, \tau )\) in vertical displacement \(\Delta z_n\), obtained from numerical simulations (green diamonds), at small time lag \(\tau _0 = 0.01~\textrm{s}\) and large time time lag \(\tau _\infty = 95.4~\textrm{s}\), respectively. The solid black lines correspond to Eq. (19), and the dashed green line to a Gaussian distribution of zero mean and \(2 \langle D_z \rangle \tau \) variance. In all panels, the PDFs are constructed from \(N_\textrm{s} = 2.1 \times 10^6\) trajectories of \(N_\textrm{t}=10 ^6\) points each, using a numerical time step \(\delta t=0.01 ~ \textrm{s}\), and the physical parameters: \(a=1.5~\mu \textrm{m}\), \(B=5.0\), \(l_\textrm{B}=526~\textrm{nm}\), \(l_\textrm{D}=88~\textrm{nm}\), and \(H_{\text {p}} = 40 ~\upmu \textrm{m}\). In all panels, the statistical error bars are smaller than the data symbols

Fig. 8
figure 8

Probability density functions \(P(\Delta x_n, \tau )\) in horizontal displacement \(\Delta x_n\), obtained from numerical simulations (blue dots) by averaging the individual PDFs of the \(N_\textrm{s}=2.1 \times 10^6\) trajectories. Three lag times are considered here: a \(\tau _1 = 0.01~\textrm{s}\), b \(\tau _2 = 1.09~\textrm{s}\) and c \(\tau _3 =193.06~\textrm{s}\). For comparison, are shown the data restricted to within the \(90^\textrm{th}\) (yellow squares) and \(99^\textrm{th}\) (brown triangles) quantiles. The solid black lines correspond to Eq. (19), and the dashed blue lines correspond to Gaussian distributions of zero means and \(2 \langle D_x \rangle \tau \) variances. In all panels, the PDFs are constructed from trajectories of \(N_\textrm{t} = 10^6\) points each, using a numerical time step \(\delta t=0.01 ~ \textrm{s}\), and the physical parameters: \(a=1.5~\mu \textrm{m}\), \(B=5.0\), \(l_\textrm{B}=526~\textrm{nm}\), \(l_\textrm{D}=88~\textrm{nm}\), and \(H_{\text {p}} = 40 ~\mathrm {\mu m}\)

Fig. 9
figure 9

a Fourth cumulant \(\langle \Delta x_n^4 \rangle _\textrm{c}\) in horizontal displacement \( \Delta x_n\) as a function of time lag \(\tau \), as obtained from the distribution method of Eqs. (21) and (22) (blue circles). For comparison, we also show simple averages (pink triangles) of the fourth cumulants in horizontal displacement obtained from the individual trajectories. bd Fourth cumulants \(\langle \Delta x_n^4 \rangle _\textrm{c}\) as functions of the number \(N_\textrm{s}\) of simulations, for three different time lags as indicated. In all panels, the solid lines correspond to the short-term asymptotic expression of Eq. (16), and the dashed lines to the long-term asymptotic expression of Eq. (17). The trajectories have \(N_\textrm{t} = 10^6\) points each, and the numerical time step is \(\delta t=0.01 ~ \textrm{s}\). The physical parameters in the simulation are: \(a=1.5~\mu \textrm{m}\), \(B=5.0\), \(l_\textrm{B}=526~\textrm{nm}\), \(l_\textrm{D}=88~\textrm{nm}\), and \(H_{\text {p}} = 40 ~\mathrm {\mu m}\)

Let us now turn to the long-term behaviour of the PDF in vertical displacement. As already observed in Figs. 5 and 6, the second and first cumulants of the vertical displacement reach plateau values at long times. This saturation indicates that equilibrium is reached in the vertical direction. Therefore, one can derive the long-term distribution \(P(\Delta z_t, \tau _\infty )\equiv \lim _{\tau \rightarrow +\infty }P(\Delta z_t, \tau )\) from the Gibbs-Boltzmann distribution (see Eq. 8), as [19, 24]:

$$\begin{aligned} P(\Delta z_t, \tau _\infty ) = \int _{-2H}^{+2H} \textrm{d}z~ P_\textrm{eq}(z) P_\textrm{eq}(z+\Delta z_t)~. \end{aligned}$$
(20)

Stated simply, at equilibrium, a certain displacement \(\Delta z_t\) corresponds to having a certain starting point z and the arrival one \(z+\Delta z_t\), both being independently distributed according to the Gibbs-Boltzmann distribution, and with a summation over all possible starting points. As shown in Fig. 7d, the long-term PDF in vertical displacement obtained from the numerical simulations is in agreement with Eq. (20), with no adjustable parameter. Moreover, we observe a marked departure from the classical bulk Gaussian distribution.

3.4 Rare events and convergence

As seen in Fig. 7a, c, resolving the non-Gaussianities in the distribution of the horizontal displacement implies to measure large displacements, which are rare events, and thus require a lot of numerical data. This is illustrated in Fig. 8, where we see that the non-Gaussian data of interest lies outside the \(99^\textrm{th}\) quantiles. As a direct consequence, a single short trajectory does not allow one to resolve the horizontal non-Gaussianities, and thus the fourth cumulant in horizontal displacement (see Supplementary Material of Ref. [81] for a similar convergence problem). One possible strategy to overcome this issue would be to generate a much longer trajectory, e.g. of \(N_\textrm{t}=10^8\) points, but this would be at the expense of accumulating important numerical errors on the rare events. In order to circumvent such an error accumulation, we instead simulate \(N_\textrm{s} = 2.1 \times 10^6\) shorter trajectories of \(N_\textrm{t}=10^6\) points each. Note that such an issue is however unimportant for the MSD (see Fig. 5) which is dominated by frequent Gaussian-like events. Therefore, the horizontal MSD can be calculated with a single trajectory of \(N_\textrm{t}=10^6\) points, as in Fig. 5.

Another important practical point to consider is the difficulty in registering \(N_\textrm{s} \times N_\textrm{t}\) points, in order to produce the fourth cumulants at large time lags in Fig. 6. To circumvent this issue, we invoke the equivalent expression of the fourth cumulant:

$$\begin{aligned} \begin{aligned} \langle \Delta x_t^4 \rangle _\textrm{c}&= \int _{-2H}^{+2H} \textrm{d}(\Delta x_t)\, \Delta x_t^4 P(\Delta x_t,\tau ) \\&~~~ - 3 \left[ \int _{-2H}^{+2H}\textrm{d}(\Delta x_t)\, \Delta x_t^2 P(\Delta x_t,\tau ) \right] ^2\ . \end{aligned} \end{aligned}$$
(21)

From this expression, we see that one just needs to construct \(P(\Delta x_n,\tau )\) from all the numerical trajectories, in order to evaluate \(\langle \Delta x_t^4 \rangle _\textrm{c}\). The construction of \(P(\Delta x_n,\tau )\) is performed by averaging the PDFs \(P^{(k)}(\Delta x_n,\tau )\) of horizontal displacements for the individual trajectories (indexed by the integer k), as:

$$\begin{aligned} P(\Delta x_n,\tau ) = \frac{1}{N_\textrm{s}} \sum _{k=1}^{N_\textrm{s}} P^{(k)}(\Delta x_n,\tau ) ~. \end{aligned}$$
(22)

In Fig. 9a, we plot the fourth cumulant in horizontal displacement as a function of time lag, as obtained from this distribution method. For comparison, we also plot the fourth cumulant in horizontal displacement estimated by a naive method, which consists in simply averaging the fourth cumulants in horizontal displacement obtained from the individual trajectories. At small time lags, where single trajectories are sufficient, both methods work properly. At large time lags, the distribution method is still robust, while the naive method underestimates the fourth cumulant. This is intimately rooted in the fact that, as \(\tau \) increases, single trajectories do not register enough rare events, which are however essential for measuring non-Gaussianities, as discussed above. As shown in Fig. 9b–d, increasing \(N_\textrm{s}\) does not solve the problem with the naive method, which fails in converging to the good value at large time lags. In contrast, the distribution method converges properly in the considered \(N_\textrm{s}\) and \(\tau \) ranges, and is thus more robust.

4 Conclusion

We have numerically investigated the Brownian motion of a negatively-buoyant colloidal particle confined between two flat rigid walls, in presence of surface charges. Specifically, we have solved the discretized overdamped Langevin equation, with an appropriate spurious drift. From the generated trajectories, and with specific care provided regarding the slow convergence of high-order cumulants, we have constructed all the relevant statistical observables. From these, we have in particular checked the convergence to equilibrium, and have quantitatively addressed the non-Gaussianity of the process. As such, our method provides efficient, broadrange and quantitative numerical simulations of Brownian motion in confinement, with potential interest for nanophysics and biophysics.