Skip to main content

coilEM

coilEM is an open-source app for designing electric motors. Draw a motor, mesh it, solve it with the built-in 2D finite-element solver, and read off torque, back-EMF and field plots. It runs on your computer, with no account and nothing sent anywhere.

Website: coilem.com

coilEM workspace

Install

coilEM is on PyPI as coilem. Install it with uv and start it:

uv tool install coilem
coilem

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

If you do not have uv yet, install it and 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"

Update check

Once a day, coilem asks coilem.com whether a newer version is released, and an Update tag appears beside the version in the app when there is one. On macOS and Linux the tag opens Upgrade and restart: coilEM stops, upgrades itself the way it was installed (uv tool, uvx or pip), starts again in the same terminal and reloads the page, so save your design before you click it. It is refused while a solve is running, and if the upgrade fails the version you had starts again and the tag says why. On Windows, and for other installs, stop coilEM and run uv tool upgrade coilem (with uvx, uvx coilem@latest). The request carries the coilEM version, your operating system (for example coilEM/0.5.10 (Windows)), whether it is the first check from your computer this week or this month, and whether coilEM had never run on your computer before, which lets installs and new installs be counted without an identifier. Nothing else is sent: no identifier and nothing about your designs or runs. To turn it off, set COILEM_UPDATE_CHECK=0 where you start coilEM. coilEM works the same offline. The privacy page covers the update check and the coilem.com website.

Supported platforms: macOS 12 or newer on Apple silicon, macOS 10.15 or newer on Intel, 64-bit Windows, and x86_64 Linux with glibc 2.27 or newer. Linux and Windows on ARM are not supported yet. On Debian and Ubuntu, install the libraries the mesher needs first:

sudo apt-get install libglu1-mesa libgl1 libx11-6 libxcursor1 libxext6 libxfixes3 libxft2 libxinerama1 libxrender1 libfontconfig1 libgomp1

Upgrade with uv tool upgrade coilem; remove it with uv tool uninstall coilem. If coilem is not found after installing, run uv tool update-shell and open a new terminal. The coilem launcher covers ports and options.

What you can do

Choose Use Example Motor, or one of the motor types on the first screen, and follow Design → Solve → Results. The Getting started guide walks through it.

  • Design inner-rotor and outer-rotor (outrunner) surface-magnet motors, and flat-buried and V-shape IPM motors, with concentrated or distributed windings. See the motor in 2D and 3D as you edit it.
  • Drive it with sinusoidal current, or with ideal six-step (BLDC) commutation for surface-magnet motors.
  • Solve for loaded torque, phase and line back-EMF, flux linkage and cogging torque, then play the field back as the rotor turns.
  • Go further with d/q flux linkage and inductances, torque–speed and efficiency maps, copper and iron loss, and magnet temperature.
  • Keep your work: saved runs, side-by-side comparison, and PDF and CSV exports.
  • Learn: ten solver-backed lessons, and workspaces for cylindrical and linear Halbach arrays.

How far to trust it

coilEM is a developer preview. Every release is compared with FEMM, a reference 2D finite-element solver, on a fixed set of benchmark motors: mean torque must agree within 8% and back-EMF within 10%.

Motor Status
Inner-rotor SPM, concentrated or two-layer distributed winding Checked against FEMM
Flat-buried IPM, concentrated winding Checked against FEMM
V-shape IPM Experimental
Outrunner (outer-rotor SPM), concentrated winding Checked against FEMM with sinusoidal current; six-step drive is Experimental

Of the other outputs, phase resistance and copper loss are checked against hand calculations. Cogging torque, d/q quantities, the maps, iron loss, efficiency and magnet temperature are experimental, and the app, PDF and CSV label each one. Agreement with FEMM is agreement between two solvers, not a hardware measurement.

Things the model leaves out:

  • It is 2D: end effects and skew are not modelled.
  • Six-step drive is the ideal commanded current, without PWM, switching, ESC dynamics or thermal behavior.
  • Electromagnetic solves use entered winding and magnet temperatures. Solve → Thermal estimates steady-state part temperatures from losses and cooling assumptions. Its heat balance omits internally generated rotor iron loss, including when the electromagnetic run reports it.
  • Losses omit magnet and rotor eddy currents, AC copper loss and the inverter.
  • Each rotor position is meshed separately, so check mesh and angle settings before reading meaning into small torque-ripple or cogging differences.

