I'm trying to simulate a buck-boost converter where Vin and Vout are constantly changing. As a result, the time it takes to charge/discharge the inductor varies as well, and a voltage source that controls the MOSFETs with a constant frequency won't cut it.
I've been simulating 1 or 2 cycles at a time by disconnecting the voltage source from the circuit after X seconds, but it's not efficient at all. Is there a way to vary the Ton of the voltage source with an equation? Or perhaps a way I can type a list of Ton values in a text box and have the voltage source pick one every cycle?
Thanks!