Modeling the competition between alkaline earth cations and trace metal species for binding by humic substances