Filter löschen
Filter löschen

Why does my Simulink-Model rebuild at every iteration?

3 Ansichten (letzte 30 Tage)
Christoph
Christoph am 19 Mai 2015
Bearbeitet: Christoph am 2 Jun. 2015
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 Kommentar
Christoph
Christoph am 26 Mai 2015
Are there no suggestions possible? Maybe I can clarify the question or give you more details if needed!

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Christoph
Christoph am 2 Jun. 2015
Bearbeitet: Christoph am 2 Jun. 2015
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.

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by