CTCMS-UQ / QtNEMD

Interactive graphical frontend for NEMD calculations
GNU General Public License v3.0
0 stars 0 forks source link

Calculate and display more thermodynamic properties #11

Open emilyviolet opened 2 years ago

emilyviolet commented 2 years ago

The mean-square displacement (MSD) is a potentially useful way to quantify the kinematics of the system, especially once we start looking at colour flow. See, for example, the paper on Lennard-Jones-Gauss potentials in simple liquids. It's worth adding some code to the Fortran backend to calculate this, since it might be too expensive to do in Python.

It'd also be nice to be able to switch between viewing real-time plots of the MSD and RDF while the code is running.

emilyviolet commented 2 years ago

Pressure could also be interesting to display alongside volume.

emilyviolet commented 2 years ago

The naive way of plotting mean-square displacement is a little bit too slow to plot in real-time. The way PyQtGraph seems to be set up, we'd need to store all the values of MSD up to the current time-step in order to view the whole time-series, either:

  1. Pre-allocate an array before running and add new elements. This has the downside of only being able to calculate up to some fixed length simulation. Probably fine in something like a notebook or standalone (non-interactive) simulation, but this is not ideal for the Qt app.
  2. Keep appending values to a dynamically-sized list (e.g. python's base list class). This is extremely slow.
  3. Combine the two into some kind of hybrid, where we initially pre-allocate space and then add more if needed.

Option three is the most appealing of the bunch, but I need to think of a way to do this which is not horribly complicated and fragile.