Principles of surface water quality modeling and control