Author Topic: MSD calculation  (Read 803 times)

Junran Lu

  • Newbie
  • *
  • Posts: 20
    • View Profile
MSD calculation
« on: April 21, 2018, 02:35:08 AM »
Hi Professor David:

In the diffusion modeling for single component (such as N2), there are four .dat file generated, namely, msd_self_N2_0.dat, msd_self_total_0.dat, msd_onsager_N2_0_N2_0.dat and msd_onsager_total.dat. And I want to calculate the diffusion coefficient of N2, which one .dat file could be used?
Moreover, for multiple components, if I want calculate the diffusion coefficient for each one, should I use the corresponding msd_self_total_0/1/2.dat ?

Thanks very much!
Best wishes!

David Dubbeldam

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: MSD calculation
« Reply #1 on: April 25, 2018, 04:55:49 PM »
The files with 'self' are self-diffusion, the 'total' file is self-diffusion of the total fluid (so independent of the component type). So for a single component run the output for the component and the total is the same. For a multi-component mixture they differ. The files with 'onsager' in the name contain mixture Onsager coefficients.
Note the files contains in the columns:
1: correlation time in picoseconds.
2: MSD averaged over x,y,z (number of dimensions = 3).
3: MSD in the x-direction  (number of dimensions = 1).
4: MSD in the y-direction (number of dimensions = 1).
5: MSD in the z-direction (number of dimensions = 1).
6: number the times this point has been computed.

The source for this is `src/sample.c'.
« Last Edit: April 25, 2018, 05:14:23 PM by David Dubbeldam »

Junran Lu

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: MSD calculation
« Reply #2 on: April 26, 2018, 07:20:30 AM »
Professor David , Thank you very much! :)

Junran Lu

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: MSD calculation
« Reply #3 on: May 02, 2018, 09:46:12 AM »
Dear Professor David:

In the resulting file of MSD calculation, the printed time-interval increased with different period in the msd_*.dat file. Such as the first 25 printed time with  internal of 0.0005 Ps, and the next 24 printed time with  internal of 0.0125 Ps, and more, the next following 24 printed time with internal of 0.3125 Ps .......7.8125 Ps,195.312 Ps, and the final 8 printed time with  internal of 4882.81 Ps. And there are any settings to keep the interval as a constant?
Besides, the total printed time (43945.3 Ps) is not equal to the time step (0.0005 Ps) multiplied the NumberOfCycles (100000000). The following is the input file of on the MSD calculation. And more, is there any restrictions on the NumberOfInitializationCylces and NumberOfEquilibrationCycles when setting?

#########################################
Simulationtype                MolecularDynamics
NumberOfCycles              100000000
NumberOfInitializationCylces 500000
NumberOfEquilibrationCycles 10000
PrintEvery                            10000
RestartFile                            No

Ensemble                             NVT
Forcefield                             local
Cutoff                                  12.0
Timestep                              0.0005

Framework                           0
FrameworkName                   ZIF-8
Unitcell                                2 2 4
RemoveAtomNumberCodeFromLabel yes

ExternalTemperature           298.0
ComputeMSD                     yes
PrintMSDEvery                    10000

Component   MoleculeName   N2
                   StarteingBead   0
                   MoleculeDefinition  TraPPE
                   TranslationProbability  1.0
                   RotationProbability  1.0
                   ReinsertionProbability  1.0
                   CreatNumberOfMolecules 5
#########################################

Looking forward to your reply!
Best wishes!
« Last Edit: May 02, 2018, 09:49:41 AM by Junran Lu »

David Dubbeldam

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: MSD calculation
« Reply #4 on: May 23, 2018, 09:39:03 AM »
See the manual for these options.

'ComputeMSDConventional'  for conventional MSD, and 'ComputeMSD' for order-n MSD (works in log-scale).

Correlation times are usually much smaller than total simulation time, because you need to average a lot to get good statistics. You could only have one measurement of a correlation time equal to your simulation length and that point would be useless.
« Last Edit: May 26, 2018, 07:02:51 PM by David Dubbeldam »

Junran Lu

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: MSD calculation
« Reply #5 on: May 29, 2018, 10:06:19 AM »
Professor David, Thanks very much! I will have a try following your advice!