exercises:2017_ethz_mmm:mc_and_kmc_2
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| exercises:2017_ethz_mmm:mc_and_kmc_2 [2017/03/09 12:32] – dpasserone | exercises:2017_ethz_mmm:mc_and_kmc_2 [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== | ===== | ||
| - | The hexaiodobenzene | + | The molecule shown in the image (hexaiodo-substituted |
| + | macrocycle cyclohexa-m-phenylene (CHP) ), when deposited on a noble metal substrate such as | ||
| Cu(111) , Ag(111) or Au(111), at room temperature looses the I atoms and starts diffusing. | Cu(111) , Ag(111) or Au(111), at room temperature looses the I atoms and starts diffusing. | ||
| + | |||
| + | |||
| + | {{: | ||
| + | |||
| The relative probability of diffusion and of binding to a neighboring molecule | The relative probability of diffusion and of binding to a neighboring molecule | ||
| determine the shape of the network that will be obtained. | determine the shape of the network that will be obtained. | ||
| The experiments performed at Empa [ [[http:// | The experiments performed at Empa [ [[http:// | ||
| while on a Au substrate 2D networks will form. | while on a Au substrate 2D networks will form. | ||
| + | |||
| + | {{: | ||
| + | |||
| <note tip> | <note tip> | ||
| The python program KMC.py will allow you to simulate the diffusion and binding of molecules | The python program KMC.py will allow you to simulate the diffusion and binding of molecules | ||
| Line 14: | Line 22: | ||
| During the execution the program shows snapshots of the positions of the molecules. | During the execution the program shows snapshots of the positions of the molecules. | ||
| + | |||
| + | {{: | ||
| + | |||
| Molecules free to diffuse will be represented via blue dots. | Molecules free to diffuse will be represented via blue dots. | ||
| Molecules that irreversibly formed a bond with a neighboring molecule will be represented by red dots. | Molecules that irreversibly formed a bond with a neighboring molecule will be represented by red dots. | ||
| At the end of the execution a snapshot of the final configuration of the system is saved an image file. | At the end of the execution a snapshot of the final configuration of the system is saved an image file. | ||
| The program asks you for some input: | The program asks you for some input: | ||
| + | |||
| < | < | ||
| coverage | coverage | ||
| Line 25: | Line 37: | ||
| binding barrier | binding barrier | ||
| </ | </ | ||
| + | |||
| </ | </ | ||
| <note warning> | <note warning> | ||
| Line 31: | Line 44: | ||
| < | < | ||
| coverage 0.1 | coverage 0.1 | ||
| - | update graph each steps 10 | + | update graph each steps 500 |
| number of steps 100000 | number of steps 100000 | ||
| temperature in K 300 | temperature in K 300 | ||
| Line 37: | Line 50: | ||
| binding barrier 0.1 | binding barrier 0.1 | ||
| </ | </ | ||
| - | Observe how events | + | Observe how events |
| Observe how time evolves. | Observe how time evolves. | ||
| Did the job perform all the 100000 steps? Why? | Did the job perform all the 100000 steps? Why? | ||
| Line 48: | Line 61: | ||
| < | < | ||
| coverage 0.1 | coverage 0.1 | ||
| - | update graph each steps 100 | + | update graph each steps 500 |
| number of steps 100000 | number of steps 100000 | ||
| temperature in K 300 | temperature in K 300 | ||
| - | diffusion barrier 0.4 | + | diffusion barrier 0.3 |
| - | binding barrier 0.3 | + | binding barrier 0.4 |
| </ | </ | ||
| Do you notice differences in the way events occur? | Do you notice differences in the way events occur? | ||
| How is evolving time compared to the previous case? | How is evolving time compared to the previous case? | ||
| How does the final geometry differ form the previous case? | How does the final geometry differ form the previous case? | ||
| + | </ | ||
| + | <note tip> | ||
| + | Now have a look at the python code. | ||
| + | The MAIN section | ||
| + | < | ||
| + | #### MAIN KMC LOOP | ||
| + | t=0 | ||
| + | |||
| + | #### at the beginning we have to check possible events for all molecules | ||
| + | tobeupdated=[iu for iu in range(len(molecules))] | ||
| + | possible_events=[] | ||
| + | for i in range(nsteps): | ||
| + | #### check possible events for selected set of molecules | ||
| + | possible_events=possible_events+events(molecules, | ||
| + | |||
| + | if possible_events==[]: | ||
| + | print "no more events possible" | ||
| + | break | ||
| + | #### compute total rate (can be imporved) | ||
| + | R=total_rate(possible_events, | ||
| + | |||
| + | #### decide which event to apply | ||
| + | selected_event=find_event(R, | ||
| + | |||
| + | #### apply the event end update partially the list of events | ||
| + | possible_events, | ||
| + | |||
| + | #### update time | ||
| + | rho2=np.random.random() | ||
| + | dt=-np.log(rho2)/ | ||
| + | t=t+dt | ||
| + | </ | ||
| + | is very simple and reflects the basic steps of the KMC approach. | ||
| + | On the contrary, the function needed to create the list of events is quite complex: | ||
| + | < | ||
| + | def events(m, | ||
| + | allevents=[] | ||
| + | set=[] | ||
| + | #### list of first neighbors (relative position) | ||
| + | set.append([[0, | ||
| + | set.append([[1, | ||
| + | |||
| + | for i in selection: | ||
| + | le=[] | ||
| + | #### consider only molecules that are not binded | ||
| + | . | ||
| + | . | ||
| + | . | ||
| + | </ | ||
| + | </ | ||
| + | <note warning> | ||
| + | **TASK 3** | ||
| + | Have a look on the section of the code that create the list of events, | ||
| + | comment on which are the critical points in setting up a KMC simulation | ||
| + | to describe a real process. | ||
| + | |||
| + | **TASK 4** | ||
| + | At each step of the simulaiton the list of possible events is created (or, betetr, updated) | ||
| + | an event is chosen randomly and is then actuated. | ||
| + | Would it be possible to execute simultaneously more events at each KMC step? | ||
| </ | </ | ||
exercises/2017_ethz_mmm/mc_and_kmc_2.1489062726.txt.gz · Last modified: (external edit)
