A method of operating a waste water treatment plant (WWTP) having at least one of an aerobic digester (AD) and a membrane bioreactor (MBR) is described. The method of operating AD is comprised of monitoring and controlling AD in real-time using an online extended Kalman filter (EKF) having a online dynamic model of AD. The EKF uses real-time AD measured data, and online dynamic model of AD to update adapted model parameters and estimate model based inferred variables for AD, which are used for AD control by AD control system having supervisory and low-level control layers. The method of operating MBR is similar to that of AD. The supervisory control ensures the WWTP satisfying the effluent quality requirement while minimize the operation cost. A WWTP having at least one of AD or MBR is disclosed. The method of operating a WWTP can be implemented using a computer.
 This application was funded under Department of Energy Contract DE-FC26-08NT05870. The U.S. Government has certain rights under this application and any patent issuing therefrom.