A control algorithm for the maximum power point tracking and the reactive power injection from grid-connected PV systems