How to modify or tune Simscape Tunable Parameters at simulation run-time?

4 visualizzazioni (ultimi 30 giorni)
I am generating code and compiling an executable from my Simscape model, with the intent to change tunable parameters at run-time. 
In the generated code, tunable parameters added to my model are not showing up as expected in the code using the 'grt' target. Likewise, my generated executable does not respond to my attempts to change the tunable parameter's value at run-time. Why might this be?

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 25 Gen 2025
Modificato: MathWorks Support Team il 31 Gen 2025
In Simscape, the process to make parameters run-time tunable differs from base Simulink.
By default, Simscape computes parameter values at compile-time rather than at run-time. You can change this preference option from MATLAB Preferences:
  1. Open the MATLAB Preferences Dialog.
  2. Select Simscape from the left pane.
  3. Select the "Show run-time parameter settings" option.
Now, tunable parameters in your Simscape blocks will have a dropdown next to their values to select either "run-time" or "compile-time". For tunability in Fast Restart or Rapid Accelerator, set the option to "run-time".
For more information about Simscape Run-Time Parameters, refer to the following documentation pages. To access the release-specific documentation, execute the following commands in the MATLAB R2020a command window:
For information about Simscape Run-Time Parameters:
>> web(fullfile(docroot, 'physmod/simscape/ug/about-simscape-run-time-parameters.html'))
To set the run-time parameters visibility preference:
>> web(fullfile(docroot, 'physmod/simscape/ug/set-the-run-time-parameters-visibility-preference.html'))
Please follow the link below to search for the required information regarding the current release:

Più risposte (0)

Categorie

Scopri di più su Run-Time Parameters in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by