Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add van Hove function tutorials #13

Merged
merged 18 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed Data/Trajectories/MDANSE/apoferritin.h5
Binary file not shown.
Binary file removed Data/Trajectories/MDANSE/ar36_120fs_8.mdt
Binary file not shown.
Binary file removed Data/Trajectories/NAMD/dmpc_in_water.nc
Binary file not shown.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ A collection of files that can be used with MDANSE. For the actual MDANSE softwa

This repository has been created out of the original MDANSE repository. Currently it contains the following file types:
* Raw trajectory files (Data/Trajectories/*), to be converted using MDANSE
* Analysis results in the new HDF format (Data/HDF) and the old NetCDF format (Data/NetCDF, Data/Jobs_reference_data)
* McStas input files (Data/McStas)
* Analysis results in the new HDF format (Data/HDF)
* PDB structure definitions (Data/PDB)

MDANSE Tutorials will also be stored here.
42 changes: 29 additions & 13 deletions tutorials/tutorial1-phase-transition/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MDANSE Tutorial: a phase transition
# MDANSE Tutorial 1: a phase transition

This tutorial will show you:
* how to convert a LAMMPS trajectory to the MDANSE format,
Expand Down Expand Up @@ -82,7 +82,7 @@ create plain text output of analysis. Please read:

# The actual tutorial, step by step.

In the text of the tutorial, we will be concentrate on the
In the text of the tutorial, we will concentrate on the
MDANSE GUI. However, the conversion and analysis jobs can
be run also without the GUI. The scripts for running all
the parts of the tutorial are provided in `md_inputs/script*`.
Expand Down Expand Up @@ -112,7 +112,9 @@ Go to the 'Converters' tab in the GUI, and pick the LAMMPS
converter. Now you have to pass the correct inputs to the
converter.

![converter](pictures/gui_converter.png)
<p align="center">
<img width="800" src="pictures/gui_converter.png"/>
</p>

The LAMMPS configuration file is
`md_inputs/structure.txt`, and the LAMMPS trajectory file
Expand All @@ -127,14 +129,18 @@ GUI will try to make it clear
by disabling the 'RUN!' button and highlighting the
wrong entries.

![entries](pictures/gui_converter_errors.png)
<p align="center">
<img width="800" src="pictures/gui_converter_errors.png"/>
</p>

Run the conversion
by pressing the 'RUN!' button in the bottom-right corner.
You can now see a new entry in the 'Running Jobs' tab,
showing the progress of the conversion.

![running](pictures/gui_jobs.png)
<p align="center">
<img width="800" src="pictures/gui_jobs.png"/>
</p>

For the moment we are going through all the steps
using the MDANSE_GUI. However, you can also get the same
Expand All @@ -153,7 +159,9 @@ frame of the trajectory in the 3D viewer. Also, basic information
about the trajectory will be displayed in the bottom-left
text box.

![trajectory](pictures/gui_trajectory.png)
<p align="center">
<img width="800" src="pictures/gui_trajectory.png"/>
</p>

You can watch the animation of the trajectory, just to see if
anything unexpected happened in your system during the run.
Expand All @@ -162,7 +170,7 @@ the 'bonds' option of the visualiser. Press the play button
to start the animation. (If you don't have the patience to watch
every single frame, you can press fast forward instead.)

**Question**: What is the difference between the structures
**Question 1**: What is the difference between the structures
in the beginning and at the end of the simulation?

## Calculate the temperature of the system
Expand All @@ -180,7 +188,9 @@ the GUI. (If not, go back to the previous step.)
In the Actions tab, find the analysis called 'Temperature'.
It is located in 'Analysis -> Thermodynamics -> Temperature'.

![temperature_analysis](pictures/gui_actions.png)
<p align="center">
<img width="800" src="pictures/gui_actions.png"/>
</p>

You can pick the interpolation
order used for the determination of velocities. In the script
Expand All @@ -191,7 +201,9 @@ in `mdanse_outputs/temperature.mda`.
You can plot the calculated temperature by going to the
'Plot Creator' tab.

![plot_creator](pictures/gui_plot_creator.png)
<p align="center">
<img width="800" src="pictures/gui_plot_creator.png"/>
</p>

Load the analysis result using the
'Load .MDA results' button. Now, unfold the contents
Expand All @@ -207,15 +219,17 @@ will be significantly different to the other points. This
is to be expected since interpolation will not be accurate
when values are only available on one side of its data point.

![plot_temperature](pictures/gui_plot.png)
<p align="center">
<img width="800" src="pictures/gui_plot.png"/>
</p>

Now, open the simulation log `md_outputs/simulation_log.txt`
in any text editor, and check the temperature values logged there.
The temperature values in the log file were calculated by
the MD engine based on the velocity values at those specific
simulation steps.

**Question**: The MDANSE temperature values don't match
**Question 2**: The MDANSE temperature values don't match
the values in the log. Why?

## Calculate the Root Mean Square Displacement of atoms
Expand All @@ -241,7 +255,7 @@ root mean square displacement of atoms from the
reference position (which in our analysis was
the initial position).

**Question**: Based on this plot, the system has
**Question 3**: Based on this plot, the system has
melted in the second half of the simulation.
At what temperature did the melting occur?

Expand Down Expand Up @@ -270,7 +284,9 @@ data set from each of the two files to the plot and click
'Plot Data'. In the Plot Holder tab you should now
see a plot like this one:

![PDF_plot](pictures/pdf_results.png)
<p align="center">
<img width="800" src="pictures/pdf_results.png"/>
</p>

The plot shows that the interatomic distances in the
liquid molybdenum are more evenly spread compared to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'fold': False, # Fold coordinates in to box
'lammps_units': 'electron', # LAMMPS unit system
'n_steps': '0', # Number of time steps (0 for automatic detection)
'output_files': ('../mdanse_outputs/converted_trajectory', 32, 'gzip', "INFO"), # MDANSE trajectory (filename, format)
'output_files': ('../mdanse_outputs/converted_trajectory', 32, 128, 'gzip', "INFO"), # MDANSE trajectory (filename, format)
'time_step': '0.2', # Time step (lammps units, depends on unit system)
'trajectory_file': '../md_outputs/trajectory.txt', # LAMMPS trajectory file
'trajectory_format': 'custom', # LAMMPS trajectory format
Expand Down
Loading