Calculations and pH measurement