Batch Linearization Efficiency When You Vary Parameter Values
You can use the Simulink® Control Design™ linearization tools to efficiently batch linearize a model at varying model parameter values. If all the model parameters you vary are tunable, the linearization tools use a single model compilation to compute linearizations for all parameter grid points.
Tunable and Nontunable Parameters
The term tunable parameters refers to parameters whose values you can change during model simulation without recompiling the model. In general, only parameters that represent mathematical variables are tunable. Common tunable parameters include the Gain parameter of the Gain block, PID gains of the PID Controller block, and Numerator and Denominator coefficients of the Transfer Fcn block.
In contrast, when you vary the value of nontunable parameters, the linearization tools compile the model for each parameter grid point. This repeated compilation makes batch linearization slower. Parameters that specify the appearance or structure of a block, such as the number of inputs of a Sum block, are not tunable. Parameters that specify when a block is evaluated, such as a block's sample time or priority, are also not tunable.
Controlling Model Recompilation
By default, the linearization tools compute all linearizations with a single compilation
whenever it is possible to do so, i.e., whenever all parameters are tunable. If the
software detects nontunable parameters specified for variation, it issues a warning and
recompiles the model for each parameter-grid point. You can change this default behavior
at the command line using the AreParamsTunable
option of linearizeOptions
. In the Model Linearizer, click
More Options and use the Recompile the model when
parameter values are varied for linearization option. The following table
describes how these options affect the recompilation behavior.
All varying parameters are tunable | Some varying parameters are not tunable | |
---|---|---|
| Linearizations are computed for all parameter-grid points with a single compilation. | Model is recompiled for each parameter-grid point. Software issues a warning. |
| Model is recompiled for each parameter-grid point. | Model is recompiled for each parameter-grid point. Warning is suppressed. |
Suppose that you are performing batch linearization by varying the values of tunable parameters and notice that the software is recompiling the model more than necessary. To ensure that linearizations are computed with a single compilation whenever possible, make sure that:
At the command line, the
AreParamsTunable
option is set totrue
.In Model Linearizer, Recompile the model when parameter values are varied for linearization is unchecked.
See Also
slLinearizer
| linearize
| linearizeOptions