Problem with Widom's particle insertion method

Hello,

I wanted to use widom particle insertion and deletion method to compute the chemical potential of my system. I am working on the swelling of polyelectrolyte hydrogels using explicit solvent (SPCE water model). Initially, I prepared my polyelectrolyte gel and equilibrated it using an NPT ensemble ( 300 K and 1 atm). My whole gel is empty, but widom method cannot insert or delete any SPCE water molecules. When I am using widom method, my system is using the NVT ensemble. However, it computes output parameters ( chemical potential, potential energy, and volume). I also tried SPCE system without gel; still, widom method couldn’t insert or delete molecules. There is also an example of widom method present with LAMMPS files; it also didn’t work. Technically, the SPCE molecule number should fluctuate if a system is in equilibrium. I don’t have any insertion or deletion or any fluctuations whatsoever. Is there anyone facing a similar problem? if so, can you please guide me? I appreciate your valuable time and help. Thank you.

Regards,
Muzaffar

1 Like

Please always report which LAMMPS version you are using and what platform you are running on.

“didn’t work” is a very unscientific way to describe a situation. Those examples do work exactly the way they were intended to. So if you believe that this is not the expected behavior, you have to - at the very least - describe in detail how you determine that this is the case.

I am using (the 23 June 2022 lammps version) on windows. Usually, in the case of polyelectrolyte gels, the expected behavior is that it should insert SPCE water molecules inside the system from the reservoir because the system is almost empty until the chemical potential reaches equilibrium. At that point, the number of SPCE water molecules should start fluctuating around constant water molecules. This sort of behavior has been reported in one of the research paper. However, they were considering water molecules as beads.

It seems to me that you are confusing fix widom and fix gcmc. To the best of my knowledge fix widom will only record energy changes due to attempting different insertions during an MD simulation. Those attempts will not result in changes in the number of particles.

I understand your point. However, Lammps documentation says, “fix performs Widom insertions of atoms or molecules at the given temperature”

https://docs.lammps.org/fix_widom.html

But this is what it does. It inserts a particle or molecule, records the change of energy, and then restores the system. With the recorded energy change, the advertised properties can be computed.

Please see, e.g.: Widom insertion method - Wikipedia

The purpose of fix widom is to sample many possible insertions at a given thermodynamic state (given by boundary conditions and thermostat and/or barostat).

For “permanent” insertions you would need to do a simulation in the grand canonical or semi-grand canonical ensemble, which is implemented by fix gcmc and sgcmc, respectively.

Fix widom can be used to determine the chemical potential at a given state, while for fix gcmc it is an input parameter.

1 Like

Thank you so much for your valuable time. I got your point.