Theoretical and practical aspects of modelling activated sludge processes