Why does my SimulationInput not update the model variables when it runs in Simulink Compiler or Rapid Accelerator?
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 28 Mai 2021
Réponse apportée : MathWorks Support Team
le 19 Août 2021
I have a model I am running from within an app using the 'sim' command. To do this, I have made a "SimulationInput" object in the same way that is shown in the documentation here:
The issue is that sometimes when I run my model with the 'sim' command, the variables that I have included in the SimulationInput don't seem to affect the results.
I have been through the debugger and verified that the values being set for this input object are indeed correct.
Furthermore, I can get it to work when my app is in base MATLAB, but when I deploy it to a web app the input values are ignored.
What could be the issue here?
Réponse acceptée
MathWorks Support Team
le 28 Mai 2021
There are a couple reasons for the model to not use the SimulationInput values:
1) Make sure there are no Model Workspace variables that could be overriding the SimulationInput. You can find this under the Modeling Tab -> Model Explorer -> (Name of my Model) -> Model Workspace
2) If you are tuning Simscape components while running in Simulink Compiler or in Rapid Accelerator mode with RapidAcceleratorUpToDateCheck off, it is likely the Simscape parameters are set as "Compile-Time" parameters.
I.e. if a Voltage Source uses the value of the variable, 'volts', then the value of volts at compile time will be used during simulation even when the SimulationInput is being used.
To let these components use the run-time value instead of the compile-time, please follow the instructions on the following page to switch the variable to be "run-time" tunable parameters:
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Choose and Parameterize Blocks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!