Hi KiMuNaMuZe,
It is a bit difficult to provide targeted guidance without seeing the model itself.
As the model complexity grows, the simulation speed will naturally slow down because the underlying matrix equations become larger and more computationally expensive to solve.
One important thing to think about is the objective of the simulation. Depending on what you are trying to analyze, different levels of model fidelity may or may not be necessary.
For example, if your focus is control loop design, parasitic elements such as the MOSFET output capacitance (Coss) may not be particularly important, since they often do not significantly influence the low-frequency control dynamics. Including parasitics like Coss introduces very fast time constants into the circuit, which forces the solver to take much smaller time steps in order to accurately solve the equations.
On the other hand, if your goal is to evaluate whether the dead-time is sufficient to achieve zero-voltage switching (ZVS), then these parasitics become very important and should absolutely be included.
One approach that can help is to use configurable subsystems where parasitic components can be enabled or disabled depending on the type of analysis you are performing.
If you are working with systems such as MMCs that contain a very large number of switching devices, another useful approach is to utilize the Power Modules. While these modules are primarily designed for real-time simulation, they can also be very effective for offline simulation.
For example, have a look at the PLECS demo model:
You can add the following code to a simulation script:
tic;
plecs('simulate');
toc;
In the initialization script, change the parameter num_sm to 20. After applying the changes, run the script.
On my computer, the simulation takes approximately 10 seconds when using fully switched models.
Next, change the configuration to use subcycle averaging. This approach effectively reduces the number of switching devices represented in the electrical network by replacing them with controlled voltage and current sources, which significantly reduces the matrix size.
To enable this mode, change the parameter config in the initialization script, apply the changes, and rerun the simulation.
On my computer, the same simulation then runs in approximately 3 seconds.
The bottom line is that optimization techniques for improving simulation speed are highly dependent on the type of system you are trying to model and the specific objectives of the simulation.
Hope this helps!