Professional Documents
Culture Documents
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兴
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
冓 冔
共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. 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
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.