You are on page 1of 7

PHYSICAL REVIEW E VOLUME 60, NUMBER 2 AUGUST 1999

Algorithms for Brownian dynamics computer simulations: Multivariable case


A. C. Brańka
Institute of Molecular Physics, Polish Academy of Sciences, Smoluchowskiego 17/19, 60-179 Poznań, Poland

D. M. Heyes
Department of Chemistry, University of Surrey, Guildford GU2 5XH, United Kingdom
共Received 16 February 1999兲
Several Brownian numerical schemes for treating stochastic differential equations at the position Langevin
level are analyzed from the point of view of their algorithmic efficiency for large-N systems. The algorithms
are tested using model colloidal fluids of particles interacting via the Yukawa potential. Limitations in the
conventional Brownian dynamics algorithm are shown and it is demonstrated that much better accuracy for
dynamical and static quantities can be achieved with an algorithm based on the stochastic expansion and
second-order stochastic Runge-Kutta algorithms. The importance of the various terms in the stochastic expan-
sion is analyzed, and the relative merits of second-order algorithms are discussed. 关S1063-651X共99兲03108-6兴

PACS number共s兲: 02.70.⫺c

I. INTRODUCTION An algorithm that needs only one evaluation of the force


per time step was proposed by van Gunsteren and Berendsen
Dispersed systems such as polymer solutions and colloi- 关6兴. In the limit of the large friction 共i.e., the limit for BD
dal liquids can be represented by a set of stochastic equations applications兲, the algorithm has a particularly simple form,
in which the effects of the large number of solvent molecules which has been used to model, for example, polymer dynam-
on polymer or colloidal particles are represented by random ics in solution 关7兴.
forces and frictional terms. The complexity of such systems In the present work we shall consider, from the point of
prohibits exact analytic treatments in all but the most ideal- view of the BD algorithms, a basic finite step-size expansion
ized of cases 共e.g., infinitely dilute systems兲. As a result, for the stochastic differential equations, and make a compari-
various problems in dispersed phase systems require com- son between the efficiency of the different BD algorithms for
puter simulations to solve them. Compared to the well- large or multivariable systems. In a previous publication we
established techniques for solving deterministic equations of carried out a preliminary study for one-dimensional systems
motion, the methods for solving stochastic equations, which 关8兴.
are often called stochastic dynamics 共SD兲, are considerably The basic BD algorithms are considered in Sec. II, and in
less well developed. Sec. III a numerical test is discussed. Conclusions are in Sec.
The most simple form of SD called the Brownian dynam- IV.
ics 共BD兲, which has been the mainstay of colloid modeling
over the past two to three decades, is the low-order algorithm II. THE ALGORITHMS
invented by Ermak and McCammon 关1,2兴. This technique is
The dynamics of N interacting colloidal particles for
at the level of the first-order Euler method for ordinary dif-
many purposes is adequately described by the position
ferential equations and requires a very small time step to
Langevin equation,
produce sufficiently accurate results. The method benefits
from its simplicity and is straightforward to use but, because dr i ␣ D
of the small time step required, is quite inefficient. BD simu- ⫽ F ⫹D 1/2␰ i ␣ , 共1兲
lations that are up to two orders of magnitude longer than dt k BT i␣
those for the equivalent MD systems are required. The BD
method can be made more efficient by adopting an appropri- where i⫽1, . . . ,N labels the particles and ␣ , ␤ , ␥ refer to the
ate second- or higher-order algorithm. Unfortunately, only a Cartesian coordinates. The quantity ␰ (t) represents a Gauss-
few proposals have been made, with little concern about ian white noise process, D is the free-particle self-diffusion
their ability to handle efficiently large physically relevant constant, k B is Boltzmann’s constant, and T is the tempera-
many-body systems, and as shown below none of them can ture. F i ␣ is the net force acting in direction ␣ on the particle,
be considered as completely satisfactory. i, derived from the interparticle potential U(rN ) usually rep-
Many of the improved BD schemes are Runge-Kutta-like resented as a sum of pairwise additive direct interactions
algorithms with some stochastic terms. Several algorithms V(r) between the particles,
along these lines have been proposed, e.g., by Helfand 关3兴, N
Iniesta and Torre 关4兴, and recently one for the one-variable
case by Honeycutt 关5兴. All these methods, as for the deter-
Fi ⫽⫺ⵜi U⫽⫺ⵜi 兺”i
j⫽
V 共 兩 ri ⫺r j 兩 兲 . 共2兲
ministic Runge-Kutta methods, require more than one evalu-
ation of the particle force per time step, which clearly re- The set of equations 共1兲 constitutes a stochastic description
duces their efficiency. of the N-particle evolution through time and space, which is

