Nernst equation and pH calculations