Simulations of ionization equilibria in weak polyelectrolyte solutions and gels.