1063-651X/99/60共2兲/2381共7兲/$15.00 PRE 60 2381 © 1999 The American Physical Society


2382 A. C. BRAŃKA AND D. M. HEYES PRE 60

equivalent to the Smoluchowski equation without hydrody- N d


D D ⳵ F k␣
namic interactions. The stationary solution of the Smolu- r k ␣ 共 ⌬t 兲 ⫽r k ␣ ⫹W k ␣ ⫹ F k ␣ ⌬t⫹
T T 兺 兺
j⫽1 ␤ ⫽1
K
⳵r j␤ j␤
chowski equation is the canonical ensemble distribution,
N d
D2 ⳵ F k␣
1 ⫹
2T 2
⌬t 2 兺 ␤兺⫽1 F
⳵r j␤ j␤
P 共 rN ,⬁ 兲 ⫽ e ⫺U/k B T , 共3兲 j⫽1
Z
N d
D ⳵ 2F k␣
where Z is the partition function and thus the time averages

2T 兺 兺
p, j⫽1 ␤ , ␥ ⫽1
G ␤␥ ,
⳵ r p␥⳵ r j␤ p j
共8兲
produced by Eq. 共1兲 are the canonical ensemble averages.
From the Smoluchowski or the Langevin equations, the where K and G are random numbers involving W,
short-time behavior of time correlation functions can be es-
timated 关9兴. Explicit results for the form of the Cartesian
components of the mean square displacement are available to
K i␣⫽ 冕
0
⌬t
W i ␣ 共 s 兲 ds, G ␣␤
ij ⫽ 冕 ⌬t

0
W i ␣ 共 s 兲 W j ␤ 共 s 兲 ds.
fourth order in time, 共9兲

具 ⌬r i2␣ 典 ⫽2Dt⫺ 冓 冔
D 2 ⳵ 2U 2
T ⳵ r i2␣
t
The expansion of Eq. 共8兲, which we call the SE expansion,
results from the integration of Eq. 共1兲, the Taylor expansion
for F, and its repeated insertion into itself 关10兴. It is impor-

冓冉 冊冔
N d
tant to recognize that the random number K i ␣ is also, like
D3 ⳵ 2U 2

兺 兺
W i ␣ , a Gaussian random number with the following proper-
⫹ t 3 ⫺Bt 4 ⫹O 共 t 5 兲 ,
3T 2 j⫽1 ␤ ⫽1 ⳵ r i␣⳵ r j␤ ties:

共4兲 2
具 K i ␣ 典 ⫽0, 具 K i ␣ K j ␤ 典 ⫽ D⌬t 3 ␦ i j ␦ ␣␤ ,
3
where d denotes the dimensionality of the system, T here 共10兲
共and subsequently兲 denotes k B T, and B contains higher de- 具 W i ␣ K j ␤ 典 ⫽D⌬t 2 ␦ i j ␦ ␣␤ .
rivatives of the total potential energy 共the explicit form of
this term is irrelevant here兲. Thus, the term in Eq. 共8兲 involving K is of order ⌬t 3/2. The
The conventional Brownian dynamics 共CBD兲 algorithm last term is of order ⌬t 2 but its nonlinearity does not allow
solves Eq. 共1兲 for the many-body system according to the us to obtain a more explicit representation and the exact for-
following particle update scheme: mula is replaced by simpler 共local兲 expressions with the
same first moment, G ␣␤ i j ⬇ 2 ⌬tW i ␣ W j ␤ .
1

D In the following, the algorithm based on the expansion of


