Automatic generation of optimization problems in water provisioning systems