Two methods for large-scale nonlinear optimization and their comparison on a case study of hydropower optimization