Algorithms for the Accounting of Multiple Switching Events in Digital Simulation of Power-Electronic Systems