Monte-Carlo Simulation of Particle Diffusion in Various Geometries and Application to Chemistry and Biology

The simulation of systems comprising different types of molecules is of great interest in several fields, notably in chemistry and biological sciences. The conventional approach to simulate biological networks is to write down macroscopic rate equations and solve the corresponding differential equations numerically to obtain the time evolution of molecules concentrations [1-3]. In this method, the system evolution is deterministic, and it is implicitly assumed that the concentrations are large. However, in most biological systems, the concentrations of molecules usually range from nanomolar to micromolar; therefore, the interactions of these molecules are highly stochastic. Recently, various techniques have been developed to take into account the spatial distribution of individual molecules and the stochastic character of reactions between them. Several of these techniques are based on the Green's functions of the Diffusion Equation (DE), and they offer the advantage of being able to follow all the particles in time and space. In this book chapter, this method is applied to simple systems in one, two, and three dimensions. Two applications are discussed. The first is the simulation of ligands molecules near a plane membrane comprising receptors with the possibility of dissociation and initiation of signal transduction. The second application of this theory is the simulation of partially diffusion-controlled chemical reactions.


Introduction
The simulation of systems comprising different types of molecules is of great interest in several fields, notably in chemistry and biological sciences. The conventional approach to simulate biological networks is to write down macroscopic rate equations and solve the corresponding differential equations numerically to obtain the time evolution of molecules concentrations [1][2][3]. In this method, the system evolution is deterministic, and it is implicitly assumed that the concentrations are large. However, in most biological systems, the concentrations of molecules usually range from nanomolar to micromolar; therefore, the interactions of these molecules are highly stochastic. Recently, various techniques have been developed to take into account the spatial distribution of individual molecules and the stochastic character of reactions between them. Several of these techniques are based on the Green's functions of the Diffusion Equation (DE), and they offer the advantage of being able to follow all the particles in time and space. In this book chapter, this method is applied to simple systems in one, two, and three dimensions. Two applications are discussed. The first is the simulation of ligands molecules near a plane membrane comprising receptors with the possibility of dissociation and initiation of signal transduction. The second application of this theory is the simulation of partially diffusion-controlled chemical reactions.

Diffusion equation and boundary conditions
The DE can be written 2 ,t ,t , p( | ) = D p( | ) t ¶ Ñ ¶ 0 0 r r r r (1) where r 0 is the initial position vector 1 of a particle and r is its position vector at time t. The diffusion coefficient of a particle (D) is used instead of the thermal diffusivity coefficient in the equation of the propagation of heat. In the model presented here, a particle is located at the position r 0 at t=0. This is expressed mathematically as: ,t 0 , p( = | ) = ( ) d -0 0 r r r r (2) where δ(r-r 0 )=δ(x-x 0 )δ(y-y 0 )δ(z-z 0 ) is the product of three Dirac's delta functions. To complete the description of the model the boundary conditions at the surfaces are specified. One important case is the radiation boundary condition at the surface X=0: x,y,z,t 0,y,z,t ,y .
x= a p( |x , y ,z ) The limit k a →∞ is known as the absorbing boundary condition. In this case, the boundary condition is written p(0,y,z,t|x 0 , y 0 , z 0 , t 0 )=0. The limit k a →0 is the reflecting boundary condition. The condition k a >0 implies that particles may bind at the surface; therefore, the Green's function of these systems are generally not normalized to 1. In all systems described in Sections 3 and 4 the boundary conditions on surfaces, if any, are reflecting (k a =0). In Section 5 two applications of the theory for which the boundary conditions are different will be discussed.

Sampling of the Green's functions
To simulate the state of a particle system after one time step, the positions of each particle are calculated by sampling the Green's function for the position r. The Green's function is written p(r, t|r 0 ) to emphasize that it represents the probability of a particle initially located at the position r 0 to be found at the position r at time t. In the systems presented in Sections 3 and 4, there is no binding of particles to boundaries. Therefore, p(r,t|r 0 ) is normalized as follows: 1 ,t 1, Ω p( | )d = ò 1 0 1 r r r (4) where Ω is the domain where the particle can be found. Another important thing to consider is that the simulation of a particle trajectory can be done by using one or several time steps. This can be expressed mathematically as: That is, the probability of a particle to be found at r 2 after the time steps Δt 1 and Δt 2 is the same as going to the intermediate position r 1 after Δt 1 and then the final position r 2 at Δt 1 +Δt 2 . The integral over the domain Ω covers all intermediate positions. This is the Chapman-Kolmogorov equation, which hold in Markovian systems.
As seen in a previous paper [5], Equations (4) and (5) have to modified in systems where there is a possibility of binding of particles at the boundaries.