r i ␣ 共 ⌬t 兲 ⫽r i ␣ ⫹ F ⌬t⫹W i ␣ , 共5兲 Eq. 共8兲 will be called the stochastic expansion 共SE兲 algo-
T i␣
rithm. In order to see the significance of the various terms in
the SE expansion, we shall also consider another algorithm,
where ⌬t is the time step, r i ␣ ⬅r i ␣ (0), and W i is a normally SEb, with the order ⌬t 3/2 in which the two terms of the
distributed random force with zero mean and 具 W i ␣ W j ␤ 典 second-order have been neglected, and the SEc algorithm, in
⫽2D⌬t ␦ i j ␦ ␣␤ . van Gunsteren and Berendsen 共GB兲 pro- which only one term, the stochastic second-order term, was
posed the following algorithm: omitted 共the first three terms are just the CBD update
scheme兲. The SE 关8兴 and SEb 关11兴 algorithms have already
D been considered for one-dimensional systems showing sev-
r i ␣ 共 ⌬t 兲 ⫽r i ␣ ⫹ 共 2F i ␣ ⫹⌬tḞ i ␣ 兲 ⌬t⫹W i ␣ , 共6兲 eral advantages over other schemes and suggesting their po-
2T
tential utility for multivariable systems.
The formal difference between the SRK and SE ap-
where the time derivative of the force is conventionally ap- proaches can be deduced by expanding the Fb force in the
proximated by Ḟ⫽ 关 F(t)⫺F(t⫺⌬t) 兴 /⌬t. SRK scheme 关10兴. The resulting formula is very similar to
The second-order stochastic Runge-Kutta 共SRK兲 algo- that in Eq. 共8兲 apart from the ⌬t 3/2 terms in which K i ␣ are
rithm updates particle positions approximated by 12 ⌬tW i ␣ . It can be shown that, as long as
the expansion parameter is small, the following SRK-like
scheme gives exactly the SE expansion 共8兲,
D
r i ␣ 共 ⌬t 兲 ⫽r i ␣ ⫹ 共 F a ⫹F ib␣ 兲 ⌬t⫹W i ␣ , 共7兲
2T i ␣ D
r i ␣ 共 ⌬t 兲 ⫽r i ␣ ⫹ 共 F a ⫹F ib␣ 兲 ⌬t⫹W i ␣
2T i ␣
calculating the forces in two stages Fai ⫽Fi (rN ), and then N d
Fbi ⫽Fi (RN ), at Ri ⫽ri ⫹(D/T)Fi ⌬t⫹Wi . For a general sto- D ⳵ F ia␣
chastic differential equation such as Eq. 共1兲, the following

2T 兺 兺
j⫽1 ␤ ⫽1 ⳵r j␤ j␤
S , 共11兲
expansion for the Cartesian components of the particle posi-
tion holds 关10兴: where
PRE 60 ALGORITHMS FOR BROWNIAN DYNAMICS COMPUTER . . . 2383

2 Equation 共8兲 yields the following expression for the


具 S i ␣ 典 ⫽0, 具 S i ␣ S j ␤ 典 ⫽ D⌬t 3 ␦ i j ␦ ␣␤ , 具 W i ␣ S j ␤ 典 ⫽0. MSD1:
3

冓 冔
共12兲
D 2 ⳵ 2U
It is to be noted that S i ␣ , like K i ␣ , is a Gaussian random 具 ⌬r i2␣ 典 ⫽2D⌬t⫺ ⌬t 2
T ⳵ r i2␣

冋 冓冉 冊 冔 冓 冔册
number but, unlike K i ␣ , is not correlated with W i ␣ . The
algorithm based on Eq. 共11兲 we shall call the SRKb algo- D2 1 ⳵U 2
⳵ 2U
rithm. ⫹ ⫺ ⌬t 2 ⫹ ␦ SE⌬t 3 .
T T ⳵ r i␣ ⳵ r i2␣
An important quantity enabling us to differentiate be-
tween the various algorithms is the mean-square displace- 共20兲
ment in a single time step, MSD1. Its exact form follows
from Eq. 共4兲. The CBD algorithm gives only the trivial linear On the basis of the relation in Eq. 共15兲, the second term of
approximation, order ⌬t 2 is equal to zero 共for any ⌬t) and the expansion of
Eq. 共8兲, like the SRK algorithm, gives the correct MSD1

具 ⌬r i2␣ 典 ⫽2D⌬t⫺ 冓 冔
D 2 ⳵ 2U
T ⳵ r i2␣
⌬t 2 ⫹ ␦ CBD⌬t 2 , 共13兲
with some deviation only in terms of order ⌬t 3 .
It should be noticed that the same is true also for the SEb
and SEc algorithms.
and the error in the second-order term is
III. NUMERICAL CALCULATIONS

