This post is intended to complement the previous one with a more theoretical look at dissolving carbon dioxide in water. I wrote a script in R to draw a Deffeyes diagram. This diagram shows the interplay between CO2, pH, and alkalinity. My main reference was the venerable Water Chemistry textbook