Metal removal from aqueous solutions: insights from modeling precipitation titration curves