The impact of residual flow on energy generation in hydroelectric power plants