# Why does molecules in MD trajectory go out of the pbc box in VMD / pymol?

**URL:** <https://gromacs.bioexcel.eu/t/why-does-molecules-in-md-trajectory-go-out-of-the-pbc-box-in-vmd-pymol/3509>\
**Category:** User discussions\
**Tags:** pbc, gmx-trjconv\
**Created:** [January 20, 2022, 5:10pm UTC](https://gromacs.bioexcel.eu/t/why-does-molecules-in-md-trajectory-go-out-of-the-pbc-box-in-vmd-pymol/3509 "2022-01-20T17:10:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kalindu](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@Kalindu](https://gromacs.bioexcel.eu/u/Kalindu)\
**Post date:** [January 20, 2022, 5:10pm UTC](https://gromacs.bioexcel.eu/t/why-does-molecules-in-md-trajectory-go-out-of-the-pbc-box-in-vmd-pymol/3509/1 "2022-01-20T17:10:22Z")

</div>

I have done an MD simulation of a few oligopeptides and obtained the trajectory. When I visualize it using VMD/ Pymol molecules move out of the PBC box.

Why does it happen ?  
How can I keep the molecules within the box?

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [January 21, 2022, 4:07am UTC](https://gromacs.bioexcel.eu/t/why-does-molecules-in-md-trajectory-go-out-of-the-pbc-box-in-vmd-pymol/3509/2 "2022-01-21T04:07:41Z")

</div>

A periodic system is infinite; there is no such thing as “outside” of a box, nor should you try to constrain your molecules to remain within it. You can recenter on some useful/convenient reference with `gmx trjconv` and see how other molecules in the system move relative to it, but otherwise there are no tricks that should be played.
