Skip to main content

coilEM — local electromagnetic design

coilEM is an open-source application for exploring electric motors and magnetic fields. Edit a motor, inspect its geometry and mesh, run the bundled Magneto2D solver, and compare saved results with field playback and PDF/CSV exports. Everything runs on your computer.

Website: coilem.com

The latest complete benchmark reports, v1.7 on macOS and v1.8 on Windows, measure the selected A/B/C/D matrix on coilEM 0.3.0 (1fac3a1): 29 PASS, one planned unsupported Prius fixture and 42/42 BLDC gates on both platforms. The two platforms agree on every verdict and gate status. They run fresh Magneto2D fields against frozen, data-only FEMM references; no new FEMM solves were executed. The benchmark index retains earlier runs, the compiled v1.2 selection, archived runs and the scoped preview qualification record.

coilEM workspace

Developer preview: the published A/B/C/D benchmark report v1.1 qualifies these tested combinations against matched FEMM references, and reports v1.7 and v1.8 confirm that every qualified fixture still passes on coilEM 0.3.0, on macOS and Windows:

  • SPM with concentrated windings, under sinusoidal or ideal six-step current;
  • SPM with two-layer distributed windings, under sinusoidal current; and
  • flat-buried IPM with concentrated windings, under sinusoidal current.

V-shape IPM and untested combinations, such as six-step with distributed windings, are experimental. See Validation for the qualified scope and its limits.

Install

coilEM is published on PyPI as coilem. Install it with uv, then start it:

uv tool install coilem
coilem

coilem starts the app on your computer and opens http://127.0.0.1:2645 in your browser. Press Ctrl+C in its terminal to stop it. To try coilEM once without installing it, run uvx coilem. uv downloads a compatible Python (3.11 to 3.15) if you do not have one, and nothing else is needed: each wheel includes the Magneto2D solver and the built UI.

If you do not have uv yet, install it first, then open a new terminal:

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Platform Requirement
macOS on Apple silicon macOS 12 or newer
macOS on Intel macOS 10.15 or newer
Linux x86_64 glibc 2.27 or newer (for example Ubuntu 18.04, Debian 10, RHEL 8) and the GLU library: sudo apt-get install libglu1-mesa on Debian and Ubuntu
Windows x64 64-bit Windows

Linux and Windows on ARM are not supported yet. CI tests the installed wheel on macOS 15 (Apple silicon and Intel), Ubuntu 22.04 and Windows Server 2022 with Python 3.11 to 3.15.

Upgrade with uv tool upgrade coilem and remove it with uv tool uninstall coilem. Saved runs stay in your user-data folder after an uninstall. If coilem is not found after installing, run uv tool update-shell and open a new terminal. pipx install coilem also works when pipx runs on Python 3.11 to 3.15. The coilem launcher describes ports and options.

Start from source

To work on coilEM itself, build it from a checkout instead. You need Python 3.11 to 3.15, Node.js 24 with npm, and stable Rust with Cargo (the locked faer dependency requires Rust 1.84 or newer). Use a fresh checkout and virtual environment. On Ubuntu/Debian, install the Gmsh system library first: sudo apt-get install libglu1-mesa.

Windows PowerShell:

py -3.11 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.lock
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
cargo build --release --locked --manifest-path solvers/magneto2d/Cargo.toml
.\.venv\Scripts\python.exe -m uvicorn backend.public_main:app --host 127.0.0.1 --port 8000

macOS or Linux:

python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.lock
.venv/bin/python -m pip install -e ".[dev]"
cargo build --release --locked --manifest-path solvers/magneto2d/Cargo.toml
.venv/bin/python -m uvicorn backend.public_main:app --host 127.0.0.1 --port 8000

In a second terminal:

cd frontend
npm ci
npm run dev

Open http://127.0.0.1:5173, choose Use Example Motor, and follow Design → Solve → Results. The Getting started guide explains the example, solve settings and exports. The backend must stay bound to loopback.

Contributors can also try the packaged launcher from a checkout. Run python -m pip install . in a separate virtual environment; this builds the UI and Magneto2D, so it still needs Node.js and Cargo. Then run coilem: it serves the UI and API together and opens http://127.0.0.1:2645. See the coilem launcher.

What you can explore

  • Radial-flux SPM and IPM (flat-buried and V-shape) motor geometry, native Gmsh meshes, sinusoidal current, and ideal wye-connected 120-degree six-step excitation for SPM.
  • Loaded torque, phase and line Back-EMF, field plots, and harmonic spectra.
  • Preview, Standard and High accuracy mesh/solve presets. These names describe resolution and sampling; they do not certify accuracy.
  • Saved runs, comparison, project save/reopen, PDF, CSV and replay downloads.
  • Solver-backed electromagnetics lessons and cylindrical and linear Halbach workspaces.

