Manage Simulink Data Variations with simulinkParser
Greg’s pick this week is simulinkParser by Tigran Mkhoyan.
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.
Contents
Define and Apply a Configuration Description
Define block parameters:
Reference this configuration from a “setConfig” block added to the model
And “Apply” the configuration to the model.
Why Is This Configuration Technique Useful?
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
Why did I select Tigran’s Simulink Data Management Tool?
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.
What Should We Add to Simulink for Data Variation Management?
Let us know here.
Published with MATLAB® R2018a
Comments
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.