So, the switch is in position one for this first interval of time

DTS and it is in position two for a second interval of time D prime TS.

I've also labeled the inductor voltage in

current as well as the capacitor voltage in current.

Incidentally, here is how we in practice normally

realize the switch using power transistors and diodes.

So there's a gate drive circuit that's just shown here as

a voltage source but when we want the switch to be in position one,

this gate driver will produce a high voltage on

the gate of the MOSFET that will turn it on and when it's

on it effectively pulls this node down to

ground just like when the switch is in position one.

For the switch in position two,

what we do is the gate driver turns off the MOSFET by making its gate voltage low.

When the MOSFET is turned off,

the inductor will forward bias the diode turning

it on and putting the switch effectively in position two.

Now, one thing you might wonder is why can we

put a diode here and why does it automatically come on?

Now, one way to look at this is to go back to

the formula for the inductor that the inductor voltage is

L DIL DT which is the voltage from plus to minus across here.

So, when the MOSFET is on we build up

some positive current flowing through the inductor and through the MOSFET.

When we turn the MOSFET off,

one way to think about it is we're effectively trying to interrupt the inductor current.

So, the inductor current that was positive is now trying to be

forced by the MOSFET turning off to go immediately to zero.

So what is DIL DT?

Well, DIL DT is big and negative if we're shutting it off.

You can think of it as heading towards minus infinity

for slope that maybe in practice it isn't.

DIT isn't that large but it is negative and large in magnitude.

So, if the IL DT is negative,

say let's call it minus infinity,

what that does is it will make VL become big and negative.

Well VL is plus to minus in this direction that's the reference direction.

So, if VL is a negative number effectively it means that

the negative terminal is becoming positive and the positive terminal is going down.

So this node here where the MOSFET is connected will head to

a large positive voltage from the voltage developed in the inductor.

So, it heads towards plus infinity but

long before it gets there it forward biases the diode.

So in fact when this voltage rises above

the output voltage the diode will turn on and clamp

this voltage to the output and once it does turn

on then it provides a path for the inductor current to flow,

the inductor is happy and the current no longer tries to change.

So we can put a MOSFET and a diode that will operate automatically with the MOSFET.

Sometimes in the business,

a diode that operates in this fashion is called a freewheeling diode.