One-dimensional systems
One dimensional (1D) systems are simpler to study than those which are multi-dimensional. They are also of interest since several multi-dimensional systems can be approached as independent 1D systems [6]. In 1D, the DE is: The initial condition is p(x,0|x 0 )=δ(x-x 0 ). Three systems are described in this section: free diffusion, diffusion in the half-space X>0 and diffusion in the space between X=0 and X=L.

Free diffusion
The Green's function of the DE in 1D for a free particle, noted p free (x,t|x 0 ), is well known: This is a Gaussian distribution, with variance σ 2 =2Dt. This distribution can be sampled by using, for example, the Box-Muller method [7].

Algorithm 1: Sampling algorithm for p free (x,Δt|x 0 ) (free 1D diffusion)
GENERATE N as a standard Normal The sampling algorithm is used to generate the positions of 1,000,000 particles after one time step. The results are stored in histograms and normalized. The Green's functions and the results of sampling are illustrated 2 in Figure 1. Because the sampling algorithms use random numbers, the simulation results vary from one simulation to another. Usually, the larger the number of histories, the smaller the statistical fluctuation of the results. The algorithms presented in this book chapter are exact, i.e. the simulation results are expected to converge to the analytical Green's function at the limit of an infinite number of histories. In practice, 1,000,000 particle histories are usually sufficient to converge to the analytical Green's function and to confirm the validity of the algorithm. The time discretization property of the Green's function can also be used to validate the algorithm: since a simulation can be done in several time steps, the positions of the particles obtained after the first time step are used as the initial positions for the next step.

Diffusion in the half-space x>0
As it will be seen in the applications, this system may be used to represent the motion of particles near a membrane. The reflective boundary condition at x=0 is given by The solution of the DE in 1D for this system, noted p ref (x,t|x 0 ), is given in ref. [8]: ( ) This Green's function is the sum of two Gaussian distributions. It can be sampled by the method described in Algorithm 2 (given in ref. [8]): where Erfc(x) is the complementary error function [9]. The Green's functions and the result of sampling are illustrated in Figure 2.

Diffusion of a particle between x=0 and x=L
This system is used to simulate the motion of particles in a confined space. In this case, the reflective boundary conditions at x=0 and x=L are given by The Green's function of the DE in 1D for a particle between the boundaries, noted p conf (x,t|x 0 ), is [4]: This function is complicated by an infinite sum. However, it is possible to use the following algorithm to generate trajectories of particles in this environment [10]. The algorithm is based on a series method, as described in [11]. For this section the functions f(x) and f n (x) are defined: The algorithm is: Algorithm 3A: Generation of random variateX distributed as p conf (x,Δt|x 0 ) (particle between x=0 and x=L in 1D) The verification of Y≤f(X) is dose by using the second part of the algorithm:

Algorithm 3B: Verification of Y<f(X)
SET S ← 1/L+2f 1 (X), k ← 1 (S holds the approximation sum) The Green's function and the result of sampling for 1,000,000 histories of particles initially located at x 0 =5 are shown in Figure 3. When time evolves, as illustrated in Figure 3, the particles become uniformly distributed between x=0 and x=10.

Two-dimensional systems
Two dimensional (2D) systems are interesting, because the particles trajectories can be visualized in a plane. The DE in 2D can be written: The initial condition is p(x,y,t=0|x 0 , y 0 )=δ(x-x 0 )δ(y-y 0 ). In several cases, the Green's function can be written as the product of the functions p x (x,t|x 0 ) and p y (y,t|y 0 ) (see ref. [6]): This property of the Green's function allows the simulation of the motion of particles in the direction x and y independently.