␦ CBD⫽
D
T
2

冋 冓冉 冊 冔 冓 冔册
1
T
⳵U
⳵ r i␣
2

⳵ U
2

⳵ r i2␣
. 共14兲
In order to compare the efficiency of the above algorithms
with increasing ⌬t and to establish how the MSD1 errors
influence the static and dynamic quantities, we have consid-
For many physical realizations, the following relation holds: ered the dynamics of N⫽121 Brownian particles in two di-

冓 冔
mensions 共2D兲 interacting via a Yukawa pairwise-additive
⳵ 2U potential,
具 F i2␣ 典 ⫺T ⫽0, 共15兲
⳵ r i2␣ V0
V共 r 兲⫽ exp关 ⫺␭ 共 r⫺1 兲兴 , 共21兲
r
which implies ␦ CBD⬎0. Thus, the CBD algorithm always
overestimates the MSD1 by 2D 2 ⌬t 2 具 F i2␣ 典 /T 2 . where V 0 sets the energy scale and ␭ is the screening param-
The GB algorithm also yields an error in the second-order eter characterizing the steepness and range of the potential.
term, The Yukawa potential, being the electrostatic part of the

冓 冔
Derjaguin-Landau-Verwey-Overbeek 共DLVO兲 potential
D 2 ⳵ 2U 关12兴, is considered to give a reasonable description of the
具 ⌬r i2␣ 典 ⫽2D⌬t⫺ ⌬t 2 ⫹ ␦ GB⌬t 2 , 共16兲
T ⳵ r i2␣ interaction of a dilute charge-stabilized spherical colloidal
suspensions 关13兴, and is often used as a model interaction in
where BD investigations 关14,15兴.

冉 冊
The basic simulation cell was a square with area A, and
3D 2 2 具 F i ␣ 共 ⌬t 兲 F i ␣ 共 0 兲 典 the usual periodic boundary conditions were applied. In or-
␦ GB⫽ ␦ CBD⫹ 2 具 F i ␣ 典 1⫺ . 共17兲 der to make the system test the various algorithms under
2T 具 F i2␣ 典 demanding conditions, the simulations were performed in the
As the normalized autocorrelation function is less than unity, dense fluid region (T⫽1,%⫽N/A⫽0.5) and the interaction
the second contribution in the ␦ GB is always positive. This potential was chosen to be strongly repulsive, with ␭⫽8.
means, rather surprisingly, that in general the GB algorithm All quantities presented here are normalized into dimen-
yields larger errors than the CBD algorithm. The SRK algo- sionless units, by choosing ␴ , ␴ 2 /D, and V 0 / ␴ as the char-
rithm gives acteristic values for length, time, and force. In the calcula-
tions the averages were calculated from simulations for

具 ⌬r i2␣ 典 ⫽2D⌬t⫺ 冓 冔
D 2 ⳵ 2U
T ⳵ r i2␣
⌬t 2 ⫺ ␦ SRK⌬t 2 , 共18兲
about 103 reduced time periods 共i.e., ⬃107 time steps with a
time step ⌬t⫽0.0001). In the SE algorithm based on Eq. 共8兲,
the two correlated random numbers W i ␣ and K i ␣ were
sampled from a bivariate Gaussian distribution.
with an error contribution, A validation problem with BD is that, unlike MD, there is
no conserved quantity that can be used to check the correct-
D3 ness of the time stepping algorithm. Furthermore, in the sto-
␦ SRK⫽ 共 具 F i2␣ 典 ⫺ 具 F i ␣ F ib␣ 典 兲 , 共19兲
2T 3 chastic part of the BD algorithms a random number genera-
tor is used and operations on the random numbers have to be
which is always positive and for small ⌬t can be approxi- performed. In this situation some subtle error connected
mated by the linear term. Thus, the SRK algorithm is the first with, for example, spurious random number correlations can
algorithm to give the correct second-order term for MSD1 easily be overlooked and any cross check of the code is
and yields an underestimation of MSD1 with a leading term highly desirable. In fact, Eq. 共15兲 can serve this purpose. In
of order ⌬t 3 . The same is true also for the SRKb algorithm. the case of the SRK algorithm, the equality Eq. 共15兲 is well
2384 A. C. BRAŃKA AND D. M. HEYES PRE 60

FIG. 2. The mean square displacement over time of a 2D


