How do I model a soft-switching H-bridge?

Problem description: 

I'm concerned that ideal switches cannot be used to simulate resonant topologies, is this true?


In general, it is possible to simulate resonant topologies with ideal switches. You just need to be extra careful with the switch timing. A switch should only be turned on once the parallel capacitor is completely discharged. Otherwise this will generate an error about state discontinuities since the capacitor is being short circuited. An alternative is to add a parallel resistance, but keep in mind that adding extremely small time constants injects numerical stiffness into a model and may slow down a simulation.