Battery Characterization and Optimization for use in Plug-in Hybrid Electric Vehicles: Hardware-in-the-loop duty cycle testing