CoilGen² · Magnetic coil design

From target field
to coil winding.

Interactive design and field evaluation for MR gradient and shim coils.

Define a support surface and target field, optimize the surface current, and turn its contours into a winding. CoilGen2 brings these steps into a Python library and a desktop workbench.

Created by Philipp Amrein. Started at the University of Freiburg.

Copper-colored winding paths around a cylindrical support in CoilGen2
A cylindrical winding in CoilGen2.Numerical illustration from the workbench. Designs, fields & evaluation →
Gradient coilsShim coilsTarget-field optimizationPython library + desktop workbench

Design & inspect

A continuous workflow.
A field check at every stage.

Work from a current-carrying surface to conductor geometry, while tracking how each processing step changes the calculated magnetic field.

  1. 01

    Define

    Support geometry, target field and suppression regions.

  2. 02

    Optimize

    Surface-current distribution with regularization and physical objectives.

  3. 03

    Build

    Contours, connections, return paths and conductor placement.

  4. 04

    Evaluate

    Fields, electrical estimates and geometric diagnostics.

CoilGen2 desktop workbench showing a model tree, cylindrical support controls and a winding visualization
The graphical workbench and its processing sequence. Explore the software →Full figure ↗

Cross-sections & sweeping

From cross-section
to conductor.

Define an elliptical, rectangular or custom convex profile, then sweep it along the winding. Inspect the resulting conductor body and its placement on the support surface.

Elliptical, rectangular and trapezoidal cross-section editors above their corresponding swept conductors; a separate plot below shows the elliptical example's field error at three processing stages
From the CoilGen2 abstract: A–C, cross-section editors; D–F, swept conductors. G, the elliptical example’s relative RMS Bz error at the source route (1), realized route before mounting (2), and mounted electrical centerline (3), using a fixed-current thin-filament calculation.Full figure ↗

Numerical geometry demonstration. The illustrated configurations did not pass all configured geometric checks. Finite cross-section electromagnetic fields were not evaluated.

Explore the coil examples →

Research foundations

Built on the original
CoilGen work.

Developed during doctoral research in Freiburg, CoilGen connects target-field optimization with coil-layout generation. CoilGen2 continues this work in Python with a shared numerical engine for scripts and graphical projects.

Publications & citing works →

Start designing

Choose a template. Define your field.

Start with a gradient or shim example, or use the Python API for a reproducible design study.

Download & install