Analysis of the Electrical Parameters of Aged Batteries and Their Effects on Power Quality in Second-Life Applications