A Simscape model can also have tunable parameters. Although the approach to protecting Simscape models is largely the same, there is one minor difference. To use Simscape parameters as tunable run-time parameters, you need to first enable run-time configurability. By doing so, the parameters are tunable in both protected and non-protected versions of the Simscape model. To better understand the workflow, please find the example below.
Example:
The example here is a simple voltage divider in which both resistors' resistances are meant to be tunable. The first step is to prepare the model properly to use Simscape parameters as tunable parameters. To do so, you first need to enable run-time configurability. The next step is to define a model workspace parameter for the parameters you later want to be tunable. (1) Specify "Run-time" configurability:
(2) Create Model Workspace parameters and enable the "Arguments" checkbox:
When importing the protected model into another model, you can now specify/ tune the parameter. To do so, right-click the protected model and select "Block Parameters." In the "Instance Parameters" Section, you can now specify the values of the Parameters either by directly inserting the required value or by specifying a parameter: