−−This paper describes a procedure to find the best controlled variables in an economic sense for the activated sludge process in a wastewater treatment plant, despite the large load disturbances. A novel dynamic analysis of the closed loop control of these variables has been performed, considering a nonlinear model predictive controller (NMPC) and a particular distributed NMPC-PI control struc...