Abstract
Constant pH (cpH) simulations are now a standard tool for investigating charge regulation in coarse-grained models of polyelectrolytes and colloidal systems. Originally developed for studying solutions with implicit ions, extending this method to systems with explicit ions or solvent presents several challenges. Ensuring proper charge neutrality within the simulation cell requires performing titration moves in sync with the insertion or deletion of ions -- a crucial aspect often overlooked in the literature. Contrary to prevailing views, cpH simulations are inherently grand-canonical, meaning that the controlled pH is that of the reservoir. The presence of the Donnan potential between the implicit reservoir and the simulation cell introduces significant differences between titration curves calculated for open and closed systems -- the pH of an isolated (closed) system is different from the pH of the reservoir, for the same protonation state of the polyelectrolyte. To underscore this point, in this paper we will compare the titration curves calculated using the usual cpH algorithm with those from the exact canonical simulation algorithm. In the latter case, titration moves adhere to the correct detailed balance condition, and pH is calculated using the recently introduced surface Widom insertion algorithm. Our findings reveal a very significant difference between the titration isotherms obtained using the standard cpH algorithm and the canonical titration algorithm, emphasizing the importance of using the correct simulation approach when studying charge regulation of polyelectrolyte, proteins, and colloidal particles.