Why does my Simulink-Model rebuild at every iteration?

조회 수: 3 (최근 30일)
Christoph
Christoph 2015년 5월 19일
편집: Christoph 2015년 6월 2일
I'am trying to speedup my simulink project and want to use the Accelerator-Simulation mode.
The aim of the project is to control a cyclic process and is structured as followes:
  • matlab-script, where all parameters and a feedforward control with parameter estimation is implemented. Also it starts simulating the simulink model for each iteration.
  • simulink model, where the dynamic system and the feedforward control (basically a lookup-table) together with a feedback control is implemented. Parameters of all blocks are set by workspace variables/structs generated by the script.
The feedforward control variable is calculated and parameter are estimated from the simulated data after every simulation pass. Then the model is simulated again. The model is not changing during the iterations, but still it is compiling at every cycle. From the first: Is this solution appropriate for using the Accelerator mode?
I tried to follow theses proposed steps to determine, why it is built at every iteration: http://de.mathworks.com/help/simulink/examples/determining-why-simulink-accelerator-is-regenerating-code.html?refresh=true
If i run it with the Accelerator-Mode (referring to the documentation of this function, it now compiles for simulation), I still cannot reproduce why it is compiled at every iteration.
csdet1.ContentsChecksum.Value ~= csdet2.ContentsChecksum.Value
is true, but the proposed code does not find any details.
csdet1.InterfaceChecksum.Value ~= csdet2.InterfaceChecksum.Value
is also true, the proposed code outputs that
UserDefinedTypesChecksum
is different. What does that mean and how can I resolve this?
Sidefact: When I run Simulink.BlockDiagram.getChecksum() with the Model opened in Simulink and Normal-Mode chosen, I get this error:
Continuous update specified for this chart chartname This is not supported for RTW."
But this chart is a Matlab-Function block, not a stateflow chart?!
  댓글 수: 1
Christoph
Christoph 2015년 5월 26일
Are there no suggestions possible? Maybe I can clarify the question or give you more details if needed!

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

답변 (1개)

Christoph
Christoph 2015년 6월 2일
편집: Christoph 2015년 6월 2일
Someone gave me the hint that matlab-functions share some code with the stateflow objects, for this reason there is this strange error message
Continuous update specified for this chart chartname This is not supported for RTW."
Now I found the appropriate parameter to change the update method from "continuous update" to "inherited": in the matlab function editor/edit data it can be found.
However, the rebuild-issue still is not solved yet.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by