Skip to main content

High-performance circuit simulator for power electronics

Project description

Pulsim

Power-electronics circuit simulator — C++23 kernel with a Python-first API.

Pulsim is a header-only C++ simulation engine (pulsim) wrapped by a flat Python module (import pulsim). It is built around a PWL state-space cache (for fast switched-converter dynamics), a Newton refinement on top of the cached linear factor (for non-linear devices), and a built-in event detector for diode/MOSFET commutations.

If you have legacy code from the pre-1.0 cycle (the old Circuit / Simulator / YamlParser surface), see docs/migration-guide.md for the device / analysis mapping table.

Why Pulsim

  • PLECS-style PWL cache — switched-converter steady-state in milliseconds instead of minutes.
  • Header-only C++23 kernel — drop pulsim/ into your own CMake target via pulsim::core; no static-library link step.
  • Python-first ergonomicsCircuitBuilder API takes string node names and SI-unit parameters, returns the same SimulationResult whether you run a transient, an AC sweep, or a parameter sweep.
  • Mixed-domain composable controlMixedDomainBlockChain runs PI/PID, comparators, rate limiters, op-amps, FOC blocks and thermal networks at kernel speed (no Python interpreter cost per step).
  • Frequency-domain analysis included — small-signal MNA Bode + swept-sine FRA + closed-loop GM/PM measurement, all in the same surface.

Quick start

git clone https://github.com/lgili/Pulsim.git
cd Pulsim

# Build kernel + Python extension
cmake -S . -B build -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DPULSIM_BUILD_PYTHON=ON
cmake --build build -j

# Use Pulsim from the source tree (no `pip install` required)
export PYTHONPATH="$(pwd)/build/python:$PYTHONPATH"

# First run — open-loop buck
python3 examples/scripts/run_buck.py

# Print available components + helpers
python3 -c "import pulsim as p; p.catalog()"

First simulation — 8 lines

import pulsim as p

b = p.CircuitBuilder()
b.add_voltage_source("Vin", "n0", "gnd", 5.0)
b.add_resistor      ("R1", "n0", "vc",   1000.0)
b.add_capacitor     ("C1", "vc", "gnd",  1e-6)

res = p.simulate(b, t_end=5e-3, dt=1e-5)
p.scope(b, res, signals=["vc"])           # one-liner plot

What ships

  • Builder: CircuitBuilder with 20+ helpers covering passives, sources, MOSFETs (SH1), IGBTs (Level 1), saturable inductors, transformers, op-amps, three-phase sources, …
  • YAML loader: same surface, 13 ready-made example circuits in examples/.
  • Solver: PWL state-space cache + Newton refresh + event detection + optional state-aware step_observer(t, x) callback for closed loops.
  • Control library: PIController, PIDController, Comparator, RateLimiter, FirstOrderLowPass, …
  • AC analysis: swept-sine Bode + auto-tuning (tune_pi_from_bode) with phase-margin / gain-margin extraction.
  • Frequency-response analyser (FRA): closed-loop / nonlinear-Bode via the time-domain swept-sine path.
  • Plot helpers: p.scope(), p.plot_bode() — one-line waveform + Bode plots with sensible defaults.

Where to learn more

Validation

# Python runtime tests
PYTHONPATH=build/python pytest python/tests -v

# C++ kernel tests (layer-by-layer Catch2 binaries)
ctest --test-dir build --output-on-failure

Reference CSV traces for the converter showcases live in benchmarks/baselines/; a 1.0-native regression runner that consumes them is not yet wired up.

Documentation

Docs deployment (GitHub Pages)

Docs are published by .github/workflows/docs.yml using MkDocs Material + mike:

  • PR: strict docs build
  • main: deploy dev docs channel
  • vX.Y.Z tag: deploy release docs and update latest

