In order to solve the eqs.(1) computationally they have to be discretized. Resolving the finite difference equations allows their implementation into the code. Holian gave explicit formulations for the Verlet algorithm [10] which translate to code as follows.
! x0,x1,x2 = positions and time derivatives in scaled units real*8,dimension(3*NPMAX) :: x0,x1,x2 ! f = forces real*8,dimension(3*NPMAX) :: f ! xi = friction coefficient real*8 :: xi ! trans = kinetic energy in units of kB real*8 :: trans x2(i) = x2(i) - f(i)*x1(i) x0(i) = two*x0(i) - x0old(i) + x2(i) transavg = half*(trans+transold) transold = trans dK = two/(three*temp)*transavg - one xi(i) = xi(i) + four*dK*deltat_fs/Q
In fig. 1 the temperature as a function of time as obtained in the MD simulation is shown. The cubic simulation box with side length 36.15Åcontained 2000 Cu atoms arranged on an fcc lattice. The initial velocities were set according to the Maxwell-Boltzmann distribution at temperature 600K.
|
Nosé has also given an expression for the period of oscillation
depending on the choice of :
Another way to check if the thermostat operates correctly is to
compute the heat capacity from the energy fluctuations