《4、分子模拟的数学基础(课堂PPT)》由会员分享,可在线阅读,更多相关《4、分子模拟的数学基础(课堂PPT)(28页珍藏版)》请在金锄头文库上搜索。
1、1.9 Simulation Box and Its Boundary Conditions Computer simulations are usually performed on a small number of molecules, 10N10,000. The time taken for a double loop used to evaluate the forces and potential energy is proportional to N 2. Whether or not the cube is surrounded by a containing wall, m
2、olecules on the surface will experience quite different forces from molecules in the bulk. It is essential to propose proper methods to overcome the problem of surface effects.11.9.1 Simulation boxxyzCubeHexagonal prismxyzExample:DNA simulation21.9.1 Simulation box-continueTruncated octahedronRhombi
3、c dodecahedron31.9.2 Periodic boundary conditionBAHDGFEC4BAHDGFECIn a cubic box, the cutoff distance is set equal to L/2. Minimum image convention5AEA side view of the box(b) A top view of the boxBDCAEHFGSimulation of molecules in slit-like pore61.9.3 Computer code for periodic boundaries How do we
4、handle periodic boundaries and the minimum image convention in a simulation program? Let us assume, initially, the N molecules in the simulation lie with a cubic box of side BOXL, with the origin at its center, i.e., all coordinate lie in the range (-BOXL/2, BOXL/2). After the molecules have been mo
5、ved, we must test the position immediately using a FORTRAN IF statement.IF(RX(I).GT.BOXL2) RX(I)=RX(I)-BOXLIF(RX(I).LT.-BOXL2) RX(I)=RX(I)+BOXL7An alternative code for periodic boundaries An alternative to the IF statement is to use FORTRAN arithmetic functions:RX(I)=RX(I)-BOXL*ANINT(RX(I)/BOXL)The
6、function ANINT(X) returns the nearest integer to X, converting the results back to type REAL.For example, ANINT(-0.49)=0; ANINT(-0.55)=-1 The function ANINT(X) is different from AINT(X).AINT(X) returns the integral part of X. The use of IF statement inside the inner loop, particularly on pipeline ma
7、chines, is to be avoided.81.9.4 Computer code for minimum image conventionImmediately after calculating a pair separation vector, we apply the code similar to the periodic boundary adjustments.RXIJ=RXIJ-BOXL*ANINT(RXIJ/BOXL)RYIJ=RYIJ-BOXL*ANINT(RYIJ/BOXL)RZIJ=RZIJ-BOXL*ANINT(RZIJ/BOXL)If we use a FO
8、RTRAN variable RCUTSQ to represent the square of cutoff distance rc. After the above codes, the following statements would be employed:9RIJSQ=RXIJ*2+RYIJ*2+RZIJ*2 IF(RIJSQ.LT.RCUTSQ)THEN compute i-j interaction accumulate energy and force. ENDIFRIJSQ=RXIJ*2+RYIJ*2+RZIJ*2RIJSQI=1.0/RIJSQRIJSQI=CVMGP(
9、RIJSQI, 0.0, RCUTSQ-RIJSQ) compute I-j interaction .as a functions of RIJSQI. recommended10The function CVMGP(A,B,C) is a vector merge statement which returns to the value A if C is non-negative and the value B otherwise.For example: CVMGP(9, 0, 0)=9 CVMGP(9, 8, 2)=9 CVMGP(9, 8, -1)=8The computer co
10、de for other shapes of simulation boxes can be found in program F1.111.9.5 Non-periodic boundary methodsPeriodic boundary conditions are not always used in computer simulation. Why? Some systems, such as liquid droplets or van der Waals clusters, inherently contain a boundary. When simulating inhomo
11、ngeneous systems or systems that are not at equilibrium, periodic boundary conditions may cause difficulties. In the study of the structural and conformational behavior of macromolecules such as proteins and protein-ligand complexes, the use of periodic boundary conditions would require a prohibitiv
12、e number of atoms to be included in the simulation.12Example for non-periodic boundary conditions-study the active site of an enzyme Reaction zone: r R1. Containing atoms or group with the site of interest. Perform full simulation. Reservoir region: R1rR2, discarded or fixed.Division into reaction z
13、one and reservoir regions in a simulation13Chapter 2 Statistical MechanicsWhy talk about statistical mechanics? Computer simulation generates information at the microscopic level: atomic and molecular positions, velocities etc. It is the statistical mechanics that can be used as a tool to converse t
14、his very detailed information into macroscopic properties: pressure, internal energy etc.MicroscopicStatistical MechanicsMacroscopic142.1 Basic Statistical MechanicsLet us consider a system (microcanonical ensemble) containing N particles and their energy levels are 1, 2, If there are n1 particles i
15、n the energy level 1, n2 particles in 2 and so on, then there are W ways in which this distribution can be achieved:The most favorable distribution is the one with highest ways and this corresponds to configuration with just one particle in each energy level (W = N!). However, there are two constrai
16、nts on the system.and15Probability density and partition function From maximising the entropy of the system, we can derived the Boltzmann distribution which gives the number of particles ni in each energy level i asProbability density of the ensemblePartition function Q16Relation between thermodynam
17、ic potential and the molecular partition function Because the energy level depends on the position and momenta, we may writeProbability density: Partition function:Energy:172.2 Summary of various ensembles Micro-canonicalCanonical Isothermal-isobaricGrand canonicalFixed thermodynamicvariables E, V,
18、N N, V, T N, P, T , V, TSystemsisolatedclosedclosedopenedthermodynamic potential-S/kBF/kBTG/kBT-PV/kBTEach combination of 3N positions and 3N momenta defines a point in the 6N-dimensional phase space; an ensemble can thus be considered to be a collection of the points in phase space.18Partition func
19、tions for various ensembles Microcanonical ensemble: Canonical ensemble Isothermal-isobaric ensemble Grand ensemble192.3 Sampling from ensembles2.3.1 Time averages and ensemble averagesIn experiment, the instantaneous value of the propertyA can be written as , and true averagevalue isTime averageBol
20、tzmann and Gibbs developed statistical mechanics, in which a single system evolving in time is replaced by a large number of replications of the system that are considered simultaneously.Ensemble average20Ergodic hypothesisIn accordance with the ergodic hypothesis, ensemble average is equal to the t
21、ime average.MD SimulationMC SimulationEvery quantum state of a many-body system with energy E is equally likely to be occupied.-One of the axioms in statistical mechanics.212.3.2 Calculation of simple thermodynamic properties Internal energy Heat capacityMore accurate Derivation: w1.doc22Generalized
22、 equipartition principle Making the approximation that a classical description is adequate, we may write the Hamiltonian H of a system of N molecules asA set of coordinatesA set of momenta In the canonical ensemble, we can derive Above formulae are valid (to O(N-1) in any ensemble.As a special case,
23、 A=pk, or qk, we have23 TemperatureIn a canonical ensemble the total temperature is constant. In the microcanonical ensemble, however, the temperature will fluctuate. The temperatureis directly related to the kinetic energy of the system as follows:Total momentum of imassTheorem of the equipartition
24、 of energyDegrees of freedomNumber of constraints24 PressureLet qk in generalized equipartition principle be , thenSum upHere superscript tot represents the sum of inter-molecular forces and external forces:Interaction potentialExternal pressure,etc25Pressure and internal virialExternal pressure P c
25、an be considered as the effect of the container walls on the system if there is no other external potential, i.e.,External pressureVolume of the containerIf we define the internal virial W asTherefore, we can calculate pressure P by26How to calculate W ?We can write as the sum of forces on atom i due to atome jThe indices i and j are equivalentNewtons third law can be used to switch the force indicesHere the intermolecular pair virial function is:27若有不当之处,请指正,谢谢!28