You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In GROMACS's rdf analysis script, there is an option to calculate with only the x- and y-coordinates (-xy). This is not as simple as zeroing the z-coordinates, since there is a normalization factor that is currently calculated with r^3, but would need to be normalized with r^2.
A more generalized case would allow for any collapsing of coordinates to an arbitrary plane. Or it could even be interesting to extend it to a 1D case, but I have not thought about when that might be useful.
Describe alternatives you've considered
Applying a transformation to the coordinates alone would not work, since the normalization factor is based on spherical shells, not circular shells when ignoring the z-direction.
Additional context
This is useful in certain cases to collapse the z-direction, even with full 3D coordinates. (One example might be with a layered structure and you want to collapse the layers together.) However, it could be useful to apply to 2D simulations where the z-direction doesn't exist or is set to zero (or some other arbitrary value).
The text was updated successfully, but these errors were encountered:
The more general case would be to prescribe the normal to the plane that you're mentioning, i.e., doing the RDF in cylindrical coordinates (r, phi, z) for each reference particle and then summing over the z coordinates and the polar angle.
Tangentially related, 2D densities in cylindrical coordinates are also useful. A very long time ago I wrote code to compute cylindrical densities which can be quite useful for looking at water and ions in channels and pores. (I think, GROMACS gmx densmap can do that nowadays.)
One possible implementation of this would be to use an rdf_type option like MDAnalysis.analysis.msd.EinsteinMSD() has, where the user could select relevant dimensions. ({'xyz', 'xy', 'yz', 'xz', 'x', 'y', 'z'}) Like MSD, the default would be 'xyz', which returns the standard 3D RDF. This should probably return dim_fac, since the dimensionality (hence volume/area/length scaling changes dimensionality).
This would make it possible to replicate GROMACS's -xy flag, but make it more extensible for any system. Non-orthogonal projections (RDF along an arbitrary plane) would need to be handled by system transformations before being passed to InterRDF().
Sorting out the normalisation factor shouldn't be too hard, then its just a matter of passing a correctly zeroed copy of the coordinates to capped_distance. 👍
Describe the solution you'd like
In GROMACS's
rdf
analysis script, there is an option to calculate with only the x- and y-coordinates (-xy
). This is not as simple as zeroing the z-coordinates, since there is a normalization factor that is currently calculated with r^3, but would need to be normalized with r^2.A more generalized case would allow for any collapsing of coordinates to an arbitrary plane. Or it could even be interesting to extend it to a 1D case, but I have not thought about when that might be useful.
Describe alternatives you've considered
Applying a transformation to the coordinates alone would not work, since the normalization factor is based on spherical shells, not circular shells when ignoring the z-direction.
Additional context
This is useful in certain cases to collapse the z-direction, even with full 3D coordinates. (One example might be with a layered structure and you want to collapse the layers together.) However, it could be useful to apply to 2D simulations where the z-direction doesn't exist or is set to zero (or some other arbitrary value).
The text was updated successfully, but these errors were encountered: