This example shows how to use different levels of fidelity in DC-DC converters. The system contains three buck-boost converters. The top converter uses an ideal switch at a sample time of 10 us. To yield accurate results even though the model is under sampled at a sample time of 50 us, the middle converter uses an averaged switch with averaged pulse. To further increase the sample rate and to operate as an ideal averaged converter, the bottom converter uses an averaged switch and duty cycle instead of gate pulse. The Control subsystem contains a PWM generator. The Scopes subsystem contains Scope blocks that allow you to see the simulation results.
The plot below shows the comparison of the currents on both sides of the converter.
The plot below shows the comparison of the voltages on both sides of the converter.