Free diffusion
The solution of the DE is the product of two Gaussian functions: Therefore, sampling of this Green's function can be done by sampling two Gaussian functions: Algorithm 4: Sampling algorithm for p free (x,y,Δt|x 0 ,y 0 ) (free 2D diffusion) GENERATE N 1 ,N 2 as a standard Normals Plotting the Green's functions in X and Y would give figures identical to Figure 1. However, in 2D, it is useful to use polar coordinates. That is, the following transformation is used: The same transformation is done with x 0 and y 0 to obtain r 0 and θ 0 . The Green's function may be rewritten: This form yields an alternate method to sample the Green's function in polar coordinates:

RETURN (R,Θ).
Algorithm 5 generates variates r and θ distributed as r*p free (r,θ,t|r 0 ,θ 0 ). The factor r originates from the differential area in polar coordinates: dxdy is replaced by rdrdθ.
It is possible to obtain related distributions such as p(r,t|r 0 ) and p(θ,t|θ 0 ). They are found by integrating the Green's function: where I 0 (x) is the Modified Bessel Function of the First Kind of order 0 (see ref. [9]). The angular distribution p(θ,t|θ 0 ) is obtained by integrating over r: The factor r is also included in the integral. The result is: ). (20) where Erf(x) is the error function [9]. The distributions p(r,t|r 0 ) and p(θ,t|θ 0 ) for x 0 =2.5 and y 0 =2.5 are illustrated in Figure 4.
Similar results are found using either algorithm 4 or 5. In 2D, it is possible to represent the time evolution of the particle system ( Figure 5).

The rectangular corner x>0, y>0
As in section 4.1, the solution of the DE is the product of two independent 1D reflective Green's functions: The positions of the particles can be sampled by using two applications of Algorithm 2 (for X and Y). An example of the time evolution of 1,000,000 particles is illustrated in Figure 6.

The rectangle 0<x<a, 0<y<b
The solution of the DE is also the product of two independent 1D Green's functions: Therefore the positions of the particles can be sampled by using Algorithm 3 for the coordinates x and y. The particle system depicted in Figure 7 illustrates how particles initially located in a given position will diffuse and eventually become uniformly distributed in the rectangular area.

The particles outside a disk of radius R
This problem is of interest to simulate how particles move and/or bind to curved cell membranes comprising receptors. In this section, only the case of the reflective boundary condition is discussed. In polar coordinates, the DE can be written The reflective boundary condition at r=R is: The Green's function for a particle initially located at (r 0 ,θ 0 ) is: where 2 2 .
J n (x) and Y n (x) are the Bessel Functions of the First and Second Kind, respectively (see ref. [9]). The parameters of this distribution are R>0, 0≤θ 0 ≤2π, r 0 >R and Dt>0. The variates of this distributions are r>R and 0≤θ≤2π.
The normalization of this function is: We have not been able so far to develop a sampling algorithm for the distribution function p(r,θ,t|r 0 , θ 0 ). An approximate algorithm to sample the positions can be done by using free diffusion and reflecting particles which are inside the disk (r<R). The results given by this simulation are illustrated in Figure 8.
In this example, since an approximate method is used to simulate the motion of particles, the distributions of r and θ do not verify the time discretization equations, as an exact sampling algorithm of p(r,θ,t|r 0 , θ 0 ) would (results not shown). Therefore, this example illustrate that the time discretization property of the Green's function is a very powerful way to verify the validity of the sampling algorithms.

Three-dimensional systems
Three dimensional systems are more complex and harder to visualize. In 3D, the DE can be written in cartesian coordinates as: x,y,z,t ,y ,z x,y,z,t ,y ,z .
The initial condition is p(x,y,z,t=0|x 0 , y 0 , z 0 )=δ(x-x 0 )δ(y-y 0 )δ(z-z 0 ). As in 2D, in several cases, the Green's function can be written as the product of the functions p x (x,t|x 0 ), p y (y,t|y 0 ) and p z (z,t|z 0 ): x,y,z,t ,y ,z x,t y,t z,t .

