User Tools

Site Tools


exercises:2018_ethz_mmm:mc2018

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
exercises:2018_ethz_mmm:mc2018 [2018/03/08 08:09] dpasseroneexercises:2018_ethz_mmm:mc2018 [2018/03/09 07:32] dpasserone
Line 1: Line 1:
-====== Monte Carlo simulations for the estimation of molecule pair interaction ====== +====== Monte Carlo simulations for the estimation of  pair interactions ====== 
 =====  ===== 
 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 10: Line 10:
  
  
-Please download the exercise from [[https://polybox.ethz.ch/index.php/s/VAgObKjIIVbKGGw|this link]] +Please download the program **monte_carlo.py** from [[https://polybox.ethz.ch/index.php/s/CH5VdcI40YdELez|this link]] 
  
  
Line 46: Line 46:
 <note important> <note important>
 **TASK 1** **TASK 1**
-Execute the program with parameters:+Execute the program 
 +<code> 
 +python monte_carlo.py 
 +</code> 
 + with parameters:
  
 <code> <code>
Line 91: Line 95:
 <code> <code>
 #### inner loop of 1000 steps #### inner loop of 1000 steps
 +</code>
 and and
 +<code>
  
 #### DECIDE whether to accept or not the move #### DECIDE whether to accept or not the move
Line 106: Line 110:
 </code> </code>
 </note> </note>
-<note warning+<note important
-The most complex (and unefficient) sections of the code are the two functions+**TASK 5** The most complex (and unefficient) sections of the code are the two functions
 <code> <code>
 def allconnected(m,id,nx,ny) def allconnected(m,id,nx,ny)
Line 116: Line 120:
 </code> </code>
 which finds out all the molecules that are 1st neighbors to a given one. which finds out all the molecules that are 1st neighbors to a given one.
 +<note warning> 
 +To understand these sections you have to refer to the graph of the hexagonal lattice 
 +with the convention adopted for the coordinate system.
 The function "allconnected" is quite intuitive and inefficient. Can The function "allconnected" is quite intuitive and inefficient. Can
-you imagine roughly a more efficient function to perform the same task? +you imagine roughly a more efficient function to perform the same task? 
 +Just think how you would do the task of identifying, among a set of particles, the ones that are alone, the ones that form 
 +an isolated dimer and thr ones that form clusters. Google can help you :) (you do not have to find a solution)
 </note> </note>
-<note warning>+</note> 
 +<note important> 
 +**TASK 6**
 The code, at each step, moves a particle chosen randomly to a new site chosen randomly. 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? **Would it be correct to move all particles in a step?
exercises/2018_ethz_mmm/mc2018.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1