Validation has the full scope and limits, and the benchmark index has every qualification record.

Check it yourself

Run the same benchmark suite on your own computer:

coilem benchmark --quick

That solves one complete-grid case in each of the six phases and compares it with the frozen reference that ships with coilEM. Drop --quick for all 69 cases, or use --list to see the selection and recorded runtime estimates. It needs no Git, Rust, Node.js or FEMM. See benchmark protocol 1.10.0.

Script it from Python or the command line

Define a motor, solve it and read the results from Python, with no request JSON to write by hand:

import coilem

if __name__ == "__main__":  # the solver's worker processes import this file again
    motor = coilem.Motor.load("my_motor.coilem")  # or build one from coilem.Stator(...), Rotor(...), Winding(...)
    result = coilem.solve(motor, coilem.OperatingPoint(current_A=20, current_angle_deg=30))
    print(result.average_torque_Nm, result.torque_ripple_pct, result.dq.L_d_H, result.dq.L_q_H)

The Python client guide covers typed inputs and their errors, current and current-angle sweeps, waveforms as arrays, solving in a running app, and two example scripts.

The coilem command does the same from a terminal or a coding agent, with one JSON document per command and the design file's saved run setups:

coilem setups my_motor.coilem
coilem solve my_motor.coilem --setup "High Speed" --quality quick --out result.json

See Command line for every command, its options and exit codes.

Build from source

To work on coilEM itself you need Python 3.11 to 3.15, Node.js 24 with npm, and stable Rust (1.84 or newer). On Debian and Ubuntu, install the Linux libraries above first.

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

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

Then, in a second terminal:

cd frontend
npm ci
npm run dev

Open http://127.0.0.1:5173. Keep the backend bound to loopback.

More

coilEM is licensed under AGPL-3.0-or-later. See LICENSE, the third-party notices and the trademark terms.

Metadata

Release files for coilem 0.5.10

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

Total release size: 30.0 MB

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

Download URL coilem-0.5.10-py3-none-win_amd64.whl
Size 7.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
93c0293a8587ce00ec4e92c61f91b169d5667f579d5134e637df1df8620819b9
BLAKE2b-256 checksum
How to use checksums
49f45dcf7fdaa321e5a3aca4b2b51b220f1f55d66ae5b57e724ed5bdf971b54b
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 25, 2026.

Transparency log

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

Download URL coilem-0.5.10-py3-none-manylinux_2_27_x86_64.whl
Size 7.8 MB
Tags Linux glibc 2.27+ x86-64 Python 3
SHA-256 checksum
How to use checksums
010f2533229d6cc278600936567faeb56912976102ea89883a748e993f386c87
BLAKE2b-256 checksum
How to use checksums
bb086325dc2bd56aac47a49df9c212e68df477dccb8af1d3abe650e45589fd20
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 25, 2026.

Transparency log

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

Download URL coilem-0.5.10-py3-none-macosx_12_0_arm64.whl
Size 7.2 MB
Tags Python 3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
b43d4940e380be1d1d789b2b6dae087a5907b30e6362edc2b8bfc110636b8064
BLAKE2b-256 checksum
How to use checksums
6398cc902a98fcec17c9e8b3e0ea795f639625af4035745c2440fb4c38b7aebf
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 25, 2026.

Transparency log

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

Download URL coilem-0.5.10-py3-none-macosx_10_15_x86_64.whl
Size 7.4 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
c0990fb38ef87b2fe6c48ca77ac3c6a675a5a8c263d8d82ff494e6fe5c7035db
BLAKE2b-256 checksum
How to use checksums
ad8d1d8a765a24f58f5ffb2bf01ab055206086ec5f08a5b2b4dbd7cbbd58cabe
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 25, 2026.

Transparency log

Security for coilem 0.5.10

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.10-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 25, 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