Dynamics, models, and management of rechargeable batteries