A smart algorithm for the diagnosis of short-circuits faults in a photovoltaic generator