Professional Documents
Culture Documents
a r t i c l e i n f o a b s t r a c t
Article history: We developed a graphical user interface, MATLAB based program to calculate the translational diffusion
Received 20 May 2010 coefficients in three dimensions for a single diffusing particle, suspended inside a fluid. When the
Received in revised form 8 September 2010 particles are not spherical, in addition to their translational motion also a rotational freedom is
Accepted 22 September 2010
considered for them and in addition to the previous translational diffusion coefficients a planar rotational
Available online 29 September 2010
diffusion coefficient can be calculated in this program. Time averaging and ensemble averaging over the
Keywords: particle displacements are taken to calculate the mean square displacement variations in time and so
Translational diffusion the diffusion coefficients. To monitor the random motion of non-spherical particles a reference frame is
Rotational diffusion used that the particle just have translational motion in it. We call it the body frame that is just like the
Brownian motion particle rotates about the z-axis of the lab frame.
Single particle Some statistical analysis, such as velocity autocorrelation function and histogram of displacements for the
Diffusion coefficients particle either in the lab or body frames, are available in the program. Program also calculates theoretical
MATLAB program values of the diffusion coefficients for particles of some basic geometrical shapes; sphere, spheroid and
cylinder, when other diffusion parameters like temperature and fluid viscosity coefficient can be adjusted.
Program summary
✩
This paper and its associated computer program are available via the Computer Physics Communications homepage on ScienceDirect (http://www.sciencedirect.com/
science/journal/00104655).
* Corresponding author.
E-mail address: charsooghi@iasbs.ac.ir (M.A. Charsooghi).
0010-4655/$ – see front matter © 2010 Elsevier B.V. All rights reserved.
doi:10.1016/j.cpc.2010.09.017
M.A. Charsooghi et al. / Computer Physics Communications 182 (2011) 400–408 401
done to measure Diffusion Coefficient (D), the weight and fraction of data points is controllable. Given
physical properties of the system, the program can calculates D theoretically for some basic geometrical
shapes; sphere, spheroid and cylinder. In the case of non-spherical particles if data of rotation is available,
the code can calculate trajectory and diffusion also in body frame. There are more statistical tools
available in the program, such as histogram and autocorrelation function to obtain more information
e.g. relaxation time to ideal diffusion motion. Code uses log–log diagram of mean square displacement
(MSD) to calculate the amount of deviation from normal diffusion to sub- or super-diffusion.
Running time: It is dependent on the input data, but for typical data in the order of mega bytes, it would
take tens of minutes.
© 2010 Elsevier B.V. All rights reserved.
1. Introduction coefficients. The program also is able to control the weight and the
number of data points. For given physical properties of the system,
Brownian motion of molecules of a fluid is an efficient mecha- the program can calculate D for particles of some basic geomet-
nism for material transport inside the fluid by means of the diffu- rical shapes; sphere, spheroid and cylinder based on theoretical
sion processes. For example, complex functionality of living cells, models by Perrin and Li et al. [28–30]. In the case of non-spherical
depends on Brownian motion of their constituents. Detailed infor- particles if the data of particle orientation are available, the code
mation about the environment can be gained by analysis of the can calculate trajectory and translational diffusion coefficients in
particle’s trajectory [1–3]. body frame.
The physical nature of interactions between a Brownian particle In continuance, the physical basis of the calculations in the pro-
and its surrounding has been investigated in many research works gram will be discussed. Then some equations which are used to
[4–11]. Investigating the time evolution of the mean square dis- calculate theoretical values of D will be introduced. After that we
placement, gives us information about the diffusive behaviour of will explain different parts of the programs in detail and show how
the particle. user can use the program. At the end a summary of the program’s
Different many-particle techniques have been widely used to benefits and advantages are presented.
study the diffusion processes. Dynamic light scattering [12–16],
neutron scattering [17–19], and fluorescence correlation spec- 2. Data analysis
troscopy (FCS) [20] are from the most common ones. In recent
years, optical methods have been developed to observe the motion The input data for the program corresponds to the positions
of single particles [21,22]. These methods, called single particle and orientation of the particle recorded in an experiment or gener-
tracking (SPT), and based on recording the trajectory of a moving ated in a simulation process. One of the main challenges in experi-
particle. mental data is the number of data points. To have a good estimate
In SPT methods transport properties of the particle are de- of diffusion coefficients a large number of data points are required.
rived by statistical analysis of the particle motion trajectories. Such Otherwise some tricks should be used to obtain trustable and pre-
method provides some information that are not available through cise results. If the data points are uncorrelated sub-ensemble can
measurements on many-particle systems. For example Saxton et al. be defined and a combination of time average and average over
measure trajectories of individual proteins or lipids in the plasma the sub-ensembles will increase the precision of the results in
membrane of cells [22], Kusumi et al. observed movement, recruit- comparison with the case when just ensemble average is taken
ment, and activation of single molecules in the plasma membrane over the whole data points. In the other hand using both methods
in living cells [23], and Dahan et al. studied the diffusion dynamics separately and comparison of the results gives a chance to have
of glycine receptors [24]. some conclusion about correlations between the data points. In
Diffusion behaviour of a spherical particles can be characterize this program we have introduced functions for all of these situ-
by their translational diffusion coefficient D but for an asymmetric ations which in this section will be explained in details.
particle, in an isotropic homogeneous fluid, at least there are two
different translational diffusion coefficients, D a for diffusion along
2.1. Diffusion coefficients
the long or principal axis and D b along the minor axis [25–27],
and a rotational diffusion coefficient, D θ [28,29].
The Brownian diffusion coefficient, D of an isolated spherical
Here we introduced a graphical user interface package which
particle is inversely proportional to the drag (or friction) coefficient
calculates the diffusion coefficients from experimental or simulated
γ via the Einstein relation,
recorded particle trajectories. Also for asymmetric particles, the
program calculates the motion trajectories in body frame (a ref- kB T
erence frame which the particle just has linear translation in it) D= . (1)
and computes translational and rotational diffusion coefficients in
γ
lab and body frame. Other statistical quantities such as velocity au- Here kB is the Boltzmann constant and T is the temperature. In
tocorrelation function (VAF) and histogram of displacement values the case of Brownian motion of a particle, D can be measured by
of particle are also accessible in the program. In this program we [31],
tried to gather all needed tools for analysis of a Brownian motion
2
of an (as)symmetric particle in a single user friendly interface. r(t )2 − r(t ) = 2nDt , (2)
There are three methods in the program for these calculations:
time average, ensemble average and their combinations. Ability to where r(t ) is equal to the displacement of the particle during
switch between different methods of calculation of mean square a time interval of t, r(t ) − r(0), and n is the space dimension. In
displacement (MSD) to find diffusion coefficients depends on the general it’s convenient to calculate D in each dimension separately,
correlations between data points. Based on the concept of a dif- e.g. x, y or z, if exist. So Eq. (2) is simplified to,
fusion process, the slope of a linear fit to the variations of the 2
calculated MSDs of the particle versus time, provides the diffusion x(t )2 − x(t ) = 2D x t , (3)
402 M.A. Charsooghi et al. / Computer Physics Communications 182 (2011) 400–408
Fig. 1. The procedure of ensemble averaging over data, as an example the boxes with dashed borders shows the ensemble average procedure on particle displacement during
the time interval t j − t 0 .
where D x is the diffusion constant along the x-axis and for a ho- where σ is the standard deviation of the samples and n is the
mogeneous space, x can be any of the coordinates. For an isolated number of samples. So if the number of trajectories are small, the
spherical particles, diffusion coefficients in all directions should be number of samples which we average over to calculate each point
the same, in spite of other cases such as ellipsoids. From now on, of MSD diagram, would be small. Therefore the error on the fi-
we will restricted ourselves to one dimension, but the results can nal measured D would be large. In this case using time average
be easily extended to higher dimensions (the program calculates method increases the number of samples in the averaging process.
diffusion coefficients for all available dimensions). In mathematical words, in this case, displacement in time in-
terval τ j , x(τ j ) − x(0), is similar to the displacement in the time
2.2. Mean square displacements, ensemble average interval between t j and t j + τ j , x(t j + τ j ) − x(t j ). We can con-
sider τ j = j δt ( j = 0, 1, 2, . . . , n), which δt is the minimum time
Assume that for a single particle there are m trajectories of a interval. In this case the time average of displacements in time in-
one-dimensional Brownian motion obtained empirically, or from tervals of τ j can be written as
simulations. Each trajectory describes the particle motion in n dis-
n− j
crete time steps. xi (t j ) is the x component of the position of the xi (t j + τ j ) − xi (t j )
particle after jth time steps over the ith trajectory (1 < i < m and xi (τ j ) = , i = 1, 2, 3, . . . , m . (6)
n− j
0 < j < n). j =0
To obtain the ensemble average of the particle displacement
If there is any correlation between the data points, then the time
during the time interval t j − 0, the program calculates xi (t j ) =
averaging appeared in Eq. (6) will leads to incorrect results. In-
xi (t j ) − xi (0) and (xi (t j ))2 and then calculate D according to stead, the following relation should be used to eliminate the over-
Eq. (3) lap between the motion intervals;
2
1 1
m m
2 n− j
xi (t j ) − xi (t j ) = 2Dt j
xi ((1 + j )τ j ) − x( j τ j )
m
i =1
m
i =1
xi (τ j ) = , i = 1, 2, 3, . . . , m ,
j =0
n−j j
for j = 0, 1, 2, . . . , n, (4)
(7)
which averaging is over different trajectories. The second term in
the left-hand side comes from the particle velocity drift or any where x is the integer part of x. Both averaging with and with-
flow in the system. If there isn’t any flow, it would be automati- out overlapping is considered in the program. Figs. 2 and 3 show
cally zero. The ensemble averaging over the ensemble of trajecto- the difference between what we called correlated and uncorrelated
ries is shown clearly in Fig. 1. time averaging method.
At the end, mean square displacement (MSD), x2 (t ) − Performing time average over the jth trajectory leads to a dif-
x(t )2 , as a function of time will be obtained. At each point fusion coefficient D j for this trajectory and finally the diffusion
of MSD diagram, error of calculated MSD, is standard deviation of coefficient D, can be written as
averaging over different trajectories divide by square root of num-
ber of samples. Diffusion coefficient is deduced from the slope of
m
D= D j /m. (8)
a linear line which fitted to MSD diagram.
j =1
Fig. 2. The procedure of time averaging over data. Arrows with solid, dash and dash-dot outlines show the time steps of t = 1δt, t = 2δt and t = 3δt respectively, which
δt is the minimum time step in the system. A box with dash-dot border shows that the procedure of averaging is done only on separate data sets. A box with dashed
boundary and gray background shows the area of overlapping between time intervals t 2 − t 0 and t 3 − t 1 for t = 2δt. In this method overlapping occurs for all time intervals,
except t = 1δt.
Fig. 3. The procedure of time averaging over data without any overlapping. As an example rows with solid and dash outlines show the time steps of t = 1δt and t = 2δt
respectively. A box with dash-dot border shows that the procedure of averaging is done only on separate data sets.
where δ(t ) is the Dirac delta function and v (0) is velocity of the
MSD(t ) ∼ Dt α , (9) particle at t = 0. In the program, velocity is simply defined from
data of position and time using equation
where D is the diffusion coefficient, t is the elapsed time and α is
x(i + 1) − x(i )
known as diffusion anomaly. In a typical diffusion process, α = 1. v (i ) = , i = 0, 1 , 2 , . . . , n − 1 , (11)
If α > 1 (α < 1), the phenomenon is called super-diffusion (sub- t ( i + 1) − t ( i )
diffusion). As an example, super-diffusion can be observed as a where i stands for the ith time step of motion. When the time av-
result of active cellular transport processes. and sub-diffusion has erage is taking over a time interval that is much larger than inter
been proposed as a measure of macromolecular crowding in the molecular collision time (i.e. < 10−12 s), Eq. (10) is well satisfied
cytoplasm [32–34]. and quite clear. Large number of collisions during the measure-
One can write log Dt α = log D + α log(t ) and to find α , it’s ment time cause the velocities of the particle in successive time
only enough to calculate the slope of the linear fit to variations intervals become uncorrelated [36].
of log(MSD) versus log(t ). Since the value of α has some errors, it For a particle with simple diffusion, the velocity autocorrelation
is better to set a range on α to obtain the diffusion anomaly. For function is computed using relation
example instead of α = 1 for normal diffusion, it’s better to use
|α − 1| δ α , when δ α is an error in measured α . A (t ) = v (t + τ ). v (τ ) , (12)
404 M.A. Charsooghi et al. / Computer Physics Communications 182 (2011) 400–408
Fig. 4. The velocity autocorrelation function versus time for random motion of a 3μ
spherical polystyrene bead inside water at room temperature; experiments – solid
For non-spherical particles, e.g. a spheroid with long axis of
line, exponential fit – dashed line. length 2a and short axes of length 2b, translational diffusion is
anisotropic. We are considering that the particle only has a pla-
nar rotation and defining a new reference frame ( X , Y , Z ) that
just rotates with the particle about the Z -axis of the lab frame
when Z = Z . We call this reference frame as the body frame. In
the body frame, the particle long (short) axis is along the X (Y )
direction and the particle diffusion along its long (short) axis is
(see Fig. 6), when γt and γt⊥ are viscous friction coefficients
parallel and perpendicular to the main axis, respectively. The par-
ticle rotation can be specified by θ , the smaller angle between
X and X axes and the rotational diffusion coefficient is defined
by D r = k B T /γr where γr is rotational viscous friction coefficient.
Perrin analytically calculated the viscous friction coefficients, for
spheroid in three dimensions [28,29].
Displacement of the particle in nth step of its random motion in
x direction is dx(tn ) = x(tn+1 ) − x(tn ) and in y direction is dy (tn ) =
y (tn+1 ) − y (tn ) (Fig. 6).
To find the trajectory of the particle in the body frame, the dis-
placements dx(tn ) = x(tn+1 ) − x(tn ) and dy (tn ) = y (tn+1 ) − y (tn )
and also changes in rotation angle by dθ(tn ) = θ(tn+1 ) − θ(tn ) are
Fig. 5. The histogram of displacements for random motion of a 3μ spherical calculated for each time step. Displacements in body frame (with
polystyrene bead inside water at room temperature; experiments – dashed line, primed symbols) are related to lab frame displacements via
exponential fit – solid line.
32πη a4 − b 4
according to Einstein’s relation (Eq. (1)). For a spherical shaped
γr
= , (21)
particle, γ is equal to [31] 3 (2a2 − b2 )s − 2a
32πη (a2 − b2 )b2
γ = 6πηa (16) γr⊥ = . (22)
3 2a − b2 s
where η is the viscosity of surrounding media and a is the radius
of the sphere. For a spheroid with semi-axis length of a and b = c, For cylindrical particles with diameter d and length L and so
the axial ratio of p = L /d the translational viscous friction coef-
translational viscous friction coefficients along, γt , and perpendic-
⊥ ficients parallel and perpendicular to the principle axis and rota-
ular, γt , to the axis a are [28,29],
tional coefficients around these axes are [30]
a2 − b 2
γt
= 16πη , (17) γt
=
2πη L
(longwise), (23)
− b2 )s − 2a
(2a2
ln p + δt
a2 − b 2
γt⊥ = 32πη 2 . (18)
γt⊥ =
4πη L
(2a − 3b2 )s + 2a (sidewise), (24)
ln p + δt⊥
Typically there are two different spheroids, prolated spheroid
3.84πη L 3 (1 + δr )
and oblated spheroid. In prolated spheroid a > b and s is γr
= (about long axis), (25)
√ p2
2 a+ a2 − b 2
s= √ log , (19) πη L 3
a2 − b 2 b γr⊥ = (about short axis), (26)
3(ln p + δr⊥ )
and for oblated spheroid a < b and s is
√ where δt , δt⊥ , δr , and δr⊥ are the end correction coefficients which
2 b 2 − a2 are functions of axial ratio, p. For cylinders with p > 1 but not for
s= √ arctan , (20)
b 2 − a2 b p = ∞ limit we will have [30,38]:
and for rotation about the mentioned axes the rotational friction
0.980 0.133
coefficients are, δt = −0.207 + − , (27)
p p2
0.185 0.233
δt⊥ = 0.839 + + , (28) time step Brownian motion is shown in Table 1. In each run, the
p p2 structure of the input files should be the same.
0.677 0.183
δr = − , (29)
3.1. Windows
p p2
0.917 0.05
δr⊥ = −0.662 + − . (30) There is a Main Window with four sub-windows which user
p p2
deals with.
Fig. 8. A screen shot of a main window of the program. User has access to all applications and functions through menu-bars and toolbars.
M.A. Charsooghi et al. / Computer Physics Communications 182 (2011) 400–408 407
Fig. 10. Diffusion statistics. When user use time average method to calculate dif-
fusion coefficient. There would be diffusion coefficients as many as the number of
Fig. 9. When user click α sign from toolbar icons or click Calculate Theory from
data sets. Use this sub-menu to plot these coefficients together. Each point corre-
Diffusion menu, the theory sub-window will be open. User can calculate transla-
sponds to one diffusion coefficient. Dashed line show the final diffusion coefficient.
tional and rotational diffusion for three basic geometrical shape; sphere, spheroid
and cylinder.
plot MSD versus time in the figure panel using one of the meth-
3.1.2. Theory sub-window ods of calculating diffusion coefficients (Time, Ensemble, Time-
When user click α sign from toolbar icons or click Calculate Ensemble average). Then the log–log plot of MSD and time is
Theory from Diffusion menu, the theory sub-window will be open. plotted and the kind and amount of anomaly will be presented
Fig. 9 shows a snapshot of a theory sub-window. in Results panel.
User can calculate translational and rotational diffusion for Diffusion Statistics – If diffusion coefficients compute using
some basic geometrical shapes; sphere, prolate spheroid, oblate time average method, there will be a diffusion coefficient for each
spheroid and cylinder. User can set sizes, units, temperature, and data set. To comparison these coefficients using this sub-menu will
viscosity of medium. plot all the values in one figure. The number of points is equal to
number of data sets (Fig. 10).
3.1.3. Results sub-window If user check the Show Fit box, the final value of diffusion will
When user click Results from View menu, the results sub- be add as a straight line.
window will be opened. User can follow, save, edit and clear the Calculate Theory – When user click α sign from toolbar icons
results of calculations there. Especially for diffusion calculations, or click Calculate Theory from Diffusion menu, the theory sub-
program exports diffusion and velocity of drift with their amount window will be open. For more information refer to part 3.1.2.
of error to this window.
3.2.3. Statistics menu
3.1.4. Description sub-window This menu will calculate and show Histogram of displacements
When user click Description from View menu, the description and velocity autocorrelation function. User can fit Gaussian func-
sub-window will be opened. User can write any extra information tion to histogram and exponential function to autocorrelation dia-
about data, such as conditions of experiment or simulation, there. gram. Fit parameters is shown in Results panel.
Also user can edit, save and clear it and load any saved description.
3.2.4. View menu
3.1.5. Log sub-window This menu contains some visual commands to change the face
When user click Log from View menu, the log sub-window will of the program’s panels. User can see results, description and log
be opened. User can follow, save, edit and clear its activity through sub-windows. Also user can plot trajectory of particle motion ver-
this window. sus time or in space.