Optimization of the operational variables of a medium-scale reactor for metal-containing wastewater purification by ferrite formation