Development of a smart algorithm for the prognosis and the diagnosis of the short circuit and the reversed polarity faults in a photovoltaic generator