This example shows a synchronous buck converter.
P. Giroux (Hydro-Quebec)
This switched power supply converts a 30V DC supply into a regulated 15V DC supply. The model can be used to size the inductance L and smoothing capacitor C, as well as to design the feedback controller. By selecting between continuous, discrete time, and fixed-point PI controllers, the impact of discretization and using limited numerical precision can be explored.
If you have Simscape™ Electronics™, see the elec_switching_power_supply example model for a detailed version that uses N-Channel MOSFETS to capture the switch-on/switch-off timing of the devices, this depending primarily on the gate capacitance values and the PWM driver output resistance.