Potentiometric titration of polyelectrolyte gels