A modular framework for battery modeling in electronic designs