simulink coder rsim runtime

2 views (last 30 days)
Julian Becker
Julian Becker on 17 Jul 2018
Answered: Rishabh Rathore on 27 Jul 2018
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?

Answers (1)

Rishabh Rathore
Rishabh Rathore on 27 Jul 2018
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.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!