Free diffusion
The solution of the DE for free particles is the product of three Gaussian functions: Since the Gaussian functions are independent, the positions x, y and z can be obtained by sampling the Gaussian distribution for each variateX, Y and Z: Algorithm 6: Sampling algorithm for p free (x,y,z,Δt|x 0 ,y 0, z 0 ) (free 3D diffusion) GENERATE N 1 , N 2 , N 3 as a standard Normals In 3D, it is useful to use spherical coordinates (r,θ,ϕ) 3 . That is, the following transformation is used: The differential volume element is given by The DE can be written in spherical coordinates as: The following notation is used: (radial, azimutal, polar). r: [0,∞),θ: [0,π],ϕ: [0,2π).
Using the transformation to spherical coordinates, the Green's function of the DE for free particles can be rewritten as: The angle between the vectors (r,θ,ϕ) and (r 0 ,θ 0 ,ϕ 0 ) is given by cos(γ): Therefore, Eq. (36) can be written in the compact form: In spherical coordinates, as in 2D, it is possible to obtain related distributions such as p(r,t|r 0 ). It is obtained by integrating the Green's function over the angles:

The corner x>0, y>0, z>0
The Green's function is the product of three independent 1D Green's functions: p(x,y,z,t | x 0 ,y 0 ,z 0 ) = As it is the case in 2D, the coordinates x,y and z can be treated independently. Therefore, the positions of the particles can be generated by using Algorithm 2 for each of the coordinates.

The parallelipiped 0<x<a, 0<y<b, 0<z<c
The Green's function is also the product of three independent 1D Green's functions:  Therefore, the positions of particles can be generated by using Algorithm 3 for each of the coordinates. This sampling algorithm can be used to simulate the trajectories of particles confined into a box of sides a, b and c. At equilibrium, as it is the case in 2D (Figure 7), the particles are uniformly distributed within the volume.

Applications
Two applications of the approach described in the previous sections are presented. The first is the simulation of particles near a membrane comprising receptors. The second one is the simulation of chemical reactions. These applications will eventually be used to study the evolution of the chemical species created by ionizing radiations in biological media [14].

Particle near a 1D membrane comprising receptors
To apply the theory described in the chapter to cell culture simulations, it is necessary to make some assumptions. The details of the model presented here and more results are given in ref. [5]. Similar models have been used to study autocrine and paracrine signals in cell culture assays [15], ligand accumulation in autocrine cell cultures [16] and the spatial range of autocrine signaling [17].

Model and assumptions
A particle is assumed to be located in the proximity of a plane membrane comprising receptors, corresponding to the plane X=0. The particle can move freely in the Y and Z directions, and can bind reversibly to receptors located on the membrane and initiate signal transduction. This is illustrated in Figure 9: The binding rate constant (k a ) is obtained from the ligand-receptor association rate constant and the density of receptors on the surface, which are assumed to be uniformly distributed on the membrane [16]. The ligand-receptor complex has the rate constants k d for dissociation and k e for initiation of signal transduction. As a first approximation, this is equivalent to the problem Since the particles are moving freely in the Y and Z direction, the Green's function can be written as the product of the independent functions p x (x,t|x 0 ), p y (y,t|y 0 ) and p z (z,t|z 0 ). But p y (y,t|y 0 ) and p z (z,t|z 0 ) are Gaussians functions, which can be sampled as described in section 4.1; therefore, only the sampling of p x (x,t|x 0 ) will be discussed here. For convenience, the index "x" will be omitted in this section.
A particle can be free at position x>0, in a reversible bound state (*) at x=0 or activating signal transduction (**). The boundary condition at x=0 can be written: where p(*,t|x 0 ) is the probability of a particle initially located at x 0 to be in the reversible bound state at time t. The time evolution of p(*,t|x 0 ) is:

Green's functions
This problem can be solved analytically by using Laplace Transforms [18]. The solutions are expressed using three coefficients α, β and γ. They are the roots of a cubic polynomial 4 , for which the coefficients are given by the rate constants k a , k d and k e as follows: The mathematical expressions of the Green's function for a particle in this system are quite long. To simplify the following expressions, the variables ρ x = x/ 4Dt, ρ 0 = x 0 / 4Dt, α ' = α Dt, β ' = β Dt and γ ' = γ Dt are defined.
where p ref (x,t|x 0 ) is the Green's function for a reflective membrane, given in Section 3.2. The functions W(x,y) and Ω(x) are defined as: It is possible for two of the roots to be complex conjugates. Nevertheless, it is still possible to use the Green's function given in Equation (47) by implementing the numerical evaluation of W(x,y) for complex numbers [19].
The probability of survival for a free particle is obtained by integrating p(x,t|x 0 ) on [0,∞): The probability of a particle initially at x 0 >0 to be reversibly bound at time t is: A particle initially at x 0 >0 can also be found in an irreversibly bound state at time t. The probability to be found in this state is given by p(**,t|x 0 )=1-p(*,t|x 0 )-Q(t|x 0 ), which can be written as: To obtain the Green's function of a particle in a reversibly bound state, the material balance condition k a p(x,t|*)=k d p(*,t|x) (given in ref. [18,20]) is used. This yields the Green's function for the dissociation of a bound particle: The probability of dissociation of a particle that was initially in a reversibly bound state Q(t|*) is found by integrating p(*,t|x) over [0,∞): The probability of a particle initially in a reversibly bound state to stay in this state is given by (ref. [18]): Finally, the probability of a particle initially in a reversibly bound state to activate signal transduction is: For some particular values of α, β and γ, the Green's functions of this section have singularities (0/0). In these cases, the Green's functions take slightly different forms, but it is still possible to use the approach described here (see ref. [5]).

