2 Molecular and Stochastic Dynamics
Total Page:16
File Type:pdf, Size:1020Kb
2 Molecular and stochastic dynamics In this chapter we discuss the most commonly used ensembles in molecular simulations and the different equations of motion that can be used to generate each ensemble. For generating a canonical ensemble one can use stochastic dynamics with or without inertia. The temperature in a simulation can also be maintained by coupling to a heat bath. We compare the different methods for generating constant temperature trajectories using several test systems. 7 2 Molecular and stochastic dynamics 2.1 Equations of motion We will briefly introduce two ways to describe classical dynamics. For a more thorough treatment see Goldstein [7] or Landau and Lifshitz [8]. Lagrangian dynamics Classical dynamics can be described in the most general way with the Lagrangian ap- ´Øµ proach. The equations of motion are expressed using generalized coordinates Õ . These coordinates do not have to be coordinates in the usual sense, which span a high dimensional space, like Cartesian coordinates, they should be seen as ’just’ variables. Î Ä Given the kinetic energy à and the potential energy , the Lagrangian of the system is defined as: ´Õ ´Øµ մصص Ã Î Ä (2.1) մص where is the derivative of Õ with respect to time: ´Øµ dÕ ´Øµ Õ (2.2) dØ Õ Ø The kinetic and potential can both be a function of Õ , and explicitly. Lagrange’s equations of motion are: Ä d Ä ¼ ½Æ (2.3) Ø Õ Õ d The elegance of this formulation is that it is completely independent of the choice of co- ordinates Õ. This is convenient when the potential energy is known in some appropriate Ü coordinate system. For Cartesian coordinates Õ , with the kinetic energy given by: Ñ ¾ à ´Ü µ ´Ü µ (2.4) ¾ and a potential energy which only depends on the coordinates, Lagrange equations of motion reduce to Newton’s equations of motion: ¾ Ü d Ñ (2.5) ¾ dØ where the forces are defined as minus the gradient of the potential: Î ´Õµ (2.6) Ü The Lagrange formulation is most useful for solving the equations of motion, but for statistical mechanics the Hamiltonian formulation is more convenient. 8 2.1 Equations of motion Hamiltonian dynamics The main conceptual difference between the Lagrangian and the Hamiltonian formu- Õ lation is that in the latter the generalized velocities are replaced by the generalized Ô momenta : Ä Ô (2.7) Õ The generalized momenta are said to be conjugate to the generalized coordinates. The Hamiltonian À is a function of the generalized momenta and coordinates and it can depend on time explicitly: À ´Ô´Øµ մصص Ô Õ Ä´Õ´Øµ մصص (2.8) The equations of motion can be derived from this definition [7]: À Õ (2.9) Ô À Ô (2.10) Õ À Ä (2.11) Ø Ø Equations (2.9) and (2.10) are called the canonical equations of Hamilton. If the generalized coordinates can be expressed as a function of Cartesian coordi- nates, the kinetic energy will be a quadratic function of the generalized velocities, with coefficients which depend on the generalized coordinates, but not explicitly on time: ½ à ´Õµ Õ Õ (2.12) ¾ Ü Ü Ñ (2.13) Õ Õ When the potential is not a function of the generalized velocities, the momenta are given by: Ä Ã ´Õµ Õ Ô (2.14) Õ Õ Using (2.8) it can be shown that under these conditions the Hamiltonian is equal to the total energy: à · Î À (2.15) From (2.11) we can see that when the potential does not depend explicitly on time the total energy is conserved. Such systems are called conservative. 9 2 Molecular and stochastic dynamics 2.2 Molecular dynamics In molecular dynamics (MD) the classical equations of motion are solved in time for a set of atoms. The interactions between the atoms, which are in principle given by the Schr¨odinger equation, are approximated by mainly pairwise potentials. Some bonded interactions, like angles and dihedrals, involve more-body terms. The accuracy of a molecular dynamics simulation is mainly determined by the quality of the inter-atomic potentials, which together are called the forcefield. Simulations which include solvent are almost always performed in Cartesian co- ordinates. When no constraints are present, the system obeys Newton’s equations of motion. When one or more inter-atomic distances are constrained one can remove these coordinates and use generalized coordinates, as described for Hamilton’s equation of motion. For analytical derivations this can be useful. But when simulating the system on a computer it is often more convenient to simulate in Cartesian space and correct the distances between the constrained particles using a constraint algorithm like SHAKE [9] or LINCS [10]. A simulation of a single molecule with fixed bond lengths and bond angles might be performed more efficiently in so called internal coordinates, which are usually dihedral angles. 2.3 Ensembles used in MD Pure conservative Hamiltonian simulations of many-particle systems yield equilibrium Ô Õµ distributions in ´ space (called phase space) with constant energy. By proper mod- ification of the equations of motion, other ensembles can be generated. There are four ensembles which are commonly used in molecular simulations. These ensembles are in- dicated by the three thermodynamic quantities which are kept constant. The ensembles ÆÎ Ì are: the constant-ÆÎ or microcanonical ensemble, the constant- or canonical Î Ì ensemble, the constant-ÆÈ Ì or isothermal-isobaric ensemble and the constant- or grand canonical ensemble. Another possible ensemble is the constant-È Ì ensemble. When MD is performed using Newton’s equations of motion, the total energy is con- served, assuming we integrate accurately with a stable integration scheme. This results in a microcanonical ensemble. When we want to obtain a different ensemble, the equations of motion need to be modified. A way of doing this is the extended system approach. To obtain a canonical ensemble, the temperature can be added as a generalized coordinate to the Lagrangian. This approach is called the Nos´e-Hoover scheme, or coupling with the Nos´e-Hoover thermostat [11]. Although a canonical ensemble is obtained, the tem- perature will oscillate around the average, where the period of the oscillations depends on the effective “mass” associated with the temperature coordinate in the Lagrangian. This can result in unwanted kinetic effects. A method which leaves the fast kinetics unaffected is weak coupling to a bath, also called the Berendsen thermostat [12]. The 10 2.4 Monte Carlo weak coupling is achieved with a first other differential equation for the temperature. This causes any deviations from the reference temperature to decay exponentially. The main disadvantage of the Berendsen thermostat is that it is unknown if it generates an ensemble. Any temperature coupling method will affect the long-term velocity correla- tions in the system. For the Berendsen thermostat a large part of these correlations can be retrieved after performing the simulation [13]. Methods for keeping the pressure constant in an MD simulation are analogous to the temperature coupling method. The volume of the periodic unit-cell, or all three vectors of the unit-cell can be added as an extra generalized coordinate in the Lagrangian. This method is called Parrinello-Rahman pressure coupling [14]. In combination with the Nos´e-Hoover thermostat this generates an isothermal-isobaric ensemble. Just like the Nos´e-Hoover thermostat, Parrinello-Rahman coupling gives oscillations of the unit-cell vectors. Berendsen coupling can also be used for the pressure. Again, this has the advantage that the fast kinetics are unaffected and the disadvantage that it is unknown if an ensemble is generated. 2.4 Monte Carlo When one is not interested in the dynamics Monte Carlo simulations can be used to gen- erate a canonical ensemble. The most simple algorithm is Metropolis Monte Carlo [15]. Ò ¼ Ö Starting from a configuration Ö a trial move is generated by giving one or more par- Ò·½ ¼ Ö ticles a random displacement. The trial move is accepted, Ö , with probability: ½ Ò·½ Ò ½ ÜÔ Î Ö Î ´Ö µ ÑÒ (2.16) Ì Ò·½ Ò Ö If the trial move is not accepted then Ö . It is essential that the random displace- ment should not introduce a bias into the sampling. For some types of biases it is pos- sible apply a correction to the probability 2.16, an example is given in section 2.7. The efficiency of the algorithm depends on the choice of the random displacement. When the displacement is very small almost every move will be accepted, but it will take a large number of moves to cover the whole available phase space. When the displace- ment is very large the acceptance ratio is very small. One can also think of complicated non-Cartesian moves. For instance, (combined) dihedral moves, which are especially efficient for proteins. An advantage of Monte Carlo over MD is that only the energy needs to be calculated, not the forces. For small systems Monte Carlo is more efficient in sampling than MD. But for large systems, such as proteins in explicit solvent, Monte Carlo is less efficient, since there will be large, collective motions present. 11 2 Molecular and stochastic dynamics 2.5 Langevin dynamics Another method to obtain a canonical ensemble is Langevin dynamics (LD). In LD a frictional force, proportional to the velocity, is added to the conservative force. The friction removes kinetic energy from the system. A random force adds kinetic energy to the system. To generate a canonical ensemble, the friction and random force have to obey the fluctuation-dissipation theorem [6].