Calculating Equilibrium Constants and pH Changes