资源预览内容
第1页 / 共28页
第2页 / 共28页
第3页 / 共28页
第4页 / 共28页
第5页 / 共28页
第6页 / 共28页
第7页 / 共28页
第8页 / 共28页
第9页 / 共28页
第10页 / 共28页
亲,该文档总共28页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
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, molecules 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 octahedronRhombic 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 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 moved, 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 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 machines, 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 FORTRAN 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(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 code 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 inhomongeneous 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 prohibitive 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 zone 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 this 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 in 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 constraints 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 thermodynamic 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, 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 functions 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 averageBoltzmann 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 time 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 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, 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 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 can 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
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号