Time discretization equations
A simulation is usually done by dividing the final simulation time in a finite number of time steps. If the simulation can be done in two time steps such as t=Δt 1 +Δt 2 , a particle initially located at position x 0 can: From this the following time discretization equations are obtained: (56) The first of these equations is similar to the Chapman-Kolmogorov equation, to which a term has been added to account for the possibility of dissociation. Each term of these equations can be associated with the possibilities i-vii. Similarly, a particle initially in a reversibly bound state can: This yields the time discretization equations for the bound particle: These equations are proven in the supplemental material of ref. [5].

Brownian dynamics algorithm
Using the Green's functions, it is possible to construct a Brownian Dynamics algorithm to simulate the motion and binding of the ligand and the possible initiation of signal transduction. First, it should be noted that p(x,t|x 0 ) is a sub-density 5 . Since p(x,t|x 0 )≤p ref (x,t|x 0 ), the rejection method can be used [21]. This yields the following algorithm: There are also particles which are bound to the membrane. These particles may dissociate with probability Q(Δt|*). If this is the case, the position x of the particle is distributed as p(x,Δt|*), which can be written with a Gaussian factor in evidence: This form is convenient because it is the product of a Gaussian function by a function g(x) with three terms in Ω(x). Since 0≤Ω(x)≤1, p(x,Δt|*) can be sampled by a rejection method:

Simulation results
A simulation has been done by using k a =6, k d =10 and k e =1. The results are shown in Figure 10. It should also be noted that the time discretization equations (56) and (57) were used to validate the simulation results. In this case, it is possible to verify that the simulation results for free particles corresponds to p(x,t|x 0 ), but also that the number of bound particles can be accurately predicted after several time steps. . The dots are given by the simulation of 1,000,000 particle histories either with one or multiple time steps. (Right) Probability of a particle in these conditions to be free, reversibly bound or irreversibly bound as a function of time.

Bimolecular reactions
Bimolecular reactions are an important application of the theory described in the book chapter.
Let the particles A and B initially at the positions r A0 and r B0 . They can react with the reaction rate k a : . a k A + B C ¾¾ ® (59)

Green's functions for the particles
The probability distribution is solution of the following equation [2]: 2 2 ,t ,t .
The same transformation is done to r A0 and r B0 to obtain r 0 and R 0 . The operators ∇ R =∂/∂R and ∇r=∂/∂r are also defined. Using the transformation, Equation (60) can be rewritten as: where D=D A +D B , the sum of the diffusion coefficients of the particles. Therefore, p(R,r,t|R 0 ,r 0 ) can be factorized as follows: ,t ,t ,t . p( , | , ) = p ( | )p ( |, ) Using this factorization, two DE are obtained in r and R: 2 2 ,t ,t , ,t ,t .
This equation describes two independent random processes -diffusion in the coordinates r and R. The initial condition for Equation (64a) is p R (R,t|R 0 )=δ(R-R 0 ), and the boundary condition is p R (|R|→∞,t|R 0 )=0. As seen in Section 5.1, Equation (64a) represents free diffusion in 3D: This function can be sampled for R as in Algorithm 3, by using three Gaussian random numbers. Equation (64b) is the diffusive motion of the separation vector between particles. The initial condition is p r (r,t|r 0 ,t 0 )=δ(r-r 0 ), and the outer boundary condition is p r (|r|→∞,t|r 0 ,t 0 )=0. The possibility of a chemical reaction is introduced as the inner boundary condition ,t 4 ,t , where σ is the reaction radius. As it is the case for free particles, Equation (66) is the radiation boundary condition. The limit k a →0 is the reflecting boundary condition (no reactions between particles), whereas the limit k a →∞ is the absorbing boundary condition. In the latter case, the boundary condition is written p r (|r|=σ,t|r 0 )=0.
This algorithm is used to sample the length of the separation vector r. To fully caracterize the vector its direction should be specified by the angles θ and ϕ in a spherical coordinate system. An exact answer including the angles could be obtained by sampling the multi-variate Green's function given by Equation 67. An approximate method to obtain the deflection angles, which can be used here, is given by [24].
After sampling of the vectors r and R, the new positions of the particles r A and r B are obtained by inverting the transformation given by Equation (61)