Yukawa fluid obtained from the seven BD algorithms discussed in
the text with time step ⌬t⫽0.0005. The curve labeled ‘‘exact’’ is
the limit obtained from calculations with ⌬t⫽2⫻10⫺5 . The SE,
SRK, and SRKb algorithm data coincide with the exact curve. The
inset presents an enlargement of the short-time regions.

are qualitatively very similar兲. On the scale of the figure the


MSD curves obtained from the SRK, SRKb, and SE calcu-
lations coincide with the exact curve, produced by all algo-
rithms in the limit of very small time step. The CBD curve
very slowly approaches from above towards the exact curve.
Also the GB curve deviates considerably from the exact
curve at short times but converges relatively quickly at
longer times 共in about 10–15 ⌬t) to the correct form. Notice
that in accordance with Eq. 共17兲, it starts above the CBD
FIG. 1. Test of the cross-check formula Eq. 共15兲. The data are
curve. The SEb produces the correct short time limit in ac-
obtained from the SRK scheme with ⌬t⫽2⫻10⫺5 . The continuous
cordance with Eq. 共20兲 but fairly quickly starts to bend
line represents the data obtained by the correct SRK code and the
dashed line is the data produced by the SRK code in which incor-
downward with the maximum deviation somewhere around
rectly the same random number was used in the calculation of the x t⫽0.05 and the deviations from the exact curve seem to
and y components of the particle displacement. The formula of Eq. persist for a long time. Also the SEc scheme gives noticeable
共15兲 vs the accumulated simulation time 共a兲 and the corresponding deviations from the exact MSD curve. As one may see in
total energy per particle 共b兲. Fig. 2, apart from the short-time region, it consequently
overestimates the exact results.
obeyed with accuracy better than 0.5% for all ⌬t⭐0.0005. The statistical uncertainty of the MSD data, as for any
An example of utility of Eq. 共15兲 is shown in Fig. 1. In fact, autocorrelation function 共ACF兲, increases with time from the
using this relation we were able to detect an error in the SRK origin. In our case, in the long-time region (t⬎2) where a
code connected with the use of the same random number for plateau is reached, all calculated MSD curves 共at least for
x and y coordinates, and which is hardly visible in the other ⌬t⭐0.0005) lie within the error bars around the ‘‘exact’’
more usually calculated quantities, e.g., energy in Fig. 1共b兲. curve. Only the data produced by the CBD algorithm with
Perhaps the most important yet simplest dynamical quan- ⌬t⫽0.0005 seem to show some systematic departure and
tity is the one we shall consider, and that is the time- deviations at long times. In this situation it is difficult to
dependent mean-square displacement 共MSD兲, over time t, for make definitive statements about the influence of the particu-
an arbitrary particle, lar algorithm on the long-time behavior of the MSD.
Therefore, within statistical uncertainty, all algorithms re-
1 produce the long-time behavior of the MSD, but differ con-
D共 t 兲⫽ 具 关 r共 t 兲 ⫺r共 0 兲兴 2 典 , 共22兲 siderably in their ability to reproduce its intermediate and
4t
particularly short-time characteristics. This is clearly seen in
which is averaged over all particles. the enlargement in Fig. 2, which illustrates a significant in-
In the long-time limit it gives the self-diffusion coefficient fluence of the MSD1 on the short-time behavior of the MSD.
of the particle. The general behavior of the MSD calculated In the enlargement, slight differences between the SRK,
with the various algorithms is shown in Fig. 2 for a fairly SRKb, and SE algorithms are still hard to notice. The SE
large time step ⌬t⫽0.0005 共for other time steps the results results practically coincide and those from the SRK method
PRE 60 ALGORITHMS FOR BROWNIAN DYNAMICS COMPUTER . . . 2385

