I am attempting to analyse the radial distribution function (oxygen to oxygen) for a ~400ps simulation on a droplet of water (MD done with NAMD). I am using the python library MDAnalysis to do this. However, the problem is that the default RDF function (MDAnalysis.analysis.rdf.InterRDF
) from MDAnalysis uses periodic boundary conditions. The water droplet simulation I am doing is in vacuum i.e. with no boundary conditions.
The calculation of the RDF seems to have a step where the total number is divided by the box volume to get the density. So, when I am using the function on my system, python is giving me a divide by zero
error, as the box volume is zero. The RDF I got is zero throughout because of this. How should I fix this?
I have considered writing my python code to get the RDF, because MDAnalysis provides the coordinates of each atoms for each frame. I was sort of able to do this when there was only one reference atom (i.e. RDF from one atom) (in the jupyter notebook), but I don't know how to get the RDF when there are multiple reference atoms. There are a lot of formulas for RDF that I could find, but I am not sure which one to use, or how to implement them in python. If anyone could help me with this, that would also be greatly appreciated.
I cannot share my raw data as it is an ongoing research project, but I can share the Jupyter Notebook I used for the analysis: https://github.com/ShoubhikRaj/molecular-modelling/blob/main/matter-modelling/rdf-mdanalysis/RDF_analysis-Copy1.ipynb
use PBC
. If you uncheck it, maybe it will not take PBC I am not sure whether it works or not, but I would give it a try. $\endgroup$