Function for calculating the hydrolysis constants