Calculation of Ion Concentrations and pH