Energy management algorithm for an optimum control of a photovoltaic water pumping system