Can Accelerator work on model with algebraic loop?

7 次查看(过去 30 天)
I am using a legacy Simulink mdl file that I am pretty sure contains an algebraic loop. The model is slow to execute so I turned on the Accelerator. Each time I run the simulation, it reports 'Successfully built the Accelerator target for model', so the Accelerator can run even if a model contains an algebraic loop, right? But, if it is rebuilding each time the model runs, am I better off with Normal execution?

采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-2-27
This is strange - if you are not making any changes to your model between runs, then the Accelerator target should not rebuild. Perhaps you should report this as a bug to MathWorks Tech Support.
Regarding your question about whether you might be better off with Normal Mode simulation - it depends. Yes, there is an initial overhead for generating and building code in Accelerator mode, but if your simulation is very long and expensive, then that initial overhead may be relatively cheap. The best way to figure out is to time your simulation. Using the tic-toc commands:
>> tic; sim(bdroot); toc
in both simulation modes and see which works out faster.
  2 个评论
K E
K E 2012-2-27
Thanks so much for this (and other answers!). Between model runs I change parameters in the workspace that the model uses, but not the model itself. But perhaps I am doing something inadvertently requiring the rebuild. At least I know what to look for now.
K E
K E 2012-2-27
It does appear that Normal is faster than Accelerator for this particular model which gets rebuilt for each simulation.

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品

Community Treasure Hunt

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

Start Hunting!

Translated by