How do you manage different simulation scenarios in your Simulink models?
Tigran provides a simple semantic language to describe how specific blocks in a Simulink model are to be configured, and apply the configuration to the model.
Define block parameters:
Reference this configuration from a “setConfig” block added to the model
And “Apply” the configuration to the model.
This technique enables you to:
- Manage block and model parameters
- Have multiple configurations for the same model
- Save the applied configuration to the model directly
This means the model can still execute simulation without the configuration file being present.
There is a school of thought that the values for block parameters should be explict numeric values, and not a reference to a variable in some other workspace. That is, the design in the Simulink model should be defined entirely within that model file.
This certainly simplifies interpretation of an algorithm, and increases the repeatability of simulation results. The drawback is typically the hinderance to scaling the number of simulation scenarios for which a given model might be used is more difficult to manage with “hard-coded” values.
This approach bridges that divide somewhat. It provides the robustness of explicit numeric parameter values and the flexibiliy to define several configurations that can be applied to a Simulink model
Managing data variations in Simulink isn’t something that has been addressed explicity as part of Simulink. There are several methods of associating a particular data set to a model, but not much in the way of configuring what data values should be applied in specific scenarios. While scripting in MATLAB gets you a long way, it still requires effort on the part of the user to develop a data variation management strategy.
Tigran’s entry provides a nice little framework for data variation management for common simulation use cases.
Let us know here.
Published with MATLAB® R2018a
Comments are closed.
1 CommentsOldest to Newest
Thanks for picking my entry! I made a recent update of simulinkParser based on my other entry configParser that allows to set constants using basic math operations. e.g. define k1 = @ 0.02/2 , k2 = @ k1 + 0.02^2. Set (covariance parameter of noise block) Cov = @ k2. See example v21. Nested relationships are also allowed.