User Tools

Site Tools


exercises:2015_ethz_mmm:c2h2_bond_energy

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:2015_ethz_mmm:c2h2_bond_energy [2015/02/26 14:19] yakutovichexercises:2015_ethz_mmm:c2h2_bond_energy [2015/06/02 11:31] dpasserone
Line 1: Line 1:
 ====== C2H2 and C2H4 bond energy ====== ====== C2H2 and C2H4 bond energy ======
 <note warning> <note warning>
-Before you start it is **ABSOLUTELY NEСESSARY** to update the function library. So from you $HOME directory please run: +TO USE THE FUNCTION LIBRARY (VERSION UP TO DATE) IN THE INTERACTIVE SHELL: 
-<code> + 
-you@eulerX ~$ ./update_functionlibrary +you@eulerX ~module load courses mmm vmd 
-</code> +  
-** Pay attention to the output of this program. It may give you some helpful information**+you@eulerX ~$ mmm-init 
 +</note>
  
-If you don't have the file "update_functionlibrary" please download it from here {{update_functionlibrary.zip|}} and unzip into your $HOME directory 
-<code> 
-you@eulerX ~$ unzip update_functionlibrary.zip 
-you@eulerX ~$ chmod 755 update_functionlibrary 
-</code> 
-Or if you are working on the remote computer you can also do the following: 
-<code> 
-you@eulerX ~$ wget http://www.cp2k.org/_media/exercises:2015_ethz_mmm:update_functionlibrary.zip 
-you@eulerX ~$ unzip exercises:2015_ethz_mmm:update_functionlibrary.zip 
-you@eulerX ~$ chmod 755 update_functionlibrary 
-</code> 
  
-</note> 
  
-<note important> **REMEMBER** to load the  module for the cp2k program:+<note important> **REMEMBER: this is the command to load the  module for the cp2k program:**
  
 <code> <code>
Line 27: Line 16:
 </code> </code>
  
-**and to submit the job chain:**+**and to submit the job:**
  
 <code> <code>
-you@eulerX ~$ bsub < c2h2.a.chain+you@eulerX ~$ bsub < jobname
 </code>  </code> 
 </note>  </note> 
Line 47: Line 36:
 In this exercise you will test the general AMBER force field, which is suitable for a large class of molecules. In this example you will compute the classical energy of a simple acetylene molecule and apply small variations to the C-C bond lengths.  In this exercise you will test the general AMBER force field, which is suitable for a large class of molecules. In this example you will compute the classical energy of a simple acetylene molecule and apply small variations to the C-C bond lengths. 
  
-Please go to the directory "exercise_2.1/c2h2/"+Then go to the directory "exercise_2.1/c2h2/"
 <code> <code>
 you@eulerX ~$ cd exercise_2.1/c2h2/ you@eulerX ~$ cd exercise_2.1/c2h2/
Line 113: Line 102:
 The script to modify the C-C distance in the input and generate the curve is the following: The script to modify the C-C distance in the input and generate the curve is the following:
  
-<code bash c2h2.amber.chain>+<code bash c2h2.chain>
 # #
 # task 2.1 C2H2 bond strength # task 2.1 C2H2 bond strength
Line 126: Line 115:
 # #
 # loads the functions # loads the functions
-# this script uses the functions: change replace getcolumn add list+# this script uses the functions: m_change m_replace m_getcolumn m_sum m_list
 # #
 module load new cp2k module load new cp2k
-~/Scripts/myfunctions.bash+. /cluster/apps/courses/mmm/m_functions.bash
  
  
Line 141: Line 130:
 # #
  
-for n in `list -5 5`+for n in `m_list -5 5`
 do do
-  dist_cc=`change $dist_cc0 $n $delta` +  dist_cc=`m_change $dist_cc0 $n $delta` 
-  c2=`add $dist_hc $dist_cc ` +  c2=`m_sum $dist_hc $dist_cc` 
-  h2=`add $c2 $dist_hc `+  h2=`m_sum $c2 $dist_hc `
   #   #
   # replaces coordinates in the input   # replaces coordinates in the input
   #   #
-  replace _C1_ $dist_hc < c2h2.amber.inp.templ | replace _C2_ $c2  | replace _H2_ $h2 > c2h2.$dist_cc.inp+  m_replace _C1_ $dist_hc < c2h2.inp.templ | m_replace _C2_ $c2  | m_replace _H2_ $h2 > c2h2.$dist_cc.inp
   #   #
   # Runs cp2k   # Runs cp2k
Line 159: Line 148:
   # gets the energy from the output (in a.u.)   # gets the energy from the output (in a.u.)
   #   #
