We have prepared an input file free.in
to perform an unconstrained molecular dynamics of $\text{NaCl}$ dissolved in water.
When collecting statistics by successive MD runs, one often wants initial conditions to be random in order for the runs to be statistically independent. At the same time, it is often desirable for MD simulations to be exactly reproducible.
This is, where pseudorandom number generators (PRNGs) come in. A PRNG produces a sequence of numbers that seems random (sampling e.g. the normal distribution), but is in fact completely determined by the so-called seed given to the PRNG. Given the same seed, the PRNG produces exactly the same sequence of numbers.
Here, we use a pseudorandom number generator to initialize the velocities of the atoms. The velocities are drawn from the Boltzmann statistics, ensuring that the corresponding kinetic energy corresponds to the desired temperature.
SEED
values for the PRNG. Note: You may want to run the simulations in different directories to avoid overwriting files. We have already provided results for the seeds 2,4,6,7,8,9,12,13,15,17, each spanning 100 ps.pbc set { lx ly lz } -all # define simulation box lx*ly*lz # center the box around Na and wrap all atoms into the box pbc wrap -centersel "element Na" -center com -all
You may use the dynamic bonds representation to recompute the bonds after the wrapping procedure. Use a different representation for NaCl.
Hint: In order to save time with the next trajectory, save the visualization state and reuse it. The pbc commands are not save into the visualization state file, but you can edit the file with a text editor and append them at the end.
Next, we are going to constrain the Na-Cl distance in the MD simulation to a value of X.Y $\unicode{x212B}$, where X.Y ranges from 2.5 to 7.0. We have already performed the MD simulations and computed the radial distribution functions.
gofr_A_B_X.Y
or the joined files gofr_A_B
(here, use splot
)../integrate.py --N=<Natoms> --L=<BoxLength> < gofr_A_B-X.Y > nc_A_B-X.y
where <Natoms>
is the number of B
atoms per cell and <BoxLength>
the length of the simulation box in $\unicode{x212B}$.