M10 Angular momentum is conserved or not: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<H1 ALIGN="CENTER"><FONT SIZE="-1">Manual 10 for MD++ </FONT>
<H1 ALIGN="CENTER"><FONT SIZE="-1">Manual 11 for MD++ </FONT>
<BR>
<BR>
Angular momentum is conserved or not?</H1>
Angular momentum is conserved or not?</H1>
Line 10: Line 10:
<BR><HR>
<BR><HR>


In molecular dynamics simulations, positions and velocities of atoms are updated following Newton's equations of motion. Naturally, we would expect that linear and angular momenta (of an isolated system such as NVE ensemble) are conserved during the time integration, or
In molecular dynamics simulations, positions and velocities of atoms are updated following Newton's equations of motion. Naturally, we would expect that linear and angular momenta are conserved during the time integration for an isloated system such as a system of NVE ensemble, because there is no external force.


{|border="0" align="center"
{|border="0" align="center"
Line 16: Line 16:
|}
|}


where '''P''' is linear momentum and '''L''' is angular mumentum. Usually, we subtract ceter-of-mass velocity nofrom the velocity of each atom so that the whole system can not drift and the linear momentume becomes zero.
where '''P''' is linear momentum and '''L''' is angular mumentum. Usually, we subtract ceter-of-mass velocity from the velocity of each atom so that the whole system can not drift and the linear momentume becomes zero.


{|border="0" align="center"
{|border="0" align="center"

Revision as of 06:24, 9 July 2009

Manual 11 for MD++
Angular momentum is conserved or not?

Keonwook Kang, Seunghwa Ryu and Wei Cai

Jul 06 , 2009



In molecular dynamics simulations, positions and velocities of atoms are updated following Newton's equations of motion. Naturally, we would expect that linear and angular momenta are conserved during the time integration for an isloated system such as a system of NVE ensemble, because there is no external force.

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{rcl} \mathbf{P} & \equiv & \sum_i m_i\mathbf{v}_ i = \mathrm{Const.} \\ \mathbf{L} & \equiv & \sum_i \mathbf{r}_i \times m_i\mathbf{v}_i = \mathrm{Const.} \end{array}, }

where P is linear momentum and L is angular mumentum. Usually, we subtract ceter-of-mass velocity from the velocity of each atom so that the whole system can not drift and the linear momentume becomes zero.

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{rcl} \mathbf{v}_i & := & \mathbf{v}_ i - \mathbf{v}_{\mathrm{CM}} \\ \mathbf{P} & = & \sum_i m_i\mathbf{v}_i - \mathbf{v}_{\mathrm{CM}}\sum_i m_i= 0 \end{array}, }

where vCM is defined as

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{v}_{\mathrm{CM}} \equiv \frac{\sum_i m_i \mathbf{v}_i}{\sum_i m_i} } .

Similarly, we can additionaly subtract velocity component contributing rotation so that the whole system can not rotate and the angular momentum becomes zero as

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{v}_i := \mathbf{v}_i - \mathbf{\Omega}\times\mathbf{r}_i } .

The angular velocity Ω is obtained from

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{\Omega} \equiv \mathbf{I}^{-1} \mathbf{L} }

and moment-of-inertia matrix I is expressed as

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{I} \equiv \sum_i m_i(\mathbf{E}_3|\mathbf{r}_i|^2 - \mathbf{r}_i\otimes\mathbf{r}_i)} ,

where E3 is a 3 by 3 identity matrix.



Let's see whether MD simulation results conserve both linear and angular momenta. For the test simulation, a diamomd cubic structure of 216 silicon atoms are equilbriated under periodic boundary conditions for 10,000 steps using NVE ensemble.

Figure 1
Init N216 PBC.jpg Linearmom.jpg Angmom.jpg
(a) (b) (c)

The linear momentum is conserved within the machine precision in figure 1(b), while the angular momentum is not as shown in figure 1(c). According to Allen and Tildesley[1], the reason is told as

If the system is invariant to rotation about an axis, then the corresponding angular momentum component is conserved. ... In the case of the periodic boundary conditions, ... none of them were spherically symmetrical; in fact it is impossible (in Euclidean space) to construct a spherically symmetric periodic system. Hence, ... total angular momentum is not conserved in most molecular dynamics simulations.

Basically, what it says is that in most MD simulations angular momentum is no longer conserved if periodic boudary conditions are used and atoms move across the simulation cell boundary.

Let's check the above statement via another test simulation, where a Si cluster of 216 atoms are equilbrated with the same initial velocity. In this simulation, the simulation box has margin surrounding the Si cluster such that the cluster no longer sees its periodic images.

Figure 2
Init noPBC.jpg Linearmom noPBC.jpg Angmom noPBC.jpg
(a) (b) (c)

In figure 2(b) and 2(c), we can see that linear and angular momenta are conserved within the machine precision in this test simulation.



