Battery Model for Embedded Systems