You are on page 1of 9

Computer Physics Communications 182 (2011) 400–408

Contents lists available at ScienceDirect

Computer Physics Communications


www.elsevier.com/locate/cpc

A MATLAB program to calculate translational and rotational diffusion coefficients


of a single particle ✩
Mohammad A. Charsooghi ∗ , Ehsan A. Akhlaghi, Sharareh Tavaddod, H.R. Khalesifard
Department of Physics, Institute for Advanced Studies in Basic Sciences (IASBS), Zanjan 45137-66731, Iran

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

Program title: KOJA


Catalogue identifier: AEHK_v1_0
Program summary URL: http://cpc.cs.qub.ac.uk/summaries/AEHK_v1_0.html
Program obtainable from: CPC Program Library, Queen’s University, Belfast, N. Ireland
Licensing provisions: Standard CPC licence, http://cpc.cs.qub.ac.uk/licence/licence.html
No. of lines in distributed program, including test data, etc.: 48 021
No. of bytes in distributed program, including test data, etc.: 1 310 320
Distribution format: tar.gz
Programming language: MatLab (MathWorks Inc.) version 7.6 or higher. Statistics Toolbox and Curve Fitting
Toolbox required.
Computer: Tested on windows and linux, but generally it would work on any computer running MatLab
(MathWorks Inc.). There is a bug in windows 7, if the user is not the administrator sometimes the
program was not able to overwrite some internal files.
Operating system: Any supporting MatLab (MathWorks Inc.) v7.6 or higher.
RAM: About eight times that of loaded data
Classification: 12
Nature of problem: In many areas of physics, knowing diffusion coefficients is vital and gives useful
information about the physical properties of diffusive particles and the environment. In many cases a
diffusive particle is not a sphere and has rotation during its movements. In these cases information
about a particle’s trajectory both in lab and body frame would be useful. Also some statistical analysis is
needed to obtain more information about a particle’s motion.
Solution method: This program tries to gather all required tools to analyse raw data from the Brownian
motion of a diffusing particle. Ability to switch between different methods of calculation of mean square
displacement to find diffusion coefficients depends on the correlations between data points. There are
three methods in the program: time average, ensemble average and their combinations. A linear fit is


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

2.3. Mean square displacements, time average


2.4. Mean square displacements, time-ensemble average

The standard deviation of the mean value is related to the num-


This method is a combination of the two previous methods. The
ber of samples by the relation
program first calculates (x(t + τ ) − x(t ))2 and (x(t + τ ) − x(t ))2 
σ using time average over each trajectory, then take ensemble aver-
standard deviation of the mean = √ , (5) age of these two quantities over all different trajectories.
n
M.A. Charsooghi et al. / Computer Physics Communications 182 (2011) 400–408 403

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.

2.5. Anomaly 2.6. Autocorrelation function

The velocity autocorrelation function can be used to check if


In a normal diffusion process, the mean squared displacement
the particle motion is a simple diffusion or not. According to the
(MSD) of a particle is a linear function of time. Anomalous dif-
theory of ideal diffusion, velocity autocorrelation function, defines
fusion is used to describe a diffusion process with a non-linear
as [35],
dependence on time.
Diffusion is often described by a power law,  
v (t ) v (0) = 2D δ(t ), (10)

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. 6. Coordinate transformation for rotation of a spheroid. The primed coordinate


fixes to spheroid axes and rotates with rotating of a spheroid. θn is the angle be-
tween X directions of lab and body frames, in nth step.

2.8. Trajectory and diffusion in the particle body frame

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

specified by diffusion coefficient, D t = k B T /γt (D t⊥ = k B T /γt⊥ )


