Increasing simulation speed in heavy presence of ideal switches

4 views (last 30 days)
I have a very stiff low voltage network model with over 150 ideal switches. I have noticed that the more switches I add the more it slows down the simulation. It is impossible to run it as continuous as it makes Simulink freeze in step without any error reported so I have to do it as discrete. I use ode23tb (stiff TR-BDF2) which has proven to be the best solver and I run at 50e-5 sample time. I have tried to optimize by following advice given in Simulink online archive (changing simulation parameters and removing excess blocks in the model) but no significant improvement. I run on i7 3.0 Ghz processor and 5min simulation takes 1 hour to compute. I just wonder if there is anything else I can do or I must accept this as reality? Does this time sound normal to you given the stiffness of simulation?
Thanks.

Answers (1)

Joel Van Sickel
Joel Van Sickel on 11 Dec 2020
This is being answered as part of a Matlab Answers cleanup effort:
It is not weird for a simulationg with 150 ideal switches to take a long time. This is to be expected as they increase the computational load on the system. Simulink is "freezing" Ie, because the network is so stiff, it is having to take extremely small time steps to capture accurate dynamics of the system. Your best bet would be to look at ways to replace switches with behavioral or average models where possible. Also make sure there are no algebraic loops, and look into powergui for settings to make the simulation run faster (there are optimzation options available such as ignoring snubbers)
Regards,
Joel

Categories

Find more on Electrical Sensors in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!