Analysis and Simulation of a Dynamic Reconfiguration Algorithm for a Photovoltaic Array