• Keine Ergebnisse gefunden

Colloidal Transport in Micro-Channels

9.2 Brownian Dynamics Simulation

Now let us introduce and compare several ways of of integrating the coupled stochastic equations of motion (9.65) in a so-calledBrownian dynamics(BD)simulation. We will close this section making some remarks on the generation of Gaussian random numbers.

9.2.1 Conventional Brownian Dynamics

Theconventional Brownian dynamics algorithm(CBD) of Ermak [Erm75,All87] uses a first-order Euler method to give a solution for equation (9.65) for the many body system which takes the form ri(t+∆t) =ri(t) +∆ri(∆t) (9.72) with the displacement

∆ri(∆t) =βD0Fi∆t+Wi (9.73) after the time step ∆t.37 The vector Wi of random displacements of particle iis sampled from a Gaussian distribution with zero mean and variance hWi·Wji=6D0∆tδi j38. This approach is based on the assumption that the systematic forces Fi remain essentially constant during the time step ∆t. The time scales with the friction coefficientξ, as∆t always occurs divided by ξ (D0=kBT/ξ) in the discretized version of equation (9.73) also.

For efficient sampling of the configuration space the basic time-step∆tshould be chosen as large as possible, but small enough so that the forces remain essentially constant. Typical choices are in the range∆t/τB≈0.5·10−4−0.5·10−2. Simulations of dense systems with steeply repulsive pair interactions require smaller time-steps, whereas longer time-steps can be used for less strongly correlated systems.

37In the program this integration method will be used as default for given compiler directiveBD OVERDAMPEDduring the compilation process. Other integration methods may be specified by further compiler directives (cf. footnote41).

38In index notation:

In the simulation for all particles and each coordinate direction we can draw Gaussian random numbers from a single Gaussian distribution, because the correlation contains the productδi jδαβand thus no cross correlations do exist.

From equation (9.73) we immediately get the mean square displacement in a time step h∆r2i=6D0t+β2D20hF2i(∆t)2+O (∆t)3

. (9.74)

For many physical realizations the following equation holds39 hF2i −kBT

2U

∂r2

=0. (9.75)

Thus, comparison of equation (9.74) with equation (9.71) shows, that the CBD algorithm always overestimates the exact result by 2β2D20hF2i(∆t)2, which is positive irrespective of the form of the interaction potential. Due to thehF2ifactor the error depends on the density and the steepness of the interaction potential. [Hey00]

The Euler integration scheme is the simplest choice, but besides the accuracy it is not very sta-ble [Pre92]. This is due to the fact that the formula (9.73) is not symmetric, i.e. it only uses derivative information at the beginning of the time step.

Usually the Euler scheme gives good numerical results when the drift and the diffusion coefficients are constant, as it is the case for our situation.40

9.2.2 Stochastic Runge-Kutta Method

Bra´nka and Heyes [Bra99,Hey00] proposed an extension of the conventional Brownian dynamics algorithm of Ermak [Erm75], which gives more accurate results. The integration of equation (9.65) is carried out using a second-orderstochastic Runge-Kutta (SRK) algorithm, which updates the particle positions according to

ri(t+∆t) = ri(t) +∆ri(∆t)

= ri(t) +βD0 2

Fai +Fbi

∆t+Wi, (9.76)

where the forces are calculated at two points in time: Fai ≡F(rN)at timet, and then Fbi(RN)at timet+∆twith

Ri=ri+βD0Fi∆t+Wi. (9.77)

This update scheme is also known asHeun predictor-corrector methodwhere the CBD displace-ment is used as the “predictor” step. TheWiin equations (9.76) and (9.77) are identical.41

39Unlike in molecular dynamics simulations, there exists no conserved quantity in a BD algorithm that can be used to check the correctness of the time stepping algorithm. But for many physical systems the relation (9.75) can serve as a cross check of the code.

40The more general Euler algorithm, which corresponds to the Itˆo stochastic differential equation dr(t) =A(t,r(t))dt+B(t,r(t))·dW(t),

reads

r(tj+1) =r(tj) +A(tj,r(tj))(tj+1tj) +B(tj,r(tj))·(Wj+1Wj)

