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 source identifies as coilEM 0.5.0 Developer Preview, with Magneto2D 0.4.0. Version 0.5.0 has not been frozen or released; coilEM 0.4.0 remains the published release. The release notes describe 0.4.0; the 0.5.0 release notes list what 0.5.0 changes and what qualification still has to establish. The v0.5.0 evidence index includes the completed physical Windows protocol 1.6 run at 88aae101 and the published Mac comparison with its original pins. The reference review is complete, and the new Windows Prius audit passes all 10 software checks. Same-candidate Mac qualification remains pending. The PyPI install commands below select the published release until 0.5.0 is published.

The v0.4.0 evidence report retains the historical Windows A/B/C/D development qualification: 35 supported jobs, 28 PASS, 1 YELLOW and one planned unsupported legacy Prius row at 5b6cb61. The separate exact Pyleecan Prius collection records 17 jobs and 568 fields at d993d76, with all 10 original software checks passing. These measured commits are the baseline for the final-candidate rerun, not measurements of a future tag. The benchmark index preserves the full reports, frozen FEMM references and earlier platform records.

The 0.5.0 freeze measures clean candidate 88aae101 under protocol 1.6.0 on both platforms (qualification update): Windows and macOS each record 46 PASS, the planned unsupported legacy ORNL Prius and 336/336 gates against the reviewed FEMM references, and the exact-candidate Pyleecan Prius passes all 10 software checks. The release qualification gate passes; v0.5.0 is not released until it is tagged and published.

coilEM workspace

Developer preview: the Windows requalification report provides the development evidence for these tested combinations with the current winding model:

  • 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. Of the 0.5.0 performance outputs, phase resistance and copper loss are qualified for a design with a wire, against hand calculations. The others (d/q flux linkage, torque–speed and efficiency maps, iron loss, efficiency and magnet temperature) are experimental. Each says which, with a reason, in the app, PDF and CSV. 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 OpenGL and X11 libraries Gmsh needs: sudo apt-get install libglu1-mesa libgl1 libx11-6 libxcursor1 libxext6 libxfixes3 libxft2 libxinerama1 libxrender1 libfontconfig1 libgomp1 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 system libraries Gmsh needs first: sudo apt-get install libglu1-mesa libgl1 libx11-6 libxcursor1 libxext6 libxfixes3 libxft2 libxinerama1 libxrender1 libfontconfig1 libgomp1.

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.
  • Loaded d/q flux linkage, apparent Ld and Lq, and a torque cross-check from them that includes reluctance torque.
  • A Torque–speed tab in Results. It solves a flux-linkage map over current and current angle, then draws peak and continuous torque–speed and power–speed curves (MTPA, field weakening and MTPV) for a DC bus and current limit, and an efficiency map.
  • Wire size, strands in hand, end-turn extension and winding temperature in Design, giving phase resistance and slot fill. Copper loss, stator iron loss and efficiency at the solved point, with a map of where the iron loss is. Iron loss is available for M350-50A and for the Pyleecan Prius's M400-50A.
  • A magnet temperature under Solve → Operating point. Br and HcJ are derated from the grade's cited coefficients for N35, N42, N48, N52 and N48SH.
  • 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. Torque–speed results download as a performance PDF, a performance CSV, an id/iq table CSV and the map points CSV.
  • Solver-backed electromagnetics lessons and cylindrical and linear Halbach workspaces.

The Pyleecan 2004 Prius software benchmark adds two fixed examples under Examples → Benchmarks: tutorial BEMF at 1000 rpm / 20°C and loaded torque at 2000 rpm / 60°C / 250 A peak. They preserve the pinned analytic model and embedded M400-50A curve through save and reopen. These experimental software references remain separate from ORNL hardware validation.

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. One of six V-shape IPM fixtures is YELLOW against FEMM, so V-shape results are experimental. Cogging, THD, airgap harmonics, losses and thermal behavior are not covered. It is not a hardware measurement.

