A Methodology For Approximating Unit Generation Function And Optimizing Energy Function For Hydropower Reservoirs