For a pilot-scale application, pH control in the treatment of highly contaminated dye industrial wastewater containing metallic compounds as the main pollutants has been investigated with a method using adaptive heuristic criticism control (AHCC). Subsequent experimentation on between 12 and 181 of the wastewater was carried out using statistical experimental design methodology to evaluate the effects of three critical factors: slaked lime (calcium hydroxide, Ca(OH)(2)) concentration, iron chloride (FeCl3) concentration and wastewater volume. With these critical factors, the wastewater treatment process is modeled as an appropriate quadratic cost function of the turbidity of the clarified water. The model is optimized with Rosenbrock's method. Response surface topology of the wastewater treatment is given in terms of optimal concentrations of lime water and FeCl3 and optimal wastewater volume at pH 11. (c) 2006 Elsevier Ltd. All rights reserved.