text: Consider a hydrogel made of polyelectrolytes decorated with weak acid groups that can ionize according to the reaction
  is immersed in a salt solution of physiological concentration. The degree of ionization of the polyelectrolytes is then controlled by the  and due to the charged nature of  and , electrostatic interactions with other ions in the systems. This is effectively a reacting system governed by acid-base equilibrium modulated by electrostatic effects, and is relevant in drug delivery, sea water desalination and dialysis technologies. Due to the elastic nature of the gel, the dispersion of  in the system is constrained and hence, there will be a partitioning of salts ions and  inside and outside the gel, which is intimately coupled to the polyelectrolyte degree of ionization. This ion partitioning inside and outside the gel is analogous to the partitioning of ions across a semipemerable membrane in classical Donnan theory, but a membrane is not needed here because the gel volume constraint imposed by network elasticity effectively acts its role, in preventing the macroions to pass through the fictitious membrane while allowing ions to pass. 
  The coupling between the ion partitioning and polyelectrolyte ionization degree is only partially by the classical Donnan theory. As a starting point we can neglect the electrostatic interactions among ions. Then at equilibrium, some of the weak acid sites in the gel would dissociate to form that electrostatically attracts positive charged  and salt cations leading to a relatively high concentration of  and salt cations inside the gel. But because the concentration of  is locally higher, it suppresses the further ionization of the acid sites. This phenomenon is the prediction of the classical Donnan theory. However, with electrostatic interactions, there are further complications to the picture. Consider the case of two adjacent, initially uncharged acid sites  are both dissociated to form . Since the two sites are both negatively charged, there will be a charge-charge repulsion along the backbone of the polymer than tends to stretch the chain. This energy cost is high both elastically and electrostatically and hence suppress ionization. Even though this ionization suppression is qualitatively similar to that of Donnan prediction, it is absent without electrostatic consideration and present irrespective of ion partitioning. The combination of both effects as well as gel elasticity determines the volume of the gel at equilibrium. Due to the complexity of the coupled acid-base equilibrium, electrostatics and network elasticity, only recently has such system been correctly recreated in computer simulations.