Monte Carlo Method (3)
Monte Carlo Method (3)
Application of mr algorithm in statistical mechanics Canonical ensemble Distribution function p(r=exp(-e(rkT)/Q Q=drN exp(e(rn)/k Different states of the Markov chain In the application of metropolis algorithm to a simulation of molecular system, the states of the Markov chain correspond to different configurations of the molecular system
Application of MR2T2 algorithm in statistical mechanics Canonical ensemble: Distribution function: r(r N)=exp(- E(r N)/kT)/Q Q = dr N exp(-E(r N)/kT) Different states of the Markov chain: In the application of Metropolis algorithm to a simulation of molecular system, the states of the Markov chain correspond to different configurations of the molecular system
How to implement the Mr t algorithm for a molecular simulation? Configuration evolution in two steps. ) attempt move(pii 2)acceptation check (t /T;) Practical recipes for configuration evolution the position of a particle, either It is evolved by displacement of Start with an initial configuration ) chosen randomly or 2)in sequence(from 1 to N)
How to implement the MR2T2 algorithm for a molecular simulation? Configuration evolution in two steps: 1) attempt move (p* ij); 2) acceptation check (pj /pi ). Practical recipes for configuration evolution: Start with an initial configuration. It is evolved by displacement of the position of a particle, either 1) chosen randomly or 2) in sequence (from 1 to N)
Attempt move in practice RXINEW=RX(D+(2.0*RANFI-1)*DRMAX RYINEW=RY+(2.0*RANF2-I)*DRMAX RZINEW=RZ(+(2.0*RANF3-1)*DRMAX Important note The displacement must be centered at the old position,i.e xnew-Xold, ynew-yold, znew -zold are uniformly distributed in(-A, 4) (△= DRMAX) In this case,pi=1(2△)
Attempt move in practice: RXINEW=RX(I) + (2.0*RANF1-1)*DRMAX RYINEW=RY(I) + (2.0*RANF2-1)*DRMAX RZINEW=RZ(I) + (2.0*RANF3-1)*DRMAX Important note: The displacement must be centered at the old position, i.e., xnew-xold, ynew-yold , znew-zold are uniformly distributed in (-D,D) (D=DRMAX). In this case, p* ij=1/(2D)
Acceptation check in practice: 1) calculate△E=E;-E △E=2)分 No need to calculate the energy of the whole system 2)IfAE 0, accept the move 3)IfAE>O, calculate exp (-AE/kT)(exp (AE/kT=I /T and accept the move with a probability equal to exp(-AE/kT) How to do this in practice? Generate a uniform random number on(0, 1),. If s<exp(-AE/kt) accept the move To understand this easily, make an analogy with the dice throwing
Acceptation check in practice: 1) calculate DE=Ej -Ei : No need to calculate the energy of the whole system! 2) If DE 0, accept the move. 3) If DE>0, calculate exp(-DE/kT) (exp(-DE/kT)=pj /pi ) and accept the move with a probability equal to exp(-DE/kT). How to do this in practice? Generate a uniform random number on (0,1), x. If x<exp(-DE/kT), accept the move. To understand this easily, make an analogy with the dice throwing. D = − j i old ij j i new rij r E u( ) u( )