PyPowerSim
A simple toolkit for simulation of standard power converter topologies including waveform analysis, steady-state, and transient calculation.
Install / Use
/learn @pascme05/PyPowerSimREADME
PyPowerSim
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.
Publication
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.
Dependencies
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".
Limitations
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
Architecture
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 $V_{dc}$. The converter is controlled by a time domain switching function $s_a(t)$ translating the constant dc link voltage in a set of high-frequent voltage pulses as described in (1):
$v_{a0}(t) = s_{a}(t) \cdot \frac{V_{dc}}{2}$ (1)
The switching function can hereby be described as a set of on- and off-states of the high-side switch $S_{a}^{+}$ and the low-side switch $S_{a}^{-}$ and can be expressed in the time-domain by the Fourier series in (2):
$s_{a}(t) = \sum_{v=1} (a_v cos(v \omega_{el} t) + b_v cos(v \omega_{el} t)) = \sum_{v=1} c_v e^{-j v \omega_{el} t}$ (2)
where $a_v$, $b_v$, $c_v$ are the Fourier series coefficients, $v$ is the harmonic number and $\omega_{el}$ is the electrical circular frequency of the output current. The relation between the current and voltage on the load side can then be expressed by the following differential equation in (3):
$v_{L}(t) = R_{L} i_{L}(t) + L_{L} \frac{di_{L}}{dt} + e(t)$ (3)
where $R_{L}$, $L_{L}$ are the resistance and the inductance of the load, $e(t)$ is the induced voltage, and $v_{L}(t)$, $i_{L}(t)$ are the load voltage and current respectively.
Usage
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:
Configuration
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.
Parameters
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.
Start Script
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:
General
- 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.)
Input Files
- 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
Plotting and Saving
- 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
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.
Model Inputs
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.
Sweeping Operation
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 ar
