How to add molecules inside a box at a given location?

GROMACS version: 2021.3 (mpi version)
GROMACS modification: Yes/No
Here post your question
I want to study micelle formation, in which I have to add a few hydrocarbons which are surrounded by surfactant molecules and then water. But I want to insert the hydrocarbon molecules at a given location (and not randomly as done by insert-molecules option) and then surround these oil molecules by a layer of surfactatnts and then run the simulation to determine whether the hydrcarbon is stable or not inside the pocket made by the surfactants. So how can I add these hydrocarbon molecules at predefined coordinates?
or Should I just add them randomly and allow them to come together during the course of the simulation?

did you try the option -ip of gmx insert-molecules?

the molecules can be inserted only at positions defined in positions.dat ( -ip ). That file should have 3 columns (x,y,z), that give the displacements compared to the input molecule position ( -ci ). Hence, if that file should contain the absolute positions, the molecule must be centered on (0,0,0) before using gmx insert-molecules (e.g. from gmx editconf -center ). Comments in that file starting with # are ignored. Option -dr defines the maximally allowed displacements during insertial trials. -try and -rot work as in the default mode "


No I haven’t tried it yet… I will definitely give it a try. One question I have here. Let’s say I want to add 100 molecules of a given type, then what should be the format for the dat file? I mean should I mention the displacements for all the molecules one by one?


You have to give position for every molecule.