How do I solve the problem of matter not being in the center of the box?

After the simulation, the two chains in the track animation are not in the center of the box, but keep bouncing sometimes in the center and sometimes on both sides. However, I have tried -pbcWholenojumpres-urcompaction-center, but I still cannot solve the problem. How should I solve this problem?
Thank you!

Hi dwayne, to clarify, is this an issue you’re having with the periodic boundary conditions, where -pbc doesn’t seem to be getting rid of them in the trajectory? Or are you trying to constrain the positions of the chains such that they stay in the center of the box? Could you describe what the simulation is trying to achieve and send what commands you entered to set it up?

Yeah, that’s exactly the problem I have with periodic boundary conditions, I want to keep the two chains in the middle, I want to constrain them, keep them in the center of the box in a bound state, how can I solve that?

If the issue is to constrain them to the center of the box, you could implement position constraints on the atoms. You could restrain all the atoms in the proteins as is done during the equilibration steps (so include the define = -DPOSRES line in the mdp file), or you could choose to restrain a subset of the atoms (which you can do by editing the posre.itp file to only include those atoms you want to restrain). Of course, this would mean any movement at all from those atoms are restrained so the result would likely not be what you would observe in a physical situation unless those atoms are known to be somehow stabilized, such as if you expect to find the proteins bound to a larger protein whose exact behaviour can be approximated to those constraints.

If the issue is to get rid of the boundary images and -pbc doesn’t seem to be helping, this may then be due to some other issue with the way you set up the simulation, such as the box simply being too small for the proteins.

If possible, could you send the actual commands you used to setup the simulation as well as the ones you used for getting rid of the pbc, and also images of what the simulation looks like?

I used whole、mol、-center and cluster for processing, but my substance was never kept in the middle of the box.

-pbc doesn’t affect the behavior of the molecules, it just readjusts them within the box. If the 2 chains gradually diffuse away from each other throughout the course of the simulation, -pbc won’t place them back together, it’ll just move all the atoms as a whole system. If you know for a fact that the 2 chains should remain bound together, then maybe there’s an issue with the way you set up the 2 chains to begin with, but based off just the picture, it doesn’t look like there’s any issue with periodic boundary conditions

Thank you so much