simulink coder rsim runtime

3 次查看(过去 30 天)
Julian Becker
Julian Becker 2018-7-17
Hello, I've got some problem deploying Simulink models to executables. The runtime difference between the RSIM executable and the Simulink calculation is huge. The executable takes up to 10 times longer. My expectation was that it would be the other way. So my question is if this is normal and if there is anything I can do about this? My sample models where 'rtwdemo_rsimtf' that i compiled just as described in https://de.mathworks.com/help/rtw/examples/using-rsim-target-for-batch-simulations.html. My other samples where a simple addition of constants and one complicated model. I ran the executable with system('modelname') and the model with sim('modelname') and stopped the time with tic and toc. I let them run once or up to a 1000 times in a row and the sim command was always a lot faster. I checked the documentation for better performance but nothing helped to speed it up. Is this normal?

回答(1 个)

Rishabh Rathore
Rishabh Rathore 2018-7-27
It is expected for executable to take a longer time than simulation.
But you can try using linear solvers (fixed step solvers) to reduce the execution time of both, simulation and executable. It could help if most of the equations involved are fairly linear.

类别

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

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by