Chemical equilibria in wastewaters during toxic metal ion removal by agricultural biomass