New Algorithm for the IV Characteristic Modeling of the Photovoltaic Generator Malfunction within Impedance and Reversed Polarity Faults