Linear quadratic dynamic programming for water reservoir management