I simulate a DMPG bilayer in a water solution. For unknown reasons the system has a drift in the z axis, meaning the bilayer moves in the z axis (up/down). I use NAMD.
When using MDAnalysis I apply PBC manually by subtracting the center of mass of the DMPG bilayer from all atoms and then move the atoms sticking out of the new box, to the other end i.e. wrapping, by an if statement. This work for the most part, but if it was possible to write the corrected positions back into the universe.trajectory, it would help me immensely.
I hope my question is understandable, in short: "Is it possible to write new positions to the universe.trajectory?".
xbox, zbox, bla, ybox = u.trajectory.ts.dimensions[:4]
But it seems the wrong dimensions, pbc wise, messes with center of mass time series. I'm not certain of this, as I couldn't quite understand whether it was dimensions or _unitcell that was used internally for pbc.
Anyways, thanks again for your help and patience.
Andreas
> Can you give an example? From what you're saying I don't understand what's wrong.Yes, of course. With the supplied code I've made this test dcd file. Asking for u.trajectory.ts.dimensions yields this result:array([ 62.2541275 , 86.92596436, 90. , 61.25470734,90. , 90. ], dtype=float32)
Asking for u.trajectory.ts._unitcell yields this result:array([ 62.2541275 , 61.25470734, 86.92596436, 90. ,90. , 90. ], dtype=float32)They are supposed to be the same, and in the original (which is too big to supply) both are equal to the _unitcell array seen above.