Documentation · PyPI · Releases
PESLite is an open-source, lightweight, multirate, and extensible power electronics simulator in Python. It provides time-domain simulation for power-electronic converters and converter-based systems—combining switching and averaged models, digital control timing, event-driven operation, and flexible multi-time-scale numerical integration via readable YAML files and a Python API—designed as a deterministic simulation backend for LLM reasoning and verification.
- AC and DC converter networks, including grid-connected and wireless-power-transfer systems.
- Configurable grid-following, grid-forming and DC converter control.
- Switching, PWM-period-averaged and continuously averaged models.
- Digital control timing, sensing and converter protection.
- Fixed-step, adaptive and multirate integration with exact event boundaries.
- Simulation events and continuation from saved states.
- Streamed waveform output, optional plotting and energy accounting.
- Custom control loops, circuit elements, events and solvers through the Python extension API.
- Standalone C++17 export with no third-party C++ runtime dependencies.
pip install pesliteUse pip install "peslite[all]" to include every optional runtime add-on.
PESLite requires Python 3.10 or newer.
Run a bundled case:
peslite gfl-exampleRun a simulation file and override any parameter by dotted path:
peslite case.pes --set simulation.t_end=1.0 --out output/testResults are written to output/<name>/. Bridge/solver presets are available through
three run modes:
peslite case.pes --switching
peslite case.pes --pwm-averaging
peslite case.pes --averagingSee Converter and Bridge Models for model fidelity, control timing and solver presets.
Use peslite --help for the full interface.
The same workflow is available from Python:
import peslite
params = peslite.load("case.pes")
result = peslite.Simulation(params).run()
print(result.summary)
print(result.final_states())Select the parameters that should remain variable in the compiled simulator, or use common:
peslite-convert case.pes common
c++ -O3 -DNDEBUG -std=c++17 export/case/peslite.cpp -o export/case/pesliteThe generated executable uses the same parameter-override and output conventions as PESLite and writes the same result structure. See the C++ Export guide for compilation, runtime configuration and current backend limits.
- Getting Started
- Examples
- Simulation Files
- Converter and Bridge Models
- Control and PWM Timing
- Solvers
- Multirate Simulation
- Events and Restart
- Output and Results
- Project Workspace
- Extending PESLite
- Architecture
- CLI Reference
The Wiki documents the current main branch. Releases and the changelog record versioned changes.
python -m pytestGNU Affero General Public License v3.0 only (AGPL-3.0-only). See LICENSE.