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/23 12:56] – [Part IV: Ensembles] gtocciexercises: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 84: Line 87:
       &SUBSYS                 ! system description       &SUBSYS                 ! system description
        &CELL        &CELL
-         ABC [angstrom] 10 10 10+         ABC [angstrom] 40 40 40
          PERIODIC NONE          PERIODIC NONE
        &END CELL        &END CELL
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.
Line 322: Line 326:
 [[ https://www.cp2k.org/exercises:2018_uzh_acpc2:installation | exercise 0 ]] to remember the commands to define the unit cell in VMD and how to wrap the coordinates to the original cell. [[ https://www.cp2k.org/exercises:2018_uzh_acpc2:installation | exercise 0 ]] to remember the commands to define the unit cell in VMD and how to wrap the coordinates to the original cell.
 </note> </note>
-===== Part III:  Radial distribution functions  =====+===== Part III:  Radial distribution functions in NVT ensemble ===== 
 + 
 +In this exercise you are asked to compute the radial distribution function of liquid Ar at different temperatures. First of all perform two simulations at 85 K and 150 K for liquid Ar in the NVT ensemble to ensure the simulations are equilibrated at the right temperatures. To perform simulations in NVT copy the relevant section in the input file as shown below. 
 + 
 +<code> 
 +  &MD 
 +    ENSEMBLE NVT 
 +    STEPS 10000 
 +    TIMESTEP 5 
 +    TEMPERATURE 85.0 
 +    &THERMOSTAT 
 +      &NOSE                    #Uses the Nose-Hoover thermostat 
 +        TIMECON 100           #timeconstant of the thermostat chain, how often does thermostat adjust your system  
 +      &END NOSE 
 +    &END 
 +  &END MD 
 +</code>
  
 Use VMD or write your own program (Fortran, C, C++, Python etc.) to calculate radial distribution $g(r)$. Plot $g(r)$, and against various the temperatures to examine the effects. Use VMD or write your own program (Fortran, C, C++, Python etc.) to calculate radial distribution $g(r)$. Plot $g(r)$, and against various the temperatures to examine the effects.
Line 500: Line 520:
 ===== Part IV:  Ensembles  ===== ===== Part IV:  Ensembles  =====
  
-In previous section, you have already run NVE ensemble molecular dynamics for Ar liquid. In this section, we will focus on the NVT, NPT ensembles.+In previous section, you have already run NVE and NVT ensemble molecular dynamics for Ar liquid. In this section, we will focus on the NPT ensembles and you will compare the results in different ensembles.
  
-Step up NVT calculation, change the setting in &MD section.   +Set up NPT calculation, change the setting in &MD section.  
- +
- +
-  &MD +
-    ENSEMBLE NVT +
-    STEPS 10000 +
-    TIMESTEP 5 +
-    TEMPERATURE 85.0 +
-    &THERMOSTAT +
-      &NOSE                    #Uses the Nose-Hoover thermostat +
-        TIMECON 100           #timeconstant of the thermostat chain, how often does thermostat adjust your system  +
-      &END NOSE +
-    &END +
-  &END MD +
-   +
-   +
-Step up NPT calculation, change the setting in &MD section.  +
  
   &FORCE_EVAL   &FORCE_EVAL
Line 544: Line 548:
 <note> <note>
 **TASK** **TASK**
-   *Run calculations in the NVT ensembles at 150 and 85 K, check the temperature, and energy of the whole system, and compare the result to the previous simulations run in NVE, and rationalize the difference.+   *For the calculations in the NVT ensemble at 150 and 85 K, check the temperature, and energy of the whole system, and compare the result to the previous simulations run in NVE, and rationalize the difference.
    *It is a common practice to first perform a simulation in NVT and then run an NVE simulation. What is a possible reason for doing this?    *It is a common practice to first perform a simulation in NVT and then run an NVE simulation. What is a possible reason for doing this?
    * It is often needed to perform MD simulations in the NPT ensemble. For the case of Argon, it is liquid at 85 K at atmospheric pressure. First perform an NPT simulation at 85 K and atmospheric pressure. Then, based on the phase diagram reported in this [[https://www.nature.com/articles/srep15850/figures/1 | link]], choose a possible value of the pressure for liquid Argon at 150 K, edit the input file accordingly and run the simulation in NPT.    * It is often needed to perform MD simulations in the NPT ensemble. For the case of Argon, it is liquid at 85 K at atmospheric pressure. First perform an NPT simulation at 85 K and atmospheric pressure. Then, based on the phase diagram reported in this [[https://www.nature.com/articles/srep15850/figures/1 | link]], choose a possible value of the pressure for liquid Argon at 150 K, edit the input file accordingly and run the simulation in NPT.
exercises/2018_uzh_acpc2/l-j_flu.1524488185.txt.gz · Last modified: 2020/08/21 10:15 (external edit)