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