Increasing simulation speed in heavy presence of ideal switches

4 次查看(过去 30 天)
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.

回答(1 个)

Joel Van Sickel
Joel Van Sickel 2020-12-11
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

类别

Help CenterFile Exchange 中查找有关 Electrical Sensors 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by