Limits to understand

Qualification means agreement with FEMM, a reference 2D finite-element solver, on the measured benchmark fixtures: mean torque within 8%, Back-EMF fundamental and peak within 10%, plus fourteen six-step gates for BLDC. It covers only the tested combinations listed above, with M350-50A steel. Two of six V-shape IPM fixtures fail, so V-shape results are experimental. Cogging, THD, airgap harmonics, losses and thermal behavior are not covered. It is not a hardware measurement.

Motor sweeps use per-angle meshes, with symmetry-based reuse where applicable, without a sliding-band interface. Mesh changes can introduce numerical noise into torque ripple and cogging. Check mesh and angular convergence before interpreting small variations. A dedicated cogging result view is not included. Six-step excitation models ideal commanded currents, without PWM, switching, ESC dynamics or thermal behavior. See Release notes and Materials.

The application is coilEM 0.3.1 and the solver is Magneto2D 0.3.3. There are no accounts, hosted services or telemetry in this distribution. Elmer is an optional development-only lane; see its setup.

Reproducibility and contributing

Run the versioned A/B/C/D suite (SPM, IPM, Distributed Winding and BLDC) from the checkout with python -m tools.run_benchmarks --out-dir ../benchmark-output/my-run --pdf. It measures the current public native solver against saved FEMM data, with no reference solver installation or adapter required. See the benchmark commands, reference compatibility and version policy.

The public Magneto2D path ignores inherited numerical solver switches. It derives native options from the request and records its environment policy and options in new motor results. Runtime settings lists public configuration names. New design files use .coilem; existing .openem files remain compatible with the same JSON project format.

Completed runs live outside the checkout in your OS user-data directory and retain requests, results and hashes. See local storage. The root snapshot manifest records the original source export, listed public patches, and current file hashes. It is an integrity record, not evidence of numerical accuracy.

See Architecture, Magneto2D, the public API boundary, and Validation for checks and numerical limitations. Report bugs through Support, and vulnerabilities privately through Security. Source is licensed under AGPL-3.0-or-later; see LICENSE, third-party notices and trademark terms.

Metadata

Release files for coilem 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for coilem 0.3.1
File
coilem-0.3.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
coilem-0.3.1-py3-none-manylinux_2_27_x86_64.whl Python 3 none Linux glibc 2.27+ x86-64 Details
coilem-0.3.1-py3-none-macosx_12_0_arm64.whl Python 3 none macOS 12.0+ ARM64 Details
coilem-0.3.1-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details

Total release size: 23.1 MB

Release files / coilem-0.3.1-py3-none-win_amd64.whl

Download URL coilem-0.3.1-py3-none-win_amd64.whl
Size 5.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
bec96dd390f58e97527d47344788d0a26df1a1d647ba30d9957d342a7fb1608e
BLAKE2b-256 checksum
How to use checksums
b9d82c22a5054816ee1f02bace427903685459f97f54ef408ea8cef2d938c668
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / coilem-0.3.1-py3-none-manylinux_2_27_x86_64.whl

Download URL coilem-0.3.1-py3-none-manylinux_2_27_x86_64.whl
Size 6.0 MB
Tags Linux glibc 2.27+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e80e4b3466b5a090d17c2564a11a8d05e9da6203e982a8fd1243c51d2f2f6402
BLAKE2b-256 checksum
How to use checksums
550b67eb456ccf74efd4518fa272f6555f99f85c1eeab8ad44dadcaa62a90171
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / coilem-0.3.1-py3-none-macosx_12_0_arm64.whl

Download URL coilem-0.3.1-py3-none-macosx_12_0_arm64.whl
Size 5.5 MB
Tags Python 3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
d426dc6f417799dd77a4808d4f7d15e8577e0298bc669fbeb3dd0a537115a71c
BLAKE2b-256 checksum
How to use checksums
f3d456689fc8c7d7016ac10ff0de3aa2961ca8a63b101a33d8c5f4e50411b239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / coilem-0.3.1-py3-none-macosx_10_15_x86_64.whl

Download URL coilem-0.3.1-py3-none-macosx_10_15_x86_64.whl
Size 5.7 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
2987e80d7609e75d6db78c14ce8b3d3b72c4fe7c54753001f1a3d5230bc0b7a8
BLAKE2b-256 checksum
How to use checksums
be1043b309653b683b0cd0d021978b92c799794b22d25f00d6115190c387773d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

4 release files

0.3.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page