User Tools

Site Tools


exercises:2017_ethz_mmm:pythonmd

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:2017_ethz_mmm:pythonmd [2017/03/03 05:48] dpasseroneexercises:2017_ethz_mmm:pythonmd [2017/03/03 16:38] dpasserone
Line 1: Line 1:
 ====== 38 atom Lennard-Jones cluster: molecular dynamics with python ======  ====== 38 atom Lennard-Jones cluster: molecular dynamics with python ====== 
 +===== 
 +In this exercise you will perform molecular dynamics with a python program that you may inspect and modify directly. Then, you will perform the same kind of dynamics using cp2k and compare the performance. =====
  
  
 <note tip> <note tip>
-All files of this exercise be downloaded from the wiki: {{e2.zip|}} +All files of this exercise be downloaded from the wiki: {{e2_bis.zip|}} 
 Download the exercise into your $HOME folder and unzip it.  Download the exercise into your $HOME folder and unzip it. 
  
 <code> <code>
-you@eulerX ~$ wget http://www.cp2k.org/_media/exercises:2017_ethz_mmm:e2.zip +you@eulerX ~$ wget http://www.cp2k.org/_media/exercises:2017_ethz_mmm:e2_bis.zip 
-you@eulerX ~$ unzip exercises:2017_ethz_mmm:e2.zip+you@eulerX ~$ unzip exercises:2017_ethz_mmm:e2_bis.zip
 you@eulerX ~$ cd exercise_2 you@eulerX ~$ cd exercise_2
 </code> </code>
Line 35: Line 37:
  
  
-In the repository you will find the program “**md.py**” and the geometry file “**fcc.xyz**”+In the repository you will find the program “**md.py**” and the geometry file “**fcc_r.xyz**”
 The program md.py can perform a MD simulation for a system of Ar atoms interacting via Lennard-Jones potential. The program md.py can perform a MD simulation for a system of Ar atoms interacting via Lennard-Jones potential.
  
Line 110: Line 112:
 prints=“False”</note> prints=“False”</note>
 execute three or four times the program and write down the execution time that you get as the only output. execute three or four times the program and write down the execution time that you get as the only output.
-Now comment the lines for the “efficient” algorithm and uncomment the lines of the ”unefficient” one. Execute with 3-4 different timesteps.+Now comment the lines for the “efficient” algorithm and uncomment the lines of the ”unefficient” one. Execute 3-4 times.
 Is the execution time longer? Why do you think you get such a result? Is the execution time longer? Why do you think you get such a result?
  
Line 124: Line 126:
  
 ====== Molecular dynamics using CP2K ====== ====== Molecular dynamics using CP2K ======
-In this second part of the exercise, the same kind of dynamics will be performed with **cp2k**. You will find in the repository +In this second part of the exercise, the same kind of dynamics will be performed with **cp2k**. You will find in the repository (zip file) the input file **md.inp**, where the **&MOTION** section is different from the last lecture exercise.
  
 +<code>
 +&MOTION
 +  &PRINT
 +    &RESTART_HISTORY OFF
 +    &END
 +    &RESTART
 +      &EACH
 +        MD 5000
 +      &END
 +    &END
 +    &TRAJECTORY
 +      &EACH
 +        MD 100
 +      &END
 +    &END
 +  &END
 +  &MD
 +    ENSEMBLE NVE
 +    STEPS 10000
 +    TIMESTEP 0.5
 +    TEMPERATURE 10.0
 +  &END MD
 +&END MOTION
 +</code>
 +
 +<note important>
 +- Run the code 
 +<code>
 +> cp2k.popt -i md.inp > md.out
 +</code>
 +Compare the performance with the one of the python code. What do you notice?
 +Plot the energy by using the file **MD-1.ener** and **gnuplot**
 +  -  What is the value of the total energy? Is it conserved?
 +  -  Increase the time step to 3 fs, and run it again. What happens to the total energy?
 +  - Note: to visualize a trajectory you can use the code (look inside it!) traj.py in the directory:
 +<code>python traj.py</code>
 +</note>
 +
 +<note warning>Here an example of [[http://users.mccammon.ucsd.edu/~dzhang/energy-unit-conv-table.html|energy conversion table]]. </note>
  
  
  
  
exercises/2017_ethz_mmm/pythonmd.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1