Simulink simulation too slow

3 次查看(过去 30 天)
fadi awar
fadi awar 2021-5-22
Good morning,
I am trying to run a simulink file that is devided into two sections, the first contains switches and PV systems (5 systems), and the second is the control that i get from a interpreted function. I ran each section alone and the speed is somehow acceptable, but once I run the whole simulation toghether it takes tooo much time.
What can I do to increase the speed of this simulation.
Thanks in advance.

回答(1 个)

Jesús Zambrano
Jesús Zambrano 2021-5-22
Hey Fadi,
There are several reasons that can slow down your simulation. Here I include few possible causes:
Hope it helps!
  2 个评论
fadi awar
fadi awar 2021-5-22
ok the problem is from the interpreted function.
But I use this function as I have a code with many nested functions to solve a graph (digraph), how is it possible to use a matlab function instead while keeping my code as is
Jesús Zambrano
Jesús Zambrano 2021-5-22
Interpreted Matlab Function block is slow because it calls the MATLAB parser during each integration step. Consider using built-in blocks (such as the Math Function block) instead. Here, I include a section in documentation showing how to use it with some example:

请先登录,再进行评论。

类别

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

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by