PyPowerSim is a Python toolkit for evaluating standard power converter topologies with clear, inspectable models. It includes half‑bridge (B2), full‑bridge (B4), three‑phase full‑bridge (B6), and dual‑active‑bridge (DAB) simulation architectures, including sweep, steady‑state, transient, and closed‑loop analyses. The goal is to make PWM and converter behavior easy to study and modify without commercial tools.
Quick Start
- Install dependencies from
requirements.txt. - Open
start_INV.py(inverter) orstart_DCDC.py(DAB) and set the configuration file insetup['Exp']['conf']. - Select the analysis mode in
setup['Exp']['type']and run the script.
Documentation
- Toolkit overview:
docu/OVERVIEW.md - Quick start guide:
docu/QUICKSTART.md - Tutorials:
docu/TUTORIALS.md - API reference:
docu/API_REFERENCE.md - Configuration guide:
docu/CONFIG_GUIDE.md - Plotting guide:
docu/PLOTTING.md
Example Results
The following images under docu/images illustrate typical outputs:
- Modulation function:
docu/images/img.png - Currents:
docu/images/img_1.png - Voltages:
docu/images/img_2.png - Steady‑state losses and temperatures:
docu/images/steady1.png,docu/images/steady2.png
Inline examples and explanations are available in docu/EXAMPLE_RESULTS.md.
The existing PDF and DOCX references remain in docu/ for deeper theory and earlier tutorials.
The PyPowerSim toolkit is part of the following survey paper and tries to replicate the presented architectures and approaches. Please cite the following paper when using the PyPowerSim toolkit. When using the B6 architecture and the waveform analysis options please also refer to the following article:
Pascal A. Schirmer, Daniel Glose, PyPowerSim: A Python toolkit for analysis of waveform distortions, power losses, and self-heating of standard converter topologies, Computers and Electrical Engineering, Volume 132, 2026, 110934, ISSN 0045-7906, https://doi.org/10.1016/j.compeleceng.2026.110934.
The requirements of the PyPowerSim toolkit are summarized in the requirements.txt data file. In detail, the PyPowerSim Toolkit was implemented using the following dependencies:
- Python 3.11
- Numpy
- Pandas
- Scipy
The complete list of requirements and packages can be found in "requirements.txt".
Since the toolkit is still under development there are several things that need to be improved, are not yet implemented or lack verification with numerical models or measurements. In the following a list of know issues and limitations is provided:
- The transfer functions for the input and output filter are not yet verified. Also, there is no protection against instability of the transfer functions.
- Soft switching architectures are not included yet.
- The interpolation methods for calculating the tabulated parameter options are only linear.
- Plotting error for average DC voltage in B6 configuration
- Currently back emf e(t) is model as a linear function of the modulation index. It would be better to model it using a dependency on the fundamental frequency
The architecture implemented in the PyPowerSim toolkit is exemplary illustrated for a B2 converter cell in Figure 1. The source code implementation of the PyPowerSim toolkit aims to follow the data follow of the implementation in Figure 1 for the interested reader to follow the data and signal flow path through the implementation. The complete description of the toolkit can be found in \docu.
Figure 1: Proposed converter architecture as implemented in the PyPowerSim toolkit.
As illustrated in Figure 1 the architecture consists of five blocks namely the source, the input
filter, the converter cell, the output filter and the load. Each of these blocks can be freely
configured with the parameter setup described. In the following a short description
without consideration of the filter elements is provided. For the complete description please
refer to the theory guide and the following theoretical works. The converter is power by a voltage source having a constant dc voltage of
The switching function can hereby be described as a set of on- and off-states of the high-side switch
where
where
Using PyPowerSim is straight forward and requires only two inputs, namely the model parameters for the switching devices and the dc-link capacitor and the configuration file including experimental, data, topology, as well as parameter information. Detailed information about these two inputs are provided below:
The configuration file is an .xlsx file that is stored under \config and includes all parameter which are relevant for the simulation. In detail, these parameters are grouped in four different categories, namely experimental, data, topology, as well as parameters. Explanation as well as valid inputs for each parameter can be found in the configuration file, description of the configuration file can be found below:
- Name: Descriptive name of the variable (arbitrary identifier)
- Category: Category of the variable (might be empty)
- Description: Detailed description of the variable including valid options
- Variable: Variable name used inside the source code
- Value: Value of the respective variable
- Unit: Unit of the respective variable
From the above column only the 'Value' column should be adapted by the user, the other columns must not be changed as they are used for reading the value.
The parameter files include one .xlsx file for the switching devices and one for the dc-lin capacitor respectively. In detail, these files include electrical and thermal parameters of the respective component. Explanation as well as valid inputs for each parameter can be found in the configuration file, description of the configuration file can be found below:
- Parameter: Arbitrary identifier for the respective parameter
- Description: Description of the parameter
- Model: Definition for which modeling approach the parameter is used (constant, linear, or tabular)
- Symbol: Symbol used inside the source code
- Typical: Typical value of the variable
- Values: Values of the variable
- Unit: Unit of the variable
From the above column only the 'Value' column should be adapted by the user, the other columns must not be changed as they are used for reading the value.
To execute a new simulation three things are needed. First, a valid configuration file as discussed above. Second, valid parameter files for the switching devices and the capacitor. Third a start script as provided in start.py used for defining the configuration and the parameter .xlsx files as well as the simulation mode. The following aspects can be defined in the start script:
- Name: Name of the simulation file (used for saving outputs)
- Author: Author of the simulation
- Debug: Debug mode for checking internal results
- Output: Simulation output, i.e. output variable that is controlled (Current, Voltage, Power, etc.)
- Type: Simulation type, i.e. operating mode of the toolkit (Sweep, Steady-State, Transient, etc.)
- Conf: Configuration .xlsx file stored under \config used as input for general parameters and settings
- Swi: Parameter .xlsx file of the switching devices stored under \para\Swi
- Cap Parameter .xlsx file of the dc-link capacitor stored under \para\Cap
- Plot: Plotting options for displaying results
- PlotGen: Generic plots for thermal and electrical models as well as transfer functions
- Save: Option for saving results to \results
In the following chapter a set of reference results is provided using the B6 converter architecture and the default setup file. For the default operation an IFX switch is chosen ( IKQ75N120CS6) For a first test run use start.py to calculate the results presented below.
In this Section the utilized models are presented. In detail, it includes the transfer functions, the loss models for semiconductors and capacitors, as well as the reduced order thermal models (transient thermal impedance curves).
Figure 1a: Bode plots for amplitude and phase considering the load, the dc-link, as well as input and output filter.
Figure 1b: Loss models for the semiconductor switches and the capacitor.
Figure 1c: Thermal models for the semiconductor switches and the capacitor.
Below the simulation results of the waveform analysis are displayed. The modulation function is illustrated in Figure 2, the load currents and voltages in the time-, frequency- and modulation-domain are illustrated in Figure 3 and Figure 4.
Figure 2: Modulation function of a B6 converter using space vector modulation and a standard switching sequence
(0127) with a pulse number of
Figure 3: Currents of a B6 converter using space vector modulation and a standard switching sequence (0127) with a
pulse number of
Figure 4: Voltages of a B6 converter using space vector modulation and a standard switching sequence (0127) with a
pulse number of
In this Section the results for the steady-state analysis are presented, the results are calculated in closed-loop condition, such that the losses are extracted for the stabilized temperature of the junction. The time-domain results for the currents, the voltages, as well as the conduction and switching losses for the six switches are illustrated in Figure 5.
Figure 5: Time-domain currents, voltages, and losses of a B6 converter using space vector modulation and a standard
switching sequence (0127) with a pulse number of
Figure 6: Time-domain losses and temperatures for the six switches and diodes of a B6 converter using space vector
modulation and a standard switching sequence (0127) with a pulse number of
In this Section the results for the steady-state analysis are presented, the results are calculated in closed-loop
condition such that the parameters are updated after every fundamental period, i.e.
Figure 7: Transient time-domain losses and temperatures for the six switches and diodes of a B6 converter using space
vector modulation and a standard switching sequence (0127) with a pulse number of
To get an indication how well the toolkit compares to commercially available solvers several comparisons with Simulink and PLECs have been conducted (see \docu). The results for comparing to a Fuji Dual Pack IGBT (2MBI300XBE120) are presented below. The results can be reproduced using the compareFuji.py setup file under \setup.
| Losses | PLECs (W) | PyPowerSim (W) | Error (W) | Error (%) |
|---|---|---|---|---|
| Transistor (Swi) | 11.1 | 11.4 | 0.30 | 2.70 |
| Transistor (Con) | 18.0 | 17.3 | 0.70 | 3.89 |
| Diode (Swi) | 5.79 | 6.08 | 0.29 | 5.00 |
| Diode (Con) | 19.5 | 19.2 | 0.30 | 1.54 |
| Total | 54.4 | 54.0 | 0.40 | 0.74 |
As failure and mistakes are inextricably linked to human nature, the toolkit is obviously not perfect, thus suggestions and constructive feedback are always welcome. If you want to contribute to the PyPowerSim toolkit or spotted any mistake, please contact me via: p.schirmer@herts.ac.uk The following aspects will be improved in future version:
- Temperature, current, and frequency dependencies for the load parameters
- Calculation of long term mission profiles
- Generation of efficiency maps for the converter operation range
The software framework is provided under the Creative Commons Attribution-NonCommercial (CC BY-NC) license.
- v.0.0: (01.04.2023) Initial version of PyPowerSim
- v.0.1: (16.06.2023) Major Update and housekeeping
- Adding MOSFET devices
- Revising switching loss calculation
- Adding output control
- v.0.2: (14.08.2023) Second major review and housekeeping
- Adding thermal coupling
- Bugfix switching sequence
- General housekeeping
- v.0.3: (13.10.2023) Third major review and housekeeping
- Fixing steady-state simulation
- General housekeeping
- v.0.4: (01.12.2023) Fourth major review and housekeeping
- Fixing bug in switching losses
- Adding direct comparison with semiconductor datasheets
- General housekeeping
- v.1.0: (01.08.2024) First complete version of PyPowerSim
- Introducing classes per topology and simplifying the topology definition
- Closed loop simulation including hysteresis
- Optimal subcyle modulation for 3-phase converters
- General housekeeping including function description for each file and update to Python 3.11
- Including an extensive tutorial as PowerPoint
- v.1.1: (15.02.2026) Second complete version of PyPowerSim
- Adding a DAB architecture (steady-state and sweep)
- General housekeeping including function description for each file and update to Python 3.11
[1] Holmes, D. Grahame, and Thomas A. Lipo. Pulse width modulation for power converters: principles and practice. Vol. 18. John Wiley & Sons, 2003.
[2] Jenni, Felix, and Dieter Wüest. Steuerverfahren für selbstgeführte Stromrichter. vdf Hochschulverlag AG, 1995.








