This is the program using LC model of switch to simulate the circuit. Source code is not available since it is a lab project. Buck Circuit Simulation Boost Circuit Simulation