Why model referencing slows down the simulation?

4 ビュー (過去 30 日間)
Nicolas Perez
Nicolas Perez 2019 年 6 月 26 日
回答済み: Jesús Zambrano 2019 年 8 月 7 日
How can I speed up may simulation with Model Referenced blocks. If I use subsystems instead of these blocks it goes 10 times faster (compiling not included for both case).
Any advice?

回答 (1 件)

Jesús Zambrano
Jesús Zambrano 2019 年 8 月 7 日
Hi Nicolas,
By default, Simulink uses 'normal mode' to simulate a reference model. Normal model means that the model is simulated similar to a subsystem type model.
Another simulation mode for reference model is 'accelerator mode'. Here, a code is generated for the reference model and is then compiled into an executable format. In this mode, the simulation speed will increase compared to the original model.
You can set this option by doing:
1) Right-click the model block and select Block Parameters.
2) Set the simulation mode to 'Accelerator' and click OK.
Note that when doing this, some time is taken to generate code for the reference model. The code is generated when the reference model has changed, not for every simulation.
Hope this can help to solve your question.

カテゴリ

Help Center および File ExchangeComponent-Based Modeling についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by