Battery algorithm verification and development using hardware-in-the-loop testing