Nonsmooth Modeling and Simulation for Switched Circuits [electronic resource]