Thermal modeling of batteries for EV energy management