Charge for phosphates:
pKa1=2.1, pKa2=6.8, pKa3=12.7 (wiki: 2.12, 7.21, 12.67 at 25°C)
tPO4 = [H3PO4] + [H2PO4] + [HPO4] + [PO4]
charge(tPO4,pH) = [H2PO4] + 2[HPO4] + 3[PO4]
[H2PO4] / [H3PO4] = 10^(pH-pKa1)
[HPO4] / [H2PO4] = 10^(pH-pKa2)
[PO4] / [HPO4] = 10^(pH-pKa3)