FIG. 3. The short-time region of the msd from the SRK and
CBD algorithm and four different sizes of the time step in increas- FIG. 4. The SACF from different algorithms and ⌬t⫽0.0005.
ing magnitude of deviation: 0.0001, 0.0005, 0.0008, and 0.001. The SE, SRK, and SRKb data coincide with the ‘‘exact’’ curve and
the inset shows an enlargement of the intermediate-time regions.
only very slightly underestimate the exact curve. The SRKb
method produces data which lie between the SE and SRK
The influence of different sizes of the time step on the
curves.
SACF is illustrated in Fig. 5 for the case of the CBD and
The significant influence of the size of the time step on
SRK algorithms. In the case of the SRK scheme, apart from
the MSD1 and the short-time behavior of the MSD is illus-
results obtained with the largest time steps ⌬t⬎0.0005, all
trated for the SRK and CBD algorithms in Fig. 3. The figure
the data practically coincide with the exact curve 共similar
also demonstrates that on increasing the magnitude of ⌬t,
behavior is observed for the SE and SRKb schemes兲. In con-
deviations of the SRK data from the exact curve emerge,
trast, the influence of the magnitude of ⌬t on the CBD
although the SRK deviations are always more than ten times
scheme is quite significant and, as may be seen from the
smaller than those from the CBD algorithm at the same size
figure, only calculations with ⌬t⭐0.0001 lead to the correct
of the time step.
form of the SACF 共and consequently the viscosity of the
The second important dynamical quantity of primary in-
system兲.
terest often calculated in BD simulations is the shear-stress
The behavior of the static quantities obtained by different
time autocorrelation function 共SACF兲, defined as
algorithms at various time steps is illustrated in Figs. 6 and 7.
V In Fig. 6 the total energy per particle is shown. It appears
C共 t 兲⫽ 具 ␴ 共 0 兲 ␴ ␣␤ 共 t 兲 典 , 共23兲 from the figure that the best approximation, at a given size of
%T ␣␤ the time step, is achieved by the SE method and the worst 共as
where ␴ ␣␤ is an off-diagonal component of the stress tensor
(␣⫽ ” ␤ ). The C(t) determines, through the Green-Kubo re-
lation, the shear viscosity and its initial value gives the
infinite-frequency shear modulus G ⬁ ⫽C(0). The shear
stress correlation function is a collective quantity, which de-
cays relatively quickly towards zero. The normalized SACFs
calculated with the various algorithms are compared in Fig.
4. At short times the C(t) produced by the different algo-
rithms converge to the exact curve, which is quite different
behavior to what was observed for the MSD. With increasing
time the curves become more different (t⬃0.03) and at even
longer times (t⬎0.1) they converge slowly again towards
the exact curve where they are mutually consistent within
error bars. The most significant deviations are therefore at
intermediate times, which may be seen more clearly in the
inset in Fig. 4. Similarly, as in the case of the MSD, the
largest deviations are produced by the CBD, SEb, and SEc
algorithms, although now the CBD algorithm underestimates
and SEb overestimates the exact curve. Also the GB scheme FIG. 5. The SACF from the SRK and CBD algorithm. The
produces noticeable deviations from the exact curve. Again results are for different sizes of the time step in increasing magni-
the best estimate is given by the SRK, SE, and SRKb algo- tude of deviation: 0.0001, 0.0005, 0.0008, 0.001. For ⌬t⭐0.0005
rithms. the SRK data coincide with the ‘‘exact’’ curve.
2386 A. C. BRAŃKA AND D. M. HEYES PRE 60

term in the SE expansion, we have also performed BD cal-


