Mathematical modeling and economic optimization of wastewater treatment plants