Dear team,
I am running a grid forming inverter using SPS software.
I downloaded the Imperix files.
I found the running time is so slow.
Do you know the reason?
Thank you
Hi!
This usually happens because the model is running in Continuous solver mode rather than Discrete. With detailed grid-forming inverters, high-frequency PWM switching (typically 10 kHz–50 kHz) forces Simulink’s continuous variable-step solver to choke on zero-crossing events at every single switch transition. To fix this, open your powergui block, switch the simulation type from Continuous to Discrete, set the sample time to around 10e-6 s (10 µs) or 20e-6 s, and configure your Simulink solver settings (Ctrl+E) to a fixed-step discrete solver. If you are mainly studying grid-level dynamics (like droop control or frequency regulation) rather than switching harmonics, you can also switch the bridge to an Average-Value Model (AVM) to make it run orders of magnitude faster. What does your current powergui configuration look like?
Slow sim speeds usually come down to the model itself rather than the solver alone. Check for excessive contact pairs, tiny step sizes forced by stiff components, or a discretization rate that’s evaluating far more often than needed. Profiling the model to see which blocks dominate runtime is a practical first step. In my experience, simplifying geometry or reducing solver iterations often helps more than tuning the SPS settings. What parameters are you currently using, and is the slowness consistent or only during specific events?
Hi Vincent,
Thanks for your question. With a grid-forming inverter model, the simulation performance can depend significantly on the model complexity, switching frequency, solver configuration, and simulation time step. In SPS, switching events can also increase the computational load because changes in the electrical network topology may require the system matrices to be recomputed during simulation.
Could you please share a few additional details so we can better identify the bottleneck?
Which MATLAB/SPS version are you using?
What simulation time step are you using?
Are you using the original Imperix example without modifications?
Is the simulation slow during initialization/compilation, or does simulated time itself progress slowly?
If possible, please also share the model or a screenshot of the SPS solver configuration.
With this information, we should be able to determine whether the behavior comes from the model configuration, solver/time step, or computational load.
@Mo.mansour I downloaded the Simulink file from the following Imperix link. Proportional droop control - imperix Technical notes power electronics