User Tools

Site Tools


exercises:2018_uzh_acpc2:l-j_flu

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
exercises:2018_uzh_acpc2:l-j_flu [2018/04/26 07:26] mpaulettiexercises:2018_uzh_acpc2:l-j_flu [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 62: Line 62:
   &MM   &MM
     &FORCEFIELD     &FORCEFIELD
 +    &SPLINE
 +     EMAX_SPLINE 100000
 +    &END
       &CHARGE             #charge of the MM atoms       &CHARGE             #charge of the MM atoms
         ATOM Ar           #Defines the atomic kind of the charge         ATOM Ar           #Defines the atomic kind of the charge
Line 105: Line 108:
  
 <code> <code>
-for d in $(seq 0.1 4); do+for d in $(seq 3.0 0.1 9); do
   sed -e "s|4 0 0|${d} 0 0|" argon.inp > energy_${d}A.inp   sed -e "s|4 0 0|${d} 0 0|" argon.inp > energy_${d}A.inp
   cp2k.sopt -i energy_${d}A.inp -o energy_${d}A.out   cp2k.sopt -i energy_${d}A.inp -o energy_${d}A.out
-  awk '/Total FORCE_EVAL/ { print $9; }' energy_${d}A.out+  awk '/Total FORCE_EVAL/ { print "'"${d}"'", $9; }' energy_${d}A.out >> Pot_En_vs_distance.dat
 done done
 </code> </code>
  
-  * The command ''seq 0.1 4'' generates the numbers ''2.0'', ''2.1'', ''2.2'', ... , ''4.0'' (try it out!) +  * The command ''seq 0.1 9.0'' generates the numbers ''3.0'', ''3.1'', ''3.2'', ... , ''9.0'' (try it out!) 
-  * With ''for d in $(seq 0.1 4); do'' we use the shell to run all commands which follow once for every number (stored in ''$d''+  * With ''for d in $(seq 0.1 9.0); do'' we use the shell to run all commands which follow once for every number (stored in ''$d''
-  * ''sed -e "s|4 0 0|$d 0 0|" energy.inp'' looks for ''4 0 0'' in the file ''energy.inp'' (the original file from above) and replaces ''4 0 0'' by ''$d 0 0'' (that is: ''2.0'', ''2.1'', ''2.2'', ...) +  * ''sed -e "s|4 0 0|$d 0 0|" energy.inp'' looks for ''4 0 0'' in the file ''energy.inp'' (the original file from above) and replaces ''4 0 0'' by ''$d 0 0'' (that is: ''3.0'', ''3.1'', ''3.2'', ...) 
-  * ... and using ''> energy_${d}A.out'' we redirect the output of the ''sed'' command to new files ''energy_2.0A.out'', ''energy_2.1A.out'', etc.+  * ... and using ''> energy_${d}A.out'' we redirect the output of the ''sed'' command to new files ''energy_3.0A.out'', ''energy_3.1A.out'', etc.
   * Then we run ''cp2k.sopt'' as shown before on those new input files and write the output to new output files as well   * Then we run ''cp2k.sopt'' as shown before on those new input files and write the output to new output files as well
   * Using ''awk'' we extract the energy from the output file   * Using ''awk'' we extract the energy from the output file
 +  * The energy as a function of distance for all the single point calculations is then printed to the file ''Pot_En_vs_distance.dat''
  
 Plot distance vs. potential energy and find the minimum in energy, which corresponds to the equilibrium distance. After having done it, you can calculate the minimum analytically as well. Plot distance vs. potential energy and find the minimum in energy, which corresponds to the equilibrium distance. After having done it, you can calculate the minimum analytically as well.
exercises/2018_uzh_acpc2/l-j_flu.1524727580.txt.gz · Last modified: 2020/08/21 10:15 (external edit)