Computational Time Analysis in Simulink
1 回表示 (過去 30 日間)
古いコメントを表示
Hello everyone,
i need to generates plot about the time that is necessary to the simulation environment in order to do all the calculations in every single step time.
The result i expect is a plot where on Y there is the real time needed for each step time and in X there is the simulation time.
Is there Some one know how to realize in "automatic" way through a script this kind of anaysis?
Maybe there is a way to use tic-toc sequence but i have only derived the real time needed for an entire simulation...
Thanks in advance.
0 件のコメント
回答 (1 件)
Walter Roberson
2022 年 5 月 27 日
There is no meaningful solution for continuous time models. Continuous time models use ode solvers that can reject steps in order to stay within integration tolerance, so the required time can vary depending on the initial conditions and the prediction model. The prediction model can take variable step sizes so the time per change of the independent variable can change during execution.
For discrete time models if rapid acceleration is turned on then Simulink divides the work up into tasks according to required rate, and executes some tasks less often and executes some tasks in parallel. The portions of the model that are grouped together into tasks are not necessarily functionally related, they might just happen to be running at the same rate.
At the best of times there are items that have to be executed for every minor time step and items that are every major time step, so the work over time depends on where you are in major vs minor steps.
3 件のコメント
参考
カテゴリ
Help Center および File Exchange で Manual Performance Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!