Since the angular momentum is not conserved in MD simulations under periodic boundary conditions, it is usually unnecessary to make angular momentum be zero when the velocities of atoms are initialized. However, when we perform simulations of nanowires or rods, it is desirable to prevent the rotation around wire axis. For example, if a nanowire is aligned along the z-direction, we want to let the z-component of angular momentum be zero, or Lz = 0.

In MD++ there is a variable zerorot, depending on whose value components of the angular momentum can be selletively zero. If zerorot = "x", x-component of angular momentum will be zero. If zerorot = "all", all three components of the angular momentum will be zero. The default value of zerorot is "none". The other possible values are "y" and "z".

In the next test simulation, a Si NW is aligned along the z-direction and we expect Lz = 0.

Figure 3
Init nw.jpg Linearmom nw.jpg Angmom nw.jpg
(a) (b) (c)

In figure 3(b) and 3(c), we can see that all three components of linear momentum and z-component of angular momentum are conserved during equilibriation.

MD++ script for this simulation is given below.

# -*-shell-script-*-
# Check linear momentum and angular momentum conservation 

#*******************************************
# Definition of procedures
#*******************************************
proc initmd { n } {
#MD++ setnolog
MD++ setoverwrite
MD++ dirname = "runs/si-test-$n"
MD++ NNM = 300
}
#end of proc initmd

proc create_crystal { N } {
#--------------------------------------------
# Create Perfect Lattice Configuration
#
MD++ latticestructure = diamond-cubic
MD++ latticeconst = 5.431 #(A) for Si
MD++ latticesize  = \[ 1 0 0  $N \
                       0 1 0  $N \
                       0 0 1  $N \]
MD++ makecrystal finalcnfile = perf.cn writecn
}

#--------------------------------------------
proc setup_md { } { MD++ {
equilsteps = 0  timestep = 0.001 # (ps)
atommass = 28.0855 # (g/mol) Si
DOUBLE_T = 0  equilsteps = 0
saveprop = 1 savepropfreq = 10 openpropfile #run
savecn = 0 savecnfreq = 10000
plotfreq = 20
vt2 = 2e28  #1e28 2e28 5e28
wallmass = 2e3     # atommass * NP = 14380
boxdamp = 1e-3     # optimal damping for 216 atoms and wallmass 1e-3
randseed = 12345 srand48
#MD++  srand48bytime
saveH # Use current H as reference (H0), needed for specifying stress
fixboxvec  = [ 0 1 1
               1 0 1
               1 1 0 ]
stress = [ 0 0 0
           0 0 0
           0 0 0 ]
output_fmt = "curstep EPOT Tinst VIRIAL(0) VIRIAL(4) DVIRIALDexx(0) DVIRIALDexx(4)"
writeall = 1
} }

#*******************************************
# Main program starts here
#*******************************************
set T 300
initmd NW
create_crystal 5
MD++ input = \[ 3 2 0 0 5 0 \] makecylinder

MD++ input = \[1 1 1\] changeH_keepR
MD++ input = \[2 2 1\] changeH_keepR

setup_md
MD++ totalsteps = 10000
MD++ T_OBJ = $T DOUBLE_T = 1 timestep = 0.001

MD++ initvelocity_type = "Gaussian" zerorot = "z" initvelocity
MD++ finalcnfile = init.cn writecn
MD++ finalcnfile = init.cfg writeatomeyecfg
  
MD++ ensemble_type = "NVE" integrator_type = "VVerlet"
MD++ {output_fmt = "curstep EPOT KATOM Tinst HELMP \
              TSTRESSinMPa_xx TSTRESSinMPa_yy TSTRESSinMPa_zz \
              TSTRESSinMPa_xy TSTRESSinMPa_xz TSTRESSinMPa_yz \
              H_11 H_22 H_33 H_12 H_13 H_21 H_23 H_31 H_32 \
              [MD++_Get P_com(0)] [MD++_Get P_com(1)] [MD++_Get P_com(2)] \
              [MD++_Get L_com(0)] [MD++_Get L_com(1)] [MD++_Get L_com(2)]" }
MD++ run

MD++ finalcnfile = equil.cn writecn
MD++ finalcnfile = equil.cfg writeatomeyecfg
MD++ quit

The MD++ variable zerorot can be used with the MD++ command initvelocity as shown above. Or it can be used with another command zerorotation. Internally, initvelocity calls the function zero_rotation() depending on the value of zerorot.



Upto here we have considered MD simulations of NVE ensemble. People might wonder whether the linear and the angular momenta will be conserved in case of canonical or NVT ensemble. In MD++, Nosé-Hoover thermostat is used for NVT ensemble. Nosé's Hamiltonian is expressed in time scaling variable s as

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathcal{H} = \frac{1}{2} \sum_i \frac{|\mathbf{p}_i|^2}{m_i s^2} + U(\{\mathbf{r}_i\}) + \frac{p_s^2}{2Q} + \frac{g\ln s}{\beta}} ,

