Further development of the mathematical model for controlling wastewater biological treatment process in a mixing aeration tank is proposed. The invariant set of the system of differential equations representing the model was found. The algorithm of finding optimal process control in the problem of minimizing oxygen consumption was developed. The results of testing the developed algorithm are reported.