Hardware-in-the-Loop Simulation of Power Electronic Systems Using Adaptive Discretization