Can Accelerator work on model with algebraic loop?

16 ビュー (過去 30 日間)
K E
K E 2012 年 2 月 27 日
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 Center および File ExchangeManual Performance Optimization についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by