Application to radiation chemistry
Ionizing radiation interacts with water molecules and creates radiolytic species, which react with cellular components and eventually lead to biological effects [14]. The precise location of the created radiolytic species are highly dependent of the type and energy of ionizing radiation. Therefore, considerable effort has been devoted to the Monte-Carlo simulation of ionizing radiation tracks, which provides such information [25]. After their formation, the radiolytic species react with each other and with other cellular molecules. Hence, radiation chemistry is a very important link between the radiation track structure and cellular damage and biological effects [26].
The simulation of radiation chemistry is difficult for several reasons. One important problem is the calculation time. Since the number of interactions between N particles is N(N-1)/2, the calculation time increases as ~N 2 . Therefore, simulation of systems comprising over 10000 particles is difficult, even in modern computers. For example, Uehara and Nikjoo [27] reported that the simulation of time-dependent yields of chemical species produced by five 1-MeV electron tracks comprising about 1,500 particles from 10 -12 to 10 -6 s requires about 250 h of calculation time. One promising approach is the new hardware called general purpose graphic processing units (GPGPU), which are special cards comprising a large number of processors designed to perform a large number of calculations simulaneously. Regarding this, the sampling algorithms proposed in this book chapter do not require much memory and could be implemented on a GPGPU, which could allow the simulation of large particle systems.
We conclude this section by showing a simulation result of water radiolysis by a 12 C 6+ ion of 25 MeV/amu [28] in Figure 12. Briefly, the track structure and the position of all the radiolytic species ( . OH, H . , eaq , H 2 , H 2 O 2 ,..) at ~10 -13 s are calculated by the code RITRACKS, described in [25] and references therein. The time evolution of the radiolytic species are calculated by using a step-by-step Monte-Carlo simulation code of radiation chemistry [28][29][30]. Each dot in Figure  12 represents a radiolytic species. The changes in the colors of the dots indicates that chemical reaction occurs. The number of chemical reactions (the radiolytic yields) which are calculated by the program have been validated with experimental data [30].

Conclusion
The simulations based on the Green's function of the DE are able to accurately describe the evolution of particles in time and space in various geometries, even if the number of particles is small. In fact, this approach is now used in several fields. Of particular interest in radiobiology is the study of radiation chemistry, biochemical networks and bimolecular reactions.
The Green's functions and their respective sampling algorithms have been presented for simple systems in one, two and three dimensions. Obviously, it is difficult to develop sampling algorithm even for simple systems because of the complex mathematical form of the Green's functions. However, it is very useful to develop sampling algorithms for systems for which analytical solutions are known, because they can be used to validate future models which will be based on numerical solutions of the DE. The DE can be solved easily by numerical methods such as finite-difference schemes, but these techniques may have restrictions for computational stability and the boundary conditions are often difficult to implement [31]. The systems with complex boundary conditions are particularly relevant to study biological networks. However, as seen in the applications, since the Green's functions of systems with complex boundary conditions are often subdensities of the Green's functions for the corresponding system with reflective boundary conditions, the rejection method can be used.
The algorithms developed in this chapter are already used to simulate the radiation chemistyoccuring in liquid water [28][29][30]. In the future, they will allow the validation and verification of future calculations, which will use the numerical solution of the diffusion equation. Eventually, the approach depicted in this book chapter will be used to simulate the time evolution of radiolytic species created by ionizing radiation and their reactions with molecules in biological media [23].