(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.


dxn cos θn sin θn dxn


= , (14)
where A (t ) is velocity autocorrelation function. Eq. (12) should dyn − sin θn cos θn dyn
have a non-zero value for t = 0. By fitting an exponential function,
−t
e β to A (t ), we can find β which specifies a time constant for a where θn = (θ(tn ) + θ(tn+1 ))/2 [37]. Then in the body frame one
simple diffusion. When t < β the diffusion is not simple. Typically can write the position for the time t j as:
β has small values but if any extra forces beside of the thermal
collisions influences the random motion of the molecules, it would 
j
x (t j ) = dxi , j = 1, 2, 3, . . . , n ,
be grow. In Fig. 4 a typical autocorrelation function for a random
i =1
walker is shown.

j

2.7. Histogram y  (t j ) = dy i , j = 1, 2, 3, . . . , n . (15)


i =1
This program also calculates histogram of displacements with a
Gaussian fit to it. Width of the Gaussian distribution which is fitted 2.9. Theoretical values of diffusion coefficients
to histogram of displacement is related to diffusion coefficient via
To find some estimation of the diffusing particle shape or to
2
σ = 2Dt , (13) test how the calculation presumptions matches with the theoret-
ical diffusion models, the program also calculates the theoretical
2
where σ is the variance of the distribution and, D is the diffu- values of diffusion coefficients for particles with one of the three
sion coefficient. Fig. 5 shows a typical diagram of displacements basic geometrical shapes; sphere, spheroid and cylinder. The diffu-
histogram which is produced with the program. sion coefficient, D, and the viscous friction coefficient are related
M.A. Charsooghi et al. / Computer Physics Communications 182 (2011) 400–408 405

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

Fig. 7. Flowchart of the program structure.


406 M.A. Charsooghi et al. / Computer Physics Communications 182 (2011) 400–408

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.

3. Using the program


3.1.1. Main window
After running the program, a window which we call it “Main
To work with program open KOJA.m in MATLAB 7.6 or higher window” appears (Fig. 8). It contains some major parts: Axes Area,
and run the m-file. A brief review of the program structure, as a Current Frame, Durrent Data, Fit Options panels.
flowchart, is shown in Fig. 7. Different parts of the program are Axes Area – Each time user select one of sub-menus, toolbar
introduced in the following sub-sections. Each input file should icons or any item of control panels (the panels left to the Axes
corresponds to Brownian motion of a single particle for a speci- Area), the related physical quantity is computed and associated
fied time duration and time steps when at each time step the x, y plot will appear in this part. User can save the resulting figure us-
and z component of the particle position and the particle orienta- ing file menu or toolbar icon, in png, bmp, eps, tiff, jpg and other
tion respect to x-axis in the laboratory frame, θ , are recorded. graphical formats.
The input data file is in the form of a matrix when the elements Current Frame – User can switch between Body Frame and Lab
on each row represents the particle position and orientation in a Frame, using this panel.
specified time step and the columns corresponds to the time, x, y, Current data – In this part user can switch between the motion
z position coordinates and the particle orientation θ . This means Dimensions and the Data sets. After selection, the data which has
that the maximum number of the columns are five and number of shown in the plotting area, will be automatically refreshed.
the rows are determined by the time duration of the motion and Fit Options – In this part user can change Fit Options. User can
length of time steps. The program also recognizes the user defined choose a portion of the data starting from the beginning of the
headers for input files. The typical structure for input file of a n- data points and running the fitting procedure based on the linear
fit. It is also possible to set the Weight of each data point in the
Table 1 this procedure. Like in the MATLAB fitting procedure, the weight
Typical structure of an input file. Each row corresponds to a time step and columns of each data point is assigned according to the error value at that
show particle’s position and orientation in associated time.
point. The fitting weight, w, is written as,
Time Coordinates Orientation
t x y z θ 1
w= (31)
t1 x1 y1 z1 θ1 σ2
t2 x2 y2 z2 θ2
t3 x3 y3 z3 θ3 where σ is the error on each data point. Program uses expo-
. . . . . nential and Gaussian fit for velocity autocorrelation function and
. . . . .
. . . . .
histogram, respectively.

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.

3.2.5. Plot menu


3.2. Menus
User can change the view of the plotting area switching be-
tween simple, log–log, semilogx and semilogy. There are options for
3.2.1. File menu
showing errors and grids both major and minor on the plot. Us-
User can load raw data, open and save its projects and figures
ing Edit Axes options, the figure is shown in the new window with
and also export axis data or print it using this menu.
many extra plot tools such as colors, labels, thicknesses, markers
and etc. User can also clear the axes area using this menu.
3.2.2. Diffusion menu
Time, Ensemble, Time-Ensemble Average – Each of these sub-
3.2.6. Help menu
menus calculates diffusion coefficient using the associated method.
Product Help – A user manual for this package in pdf format.
These methods are explained completely in Section 2. MSD versus
About – About the version of this product and a collaboration
time, with a linear fit will be shown in the figure panel. The value
team which produce the software.
of the coefficients are written in Results panel.
Anomaly – To calculate non-linearity dependence of diffusion User can save all calculated quantities as a mat file. All calcu-
on time, user should use this sub-menu. Before that user should lated data is loaded any time user opens its saved project. As diffu-
408 M.A. Charsooghi et al. / Computer Physics Communications 182 (2011) 400–408

sion parameters are important parts of this program, we mention Acknowledgements


them separately. The value of diffusion, its error and its intercept,
velocity and its error and the evolution of MSD can be saved. In We are grateful to Farshid Mohammad-Rafiee, Sarah Moham-
the case of calculation of diffusion coefficients using time average madinejad, Laleh Mollazadeh and Faegheh Hajizadeh for helpful
method, beside the parameters of final case, parameters for each discussions.
trajectory are also available and can be saved. These situations are
established for both lab and body frame. Appendix A. Supplementary material
For more information about using the program, user can refer
to the user manual which is available with the program. Supplementary material related to this article can be found on-
line at doi:10.1016/j.cpc.2010.09.017.
4. Program features
References
In the following some useful features of the program are high-
[1] F.C. MacKintosh, C.F. Schmidt, Current Opinion Colloid Interface Sci. 4 (1999)
lighted 300.
[2] C. Tischer, et al., Appl. Phys. Lett. 79 (2001) 3878.
• The program can call all data files recorded in txt, dat, and [3] S. Jeney, E.H.K. Stelzer, H. Grubmüller, E.-L. Florin, Chem. Phys. Chem. 5 (2004)
1150.
ascii formats. The program also benefits from a user friendly
[4] A. Einstein, Ann. Phys. 14 (2005) 182.
menu bar and sub-menus to manipulate different program [5] E.J. Hinch, J. Fluid Mech. Digital Archive 72 (1975) 499.
windows. [6] A. Rahman, Phys. Rev. 136 (1964) A405.
• Since sometimes specially in the simulation processes, a large [7] K. Ohbayashi, T. Kohno, H. Utiyama, Phys. Rev. A 27 (1983) 2632.
[8] D.A. Weitz, D.J. Pine, P.N. Pusey, R.J.A. Tough, Phys. Rev. Lett. 63 (1989) 1747.
amount of data are generated, to optimize memory usage
[9] Y.W. Kim, J.E. Matta, Phys. Rev. Lett. 31 (1973) 208.
and prevent any out of memory error, the program saves all [10] A. Meller, et al., Biophysical Journal 74 (1998) 1541.
variable values on hard disk. For large amount of data (few [11] E.J.G. Peterman, M.A. van Dijk, L.C. Kapitein, C.F. Schmidt, Rev. Scientific Instru-
hundred mega bytes), calculations take long time and user ments 74 (2003) 3246.
should be patient. [12] B.J. Berne, R. Pecora, Dynamic Light Scattering: With Applications to Chemistry,
Biology, and Physics, Dover Publications, 2000.
• It’s a graphical user interface (GUI) program, so helps user
[13] S. Roldán-Vargas, et al., Phys. Rev. E 80 (2009) 021403.
to have everything in its hands. This prevents producing too [14] A. Mertelj, L. Cmok, M. Čopič, Phys. Rev. E 79 (2009) 041402.
many output figures as the results of different calculations [15] P. Holmqvist, G. Nägele, Phys. Rev. Lett. 104 (2010) 058301.
on the loaded data. To observe different outputs it is just [16] E. Andablo-Reyes, P. Díaz-Leyva, J.L. Arauz-Lara, Phys. Rev. Lett. 94 (2005)
106001.
enough to switch to different applications on the menu bar
[17] J.S. Higgins, H.C. Benoît, Polymers and Neutron Scattering, Oxford Series on
like “Trajectory” for plotting the displacement in x, y or z Neutron Scattering in Condensed Matter, vol. 8, Oxford University Press, USA,
direction versus time or “MSD” to find the mean square dis- 1997.
placement in x, y or z directions. [18] T. Spehr, et al., Phys. Rev. E 79 (2009) 031404.
• Whole of a project can be saved so user can save all calculated [19] E. Mamontov, Y.A. Kumzerov, S.B. Vakhrushev, Phys. Rev. E 72 (2005) 051502.
[20] K. Bacia, P. Schwille, Methods 29 (2003) 74.
parameters and also the next time when the project is opened [21] H. Geerts, et al., Biophysical Journal 52 (1987) 775.
again, user will have access to all the data and results, which [22] M.J. Saxton, K. Jacobson, Annual Rev. Biophys. Biomolecular Struct. 26 (1997)
calculated in last session. 373.
• In the first running user should determine the physical quan- [23] A. Kusumi, et al., Annual Rev. Biophys. Biomolecular Struct. 34 (2005) 351.
[24] M. Dahan, et al., Science 302 (2003) 442.
tity of each column of data, but after that the program will
[25] P.G. Saffman, M. Delbrück, Proc. Nat. Acad. Sci. USA 72 (1975) 3111.
memorize until structural changes appear in data files. Pro- [26] Y. Gambin, et al., Proc. Nat. Acad. Sci. USA 103 (2006) 2098.
gram consider user’s first choices as defaults but user can [27] A.J. Levine, T.B. Liverpool, F.C. MacKintosh, Phys. Rev. E 69 (2004) 021503.
changes them in any run. [28] F. Perrin, J. Phys. Radium 5 (1934) 497.
[29] F. Perrin, J. Phys. Radium 7 (1936) 1.
• A report of the output results and a log file in a txt format also
[30] G. Li, J.X. Tang, Phys. Rev. E 69 (2004) 061921.
are available. User can take a report and also log file of his/her [31] P. Nelson, Biological Physics: Energy, Information, Life, W.H. Freeman, 2003.
activities in the program. Also user can save, clean and upload [32] A. Caspi, R. Granek, M. Elbaum, Phys. Rev. E 66 (2002) 011916.
them. [33] M. Weiss, M. Elsner, F. Kartberg, T. Nilsson, Biophysical Journal 87 (2004) 3518.
• This program is not only applicable for diffusion of colloids [34] J. Bouchaud, Phys. Reports 195 (1990) 127.
[35] R. Zwanzig, Annual Rev. Phys. Chem. 16 (1965) 67.
or microorganisms in fluids, but also it can analyse any kind [36] S. Chandrasekhar, Rev. Modern Phys. 15 (1943) 1.
of data of diffusion processes obtained from experiments or [37] Y. Han, et al., Science 314 (2006) 626.
computer simulations. [38] J.G. de la Torre, V.A. Bloomfield, Quart. Rev. Biophys. 14 (1981) 81.

You might also like