Of the 0.5.0 performance outputs, only phase resistance and copper loss pass a gate so far:

  • Phase resistance passes a gate against independent hand calculations, for a design with a wire. A design without one gets a wire sized to fill the slot, and its resistance stays experimental. The gate checks the calculation, not a measured winding.
  • Loaded λd/λq and magnet temperature have FEMM gates registered for the freeze, so they are experimental until then. Ld and Lq, the maps, iron loss and efficiency have no gate.
  • Losses leave out magnet and rotor eddy-current loss, AC copper loss (skin and proximity effects) and inverter loss. Mechanical loss is a single constant you enter, the same at every speed.
  • Iron loss comes from the steel grade's guaranteed loss limits, not from measured motor data, and other steels show it as unavailable.
  • Magnet temperature derates Br linearly. It does not model demagnetisation, and there is no thermal solver: magnet and winding temperatures are inputs.
  • The torque–speed envelope ignores inverter voltage drops and dead time. Its continuous curve is a current limit, not a thermal rating.

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 source application is coilEM 0.5.0 and the solver is Magneto2D 0.4.0. 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) on your own computer with coilem benchmark, or coilem benchmark --quick for one case per phase in about 5 minutes. It solves each case with the installed Magneto2D and grades it against the frozen FEMM reference that ships with coilEM. It then checks that the result matches the published record for your platform, and writes a shareable report with no local paths. It needs no Git, Rust, Node.js or FEMM. From a checkout, python -m tools.run_benchmarks --out-dir ../benchmark-output/my-run --pdf runs the same suite with the developer options. See the benchmark commands, reference compatibility and version policy.

The motor benchmark collection also includes Pyleecan Prius 8p48s and the exploratory Honda Accord 2005 comparison. From a clean checkout, python -m tools.run_model_benchmarks --list lists the named selections; --out ../benchmark-output/all-models runs all three workflows. Prius has software acceptance checks; Honda retains its hardware residuals without a pass/fail claim. Deferred legacy ORNL Prius coverage is separate.

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.5.0

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.5.0
File Actions
coilem-0.5.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for coilem-0.5.0-py3-none-win_amd64.whl
coilem-0.5.0-py3-none-manylinux_2_27_x86_64.whl Python 3 none Linux glibc 2.27+ x86-64 Details for coilem-0.5.0-py3-none-manylinux_2_27_x86_64.whl
coilem-0.5.0-py3-none-macosx_12_0_arm64.whl Python 3 none macOS 12.0+ ARM64 Details for coilem-0.5.0-py3-none-macosx_12_0_arm64.whl
coilem-0.5.0-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details for coilem-0.5.0-py3-none-macosx_10_15_x86_64.whl

Total release size: 25.6 MB

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

Download URL coilem-0.5.0-py3-none-win_amd64.whl
Size 6.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
264f697cff4b1b09b5e775c5d5efa915219ea75d4f00d5137242151eba9c2de5
BLAKE2b-256 checksum
How to use checksums
e87ef4a5f418a156f3c8794403ec2db5a69e9dcf37833e7069e3bc4ac1a3397e
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 Nov 3, 2026.

Transparency log

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

Download URL coilem-0.5.0-py3-none-manylinux_2_27_x86_64.whl
Size 6.7 MB
Tags Linux glibc 2.27+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5f39bf61e37b41f6b0d49d13bd109d51b0f0b52cd8b13304eb1e3f7d8f215e9a
BLAKE2b-256 checksum
How to use checksums
99c08a49a0bb3325c536bf6d08e5c771d60ecafb7c0ea756436943a9a606ec58
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 Nov 3, 2026.

Transparency log

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

Download URL coilem-0.5.0-py3-none-macosx_12_0_arm64.whl
Size 6.1 MB
Tags Python 3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
79c339c22d9f0dc3561863e6f27163e4012761d94cca1efaa317af3db4a65300
BLAKE2b-256 checksum
How to use checksums
472211f55abe0be9d45c8f3e45235f625d3a3108371d4c878818ab9566d902bb
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 Nov 3, 2026.

Transparency log

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

Download URL coilem-0.5.0-py3-none-macosx_10_15_x86_64.whl
Size 6.3 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
c9d8333dac7e66ec26d329aa75b7c78f736644f1377d8658a80652d441c418fa
BLAKE2b-256 checksum
How to use checksums
75fd8a739924fbaaf40b445b5dc1daed5c6702f355d654fa0700d8ae8e9295bc
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 Nov 3, 2026.

Transparency log

Security for coilem 0.5.0

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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for coilem-0.5.0-py3-none-win_amd64.whl

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 Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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