Cell potential and pH calculations