A Dynamic Programming Algorithm for HEV Powertrains Using Battery Power as State Variable