forj=0,1,2...,Nstep. It can be shown to converge strongly with order 1/2 (instead of order 1 as for the determin-istic case) [¨Ot96]. The source of the convergence order 1/2 are the configuration dependent coefficientsB, which in the Euler scheme are only evaluated at the initial configuration. Thus higher order of convergence can be expected for additive noise.

41The stochastic Runge-Kutta method will be used in the executable simulation program, when the compiler directives BD OVERDAMPEDandHEYES SRKare both set.

This predictor-corrector method can be shown to be weakly second-order convergent [¨Ot96,Klo99].

This means that, ifrexacti is the exact trajectory, then the error of any polynomial function ofriis bounded by

g

rexacti (t)

−g[ri(t)]≤c(∆t)2, (9.78) wherecis a positive constant, which does not depend on∆t.

The mean square displacement in a time step is up to the second order in ∆t identical with the exact result of equation (9.71). Therefore the leading error term is of orderO((∆t)3)compared to O((∆t)2)of the CBD algorithm.

9.2.3 Smart Monte-Carlo Method

The Smart Monte-Carlo methodcan be considered as an extension of the CBD method [Ros78, Hey98,Hey00,Jar99,All87]. To ensure that the state distribution at each Monte-Carlo-time step conforms to the Boltzmann distribution

Pk= 1

Ze−βUk, (9.79)

a Boltzmann weighted importance sampling is introduced into the generation of tentative trajecto-ries. HereZis the partition function andUkis the potential energy of thekth configuration.

The transition probability from statekto statel,

Pkl=TklAkl, (9.80)

can be written as the product of the acceptance probabilityAkltimes the state-to-state displacement transition vectorTkl. To ensure the condition of detailed balanceAklis chosen as

Akl=min

Trajectories are generated using the algorithm of Ermak where now the particle indices are re-placed by a state indexkorl,i.e.the trial new statelis calculated from statekusing

Rl=Rk+∆Rk (9.82)

and

∆Rk=βD0Fk∆t+Wk. (9.83)

These equations of motion result in the underlying stochastic matrix Tkl=

which is needed for the evaluation ofAkl. Finally, in a Metropolis Monte-Carlo scheme one decides whether the new trial stateRl gets accepted.

The smart Monte-Carlo method can be used to deal with hard spheres and particles with steep short-range repulsions [Cic90].

9.2.4 Gaussian Random Numbers

Any quantityAis called aGaussian random numberif its probability distributionρ(a), defined by

The generation of Gaussian random numbers is based on uniform distributed random numbers of the interval(0,1). As a direct application of the central limit theorem Gaussian random numbers can be generated by simple addition of enough uniformly distributed random numberszi∈(0,1):

r12

For most applicationsn=12 gives good results. But for the generation of every Gaussian random number one has to draw 12 uniformly distributed random numbers.42 In our simulation we use the more efficientBox-Muller method[Box58,Pre92,All87], which works as follows. Two uniform deviates on(0,1),x1,x2are transformed to the two quantitiesy1andy2according

y1 = p

Evaluation of the general transformation law for the joint probability distributions [Pre92]

p(y1,y2,...) =p(x1,x2,...)

42On the level of the first-order Ermak algorithm only the first and second moments of the Gaussian distribution are needed, which can equally well obtained by using a random number constructed from the uniformly distributed random numberzaccording to

This random numberRhas the same first two moments as a Gaussian random number. [Gre88]

So the joint probability distribution is a product of two independent normal distributions and thus eachyis independently distributed according to the normal distribution (9.86), which is centered around zero and has the varianceσ=1.0.

The efficiency of the Box-Muller transformation (9.88) can be increased by applying the follow-ing trick [Pre92]. Instead of drawfollow-ing uniform deviates x1 and x2 in the unit square, we pick a random point with coordinates v1 andv2 inside the unit circle around the origin. The radial coordinate R2 =v21+v22 is a uniform deviate, which can be used for x1, while the polar angle φ=arctan(v2/v1)can serve as the random angle 2πx2. This allows us to avoid the numeric evalu-ation of the trigonometric function calls in (9.88), because the cosine and sine can now be written asv1/√

R2andv2/√

R2respectively.

This algorithm is implemented in the template classRandomGauss43, which can be used in com-bination with any uniform distributed random number generator, for example the random number generators of the “GNU Scientific Library” [Gal06] or of the “blitz++ library” for scientific com-puting [Vel05].