Buck-Boost Converters
Overview
This demonstration shows an inverting and a non-inverting buck-boost converter, both unregulated.

Electrical model
The buck-boost converter is a DC/DC converter that can be configured to produce an output voltage either lower or higher than the input voltage. Two different topologies exist: one has an inverting output where the polarity is the opposite the input; the second maintains the same polarity at the output as exists at the input.
The inverting buck-boost converter has an ideal transfer function of:
Vout ⁄ Vin = -D⁄(1-D), where D is the duty cycle.
This means that a duty cycle value of 0.5 will create a unity gain of 1 with opposite polarity, and values higher or lower than 0.5 will step-up or step-down the output voltage, respectively.
The second topology is essentially a buck converter followed by a boost converter, where a single inductor is shared by both and connects the two in series. The ideal transfer function is the same, except that the non-inverting buck-boost converter will produce an output polarity consistent with that of the input.
Simulation
Run the simulation with the model as provided to view the signals and verify that the load voltage of both topologies has an absolute magnitude of Vin * 0.3⁄(1-0.3) = 10 V * 3⁄7, or approximately 4.3 VDC. The voltages are of opposite polarity, while the currents are the same.