I am having an issue understanding how the a buck converter circuit actually steps down the input voltage. Specifically, my issue is regarding the capacitor charging and discharging. Let's consider the basic buck converter diagram with an ideal switch:
When the switch is closed an increasing current flows through the inductor, going to the capacitor and the capacitor is charging, right? Now, when the switch is opened, a negative spike appears at the node prior to the inductor such that the diode is forward biased and the polarity of the inductor voltage is reversed. Now, I really haven't figured out what happens with the voltage of the capacitor. Is there a negative current now going to the capacitor which means that the capacitor voltage is decreasing?