A generalized equivalent circuit model for lithium-iron phosphate batteries