Skip to content

M1 · Derive and verify the buck

  • Derive the buck converter’s conversion ratio in CCM from volt-second balance, by hand and with sympy.
  • Derive its inductor-current ripple from the slope of the current during the on-interval.
  • Follow one equation through the site’s checks: its entry in equations.yaml, its test values, the sympy derivation that must reproduce it, and the generator. Break each on purpose and see which check fails.
  • Read volt-second and charge balance and the buck converter.
  • Have a clone of the repository with its Python package installed (pip install -e "python[dev,figures]", as the README says). Run the commands below from the clone’s root.
  • On this site, ΔiL\Delta i_L is half the peak-to-peak ripple of the inductor current, as in Erickson.

In CCM the switch connects the inductor to VgV_g for DTsD T_s, and the diode connects it to ground for the rest of the period. Write the inductor voltage in each interval, with the output voltage VV taken as constant (the small-ripple approximation). Average it over one period, set the average to zero, and solve for VV. Compare V/VgV/V_g with the buck's conversion ratio.

Let sympy do the same algebra. Fill in the two inductor voltages:

import sympy as sp
D, Vg, V = sp.symbols('D V_g V', positive=True)
v_on = ... # the inductor voltage while the switch is on
v_off = ... # and while the diode conducts
print(sp.solve(sp.Eq(D * v_on + (1 - D) * v_off, 0), V))

The repository’s own derivation is python/pe_core/derive/ccm_ratios.py, shown step by step on the derivations page.

During the on-interval the inductor current rises at a constant slope. Its rise over DTsD T_s is the peak-to-peak ripple, and half of it is ΔiL\Delta i_L. Compare your result with the buck's inductor ripple.

The buck example has VgV_g = 24 V, DD = 0.5, LL = 100 µH and fsf_s = 100 kHz. Work out its output voltage and its ΔiL\Delta i_L, and enter them under Acceptance criteria. Then open the ripple in the equation explorer and sweep the inductance: the ripple falls as 1/L1/L.

▶ Open in the equation explorer: Buck inductor current ripple (half peak-to-peak), CCM
Preset from the example buck-basic

In your clone, run python scripts/gen_equations.py, pytest and python scripts/mathlint.py. All three pass, and git status shows that the generator left packages/pe-core/equations/ as it was.

In packages/pe-core/equations/equations.yaml, change the first expected value in the tests of buck.ccm.M. Run python scripts/gen_equations.py: it refuses, and its message names the entry, the test and the value the expression gives. Undo the change with git checkout -- packages/pe-core/equations/.

Now change the expression of buck.ccm.M and both of its expected values so that they agree with each other (halve all three, say). The generator accepts this, but pytest fails in test_derivation_reproduces_yaml[buck.ccm.M]: the sympy derivation still gives the ratio you found in step 1. Undo the change as before; the same checkout also restores the files the generator rewrote.

  • Show the example's value

    12 V (from buck-basic: Buck example)

  • Show the example's value

    300 mA (from buck-basic: Buck example)

Your ticks stay in this browser only: no account, and nothing is sent.

  • ΔiL\Delta i_L here is half the peak-to-peak ripple. The full swing of the current is twice the value the check expects.
  • The ratio holds in CCM only. When the inductor current reaches zero before the period ends, the output rises above DVgD V_g (CCM and DCM, and mission M2).
  • Run pytest with the Python that has pe_core installed. Another interpreter fails at import, before any check runs.
  • An experiment that the generator accepted also rewrote its output files. git checkout -- packages/pe-core/equations/ restores the YAML and those files together.
  • Book chapter Principles of Steady-State Converter Analysis (Ch. 2) — R. W. Erickson, D. Maksimović · retrieved 2026-09-23
    The standard derivation of volt-second and charge balance, the small-ripple approximation and inductor/capacitor ripple.
  • Course Introduction to Power Electronics — University of Colorado Boulder (Coursera) · retrieved 2026-09-23
    First course of the CU Boulder specialization: steady-state analysis, losses and efficiency.
  1. Why is the inductor voltage, averaged over one switching period, zero in steady state?

    1. Because the output capacitor holds the output voltage constant
    2. Because the inductor current ends each period at the value it started with
    3. Because the switch and the diode conduct for equal times
    4. Because the input voltage is constant
    Answer and explanation

    Correct answer: B The change of the inductor current over a period is its average voltage times the period over the inductance. A current that repeats from period to period changes by zero, so the average voltage is zero: that is volt-second balance.

  2. A buck converter in CCM runs from 48 V at a duty ratio of 0.25. What is its output voltage?

    1. 36 V
    2. 64 V
    3. 12 V
    4. 16 V
    Answer and explanation

    Correct answer: C The conversion ratio is the duty ratio: 0.25 times 48 V is 12 V.

  3. The inductor current of a buck swings between 1.0 A and 1.6 A. What is ΔiL\Delta i_L in this site's convention?

    1. 0.6 A
    2. 0.3 A
    3. 1.3 A
    4. 1.6 A
    Answer and explanation

    Correct answer: B The peak-to-peak ripple is 0.6 A, and ΔiL\Delta i_L is half of it, 0.3 A, as in Erickson. The average current is 1.3 A.

  4. The inductance of a buck in CCM is doubled, all else unchanged. What happens to ΔiL\Delta i_L?

    1. It halves
    2. It doubles
    3. It stays the same
    4. It falls to a quarter
    Answer and explanation

    Correct answer: A The current's slope during the on-interval is the inductor voltage over the inductance, so the rise over the same time halves.

  5. You change the expected value of one test of an equation in equations.yaml and leave its expression alone. What happens?

    1. Nothing, until the site is built
    2. Only the TypeScript tests fail
    3. The generator refuses, naming the entry, the test and the value the expression gives
    4. mathlint reports a hand-typed formula
    Answer and explanation

    Correct answer: C Loading the catalogue evaluates every test against its expression, so the generator, and pytest, stop at the first mismatch and say where it is.

  6. You change an expression and its expected values so that they agree with each other. Which check still catches it?

    1. None: the tests pass
    2. The derivation test: the sympy derivation must reproduce the expression in equations.yaml
    3. The privacy scan
    4. The link checker
    Answer and explanation

    Correct answer: B The test values only check the expression against itself. The derivation in python/pe_core/derive/ is independent of the YAML, and pytest compares the two.

The numbers in the examples, presets and exercises on this site are synthetic: round teaching values, not data from any real design.