where ri and pi are scaled coordinate and momentum of atoms. And they are related with real coordinate riFailed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle '} and momenutm piFailed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle '} as

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{rcl} \mathbf{r}_i & = & \mathbf{r}'_ i \\ \mathbf{p}_i & = & s\mathbf{p}'_i \end{array}} .

The real time step Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \Delta t'} are related with the scaled time step Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \Delta t} as

.

Q is thermal mass, g is number of degree of freedom, and ps is the conjugate momentum of s. Then, the time derivative of the linear and the angular momenta in real coordinate and momentum can be expressed as

.

The 1st terms on the right hand side are zeros, since the linear and the angular momentum are conserved in scaled formulation. However, s is varing as a function of time and . Thus the linear and angular momenta in real varaiable formulation would not be constant in time, unless the following is satisfied.

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{rcl} \sum_i\mathbf{p}_i & = & 0 \\ \sum_i \mathbf{r}_i \times \mathbf{p}_i & = & 0 \end{array}} .

In other words, only if the linear and angular momenta are intially zeros, those quantites are conserved in NVT ensemble. Besides, it is known that Nosé thermostat will generate the trajectory of canonical ensemble if the total momentum is zero.[2]

Figure 4 shows the linear and the angular momenta as functions of integration step in MD simulation of NVT ensemble when both linear and angular momenta are initially set to be zeros. You can see that both momenta are conserved.

Figure 4
Init noPBC.jpg Linearmom NVT.jpg Angmom NVT.jpg
(a) (b) (c)

On the other hand, figure 5(c) shows how the angular momentum behaves in NVT ensemble simulation when it is not zero initially.

Figure 5
Init noPBC.jpg Linearmom NVT2.jpg Angmom NVT2.jpg
(a) (b) (c)

According to figure 5(c), angular momentum exponentially decays in the early time and fluctuates around some constant value later. The equations of motion of Nosé-Hoover thermostat are given as

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{rcl} \frac{d \mathbf{p}'_i}{dt'} &=& - \frac{\partial U(\left\{ \mathbf{r}'_i \right\})}{\partial \mathbf{r}'_i} - \zeta \mathbf{p}'_i \\ \frac{d \mathbf{r}'_i}{dt'} &=& \frac{\mathbf{p}'_i}{m_i} \\ \dot{\zeta}' &=& \frac{gk_B}{Q} \left( T - T_\mathsf{obj} \right) \end{array}} .

From the 1st equation, we can get

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathbf{r}'_i \times \frac{d \mathbf{p}'_i}{dt'} = - \mathbf{r}'_i \times \frac{\partial U}{\partial \mathbf{r}'_i} - \zeta \mathbf{r}'_i \times \mathbf{p}'_i } .

Rearranging time derivative term gives

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \frac{d}{dt'} \left(\mathbf{r}'_i \times \mathbf{p}'_i\right) - \frac{d\mathbf{r}'_i} {dt'} \times \mathbf{p}'_i= - \mathbf{r}'_i \times \frac{\partial U}{\partial \mathbf{r}'_i} - \zeta \mathbf{r}'_i \times \mathbf{p}'_i } .

By substituting the 2nd equation for the 2nd term in the left hand side, the above equation becomes

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \frac{d}{dt'} \left(\mathbf{r}'_i \times \mathbf{p}'_i\right) - \frac{\mathbf{p}'_i} {m_i} \times \mathbf{p}'_i= - \mathbf{r}'_i \times \frac{\partial U}{\partial \mathbf{r}'_i} - \zeta \mathbf{r}'_i \times \mathbf{p}'_i } ,

and the 2nd term in the left hand side becomes zero. If we take summation over i of remaining terms, we get

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \sum_i \frac{d}{dt'} \left(\mathbf{r}'_i \times \mathbf{p}'_i\right) = - \sum_i \mathbf{r}'_i \times \frac{\partial U}{\partial \mathbf{r}'_i} - \zeta \sum_i \mathbf{r}'_i \times \mathbf{p}'_i }

Since the 1st term in the right-hand side is the summation of the internal torque, it is zero. Finally, the equation for the angular momentum becomes

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \frac{d}{dt'} \mathbf{L}' = - \zeta \mathbf{L}'} .

This relation explains the exponential behavior at the early time. Later, when the system reaches equilibrium state, temperature will fluctuate around the objective temperature and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle d\zeta/dt'} keeps changing its sign to compensate the difference, T-TOBJ. Thus, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \zeta} will fluctuate around zero in the long run and that explains the flat region of angular momentum curve. Linear momentum would show similiar behavior if its initial value is not zero.

Notes

  1. M. P. Allen and D. J. Tildesley, Computer Simulations of Liquids, Oxford Science Publications (2004) pp.72-73
  2. T. Çagin and J. R. Ray, Isothermal molecular-dynamics ensembles, Phys. Rev. A. (1988) 37 pp. 4510--4513