Hello everybody,
I am trying to convert an atomic subsystem which contains other atomic subsystems with different time steps into a model reference, see the first image.
Principal.PNG
However, when I convert directly the main atomic subsystem, the simulation runs very slow.
ModelReference1.PNG
I have realized that if I remove all the output ports, the simulation runs as fast as without model reference.
ModelReference2.PNG
I do not know why it is happening. Could someone help me with this problem, please? This model in the future will be connected with other models, so the output ports are necessaries.
Thanks in advance!

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2019년 1월 31일

0 개 추천

My guess is that it is not equal comparison. In your first picture, all the outputs are terminated. Maybe Simulink did some optimization not to calculate those outputs. When it is converted to model reference, it is different. All those outputs need to be calculated even though outside the model reference, they are still terminated.
In your first picture, connect all the outputs of the automic subsystem to Outport blcoks and then see if there is a speed difference.

댓글 수: 2

Sergio Zarate
Sergio Zarate 2019년 1월 31일
Thanks for your answer Fangjun Jiang. You are right. I have connected all the outputs of the atomic subsystem to output ports and the speed goes down.
Do you know any possible solution for this issue? I need to protect this subsystem and the output ports must be used for connecting signals with other blocks without increasing the simulation time.
Thanks!
Fangjun Jiang
Fangjun Jiang 2019년 1월 31일
If that is the case, I guess there is no issue. Your first case is faster because it is not reflecting real usage (no outputs). Pre-compiled model reference is already faster than regular subsystem. Sometimes it takes time to run the simulation. Your next option is to improve your algorithm or do "Analysis", "Performance Tools".

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Subsystems에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2019년 1월 31일

댓글:

2019년 1월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by