Hello all,

I can't figure out how to use restraints correctly, and would really appreciate some help. I simply want to keep some small molecules from getting close to the box boundaries.


What I've tried:
I have a simple 31 x 31 x 31 A box filled with water and five hydronium molecules. I do mini abnr nstep 300 first and then successfully run a dyna CPT simulation without errors.
Now I want to keep those five hydroniums from reaching the box boundary. So I tried to harmonically restrain them to the box center:

CONS HMCM FORCE 100.0 WEIG REFX 15.5 REFY 15.5 REFZ 15.5 -
SELECT SEGID HYDR END

I placed this command in various positions in the input file:
- anywhere in the dynamics block: I just get "extraneous characters found" in the output
- after mini, before dyna: all molecules freeze except hydronium

I don't want the restraint included in the minimization, I only want it active during a regular MD run.
I also played around with CONS HARM ABSO.
I read the cons.doc but it doesn't tell me where to place the command.


Questions:
1) Where and how do I write the restraints block in the input file for a dynamics run?
2) Is this even a good way to keep my molecules in the box center?
3) Does RDIST of HMCM keep molecules within or outside a specific radius?
4) Is there a way to specify the box center instead of a reference coordinate set to restrain to with CONS HARM ABSO?


This seem to be basic question and I apologize if I overlooked something in the docs or the forum posts. I spent several days searching, but I am still a CHARMM beginner.
Any advice or sample input will be greatly appreciated.

Attached Images
water_ions.inp.txt (1.32 KB, 198 downloads)
SHA1: 4ae7e4a818a5ef536b78eb2558e1223bc5ca88ad