Calculation of site affinity constants and cooperativity coefficients for binding of ligands and/or protons to macromolecules. II. Relationships between chemical model and partition function algorithm