In repository settings, set Pages Source to GitHub Actions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulsim-1.1.0.tar.gz (26.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pulsim-1.1.0-cp313-cp313-win_amd64.whl (812.9 kB view details)

Uploaded CPython 3.13Windows x86-64

pulsim-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pulsim-1.1.0-cp313-cp313-macosx_13_0_arm64.whl (804.8 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

pulsim-1.1.0-cp312-cp312-win_amd64.whl (812.9 kB view details)

Uploaded CPython 3.12Windows x86-64

pulsim-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pulsim-1.1.0-cp312-cp312-macosx_13_0_arm64.whl (804.8 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

pulsim-1.1.0-cp311-cp311-win_amd64.whl (809.0 kB view details)

Uploaded CPython 3.11Windows x86-64

pulsim-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pulsim-1.1.0-cp311-cp311-macosx_13_0_arm64.whl (801.8 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

pulsim-1.1.0-cp310-cp310-win_amd64.whl (807.0 kB view details)

Uploaded CPython 3.10Windows x86-64

pulsim-1.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pulsim-1.1.0-cp310-cp310-macosx_13_0_arm64.whl (800.6 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

File details

Details for the file pulsim-1.1.0.tar.gz.

File metadata

  • Download URL: pulsim-1.1.0.tar.gz
  • Upload date:
  • Size: 26.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pulsim-1.1.0.tar.gz
Algorithm Hash digest
SHA256 51a3df01468b425ff2339394436ec168fa5cb095922de829fd606348a27716e0
MD5 1f0473720c17f8672f63a467f073bc34
BLAKE2b-256 77b03ac6ea16b9ed0abe85059463c0f113057787bf490178d38a8e7871ac84ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0.tar.gz:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pulsim-1.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 812.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pulsim-1.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 aa3be03f107a2af9a660958c6328ba720c5a5f0d8afb6cbf9f62040794d7ad2c
MD5 cca7947f8baebe16a4b9d8b13e40b1a7
BLAKE2b-256 1344a13931ca542caf31ef4afccdcf0de4625f9423db780cab32a7aec9a8e52e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pulsim-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd7655c259a96f41fbbc6167dfd874b8f935da5a51b52dbdbf4f6bd7fbd79ac4
MD5 9dd94a1a6e31780e0480078add6f0d51
BLAKE2b-256 49987eede13e26ea34c9517a7f2e7229626406af5af0dcdeb64f5ef77d275929

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pulsim-1.1.0-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 c2eac7eedfd6493619650baaabc6319b3acf29d31838cdff15adeb1a73f757a9
MD5 288a75371f960e5700e2e8037faf54ff
BLAKE2b-256 bda36d5c87c06ea462d75651c05f3c11b0824ca1471d1b91222827beb3fb4661

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp313-cp313-macosx_13_0_arm64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pulsim-1.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 812.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pulsim-1.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9eadb01a7b8d8f69ef6078bf4c8cc8eec11a5f77fea2d53471e57429c30ca43d
MD5 882958c1413e0abb546dc320fc5703dd
BLAKE2b-256 93152d63c8f9dbfc5bdc7c71469b22f838068be1fd7a07f7ac2185155fb3361b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pulsim-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2d56bdcf892368a0f071b1139b154af89f5ada632c35210fd41a9f2511675bfe
MD5 bb0850860ea61507b48e06e371e69733
BLAKE2b-256 ac8a914a71fd20024053a05c3cbb94369d444bff6bcfd3dd5ae285c334cecb7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pulsim-1.1.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a7b18b22491f2825b47be748bc27442ef9752183f9930d18c197874adf1b70c8
MD5 71e436bfbfc530fbc3777c0e5fdb842f
BLAKE2b-256 ab2af027494fa5ea5adcd1671650ce77bc41d692c1ddc061fc500b200e3f0e8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp312-cp312-macosx_13_0_arm64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pulsim-1.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 809.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pulsim-1.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a9c33c29cba6aebf0f4f940839ceb164670988bb5363d32c66b94d01ebc25db2
MD5 f89b446a7557c601cd589d95d9837440
BLAKE2b-256 b55a418c68a03cd8f1598060f477408cbe81e381a03e73bedd81d7ad82018072

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pulsim-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30aad4286833fb65ba3d313bddbb022bd79eeb4759090ce0e9c3e2e922b4f1d4
MD5 8e5c58f37cc65bb7d0cbb0f53f3b6b6b
BLAKE2b-256 88671acbe2c120cf37f3197160178580cf1d60996953b0253091342a0255640f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pulsim-1.1.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 06c93c3d1135d8eb7b11b4f61ed15de7773330049b6321f8f10223bf0cd9f845
MD5 250b156ab19c6870b0ad1a3434cf1079
BLAKE2b-256 7eb7e5e9e55d30b42f53c0e7d465405fdda6f51fc6bfd21cb115db4ae422da49

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp311-cp311-macosx_13_0_arm64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pulsim-1.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 807.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pulsim-1.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 facabfaaf55c701957d43a49ddba2791169f66c666aa7eb072b93d5f20ea88d5
MD5 d1ac12c0c645abeb5f58373aa09d43e6
BLAKE2b-256 ce7b1ed39100058ac67172fe47a1e9ac11c1ebbb2e4675dbbdad4f915e691e31

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pulsim-1.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0ae39cb0308338c6343cf3b8eb78b7db1bb1b7282b30876cea5124a2fe5a526e
MD5 443d48b03898d6f3c4ea300234e2496c
BLAKE2b-256 20c65166a3c9a027b3ed868afe3eefb42fdeab8be19286a01b83c20de07ff988

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulsim-1.1.0-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pulsim-1.1.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a8beba3708214485deeab11919fb73dec81de2f63a945afd77a012ef59e6fa6a
MD5 025d54a077818a6987ec8cd3f62835a8
BLAKE2b-256 c2141e6bccfb0582080e1b454e3df83146002d730da8f9eb53918555d20eea30

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulsim-1.1.0-cp310-cp310-macosx_13_0_arm64.whl:

Publisher: publish.yml on lgili/Pulsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page