Nonlinear optimal control for hydro-power generation units