What is the recommended way to varying values for tunable parameters in Rapid Accelerator Mode simulations in Simulink?

16 次查看(过去 30 天)
I have seen mentions of various ways in which tunable parameters can be varied when running simulations in Rapid Accelerator Mode, either in serial or parallel. One approach uses "Simulink.SimulationInput" and its "setVariable" method, another reference talks about using "Simulink.BlockDiagram.modifyTunableParameters" and the 'RapidAcceleratorParameterSets' parameter of sim() or parsim(). So which option should I use in which situation?

采纳的回答

MathWorks Support Team
In Simulink R2017a the SimulationInput object was introduced. The SimulationInput object serves as a container for run specific data overrides and makes it easier to move between workflows such as serial simulation, parallel simulation, and deployment with Simulink Compiler. The recommended way for running simulations in Rapid Accelerator Mode with varying values for tunable parameters is to use the "Simulink.SimulationInput" with its "setVariable" method approach. If "setVariable" is used for a tunable variable, then changing this variable will not trigger a rebuild of the model. Additionally if you set "RapidAcceleratorUpToDateCheck" to "off", then Simulink will additionally skip the "UpToDateCheck" to see if a rebuild is needed. This can provide additional speedup to initialization time but changes to non-tunable parameters will not be honored. 
Find an example of this approach here:
Prior to R2017a, using the "Simulink.BlockDiagram.modifyTunableParameters" was only way to change parameters on a Rapid Accelerator model when "RapidAcceleratorUpToDateCheck" is off. This method continues to work in later releases for backwards compatibility, but we recommend using the SimulationInput object instead. 
 

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Run Individual Simulations 的更多信息

标签

尚未输入任何标签。

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by