Presentation is loading. Please wait.

Presentation is loading. Please wait.

General considerations Monte Carlo methods (I). Averages X = (x 1, x 2, …, x N ) – vector of variables P – probability density function.

Similar presentations


Presentation on theme: "General considerations Monte Carlo methods (I). Averages X = (x 1, x 2, …, x N ) – vector of variables P – probability density function."— Presentation transcript:

1 General considerations Monte Carlo methods (I)

2 Averages X = (x 1, x 2, …, x N ) – vector of variables P – probability density function

3 Random variables and their distributions A random variable: a number assigned to an event Distribuand: Probability density: Any function of a random variable is a random variable.

4 Moments of a distribution Continuous variables: If H(x)=(x-x c ) n then E{H(X)} is called the nth moment of x with respect to c; if c= then E is the nth central moment,  n ({x}).

5 Some useful central moments Variance Skewness Kurtosis

6 For a set of points:

7 Some examples of central moments

8 Boltzmann distribution k B (Boltzmann constant) = 1.38  10 -23 J/K N A k B = R (universal gas constant) = 8.3143 J/(mol  K) q – positions; p – momenta;  (E) – density of states with energy E

9 Thermodynamic quantities

10 Ergodicity

11 Trajectories in the phase space. For ergodic sampling, sub-trajectories should be part of a trajectory that passes through all points.

12 Monte Carlo methods: use of random-number generators to follows the evolution of a system according to a given probability-distribution function. Beginnings: Antiquity (?); estimation of the results of dice game. First documented use: G. Comte de Buffon (1777): estimation of the number p by throwing a needle on a sheet of paper with parallel lines and counting the number of hits. First large-scale (wartime) application: J. von Neumann, S. Ulam, N. Metropolis, R.P. Feynman i in. (1940’s; the Manhattan project) calculations of neutron creation and scattering. For security, the calculations were disguised as,,Monte Carlo” calculations.

13 Kinds of Monte Carlo methods  The von Neumann (rejection) sampling  The Metropolis (in general: Markov chain) sampling. Also known as „importance sampling”

14 Simple Monte Carlo averaging x f(x)f(x) Sample a point on x from a uniform distribution Compute f(x i )

15 Rejection or hit-and-miss sampling x f(x)f(x) Sample a point on x from a uniform distrubution Sample a point on f accept reject

16 Algorithm Generate a random point X in the configurational space Generate a random point y in [0,1] P(X)>y Accept X A:=A+A(X) Reject X

17 Application of the rejection sampling to compute the number  1

18 Applications For one-dimensional integrals classical quadratures (Newton-Cotes, Gauss) are better than that. For multi-dimensional integrals sampling the integrations space is somewhat better; however most points have zero contributions. We cannot compute ensemble averages of molecular systems that way. The positions of atoms would have to generated at random, this usually leading to HUGE energies.

19 Illustration of the difference between the direct- and importance- sampling methods to measure the depth of the river of Nile Von Neumann: all points are visited Metropolis: The walker stays in the river

20

21 Perturb X o : X 1 = X o +  X Compute the new energy (E 1 ) Configuration X o, energy E o E 1 <E o ? Draw Y from U(0,1) Compute W=exp[-(E 1 -E o )/kT] W>Y? X o =X 1, E o =E 1 N Y Y N A:=A+A(X o )

22 E0E0 E1E1 Accept with probability exp[-(E 2 -E 1 )/k B T] E1E1 Accept

23 Space representation in MC simulations Lattice (discrete). The particles are on lattice nodes Continuous. The particles move in the 3D space.

24 On- and off-lattice representations

25 Application of Metropolis Monte Carlo Determination of mechanical and thermodynamic properties(density, average energy, heat capacity, conductivity, virial coefficients). Simulations of phase transitions. Simulations of polymer properties. Simulations of biopolymers. Simulations of ligand-receptor binding. Simulations of chemical reactions.

26 Computing averages with Metropolis Monte Carlo It should be noted that all MC steps are considered, including those which resulted in the rejection of a new configuration. Therefore, if a configuration has a very low energy, it will be counted multiple times.

27 Detailed balance (Einstein’s theorem) old new

28 In real life the detailed balance condition is rarely satisfied… These gates at a Seoul subway station do not satisfy the detailed-balance condition: you can go through but you cannot go back… A famous Russian proverb states: „A ruble to get in, ten rubles to get out”

29 I thought there was a way out…. I was sssoooo busy working for my Queen and Community…. Nature teaches us the hard way that detailed balance is not something to meet in the macro- world..

30 It is only too easy to violate the detailed-balance conditions Monte Carlo with minimization: energy is minimized after each move. Transition probability is proportional to basin size. Little chance to get from C to B AB C pertubation minimization pertubation Minimization brings back to C

31 Translational perturbations (straightforward) x[o] 

32 Orientational perturbations Euler angles. We rotate the system first about the z axis by  so that the new x axis is axis w, then about the w axis by  so that the new z axis is z’ and finally about the z’ axis by  so that the new x axis is x’ and the new y axis is y’. Uniform sampling the Euler angles would result in a serious bias.

33 Rotational perturbations: rigid linear molecules Orientational perturbation u u’ Genarate a random unit vector v Compute t:=u+  v Compute u’:= t/||t||

34 Rigid non-linear molecules Sample a unit vector on a 4D sphere (quaternion) (E. Veseley, J. Comp. Phys., 47:291-296, 1982), then compute the Euler angles from the following formulas:

35 Rotation matrix

36 Choosing the initial configuration and step size Generally: avoid clashes. For rigid liquids molecules start from a configuration on a lattice. For flexible molecules: build the chain to avoid overlap with the atoms already present.

37 MC step size Too small: high acceptance rate but poor ergodicity (can’t get out of a local minimum). Too large: low acceptance rate. Avoid accepting „good” advices that the acceptance rate should be 10/20/50%, etc. Do pre-production simulations to select optimal step size This can help: –Configurational-bias Monte Carlo, –Parallel tempering.

38 Reference algorithms for MC/MD simulations (Fortran 77) M.P. Allen, D.J. Tildesley, „Computer Simulations of Liquids”, Oxford Science Publications, Clardenon Press, Oxford, 1987 http://www.ccp5.ac.uk/software/allen_tildersley.shtml F11: Monte Carlo simulations of Lennard-Jones fluid.


Download ppt "General considerations Monte Carlo methods (I). Averages X = (x 1, x 2, …, x N ) – vector of variables P – probability density function."

Similar presentations


Ads by Google