# CP2K Open Source Molecular Dynamics

### Site Tools

exercises:2017_ethz_mmm:mc_and_kmc

# Differences

This shows you the differences between two versions of the page.

 exercises:2017_ethz_mmm:mc_and_kmc [2017/03/08 15:41]dpasserone exercises:2017_ethz_mmm:mc_and_kmc [2020/08/21 10:15] (current) Both sides previous revision Previous revision 2017/03/31 07:34 dpasserone 2017/03/10 16:21 dpasserone 2017/03/09 15:50 dpasserone 2017/03/09 15:46 dpasserone 2017/03/09 15:06 dpasserone 2017/03/09 15:05 dpasserone 2017/03/09 15:05 dpasserone 2017/03/09 15:04 dpasserone 2017/03/09 13:42 dpasserone 2017/03/09 13:28 dpasserone 2017/03/09 13:28 dpasserone 2017/03/09 10:52 dpasserone 2017/03/09 10:52 dpasserone 2017/03/08 16:08 dpasserone 2017/03/08 15:52 dpasserone 2017/03/08 15:52 dpasserone 2017/03/08 15:51 dpasserone 2017/03/08 15:47 dpasserone 2017/03/08 15:47 dpasserone 2017/03/08 15:46 dpasserone 2017/03/08 15:41 dpasserone 2017/03/08 15:32 dpasserone 2017/03/08 15:24 dpasserone 2017/03/08 15:06 dpasserone 2017/03/08 14:57 dpasserone 2017/03/08 14:55 dpasserone 2017/03/08 14:51 dpasserone 2017/03/08 14:47 dpasserone created Next revision Previous revision 2017/03/31 07:34 dpasserone 2017/03/10 16:21 dpasserone 2017/03/09 15:50 dpasserone 2017/03/09 15:46 dpasserone 2017/03/09 15:06 dpasserone 2017/03/09 15:05 dpasserone 2017/03/09 15:05 dpasserone 2017/03/09 15:04 dpasserone 2017/03/09 13:42 dpasserone 2017/03/09 13:28 dpasserone 2017/03/09 13:28 dpasserone 2017/03/09 10:52 dpasserone 2017/03/09 10:52 dpasserone 2017/03/08 16:08 dpasserone 2017/03/08 15:52 dpasserone 2017/03/08 15:52 dpasserone 2017/03/08 15:51 dpasserone 2017/03/08 15:47 dpasserone 2017/03/08 15:47 dpasserone 2017/03/08 15:46 dpasserone 2017/03/08 15:41 dpasserone 2017/03/08 15:32 dpasserone 2017/03/08 15:24 dpasserone 2017/03/08 15:06 dpasserone 2017/03/08 14:57 dpasserone 2017/03/08 14:55 dpasserone 2017/03/08 14:51 dpasserone 2017/03/08 14:47 dpasserone created Line 1: Line 1: - ====== 38 atom Lennard-Jones cluster: molecular dynamics with python ====== + ====== Monte Carlo simulations for the estimation of molecule pair interatcion ====== ===== ===== In this exercise you will perform a MC simulation for different coverages of "sumanene" mlecules In this exercise you will perform a MC simulation for different coverages of "sumanene" mlecules Line 7: Line 7: - All files of this exercise be downloaded from the wiki: {{e3_bis.zip|}} + All files of this exercise can be downloaded from the wiki: {{exercise_3.zip|}} Download the exercise into your $HOME folder and unzip it. Download the exercise into your$HOME folder and unzip it. - you@eulerX ~$wget http://www.cp2k.org/_media/exercises:2017_ethz_mmm:e3_bis.zip + you@eulerX ~$ wget http://www.cp2k.org/_media/exercises:2017_ethz_mmm:exercise_3.zip - you@eulerX ~$unzip exercises:2017_ethz_mmm:e3_bis.zip + you@eulerX ~$ unzip exercises:2017_ethz_mmm:exercise_3.zip you@eulerX ~$cd exercise_3 you@eulerX ~$ cd exercise_3 Line 20: Line 20: In an experiment performed at Empa, sumanene molecules were adsorbed on a Ag(111) surface. In an experiment performed at Empa, sumanene molecules were adsorbed on a Ag(111) surface. It was found that at very low coverage (0.02) 30% of the molecules were weakly bound into dimers. It was found that at very low coverage (0.02) 30% of the molecules were weakly bound into dimers. + [ [[http://dx.doi.org/10.1021/ja504126z]]  J. Am. Chem. Soc. 2014, 136, 13666−13671] - IMAGE + {{:exercises:2017_ethz_mmm:coverage.jpg?200|}} Line 27: Line 28: (blue dots) are allowed to move by random discrete steps (blue dots) are allowed to move by random discrete steps - IMAGE LATTICE + {{:exercises:2017_ethz_mmm:hex_0.jpg?200|}} While in execution, the code will show you snapshots of the positions of the molecules on the lattice While in execution, the code will show you snapshots of the positions of the molecules on the lattice on the left panel. on the left panel. + + {{:exercises:2017_ethz_mmm:plots_0.0_200.0.png?600|}} + In the central panel average values for the number of isolated molecules, the number of dimers and the number of clusters In the central panel average values for the number of isolated molecules, the number of dimers and the number of clusters is plotted. is plotted. Line 55: Line 59: where k is Boltzmann's constant where k is Boltzmann's constant T is the simulation (and experiment) temperature T is the simulation (and experiment) temperature - n0 is teh concentration of dimers in the case of zero interaction + n0 is the concentration of dimers in the case of zero interaction nexp is the concentration of dimers found in the experiment nexp is the concentration of dimers found in the experiment + To compute the concentration consider that at coverage 0.02, in the simulation, the total number of molecules is 50 Line 74: Line 79: - #### MAIN MC LOOP + clusters_plot=[] + for i in range(nouter): and also the section and also the section Line 89: Line 95: + + The most complex (and unefficient) sections of the code are the two functions + + def allconnected(m,id,nx,ny) + + which finds out all teh molecules that are connected to a given one + + def neighbors(a,id,nx,ny) + + which finds out all the molecules that are 1st neighbors to a given one. + + The function "allconnected" is quite intuitive and inefficient. Can + you imagine roughly a more efficient function to perform the same task? + + + The code, at each step, moves a particle chosen randomly to a new site chosen randomly. + **Would it be correct to move all particles in a step? + what would change?** + +