culations with a 1D Brownian particle in a biharmonic po-
tential i.e., the system studied by us recently 关8兴. We con-
firmed that as for the multivariable case, also in the one-
variable system, the energy produced by the SEc algorithm
with different values of ⌬t is very similar to that produced
by the CBD method 共i.e., considerably worse than that ob-
tained by the SE, SEK, and GB methods兲. Thus, the second-
order stochastic term in the SE expansion seems to be im-
portant irrespective of the complexity of the system studied.
It is also apparent, particularly in Figs. 6 and 7, that the
second-order schemes SRK, SRKb, and SE provide useful
information on the maximum value of ⌬t at which the algo-
rithm can be properly used, enabling us to choose the opti-
mum value of the time step. In the case studied here this
maximum time step size is about 0.0005, which is almost an
order of magnitude greater than what should be used in the
CBD calculations, but it is worth noting that it is still an
FIG. 6. Energy of the Yukawa fluid vs time step from the dif-
order of magnitude smaller than can be used in deterministic
ferent algorithms. The exact value is estimated to be 0.4345.
algorithms for the same potential and thermodynamic param-
eters.
expected兲 is by the CBD route. For ⌬t⭐0.0005, the results Finally, we have also performed some calculations with
produced by the SRK and SRKb algorithms are practically as the so-called predictor-corrector algorithm proposed by
good as the SE 共within the error bars they all coincide with Mannella and Palleschi 共MP兲 关11兴. The MP algorithm, like
the exact values兲. For the larger time steps the deviations the SRK scheme, needs two evaluations of the force per time
from the exact value become more significant. The results step but involves two stochastic terms and thus can be ex-
produced by the SEb method are only slightly better and by pected to produce more accurate results. Our calculations for
the SEc even slightly worse than that obtained by the CBD the 121 Brownian particle fluid have shown, however, that
route. The SEc method becomes unstable at ⌬t⬎0.0008. All the data produced by the MP algorithm, with ⌬t⬎0.0002,
this clearly demonstrates the great importance of the particu- are noticeably less accurate than those obtained by the SRK
lar terms in the SE expansion. The GB approach gives a approach, similar to the result we obtained for the 1D
fairly good estimation of the energy, although the method Brownian particle system. Thus, in the cases studied by us,
becomes unstable for ⌬t⬎0.0008. The results for the pres- the MP was less accurate and thus less efficient than the SRK
sure are qualitatively very similar to that for the energy. As approach.
one can see in Fig. 7, the results for the shear modulus are
quite similar to those of the energy. Again, the worst esti-
mates come from the CBD, SEc, and SEb, and the best from IV. CONCLUSIONS
SE, SRK, and SRKb schemes.
The clear disability of the SEc approach to estimate prop- In this work we have considered algorithms for solving
erly the static quantities is rather unexpected. To confirm the the stochastic differential equation of the position Langevin
important role of the second-order non-Gaussian stochastic equations. In particular, properties of the Yukawa fluid were
analyzed from the point of view of algorithmic efficiency at
different time steps.
As expected, the original 1975 first-order Brownian dy-
namics 共CBD兲 algorithm due to Ermak yields the worst es-
timate of the calculated quantities for any ⌬t. It generates
with increasing ⌬t a significant overestimation or underesti-
mation of both static and dynamic quantities. It is, however,
the simplest scheme to implement and is fairly stable. The
van Gunsteren and Berendesen 共GB兲 algorithm gives the
largest deviation for the mean-square displacement in a time
step 共MSD1兲 and, as for the CBD method, is not able to
reproduce correctly the short-time region of the mean-square
displacements. It also produces noticeable deviations in the
intermediate-time region of the shear autocorrelation func-
tion. Thus, both of these algorithms should be used with
caution when accurate results for dynamical quantities at
short and intermediate times are required. The GB algorithm,
however, yields a much better estimation of static quantities
than the CBD algorithm. Such behavior probably follows
FIG. 7. The shear modulus vs time step from the different algo- from the fact that, although the GB algorithm is higher order
rithms. The exact value is estimated to be 1.70. than the CBD, it is not a true second-order algorithm as the
PRE 60 ALGORITHMS FOR BROWNIAN DYNAMICS COMPUTER . . . 2387