-  energy=` getcolumn 'ENERGY|' 9 < c2h2.$dist_cc.out `+  energy=` m_getcolumn 'ENERGY|' 9 < c2h2.$dist_cc.out ` 
   echo $dist_cc $energy  >> curve.amber.c2h2   echo $dist_cc $energy  >> curve.amber.c2h2
 # #
Line 172: Line 161:
 mv c2h2.*.inp c2h2.*.out Logs mv c2h2.*.inp c2h2.*.out Logs
 rm RUN* *restart* rm RUN* *restart*
 +
 +
  
 </code> </code>
Line 179: Line 170:
  
 <code> <code>
-you@brutusX mmm_exercise_2.1$ module load new cp2k +you@eulerX c2h2$ module load new cp2k 
-you@brutusX mmm_exercise_2.1$ bsub < c2h2.a.chain+you@eulerX c2h2$ bsub < c2h2.chain
 </code> </code>
  
Line 188: Line 179:
  
 <code> <code>
-you@brutusX mmm_exercise_2.1$ gnuplot fit.triple.gnu+you@eulerX c2h2$ gnuplot fit.gnu
 </code> </code>
  
-<code - fit.triple.gnu>+<code - fit.gnu>
 #!/usr/bin/gnuplot #!/usr/bin/gnuplot
 f(x)=k*(x-x0)*(x-x0)+e0         # definition of the function to be fitted f(x)=k*(x-x0)*(x-x0)+e0         # definition of the function to be fitted
Line 232: Line 223:
  
 Now, perform the same exercise in another directory for the molecule C2H4. Now, perform the same exercise in another directory for the molecule C2H4.
 +<code>
 +you@eulerX c2h2$ cd ../c2h4
 +</code>
  
-    * The input c2h4.amber.inp.templ is similar to the previous one, only with different project name (C2H4) and coordinates:+    * The new input c2h4.inp.templ is similar to the previous one, only with different project name (C2H4) and coordinates:
  
 <code coo.ch4> <code coo.ch4>
Line 246: Line 240:
    * The script to modify the bond lengths changes slightly as well    * The script to modify the bond lengths changes slightly as well
  
-<code bash c2h4.a.chain>+<code bash c2h4.chain>
 # #
 # task 2.2 C2H4 bond strength # task 2.2 C2H4 bond strength
Line 259: Line 253:
 # #
 # loads the functions # loads the functions
-# this script uses the functions: change replace getcolumn add list+# this script uses the functions: m_change m_replace m_getcolumn m_sum m_list
 # #
 module load new cp2k module load new cp2k
-. ~/Scripts/myfunctions.bash+#. ~/Scripts/myfunctions.bash 
 +. /cluster/apps/courses/mmm/m_functions.bash
  
  
Line 274: Line 269:
 # #
  
-for n in `list -5 5`+for n in `m_list -5 5`
 do do
-  dist_cc=`change $dist_cc0 $n $delta` +  dist_cc=`m_change $dist_cc0 $n $delta` 
-  c2=`add $dist_hcx $dist_cc` +  c2=`m_sum $dist_hcx $dist_cc` 
-  h3=`add $c2 $dist_hcx `+  h3=`m_sum $c2 $dist_hcx `
   #   #
   # replaces coordinates in the input   # replaces coordinates in the input
   #   #
-  replace _C1_ $dist_hcx < c2h4.amber.inp.templ | replace _C2_ $c2  | replace _H3_ $h3 > c2h4.$dist_cc.inp+  m_replace _C1_ $dist_hcx < c2h4.inp.templ | m_replace _C2_ $c2  | m_replace _H3_ $h3 > c2h4.$dist_cc.inp
   #   #
   # Runs cp2k   # Runs cp2k
Line 291: Line 286:
   # gets the energy from the output (in a.u.)   # gets the energy from the output (in a.u.)
   #   #
-  energy=` getcolumn 'ENERGY|' 9 < c2h4.$dist_cc.out ` +  energy=` m_getcolumn 'ENERGY|' 9 < c2h4.$dist_cc.out `
   echo $dist_cc $energy  >> curve.amber.c2h4   echo $dist_cc $energy  >> curve.amber.c2h4
 # #
Line 304: Line 299:
 mv c2h4.*.inp c2h4.*.out Logs mv c2h4.*.inp c2h4.*.out Logs
 rm RUN* *restart* rm RUN* *restart*
-                                                                                                                                                                        + 
 +                                                                                                                                                  
 </code> </code>
  
Line 312: Line 308:
 <note tip>Assignment:  <note tip>Assignment: 
   - Report the values of the bond length and force constants in all cases.    - Report the values of the bond length and force constants in all cases. 
-  - Discuss these values in view of the kind of molecules we are simulating+  - Discuss these values in view of the kind of molecules we are simulating
 +</note>
exercises/2015_ethz_mmm/c2h2_bond_energy.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1