Flyback: design the transformer
A flyback stores energy in its coupled inductor while the switch is on and passes it to the output while it is off. Here you simulate the flyback example, let magnetics.design pick a core, the turns, the wire and the air gap from the simulated currents, write the result into the circuit and check it. About 10 minutes.
Pictures: a numbered red box is what you click or read, Run is a button, Design › Automate a menu path, F5 a key.
1. Open the flyback example
Step 1 of 7 · about 1 minChoose File › Open Example › Isolated › Flyback converter.
File.Open Example.Isolated.Flyback converter.
2. Read the circuit
Step 2 of 7 · about 1 minT1: the coupled inductor, 50 µH on each side (1:1), coupling 0.995.S1: the switch, at 100 kHz and a duty of 0.4.D1: the output diode.C1: the 47 µF output capacitor, with a 20 Ω load.
The 12 V source Vin and an RC snubber (Csn, Rsn) complete the circuit.
3. Simulate it first
Step 3 of 7 · about 1 minPress F5 (or ▶ Run). The magnetics design reads the winding currents from this run.
v(out)settles near 7.9 V.
4. Open Design Magnetics
Step 4 of 7 · about 1 min5. Check the spec
Step 5 of 7 · about 1 minThe Design page opens at Magnetics. Every field may stay empty: the part is the only magnetic part, T1, and the currents come from the last run.
Magnetics, the task.Part kind:AutodesignsT1as the coupled inductor it is.- Click
Run.
6. Read the design and apply it
Step 6 of 7 · about 2 minThe result shows beside the spec. Collapse the bottom panel (↓ at its top right) to see all of it, then click Apply: the design is written into T1 as one undo step, and the circuit is simulated again with the new part to check it. The best fit is picked in the Core table; pick another row's round button first to apply that core instead. A greyed Apply says why when you point at it.
- The total loss of the best candidate: 37.4 mW.
- Its temperature: 42.06 °C at 40 °C ambient.
- Its peak flux density: 132.7 mT, well below the 503 mT where the ferrite saturates.
- The check:
✔ Verified. - The core it chose.
The candidates are ranked by the size of the core, the smallest first, then by loss. To see the larger core with the least loss, set Rank cores by to Least loss, or type a shape from the catalogue into Shape under Advanced (besides the E pairs and rings, ETD, PQ, RM, EFD and planar sets such as ETD 34/17/11, PQ 26/25 or E 32/6/20, read from the Ferroxcube and TDK data sheets), and run again. The notes at the bottom are worth reading: the catalogue is a starter set, so check the core, gap and wire against the maker's data sheet.
The page also draws the winding as a cross-section: the core side on the left, each layer coloured by its winding, and a line for the magnetomotive force across the window. Hover a layer to see its turns, its Dowell factor and its loss; the table under it lists every layer. For a transformer, Winding order picks P/S, or P/S/P to split the primary around the secondary: the result then names the other arrangement beside the chosen one with its winding loss and leakage, so you can see what interleaving would save.
7. Simulate with the designed part
Step 7 of 7 · about 1 minClose the Design page with the × on its tab, open the bottom panel again and press F5.
v(out)settles near 7.9 V with the designedT1(its inductances and coupling now come from the core and the winding).
The same steps from a script
powercraft-cli run \
--cmd file.openExample --params '{"name":"flyback"}' \
--cmd simulation.run --params '{}' \
--cmd magnetics.design --params '{"apply":true,"verify":true}' \
--cmd simulation.run --params '{}' \
--cmd scope.measure --params '{"signals":["v(out)"],"t0":"2m"}'
Your own cores and materials
If your core, material or wire is not in the catalogue, import its OpenMagnetics MAS records (a vendor's MAS file, or records you write from the data sheet) with magnetics.importMas. Every record is checked first, and a bad value is refused with its field named. magnetics.design then searches your records beside the built-in ones and marks a design that uses one as user data (userData). The desktop app keeps them in library/magnetics.json in its settings folder. On the command line, --root . lets the chain read the file from the current folder:
powercraft-cli run --root . \
--cmd magnetics.importMas --params '{"path":"my-ferrite.ndjson"}' \
--cmd magnetics.library --params '{"source":"user"}'
If the data sheet plots the material's loss but gives no Steinmetz coefficients, read a few sine-loss points off its curves, at two or more frequencies and two or more flux densities, and fit them with magnetics.steinmetzFit. It returns k, alpha and beta (W/m³, Hz, T peak) with the error of the fit at every point (errorPct, maxErrorPct) and the range the fit holds over. Fit each frequency range on its own points, because a ferrite's α and β change with frequency:
powercraft-cli run --cmd magnetics.steinmetzFit --params '{"lossUnit":"kW/m3","points":[
{"frequencyHz":50e3,"bPeakT":0.1,"loss":20},{"frequencyHz":100e3,"bPeakT":0.1,"loss":50},
{"frequencyHz":100e3,"bPeakT":0.2,"loss":300},{"frequencyHz":200e3,"bPeakT":0.1,"loss":130}]}'
The points above only show the format. Read yours from your data sheet.
Next: boost and buck-boost.