deterministic part is of order ⌬t 2 and the stochastic part in- tion, and evaluation of correlated random numbers is neces-
volves only a term at the ⌬t 1/2 level. sary. Also, an extension of the SE approach to deal with
Terms of different levels are involved also in the SEb position-dependent diffusion coefficients seems to be rather
algorithm 共the deterministic part here is of order ⌬t but the difficult, as the stochastic part of the expansion becomes pro-
stochastic one is of order ⌬t 3/2) and in the SEc algorithm hibitively more complicated. Our calculations indicate that
共here the deterministic part is of order ⌬t 2 and the stochastic the large number of rather complicated force-related terms in
one is of order ⌬t 3/2). In contrast to the GB scheme, they the SE scheme increases considerably the computational re-
give rather unsatisfactory static quantity estimation but good quirements per step. We estimate its computational effi-
short-time MSD data. Additionally, the noticeable deviations ciency to be between the CBD and SRK methods. The SE
of the MSD and the SACF at intermediate times make the approach should have advantages over other approaches in
SEb and SEc approaches rather uncompetitive compared to the case of few variable problems and/or a very simple form
the second order schemes. The results produced by the SEb, of the interparticle interactions 共e.g., the harmonic interac-
SEc, and GB as well as by MP schemes indicate that algo- tions兲.
rithms based on different level terms in the deterministic and The form of the error of the MSD1 and its systematic
stochastic parts can produce less accurate and/or less effi- influence on the calculated quantities implies that the effi-
cient results than the consistently lower-order algorithms. ciency of all the studied algorithms decreases as the interac-
They seem to be also less stable with increasing ⌬t. Further- tion potential become harder.
more, the SEc results clearly show a great importance of the For multivariable or larger systems, among the considered
non-Gaussian second-order stochastic term in the stochastic approaches, the SRK algorithm seems to be the one which
expansion of Eq. 共8兲. Any schemes, e.g., higher-order can be recommended. Its main drawback is the double evalu-
schemes 关16兴, even if used only for a few variable systems, ation of the force loop per time step. This roughly doubles
should be applied with caution if this term is neglected. the CPU time but, as has been shown above, the SRK
The second-order position-update schemes considered, scheme produces the data which are several times more ac-
the stochastic Runge-Kutta algorithm 共SRK兲, SRKb, and the curate than those produced by the CBD scheme and in sum-
SE based on Eq. 共8兲 in the text, give the correct form for the mary it is at least four times more efficient than the CBD
MSD1 and the best estimation for the mean-square displace- approach.
ments and SACF. The SE approach gives also the best esti- In conclusion, we have to say that none of the above
mation for the energy. The SRKb scheme offers a more ac- algorithms can be considered as entirely satisfactory in being
curate estimation of calculated quantities than the SRK accurate, fast, stable, and easy to implement for the BD
approach, although the improvement is marginal and in prac- simulations of multivariable systems. This work clearly indi-
tice it does not compensate for the additional programming cates that the task of developing an efficient algorithm for
effort required to include the extra force terms in the SRKb the multivariable stochastic differential equations is far from
update scheme. being solved.
The differences between the SE and SRK algorithms ACKNOWLEDGMENTS
come from the fact that the SRK algorithm is an approxima-
tion of Eq. 共8兲 in which all of the random terms are repre- The work has been supported by Polish Committee for
sented by a single random number term. Our results suggest Scientific Research 共KBN兲 Grant No. 8T11F01214. We are
that a rigorous implementation of this expansion gives im- grateful to Professor Tony Ladd, University of Florida at
provements in the accuracy of the calculated quantities. A Gainesville, for helpful discussions. Parts of the calculations
disadvantage of the SE method is that higher-order deriva- were performed at the Poznań Computer and Networking
tives of the interaction potential are involved in the calcula- Center.

关1兴 D. L. Ermak, J. Chem. Phys. 62, 4189 共1975兲. van den Broeck, Mol. Phys. 59, 595 共1986兲.
关2兴 D. L. Ermak and J. A. McCammon, J. Chem. Phys. 69, 1352 关10兴 A. Greiner, W. Strittmatter, and J. Honerkamp, J. Stat. Phys.
共1979兲. 51, 95 共1988兲.
关3兴 E. Helfand, J. Chem. Phys. 69, 1010 共1978兲. 关11兴 R. Mannella and V. Palleschi, Phys. Rev. A 40, 3381 共1989兲.
关4兴 A. Iniesta and J. Garcia de la Torre, J. Chem. Phys. 92, 2015 关12兴 W. Hess and R. Klein, Adv. Phys. 32, 173 共1983兲.
共1990兲. 关13兴 H. Löwen, Phys. Rev. Lett. 72, 424 共1994兲; J. Chem. Phys.
关5兴 R. L. Honeycutt, Phys. Rev. A 45, 600 共1992兲. 100, 6738 共1994兲.
关6兴 W. F. van Gunsteren and H. J. C. Berendsen, Mol. Phys. 45, 关14兴 H. Löwen, J. P. Hansen, and J. N. Roux, Phys. Rev. A 44,
637 共1982兲. 1169 共1991兲.
关7兴 X. Y. Chang and K. F. Freed, Chem. Eng. Sci. 49, 2821 关15兴 H. Löwen, T. Palberg, and R. Simon, Phys. Rev. Lett. 70, 1557
共1994兲.
共1993兲.
关8兴 A. C. Brańka and D. M. Heyes, Phys. Rev. E 58, 2611 共1998兲.
关16兴 E. Hershkovitz, J. Chem. Phys. 108, 9253 共1998兲.
关9兴 R. J. A. Tough, P. N. Pusey, H. N. W. Lekkerkerker, and C.

You might also like