Can Accelerator work on model with algebraic loop?

4 views (last 30 days)
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?

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 27 Feb 2012
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 Comments
K E
K E on 27 Feb 2012
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 on 27 Feb 2012
It does appear that Normal is faster than Accelerator for this particular model which gets rebuilt for each simulation.

Sign in to comment.

More Answers (0)

Categories

Find more on Manual Performance Optimization in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!